Commit f41a0147f5c90cc714f13d99dcd8ad806ae15564
1 parent
c4101445
增加打印功能
Showing
19 changed files
with
958 additions
and
25 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -126,7 +126,7 @@ export const completeTaskByWMS = (params)=>postAction('/task/taskHeader/complete |
126 | 126 | //下发任务给WCS |
127 | 127 | export const execute = (params)=>postAction('/task/taskHeader/execute', params); |
128 | 128 | //取消任务 |
129 | -export const cancelTask = (params)=>postAction('/task/taskHeader/cancelTask?1', params); | |
129 | +export const cancelTask = (params)=>postAction('/task/taskHeader/cancelTask?ids=' + params, params); | |
130 | 130 | //自动配盘 |
131 | 131 | export const autoCombination = (params)=>postAction('/shipment/shipmentCombination/autoCombination', params); |
132 | 132 | //创建出库任务 |
... | ... | @@ -155,6 +155,8 @@ export const createOverStationTask = (params)=>postAction('/task/taskHeader/crea |
155 | 155 | export const createManyEmptyIn = (params)=>postAction('/task/taskHeader/createManyEmptyIn', params); |
156 | 156 | //创建空托盘组出库任务 |
157 | 157 | export const createManyEmptyOut = (params)=>postAction('/task/taskHeader/createManyEmptyOut', params); |
158 | +//获取打印数据 | |
159 | +export const getPrintContent = (params)=>postAction('/config/container/getPrintContent?ids=' + params, params); | |
158 | 160 | |
159 | 161 | // 中转HTTP请求 |
160 | 162 | export const transitRESTful = { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue
... | ... | @@ -50,6 +50,7 @@ |
50 | 50 | |
51 | 51 | <!-- 操作按钮区域 --> |
52 | 52 | <div class="table-operator"> |
53 | + <a-button @click="batchPrint()" type="primary" icon="plus">打印</a-button> | |
53 | 54 | <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
54 | 55 | <a-button type="primary" icon="download" @click="handleExportXls('容器管理')">导出</a-button> |
55 | 56 | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
... | ... | @@ -119,7 +120,7 @@ |
119 | 120 | </template> |
120 | 121 | |
121 | 122 | <span slot="action" slot-scope="text, record"> |
122 | - <a @click="handleEdit(record)">编辑</a> | |
123 | + <a @click="editForm(record)">编辑</a> | |
123 | 124 | |
124 | 125 | <a-divider type="vertical" /> |
125 | 126 | <a-dropdown> |
... | ... | @@ -141,6 +142,8 @@ |
141 | 142 | </div> |
142 | 143 | |
143 | 144 | <container-modal ref="modalForm" @ok="modalFormOk"></container-modal> |
145 | + <container-edit-modal ref="modalEditForm" @ok="modalFormOk"></container-edit-modal> | |
146 | + <container-print-modal ref="modalPrintForm" @ok="modalFormOk"></container-print-modal> | |
144 | 147 | </a-card> |
145 | 148 | </template> |
146 | 149 | |
... | ... | @@ -153,11 +156,15 @@ |
153 | 156 | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
154 | 157 | import {getZoneList} from '@/api/api' |
155 | 158 | import {getContainerTypeList} from '@/api/api' |
159 | + import ContainerEditModal from "./modules/ContainerEditModal"; | |
160 | + import ContainerPrintModal from "./modules/ContainerPrintModal"; | |
156 | 161 | |
157 | 162 | export default { |
158 | 163 | name: 'ContainerList', |
159 | 164 | mixins:[JeecgListMixin, mixinDevice], |
160 | 165 | components: { |
166 | + ContainerPrintModal, | |
167 | + ContainerEditModal, | |
161 | 168 | ContainerModal |
162 | 169 | }, |
163 | 170 | data () { |
... | ... | @@ -266,6 +273,26 @@ |
266 | 273 | fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) |
267 | 274 | this.superFieldList = fieldList |
268 | 275 | }, |
276 | + editForm(record) { | |
277 | + this.$refs.modalEditForm.edit(record); | |
278 | + this.$refs.modalEditForm.title = "编辑容器"; | |
279 | + this.$refs.modalEditForm.disableSubmit = false; | |
280 | + }, | |
281 | + batchPrint() { | |
282 | + if (this.selectedRowKeys.length <= 0) { | |
283 | + this.$message.warning('请选择一条记录!'); | |
284 | + return; | |
285 | + } else { | |
286 | + var ids = ""; | |
287 | + for (var a = 0; a < this.selectedRowKeys.length; a++) { | |
288 | + ids += this.selectedRowKeys[a] + ","; | |
289 | + } | |
290 | + console.log(ids); | |
291 | + this.$refs.modalPrintForm.edit(ids); | |
292 | + this.$refs.modalPrintForm.title = "打印容器编码"; | |
293 | + this.$refs.modalPrintForm.disableSubmit = false; | |
294 | + } | |
295 | + }, | |
269 | 296 | loadFrom() { |
270 | 297 | getZoneList().then((res) => { |
271 | 298 | if (res.success) { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationList.vue
... | ... | @@ -99,6 +99,7 @@ |
99 | 99 | |
100 | 100 | <!-- 操作按钮区域 --> |
101 | 101 | <div class="table-operator"> |
102 | + <a-button @click="batchAdd()" type="primary" icon="plus">批量新增</a-button> | |
102 | 103 | <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
103 | 104 | <a-button type="primary" icon="download" @click="handleExportXls('库位管理')">导出</a-button> |
104 | 105 | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
... | ... | @@ -190,6 +191,7 @@ |
190 | 191 | </div> |
191 | 192 | |
192 | 193 | <location-modal ref="modalForm" @ok="modalFormOk"></location-modal> |
194 | + <location-batch-add-modal ref="batchAddModalForm" @ok="modalFormOk"></location-batch-add-modal> | |
193 | 195 | </a-card> |
194 | 196 | </template> |
195 | 197 | |
... | ... | @@ -202,11 +204,13 @@ |
202 | 204 | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
203 | 205 | import {getLocationTypeList} from '@/api/api' |
204 | 206 | import {getZoneList} from '@/api/api' |
207 | + import LocationBatchAddModal from "./modules/LocationBatchAddModal"; | |
205 | 208 | |
206 | 209 | export default { |
207 | 210 | name: 'LocationList', |
208 | 211 | mixins:[JeecgListMixin, mixinDevice], |
209 | 212 | components: { |
213 | + LocationBatchAddModal, | |
210 | 214 | LocationModal |
211 | 215 | }, |
212 | 216 | data () { |
... | ... | @@ -217,14 +221,9 @@ |
217 | 221 | // 表头 |
218 | 222 | columns: [ |
219 | 223 | { |
220 | - title: '#', | |
221 | - dataIndex: '', | |
222 | - key:'rowIndex', | |
223 | - width:60, | |
224 | + title:'ID', | |
224 | 225 | align:"center", |
225 | - customRender:function (t,r,index) { | |
226 | - return parseInt(index)+1; | |
227 | - } | |
226 | + dataIndex: 'id' | |
228 | 227 | }, |
229 | 228 | { |
230 | 229 | title:'库位编码', |
... | ... | @@ -382,6 +381,11 @@ |
382 | 381 | } |
383 | 382 | }) |
384 | 383 | }, |
384 | + batchAdd() { | |
385 | + this.$refs.batchAddModalForm.add(); | |
386 | + this.$refs.batchAddModalForm.title = "批量新增"; | |
387 | + this.$refs.batchAddModalForm.disableSubmit = false; | |
388 | + }, | |
385 | 389 | solutionZoneCode(value) { |
386 | 390 | var actions = [] |
387 | 391 | Object.keys(this.zoneList).some((key) => { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditForm.vue
0 → 100644
1 | +<template> | |
2 | + <a-spin :spinning="confirmLoading"> | |
3 | + <j-form-container :disabled="formDisabled"> | |
4 | + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |
5 | + <a-row> | |
6 | + <a-col :span="24"> | |
7 | + <a-form-model-item label="容器类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerTypeCode"> | |
8 | + <a-select | |
9 | + show-search | |
10 | + placeholder="请选择容器类型" | |
11 | + option-filter-prop="children" | |
12 | + :filter-option="filterOption" | |
13 | + v-model="model.containerTypeCode"> | |
14 | + <a-select-option v-for="item in containerTypeList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option> | |
15 | + </a-select> | |
16 | + </a-form-model-item> | |
17 | + </a-col> | |
18 | + <a-col :span="24"> | |
19 | + <a-form-model-item label="库位编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationCode"> | |
20 | + <a-input v-model="model.locationCode" placeholder="请输入库位编码" ></a-input> | |
21 | + </a-form-model-item> | |
22 | + </a-col> | |
23 | + <a-col :span="24"> | |
24 | + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> | |
25 | + <j-dict-select-tag type="list" v-model="model.status" dictCode="container_status" placeholder="请选择状态" /> | |
26 | + </a-form-model-item> | |
27 | + </a-col> | |
28 | + </a-row> | |
29 | + </a-form-model> | |
30 | + </j-form-container> | |
31 | + </a-spin> | |
32 | +</template> | |
33 | + | |
34 | +<script> | |
35 | + | |
36 | + import { httpAction, getAction } from '@/api/manage' | |
37 | + import { validateDuplicateValue } from '@/utils/util' | |
38 | + import {getZoneList} from '@/api/api' | |
39 | + import {getContainerTypeList} from '@/api/api' | |
40 | + | |
41 | + export default { | |
42 | + name: 'ContainerEditForm', | |
43 | + components: { | |
44 | + }, | |
45 | + props: { | |
46 | + //表单禁用 | |
47 | + disabled: { | |
48 | + type: Boolean, | |
49 | + default: false, | |
50 | + required: false | |
51 | + } | |
52 | + }, | |
53 | + data () { | |
54 | + return { | |
55 | + model:{ | |
56 | + }, | |
57 | + labelCol: { | |
58 | + xs: { span: 24 }, | |
59 | + sm: { span: 5 }, | |
60 | + }, | |
61 | + wrapperCol: { | |
62 | + xs: { span: 24 }, | |
63 | + sm: { span: 16 }, | |
64 | + }, | |
65 | + confirmLoading: false, | |
66 | + zoneList:[], | |
67 | + containerTypeList:[], | |
68 | + validatorRules: { | |
69 | + containerTypeCode: [ | |
70 | + { required: true, message: '请选择容器类型!'}, | |
71 | + ], | |
72 | + }, | |
73 | + url: { | |
74 | + add: "/config/container/add", | |
75 | + edit: "/config/container/edit", | |
76 | + queryById: "/config/container/queryById" | |
77 | + } | |
78 | + } | |
79 | + }, | |
80 | + computed: { | |
81 | + formDisabled(){ | |
82 | + return this.disabled | |
83 | + }, | |
84 | + }, | |
85 | + created () { | |
86 | + //备份model原始值 | |
87 | + this.model.status = "empty"; | |
88 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
89 | + this.loadFrom(); | |
90 | + }, | |
91 | + methods: { | |
92 | + add () { | |
93 | + this.edit(this.modelDefault); | |
94 | + }, | |
95 | + edit (record) { | |
96 | + this.model = Object.assign({}, record); | |
97 | + this.visible = true; | |
98 | + }, | |
99 | + loadFrom() { | |
100 | + getZoneList().then((res) => { | |
101 | + if (res.success) { | |
102 | + this.zoneList = res.result | |
103 | + } | |
104 | + }); | |
105 | + getContainerTypeList().then((res) => { | |
106 | + if (res.success) { | |
107 | + this.containerTypeList = res.result | |
108 | + } | |
109 | + }); | |
110 | + }, | |
111 | + submitForm () { | |
112 | + const that = this; | |
113 | + // 触发表单验证 | |
114 | + this.$refs.form.validate(valid => { | |
115 | + if (valid) { | |
116 | + that.confirmLoading = true; | |
117 | + let httpurl = ''; | |
118 | + let method = ''; | |
119 | + if(!this.model.id){ | |
120 | + httpurl+=this.url.add; | |
121 | + method = 'post'; | |
122 | + }else{ | |
123 | + httpurl+=this.url.edit; | |
124 | + method = 'put'; | |
125 | + } | |
126 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
127 | + if(res.success){ | |
128 | + that.$message.success(res.message); | |
129 | + that.$emit('ok'); | |
130 | + }else{ | |
131 | + that.$message.warning(res.message); | |
132 | + } | |
133 | + }).finally(() => { | |
134 | + that.confirmLoading = false; | |
135 | + }) | |
136 | + } | |
137 | + | |
138 | + }) | |
139 | + }, | |
140 | + } | |
141 | + } | |
142 | +</script> | |
0 | 143 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + switchFullscreen | |
7 | + @ok="handleOk" | |
8 | + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <location="realForm" @ok="submitCallback" :disabled="disableSubmit"></container-edit-form> | |
12 | + </j-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | + | |
17 | + import ContainerEditForm from './ContainerEditForm' | |
18 | + export default { | |
19 | + name: 'ContainerEditModal', | |
20 | + components: { | |
21 | + ContainerEditForm | |
22 | + }, | |
23 | + data () { | |
24 | + return { | |
25 | + title:'', | |
26 | + width:800, | |
27 | + visible: false, | |
28 | + disableSubmit: false | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + add () { | |
33 | + this.visible=true | |
34 | + this.$nextTick(()=>{ | |
35 | + this.$refs.realForm.add(); | |
36 | + }) | |
37 | + }, | |
38 | + edit (record) { | |
39 | + this.visible=true | |
40 | + this.$nextTick(()=>{ | |
41 | + this.$refs.realForm.edit(record); | |
42 | + }) | |
43 | + }, | |
44 | + close () { | |
45 | + this.$emit('close'); | |
46 | + this.visible = false; | |
47 | + }, | |
48 | + handleOk () { | |
49 | + this.$refs.realForm.submitForm(); | |
50 | + }, | |
51 | + submitCallback(){ | |
52 | + this.$emit('ok'); | |
53 | + this.visible = false; | |
54 | + }, | |
55 | + handleCancel () { | |
56 | + this.close() | |
57 | + } | |
58 | + } | |
59 | + } | |
60 | +</script> | |
0 | 61 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintForm.vue
0 → 100644
1 | +<template> | |
2 | + <div class="container" style=" width:600px;/*height:228px;*/color: #333"> | |
3 | + | |
4 | + <div class="noprint container" style="text-align:right; float: right"> | |
5 | + <a-button v-print="'#printContent'" ghost type="primary">打印</a-button> | |
6 | + </div> | |
7 | + | |
8 | + <div class="row" id="printContent" > | |
9 | + <table width="100%" | |
10 | + v-for="source in dataSource"> | |
11 | + <caption style="font-size:22px;text-align:center; color:#333; padding-bottom: 3px;"></caption> | |
12 | + <tbody> | |
13 | + <tr > | |
14 | + <td scope="col" style="font-size:12px;font-weight:bold" >物料图号:{{source.code}}</td> | |
15 | + </tr> | |
16 | +<!-- <tr >--> | |
17 | +<!-- <td rowspan="4" style="padding: 1px">--> | |
18 | +<!-- <vue-qr :text="source.code" :size="70" :margin="0"></vue-qr>--> | |
19 | +<!-- </td>--> | |
20 | +<!-- </tr>--> | |
21 | + </tbody> | |
22 | + </table> | |
23 | + </div> | |
24 | + </div> | |
25 | +</template> | |
26 | + | |
27 | +<script> | |
28 | + | |
29 | + import { httpAction, getAction } from '@/api/manage' | |
30 | + import { validateDuplicateValue } from '@/utils/util' | |
31 | + import {getZoneList} from '@/api/api' | |
32 | + import {getContainerTypeList, getPrintContent} from '@/api/api' | |
33 | + import JsBarcode from 'jsbarcode' | |
34 | + | |
35 | + export default { | |
36 | + name: 'ContainerPrintForm', | |
37 | + components: { | |
38 | + JsBarcode, | |
39 | + }, | |
40 | + props: { | |
41 | + //表单禁用 | |
42 | + disabled: { | |
43 | + type: Boolean, | |
44 | + default: false, | |
45 | + required: false | |
46 | + } | |
47 | + }, | |
48 | + data () { | |
49 | + return { | |
50 | + model:{ | |
51 | + }, | |
52 | + dataSource:[], | |
53 | + ids:{}, | |
54 | + labelCol: { | |
55 | + xs: { span: 24 }, | |
56 | + sm: { span: 5 }, | |
57 | + }, | |
58 | + wrapperCol: { | |
59 | + xs: { span: 24 }, | |
60 | + sm: { span: 16 }, | |
61 | + }, | |
62 | + confirmLoading: false, | |
63 | + zoneList:[], | |
64 | + containerTypeList:[], | |
65 | + url: { | |
66 | + add: "/config/container/add", | |
67 | + edit: "/config/container/edit", | |
68 | + queryById: "/config/container/queryById" | |
69 | + } | |
70 | + } | |
71 | + }, | |
72 | + computed: { | |
73 | + formDisabled(){ | |
74 | + return this.disabled | |
75 | + }, | |
76 | + }, | |
77 | + created () { | |
78 | + //备份model原始值 | |
79 | + this.model.status = "empty"; | |
80 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
81 | + this.loadFrom(); | |
82 | + }, | |
83 | + methods: { | |
84 | + add () { | |
85 | + this.edit(this.modelDefault); | |
86 | + }, | |
87 | + edit (record) { | |
88 | + // this.model = Object.assign({}, this.modelDefault); | |
89 | + getPrintContent(record).then((res) => { | |
90 | + if (res.success) { | |
91 | + // var data = res.result; | |
92 | + console.log("getPrintContent:" + res.result); | |
93 | + this.dataSource = res.result; | |
94 | + console.log("getPrintContent!!:" + this.dataSource.length); | |
95 | + this.visible = true; | |
96 | + } | |
97 | + }); | |
98 | + }, | |
99 | + loadFrom() { | |
100 | + getZoneList().then((res) => { | |
101 | + if (res.success) { | |
102 | + this.zoneList = res.result | |
103 | + } | |
104 | + }); | |
105 | + getContainerTypeList().then((res) => { | |
106 | + if (res.success) { | |
107 | + this.containerTypeList = res.result | |
108 | + } | |
109 | + }); | |
110 | + }, | |
111 | + submitForm () { | |
112 | + const that = this; | |
113 | + // 触发表单验证 | |
114 | + this.$refs.form.validate(valid => { | |
115 | + if (valid) { | |
116 | + that.confirmLoading = true; | |
117 | + let httpurl = ''; | |
118 | + let method = ''; | |
119 | + if(!this.model.id){ | |
120 | + httpurl+=this.url.add; | |
121 | + method = 'post'; | |
122 | + }else{ | |
123 | + httpurl+=this.url.edit; | |
124 | + method = 'put'; | |
125 | + } | |
126 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
127 | + if(res.success){ | |
128 | + that.$message.success(res.message); | |
129 | + that.$emit('ok'); | |
130 | + }else{ | |
131 | + that.$message.warning(res.message); | |
132 | + } | |
133 | + }).finally(() => { | |
134 | + that.confirmLoading = false; | |
135 | + }) | |
136 | + } | |
137 | + | |
138 | + }) | |
139 | + }, | |
140 | + } | |
141 | + } | |
142 | +</script> | |
0 | 143 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + switchFullscreen | |
7 | + @ok="handleOk" | |
8 | + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <container-print-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></container-print-form> | |
12 | + </j-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | + | |
17 | + import ContainerPrintForm from './ContainerPrintForm' | |
18 | + export default { | |
19 | + name: 'ContainerPrintModal', | |
20 | + components: { | |
21 | + ContainerPrintForm | |
22 | + }, | |
23 | + data () { | |
24 | + return { | |
25 | + title:'', | |
26 | + width:800, | |
27 | + visible: false, | |
28 | + disableSubmit: false | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + add () { | |
33 | + this.visible=true | |
34 | + this.$nextTick(()=>{ | |
35 | + this.$refs.realForm.add(); | |
36 | + }) | |
37 | + }, | |
38 | + edit (record) { | |
39 | + console.log("record:" + record); | |
40 | + this.visible=true | |
41 | + this.$nextTick(()=>{ | |
42 | + this.$refs.realForm.edit(record); | |
43 | + }) | |
44 | + }, | |
45 | + close () { | |
46 | + this.$emit('close'); | |
47 | + this.visible = false; | |
48 | + }, | |
49 | + handleOk () { | |
50 | + this.$refs.realForm.submitForm(); | |
51 | + }, | |
52 | + submitCallback(){ | |
53 | + this.$emit('ok'); | |
54 | + this.visible = false; | |
55 | + }, | |
56 | + handleCancel () { | |
57 | + this.close() | |
58 | + } | |
59 | + } | |
60 | + } | |
61 | +</script> | |
0 | 62 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddForm.vue
0 → 100644
1 | +<template> | |
2 | + <a-spin :spinning="confirmLoading"> | |
3 | + <j-form-container :disabled="formDisabled"> | |
4 | + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |
5 | + <a-row> | |
6 | + <a-col :span="24"> | |
7 | + <a-form-model-item label="编码前缀" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prefix"> | |
8 | + <a-input v-model="model.prefix" placeholder="请输入编码前缀" ></a-input> | |
9 | + </a-form-model-item> | |
10 | + </a-col> | |
11 | + <a-col :span="24"> | |
12 | + <a-form-model-item label="起始行" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstRow"> | |
13 | + <a-input v-model="model.firstRow" placeholder="请输入起始行" ></a-input> | |
14 | + </a-form-model-item> | |
15 | + </a-col> | |
16 | + <a-col :span="24"> | |
17 | + <a-form-model-item label="最后行" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastRow"> | |
18 | + <a-input v-model="model.lastRow" placeholder="请输入最后行" ></a-input> | |
19 | + </a-form-model-item> | |
20 | + </a-col> | |
21 | + <a-col :span="24"> | |
22 | + <a-form-model-item label="起始列" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstColumn"> | |
23 | + <a-input v-model="model.firstColumn" placeholder="请输入起始列" ></a-input> | |
24 | + </a-form-model-item> | |
25 | + </a-col> | |
26 | + <a-col :span="24"> | |
27 | + <a-form-model-item label="最后列" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastColumn"> | |
28 | + <a-input v-model="model.lastColumn" placeholder="请输入最后列" ></a-input> | |
29 | + </a-form-model-item> | |
30 | + </a-col> | |
31 | + <a-col :span="24"> | |
32 | + <a-form-model-item label="起始层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstLayer"> | |
33 | + <a-input v-model="model.firstLayer" placeholder="请输入起始层" ></a-input> | |
34 | + </a-form-model-item> | |
35 | + </a-col> | |
36 | + <a-col :span="24"> | |
37 | + <a-form-model-item label="最后层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastLayer"> | |
38 | + <a-input v-model="model.lastLayer" placeholder="请输入最后层" ></a-input> | |
39 | + </a-form-model-item> | |
40 | + </a-col> | |
41 | + <a-col :span="24"> | |
42 | + <a-form-model-item label="巷道" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="roadWay"> | |
43 | + <a-input v-model="model.roadWay" placeholder="请输入巷道" ></a-input> | |
44 | + </a-form-model-item> | |
45 | + </a-col> | |
46 | + <a-col :span="24"> | |
47 | + <a-form-model-item label="高低位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="high"> | |
48 | + <j-dict-select-tag type="list" v-model="model.high" dictCode="high_status" placeholder="请选择高低位" /> | |
49 | + </a-form-model-item> | |
50 | + </a-col> | |
51 | + <a-col :span="24"> | |
52 | + <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode"> | |
53 | + <a-select | |
54 | + show-search | |
55 | + placeholder="请选择库区" | |
56 | + option-filter-prop="children" | |
57 | + :filter-option="filterOption" | |
58 | + v-model="model.zoneCode"> | |
59 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option> | |
60 | + </a-select> | |
61 | + </a-form-model-item> | |
62 | + </a-col> | |
63 | + <a-col :span="24"> | |
64 | + <a-form-model-item label="库位类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationTypeCode"> | |
65 | + <a-select | |
66 | + show-search | |
67 | + placeholder="请选择库位类型" | |
68 | + option-filter-prop="children" | |
69 | + :filter-option="filterOption" | |
70 | + v-model="model.locationTypeCode"> | |
71 | + <a-select-option v-for="item in locationTypeList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option> | |
72 | + </a-select> | |
73 | + </a-form-model-item> | |
74 | + </a-col> | |
75 | +<!-- <a-col :span="24">--> | |
76 | +<!-- <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">--> | |
77 | +<!-- <j-dict-select-tag type="list" v-model="model.status" dictCode="location_status" placeholder="请选择状态" />--> | |
78 | +<!-- </a-form-model-item>--> | |
79 | +<!-- </a-col>--> | |
80 | +<!-- <a-col :span="24">--> | |
81 | +<!-- <a-form-model-item label="是否可用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enable">--> | |
82 | +<!-- <j-dict-select-tag type="list" v-model="model.enable" dictCode="enable_status" placeholder="请选择是否可用" />--> | |
83 | +<!-- </a-form-model-item>--> | |
84 | +<!-- </a-col>--> | |
85 | + </a-row> | |
86 | + </a-form-model> | |
87 | + </j-form-container> | |
88 | + </a-spin> | |
89 | +</template> | |
90 | + | |
91 | +<script> | |
92 | + | |
93 | + import { httpAction, getAction } from '@/api/manage' | |
94 | + import { validateDuplicateValue } from '@/utils/util' | |
95 | + import {getZoneList} from '@/api/api' | |
96 | + import {getLocationTypeList} from '@/api/api' | |
97 | + | |
98 | + export default { | |
99 | + name: 'LocationBatchAddForm', | |
100 | + components: { | |
101 | + }, | |
102 | + props: { | |
103 | + //表单禁用 | |
104 | + disabled: { | |
105 | + type: Boolean, | |
106 | + default: false, | |
107 | + required: false | |
108 | + } | |
109 | + }, | |
110 | + data () { | |
111 | + return { | |
112 | + model:{ | |
113 | + }, | |
114 | + labelCol: { | |
115 | + xs: { span: 24 }, | |
116 | + sm: { span: 5 }, | |
117 | + }, | |
118 | + wrapperCol: { | |
119 | + xs: { span: 24 }, | |
120 | + sm: { span: 16 }, | |
121 | + }, | |
122 | + confirmLoading: false, | |
123 | + zoneList:[], | |
124 | + locationTypeList:[], | |
125 | + validatorRules: { | |
126 | + prefix: [ | |
127 | + { required: true, message: '请输入编码前缀!'}, | |
128 | + ], | |
129 | + firstRow: [ | |
130 | + { required: true, message: '请输入起始行!'}, | |
131 | + ], | |
132 | + lastRow: [ | |
133 | + { required: true, message: '请输入最后行'}, | |
134 | + ], | |
135 | + firstColumn: [ | |
136 | + { required: true, message: '请输入起始列!'}, | |
137 | + ], | |
138 | + lastColumn: [ | |
139 | + { required: true, message: '请输入最后列'}, | |
140 | + ], | |
141 | + firstLayer: [ | |
142 | + { required: true, message: '请输入起始层!'}, | |
143 | + ], | |
144 | + lastLayer: [ | |
145 | + { required: true, message: '请输入最后层'}, | |
146 | + ], | |
147 | + roadWay: [ | |
148 | + { required: true, message: '请输入巷道!'}, | |
149 | + ], | |
150 | + zoneCode: [ | |
151 | + { required: true, message: '请输入库区!'}, | |
152 | + ], | |
153 | + locationTypeCode: [ | |
154 | + { required: true, message: '请输入库位类型!'}, | |
155 | + ], | |
156 | + high: [ | |
157 | + { required: true, message: '请输入高低位!'}, | |
158 | + ], | |
159 | + }, | |
160 | + url: { | |
161 | + add: "/config/location/batchAdd", | |
162 | + edit: "/config/location/edit", | |
163 | + queryById: "/config/location/queryById" | |
164 | + } | |
165 | + } | |
166 | + }, | |
167 | + computed: { | |
168 | + formDisabled(){ | |
169 | + return this.disabled | |
170 | + }, | |
171 | + }, | |
172 | + created () { | |
173 | + //备份model原始值 | |
174 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
175 | + this.loadFrom(); | |
176 | + }, | |
177 | + methods: { | |
178 | + add () { | |
179 | + this.edit(this.modelDefault); | |
180 | + }, | |
181 | + edit (record) { | |
182 | + this.model = Object.assign({}, record); | |
183 | + this.visible = true; | |
184 | + }, | |
185 | + loadFrom() { | |
186 | + getZoneList().then((res) => { | |
187 | + if (res.success) { | |
188 | + this.zoneList = res.result | |
189 | + } | |
190 | + }); | |
191 | + getLocationTypeList().then((res) => { | |
192 | + if (res.success) { | |
193 | + this.locationTypeList = res.result | |
194 | + } | |
195 | + }) | |
196 | + }, | |
197 | + submitForm () { | |
198 | + const that = this; | |
199 | + // 触发表单验证 | |
200 | + this.$refs.form.validate(valid => { | |
201 | + if (valid) { | |
202 | + that.confirmLoading = true; | |
203 | + let httpurl = ''; | |
204 | + let method = ''; | |
205 | + httpurl+=this.url.add; | |
206 | + method = 'post'; | |
207 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
208 | + if(res.success){ | |
209 | + that.$message.success(res.message); | |
210 | + that.$emit('ok'); | |
211 | + }else{ | |
212 | + that.$message.warning(res.message); | |
213 | + } | |
214 | + }).finally(() => { | |
215 | + that.confirmLoading = false; | |
216 | + }) | |
217 | + } | |
218 | + | |
219 | + }) | |
220 | + }, | |
221 | + } | |
222 | + } | |
223 | +</script> | |
0 | 224 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + switchFullscreen | |
7 | + @ok="handleOk" | |
8 | + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <location-batch-add-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></location-batch-add-form> | |
12 | + </j-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | + | |
17 | + import LocationBatchAddForm from "./LocationBatchAddForm"; | |
18 | + export default { | |
19 | + name: 'LocationBatchAddModal', | |
20 | + components: { | |
21 | + LocationBatchAddForm | |
22 | + }, | |
23 | + data () { | |
24 | + return { | |
25 | + title:'', | |
26 | + width:800, | |
27 | + visible: false, | |
28 | + disableSubmit: false | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + add () { | |
33 | + this.visible=true | |
34 | + this.$nextTick(()=>{ | |
35 | + this.$refs.realForm.add(); | |
36 | + }) | |
37 | + }, | |
38 | + edit (record) { | |
39 | + this.visible=true | |
40 | + this.$nextTick(()=>{ | |
41 | + this.$refs.realForm.edit(record); | |
42 | + }) | |
43 | + }, | |
44 | + close () { | |
45 | + this.$emit('close'); | |
46 | + this.visible = false; | |
47 | + }, | |
48 | + handleOk () { | |
49 | + this.$refs.realForm.submitForm(); | |
50 | + }, | |
51 | + submitCallback(){ | |
52 | + this.$emit('ok'); | |
53 | + this.visible = false; | |
54 | + }, | |
55 | + handleCancel () { | |
56 | + this.close() | |
57 | + } | |
58 | + } | |
59 | + } | |
60 | +</script> | |
0 | 61 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -148,6 +148,8 @@ |
148 | 148 | <span slot="action" slot-scope="text, record"> |
149 | 149 | <a v-if="record.status == 1" @click="executeTask(record)">执行</a> |
150 | 150 | <a-divider type="vertical" /> |
151 | + <a v-if="record.status < 100" @click="cancelTask(record)">取消</a> | |
152 | + <a-divider type="vertical" /> | |
151 | 153 | <a v-if="record.status < 100" @click="completeTask(record)">完成</a> |
152 | 154 | <a-divider type="vertical" /> |
153 | 155 | <a-dropdown> |
... | ... | @@ -189,7 +191,7 @@ |
189 | 191 | import TaskDetailList from './TaskDetailList' |
190 | 192 | import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
191 | 193 | import '@/assets/less/TableExpand.less' |
192 | - import {completeTaskByWMS} from '@/api/api' | |
194 | + import {completeTaskByWMS, cancelTask} from '@/api/api' | |
193 | 195 | import {execute} from '@/api/api' |
194 | 196 | import {getZoneList} from '@/api/api' |
195 | 197 | import EmptyOutTaskModal from './modules/EmptyOutTaskModal' |
... | ... | @@ -394,6 +396,20 @@ |
394 | 396 | this.loading = false; |
395 | 397 | }) |
396 | 398 | }, |
399 | + cancelTask(record) { | |
400 | + this.loading = true; | |
401 | + this.model = Object.assign({}, record); | |
402 | + cancelTask(this.model.id).then((res) => { | |
403 | + this.loading = false; | |
404 | + if (res.success) { | |
405 | + this.$message.success(res.message); | |
406 | + } | |
407 | + else { | |
408 | + this.$message.error(res.message); | |
409 | + } | |
410 | + this.searchQuery(); | |
411 | + }); | |
412 | + }, | |
397 | 413 | completeTask(record) { |
398 | 414 | this.loading = true; |
399 | 415 | this.model = Object.assign({}, record); |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java
... | ... | @@ -35,8 +35,8 @@ import org.jeecg.common.util.oConvertUtils; |
35 | 35 | public class JwtUtil { |
36 | 36 | |
37 | 37 | // Token过期时间2天(用户登录过期时间是此时间的两倍,以token在reids缓存时间为准) |
38 | - public static final long EXPIRE_TIME = 2 * 24 * 60 * 60 * 1000; | |
39 | - | |
38 | +// public static final long EXPIRE_TIME = 2 * 24 * 60 * 60 * 1000; | |
39 | + public static final long EXPIRE_TIME = -1; | |
40 | 40 | /** |
41 | 41 | * |
42 | 42 | * @param response |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java
1 | 1 | package org.jeecg.modules.wms.config.container.controller; |
2 | 2 | |
3 | +import java.lang.ref.WeakReference; | |
3 | 4 | import java.util.Arrays; |
4 | 5 | import java.util.List; |
5 | 6 | import java.util.Map; |
... | ... | @@ -7,8 +8,13 @@ import java.util.stream.Collectors; |
7 | 8 | import java.io.IOException; |
8 | 9 | import java.io.UnsupportedEncodingException; |
9 | 10 | import java.net.URLDecoder; |
11 | +import javax.annotation.Resource; | |
10 | 12 | import javax.servlet.http.HttpServletRequest; |
11 | 13 | import javax.servlet.http.HttpServletResponse; |
14 | + | |
15 | +import com.aliyun.oss.ServiceException; | |
16 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
17 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
12 | 18 | import org.jeecg.common.api.vo.Result; |
13 | 19 | import org.jeecg.common.system.query.QueryGenerator; |
14 | 20 | import org.jeecg.common.system.util.JwtUtil; |
... | ... | @@ -21,6 +27,8 @@ import lombok.extern.slf4j.Slf4j; |
21 | 27 | |
22 | 28 | import org.jeecg.modules.wms.config.container.entity.Container; |
23 | 29 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
30 | +import org.jeecg.modules.wms.config.location.entity.Location; | |
31 | +import org.jeecg.modules.wms.config.location.service.ILocationService; | |
24 | 32 | import org.jeecg.utils.StringUtils; |
25 | 33 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
26 | 34 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
... | ... | @@ -51,6 +59,8 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
51 | 59 | public class ContainerController extends JeecgController<Container, IContainerService> { |
52 | 60 | @Autowired |
53 | 61 | private IContainerService containerService; |
62 | + @Resource | |
63 | + private ILocationService locationService; | |
54 | 64 | |
55 | 65 | /** |
56 | 66 | * 分页列表查询 |
... | ... | @@ -71,8 +81,10 @@ public class ContainerController extends JeecgController<Container, IContainerSe |
71 | 81 | String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); |
72 | 82 | container.setWarehouseCode(warehouseCode); |
73 | 83 | QueryWrapper<Container> queryWrapper = QueryGenerator.initQueryWrapper(container, null); |
84 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = queryWrapper.lambda(); | |
85 | + containerLambdaQueryWrapper.orderByAsc(Container::getId); | |
74 | 86 | Page<Container> page = new Page<Container>(pageNo, pageSize); |
75 | - IPage<Container> pageList = containerService.page(page, queryWrapper); | |
87 | + IPage<Container> pageList = containerService.page(page, containerLambdaQueryWrapper); | |
76 | 88 | return Result.OK(pageList); |
77 | 89 | } |
78 | 90 | |
... | ... | @@ -105,7 +117,17 @@ public class ContainerController extends JeecgController<Container, IContainerSe |
105 | 117 | @ApiOperation(value="容器管理-编辑", notes="容器管理-编辑") |
106 | 118 | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
107 | 119 | public Result<String> edit(@RequestBody Container container) { |
108 | - containerService.updateById(container); | |
120 | + String locationCode = container.getLocationCode(); | |
121 | + if(StringUtils.isNotEmpty(locationCode)) { | |
122 | + Location location = locationService.getLocationByCode(locationCode, container.getWarehouseCode()); | |
123 | + if(location == null) { | |
124 | + throw new ServiceException("编辑的库位号不存在"); | |
125 | + } | |
126 | + } | |
127 | + boolean success = containerService.updateById(container); | |
128 | + if(!success) { | |
129 | + throw new ServiceException("编辑失败"); | |
130 | + } | |
109 | 131 | return Result.OK("编辑成功!"); |
110 | 132 | } |
111 | 133 | |
... | ... | @@ -137,6 +159,23 @@ public class ContainerController extends JeecgController<Container, IContainerSe |
137 | 159 | return Result.OK("批量删除成功!"); |
138 | 160 | } |
139 | 161 | |
162 | + /** | |
163 | + * 获取打印数据 | |
164 | + * | |
165 | + * @param ids | |
166 | + * @return | |
167 | + */ | |
168 | + @AutoLog(value = "容器管理-获取打印数据") | |
169 | + @ApiOperation(value="容器管理-获取打印数据", notes="容器管理-获取打印数据") | |
170 | + @PostMapping(value = "/getPrintContent") | |
171 | + @ResponseBody | |
172 | + public Result getPrintContent(@RequestParam(name="ids",required=true) String ids) { | |
173 | + List<String> idlist = Arrays.asList(ids.split(",")); | |
174 | + List<Container> containerList = containerService.listByIds(idlist); | |
175 | + return Result.OK(containerList); | |
176 | + } | |
177 | + | |
178 | + | |
140 | 179 | /** |
141 | 180 | * 通过id查询 |
142 | 181 | * |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
... | ... | @@ -9,6 +9,8 @@ import java.io.UnsupportedEncodingException; |
9 | 9 | import java.net.URLDecoder; |
10 | 10 | import javax.servlet.http.HttpServletRequest; |
11 | 11 | import javax.servlet.http.HttpServletResponse; |
12 | + | |
13 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
12 | 14 | import org.jeecg.common.api.vo.Result; |
13 | 15 | import org.jeecg.common.system.query.QueryGenerator; |
14 | 16 | import org.jeecg.common.system.util.JwtUtil; |
... | ... | @@ -19,9 +21,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
19 | 21 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
20 | 22 | import lombok.extern.slf4j.Slf4j; |
21 | 23 | |
24 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
25 | +import org.jeecg.modules.wms.config.location.entity.BatchLocation; | |
22 | 26 | import org.jeecg.modules.wms.config.location.entity.Location; |
23 | 27 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
24 | 28 | import org.jeecg.utils.StringUtils; |
29 | +import org.jeecg.utils.constant.QuantityConstant; | |
25 | 30 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
26 | 31 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
27 | 32 | import org.jeecgframework.poi.excel.entity.ExportParams; |
... | ... | @@ -70,14 +75,16 @@ public class LocationController extends JeecgController<Location, ILocationServi |
70 | 75 | HttpServletRequest req) { |
71 | 76 | String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); |
72 | 77 | location.setWarehouseCode(warehouseCode); |
73 | - QueryWrapper<Location> queryWrapper = QueryGenerator.initQueryWrapper(location, req.getParameterMap()); | |
78 | + QueryWrapper<Location> queryWrapper = QueryGenerator.initQueryWrapper(location, null); | |
79 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = queryWrapper.lambda(); | |
80 | + locationLambdaQueryWrapper.orderByAsc(Location::getId); | |
74 | 81 | Page<Location> page = new Page<Location>(pageNo, pageSize); |
75 | - IPage<Location> pageList = locationService.page(page, queryWrapper); | |
82 | + IPage<Location> pageList = locationService.page(page, locationLambdaQueryWrapper); | |
76 | 83 | return Result.OK(pageList); |
77 | 84 | } |
78 | 85 | |
79 | 86 | /** |
80 | - * 添加 | |
87 | + * 添加 | |
81 | 88 | * |
82 | 89 | * @param location |
83 | 90 | * @return |
... | ... | @@ -94,6 +101,25 @@ public class LocationController extends JeecgController<Location, ILocationServi |
94 | 101 | return Result.OK("添加成功!"); |
95 | 102 | } |
96 | 103 | |
104 | + /** | |
105 | + * 批量添加 | |
106 | + * | |
107 | + * @param batchLocation | |
108 | + * @return | |
109 | + */ | |
110 | + @AutoLog(value = "库位管理-批量添加") | |
111 | + @ApiOperation(value="库位管理-批量添加", notes="库位管理-批量添加") | |
112 | + @PostMapping(value = "/batchAdd") | |
113 | + public Result<String> batchAdd(@RequestBody BatchLocation batchLocation, HttpServletRequest req) { | |
114 | + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); | |
115 | + if(StringUtils.isNotEmpty(warehouseCode)) { | |
116 | + batchLocation.setWarehouseCode(warehouseCode); | |
117 | + } | |
118 | + batchLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); | |
119 | + Result result = locationService.batchAdd(batchLocation); | |
120 | + return result; | |
121 | + } | |
122 | + | |
97 | 123 | /** |
98 | 124 | * 编辑 |
99 | 125 | * |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/entity/BatchLocation.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.location.entity; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +/** | |
6 | + * @author 游杰 | |
7 | + */ | |
8 | +@Data | |
9 | +public class BatchLocation { | |
10 | + | |
11 | + private String prefix; | |
12 | + private Integer firstRow; | |
13 | + private Integer lastRow; | |
14 | + private Integer firstColumn; | |
15 | + private Integer lastColumn; | |
16 | + private Integer firstLayer; | |
17 | + private Integer lastLayer; | |
18 | + private Integer firstGrid; | |
19 | + private Integer lastGrid; | |
20 | + private Integer roadWay; | |
21 | + private String zoneCode; | |
22 | + private String locationTypeCode; | |
23 | + private String status; | |
24 | + private int high; | |
25 | + private String warehouseCode; | |
26 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
1 | 1 | package org.jeecg.modules.wms.config.location.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | +import org.jeecg.common.api.vo.Result; | |
5 | +import org.jeecg.modules.wms.config.location.entity.BatchLocation; | |
4 | 6 | import org.jeecg.modules.wms.config.location.entity.Location; |
5 | 7 | |
6 | 8 | import java.util.List; |
... | ... | @@ -36,4 +38,5 @@ public interface ILocationService extends IService<Location> { |
36 | 38 | |
37 | 39 | boolean haveUncompleteTaskInNear(Location location); |
38 | 40 | |
41 | + Result batchAdd(BatchLocation batchLocation); | |
39 | 42 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.config.location.service.impl; |
2 | 2 | |
3 | +import com.aliyun.oss.ServiceException; | |
3 | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | +import org.jeecg.common.api.vo.Result; | |
7 | +import org.jeecg.modules.wms.config.location.entity.BatchLocation; | |
5 | 8 | import org.jeecg.modules.wms.config.location.entity.Location; |
6 | 9 | import org.jeecg.modules.wms.config.location.mapper.LocationMapper; |
7 | 10 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
11 | +import org.jeecg.modules.wms.config.locationType.entity.LocationType; | |
12 | +import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService; | |
13 | +import org.jeecg.modules.wms.config.zone.entity.Zone; | |
14 | +import org.jeecg.modules.wms.config.zone.service.IZoneService; | |
8 | 15 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
16 | +import org.jeecg.utils.StringUtils; | |
9 | 17 | import org.jeecg.utils.constant.QuantityConstant; |
10 | 18 | import org.springframework.stereotype.Service; |
11 | 19 | |
12 | 20 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
21 | +import org.springframework.transaction.annotation.Transactional; | |
13 | 22 | |
14 | 23 | import javax.annotation.Resource; |
24 | +import java.text.MessageFormat; | |
15 | 25 | import java.util.ArrayList; |
16 | 26 | import java.util.Collections; |
17 | 27 | import java.util.Comparator; |
... | ... | @@ -28,6 +38,10 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
28 | 38 | |
29 | 39 | @Resource |
30 | 40 | private ITaskHeaderService taskHeaderService; |
41 | + @Resource | |
42 | + private ILocationTypeService locationTypeService; | |
43 | + @Resource | |
44 | + private IZoneService zoneService; | |
31 | 45 | |
32 | 46 | @Override |
33 | 47 | public Location getLocationByCode(String locationCode, String warehouseCode) { |
... | ... | @@ -229,6 +243,95 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
229 | 243 | return false; |
230 | 244 | } |
231 | 245 | |
246 | + @Override | |
247 | + @Transactional(rollbackFor = Exception.class) | |
248 | + public Result batchAdd(BatchLocation batchLocation) { | |
249 | + String prefix = batchLocation.getPrefix(); | |
250 | + Integer firstRow = batchLocation.getFirstRow(); | |
251 | + Integer lastRow = batchLocation.getLastRow(); | |
252 | + Integer firstColumn = batchLocation.getFirstColumn(); | |
253 | + Integer lastColumn = batchLocation.getLastColumn(); | |
254 | + Integer firstLayer = batchLocation.getFirstLayer(); | |
255 | + Integer lastLayer = batchLocation.getLastLayer(); | |
256 | + Integer roadWay = batchLocation.getRoadWay(); | |
257 | + String zoneCode = batchLocation.getZoneCode(); | |
258 | + String locationTypeCode = batchLocation.getLocationTypeCode(); | |
259 | + String status = batchLocation.getStatus(); | |
260 | + int high = batchLocation.getHigh(); | |
261 | + String warehouseCode = batchLocation.getWarehouseCode(); | |
262 | + if(StringUtils.isEmpty(prefix)) { | |
263 | + return Result.error("批量增加库位时, 前缀为空"); | |
264 | + } | |
265 | + if(StringUtils.isEmpty(zoneCode)) { | |
266 | + return Result.error("批量增加库位时, 库区编码为空"); | |
267 | + } | |
268 | + if(StringUtils.isEmpty(locationTypeCode)) { | |
269 | + return Result.error("批量增加库位时, 库位类型编码为空"); | |
270 | + } | |
271 | + if(StringUtils.isEmpty(status)) { | |
272 | + return Result.error("批量增加库位时, 状态为空"); | |
273 | + } | |
274 | + if(StringUtils.isEmpty(warehouseCode)) { | |
275 | + return Result.error("批量增加库位时, 仓库编码为空"); | |
276 | + } | |
277 | + LocationType locationType = locationTypeService.getLocationTypeByCode(locationTypeCode, warehouseCode); | |
278 | + if(locationType == null) { | |
279 | + return Result.error("批量增加库位时, 没有找到库位类型"); | |
280 | + } | |
281 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | |
282 | + if(zone == null) { | |
283 | + return Result.error("批量增加库位时, 没有找到库区"); | |
284 | + } | |
285 | + List<Location> locationList = new ArrayList<>(); | |
286 | + for(int i=firstRow; i<=lastRow; i++) { | |
287 | + for(int j=firstColumn; j<= lastColumn; j++) { | |
288 | + for( int k=firstLayer; k<= lastLayer; k++) { | |
289 | + Location location = new Location(); | |
290 | + location.setRow(i); | |
291 | + location.setIcolumn(j); | |
292 | + location.setLayer(k); | |
293 | + location.setRoadWay(roadWay); | |
294 | + location.setZoneCode(zoneCode); | |
295 | + location.setLocationTypeCode(locationTypeCode); | |
296 | + location.setStatus(status); | |
297 | + location.setHigh(high); | |
298 | + location.setRowFlag(QuantityConstant.ROW_IN); | |
299 | + location.setWarehouseCode(warehouseCode); | |
300 | + location.setEnable(QuantityConstant.STATUS_ENABLE); | |
301 | + String code = MessageFormat.format("{0}{1}{2}{3}", | |
302 | + prefix, | |
303 | + String.format("%02d", i), | |
304 | + String.format("%02d", j), | |
305 | + String.format("%02d", k)); | |
306 | + location.setCode(code); | |
307 | + locationList.add(location); | |
308 | + } | |
309 | + } | |
310 | + } | |
311 | + // 计算有多少列 | |
312 | + int rowSize = lastRow - firstRow; | |
313 | + if(rowSize == 4) { | |
314 | + for (Location location3 : locationList) { | |
315 | + for (int i = 0; i < rowSize; i++) { | |
316 | + int row = location3.getRow(); | |
317 | + row = row % rowSize; | |
318 | + // 每个巷道的第1行和第4行为外侧,深库位 | |
319 | + if(row == 1 || row == 0) { | |
320 | + location3.setRowFlag(QuantityConstant.ROW_OUT); | |
321 | + } else { | |
322 | + location3.setRowFlag(QuantityConstant.ROW_IN); | |
323 | + } | |
324 | + } | |
325 | + } | |
326 | + } | |
327 | + | |
328 | + boolean success = saveBatch(locationList); | |
329 | + if(!success) { | |
330 | + throw new ServiceException("批量增加库位失败"); | |
331 | + } | |
332 | + return Result.ok("批量增加库位成功"); | |
333 | + } | |
334 | + | |
232 | 335 | private boolean getOutSideCanMove(Location location) { |
233 | 336 | Location locaiton2 = getInsideNear(location); |
234 | 337 | if (locaiton2.getStatus().equals(QuantityConstant.STATUS_LOCATION_LOCK)) { |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -346,7 +346,7 @@ public class TaskHeaderController extends JeecgController<TaskHeader, ITaskHeade |
346 | 346 | @ApiOperation(value="任务表-取消任务", notes="任务表-取消任务") |
347 | 347 | @PostMapping( "/cancelTask") |
348 | 348 | @ResponseBody |
349 | - public Result cancelTask(String ids) { | |
349 | + public Result cancelTask(@RequestParam(name="ids",required=true) String ids) { | |
350 | 350 | if (StringUtils.isEmpty(ids)) { |
351 | 351 | return Result.error("taskId不能为空"); |
352 | 352 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -737,6 +737,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
737 | 737 | } |
738 | 738 | |
739 | 739 | @Override |
740 | + @Transactional(rollbackFor = Exception.class) | |
740 | 741 | public Result cancelTask(Integer taskId) { |
741 | 742 | TaskHeader taskHeader = getById(taskId); |
742 | 743 | if(taskHeader == null) { |
... | ... | @@ -756,21 +757,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
756 | 757 | if(!success) { |
757 | 758 | return Result.error("取消任务失败, 删除任务失败"); |
758 | 759 | } |
759 | - Result result = null; | |
760 | + Result result = Result.ok("取消任务成功"); | |
760 | 761 | switch (taskType) { |
761 | 762 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: |
762 | 763 | case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: |
763 | - cancelLocationAndContainerStatus(taskHeader); | |
764 | 764 | result = cancelReceiptTask(taskHeader); |
765 | 765 | break; |
766 | 766 | case QuantityConstant.TASK_TYPE_WHOLESHIPMENT: |
767 | 767 | case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: |
768 | - cancelLocationAndContainerStatus(taskHeader); | |
769 | 768 | result = cancelShipmentTask(taskHeader); |
770 | 769 | break; |
771 | - default: | |
772 | - throw new ServiceException("不支持的任务类型" + taskType); | |
773 | 770 | } |
771 | + cancelLocationAndContainerStatus(taskHeader); | |
774 | 772 | return result; |
775 | 773 | } |
776 | 774 | |
... | ... | @@ -1813,14 +1811,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1813 | 1811 | String warehouseCode = taskHeader.getWarehouseCode(); |
1814 | 1812 | |
1815 | 1813 | boolean success = false; |
1816 | - if(StringUtils.isEmpty(fromLocationCode)) { | |
1814 | + if(StringUtils.isNotEmpty(fromLocationCode)) { | |
1817 | 1815 | success = locationService.updateStatus(fromLocationCode, |
1818 | 1816 | QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
1819 | 1817 | if(!success) { |
1820 | 1818 | throw new ServiceException("取消任务时, 更新起始库位状态失败"); |
1821 | 1819 | } |
1822 | 1820 | } |
1823 | - if(StringUtils.isEmpty(toLocationCode)) { | |
1821 | + if(StringUtils.isNotEmpty(toLocationCode)) { | |
1824 | 1822 | success = locationService.updateStatus(toLocationCode, |
1825 | 1823 | QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
1826 | 1824 | if(!success) { |
... | ... |