Commit a0955f0424a3faab2e1193f3a2d9aea4dba658d4
1 parent
68c8d8ef
所有任务界面,增加悬臂库入库功能
Showing
17 changed files
with
805 additions
and
33 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -277,6 +277,10 @@ export const getDocumentAduitFlow = (params) => getAction('/config/parameterConf |
277 | 277 | export const flatQuickReceipt = (params) => postAction('/receipt/receiveHeader/flatQuickReceipt', params) |
278 | 278 | //快速入库 |
279 | 279 | export const quickReceipt = (params) => postAction('/task/taskHeader/quickReceipt', params) |
280 | +//悬臂库入库 | |
281 | +export const cantaleverReceipt = (params) => postAction('/task/taskHeader/cantaleverReceipt', params) | |
282 | +//快速入库 | |
283 | +export const stageingReceipt = (params) => postAction('/task/taskHeader/stageingReceipt', params) | |
280 | 284 | //快速出库,批量快速出整托 |
281 | 285 | export const shipmentInventoryHeader = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryHeader', params) |
282 | 286 | //快速出库,批量快速出库存详情 |
... | ... |
ant-design-vue-jeecg/src/views/system/task/AllTaskHeaderList.vue
... | ... | @@ -91,9 +91,12 @@ |
91 | 91 | <a-button v-has="'taskHeader:emptyIn'" @click="createEmptyIn()" type="primary">空托入库</a-button> |
92 | 92 | <a-button v-has="'taskHeader:manyEmptyIn'" @click="createManyEmptyIn()" type="primary">空托组入库</a-button> |
93 | 93 | <a-button v-has="'taskHeader:quickReceipt'" @click="quickReceipt()" type="primary">快速入库</a-button> |
94 | + <a-button v-has="'taskHeader:quickReceipt'" @click="stageingReceipt()" type="primary">暂存区入库</a-button> | |
95 | + <a-button v-has="'taskHeader:quickReceipt'" @click="cantaleverReceipt()" type="primary">悬臂库入库</a-button> | |
94 | 96 | <a-button v-has="'taskHeader:callReceiptBox'" @click="callReceiptBox()" type="primary" >呼叫入库有货托盘</a-button> |
95 | 97 | <a-button v-has="'taskHeader:callReceiptBox'" @click="callReceiptEmptyBox()" type="primary" >呼叫入库空托盘</a-button> |
96 | 98 | <a-button v-has="'taskHeader:emptyOut'" @click="createEmptyOut()" type="primary">空托出库</a-button> |
99 | + <a-button v-has="'taskHeader:quickShipment'" @click="quickShipment()" type="primary">快速出库</a-button> | |
97 | 100 | <a-button v-has="'taskHeader:manyEmptyOut'" @click="batchCreateEmptyOut()" type="primary">批量空托出库</a-button> |
98 | 101 | <a-button v-has="'taskHeader:manyEmptyOut'" @click="createManyEmptyOut()" type="primary">空托组出库</a-button> |
99 | 102 | <a-button v-has="'taskHeader:callShipmentBox'" @click="callShipmentBox()" type="primary" >呼叫出库托盘</a-button> |
... | ... | @@ -193,6 +196,8 @@ |
193 | 196 | <empty-in-task-modal ref="emptyInModal" @ok="modalFormOk"></empty-in-task-modal> |
194 | 197 | <many-empty-in-task-modal ref="manyEmptyInModal" @ok="modalFormOk"></many-empty-in-task-modal> |
195 | 198 | <MaterialTaskModal ref="materialTaskModal" @ok="modalFormOk"></MaterialTaskModal> |
199 | + <CantaleverTaskModal ref="cantaleverTaskModal" @ok="modalFormOk"></CantaleverTaskModal> | |
200 | + | |
196 | 201 | <call-receipt-box-modal ref="modalForm5" @ok="modalFormOk"></call-receipt-box-modal> |
197 | 202 | <call-receipt-empty-box-modal ref="modalForm6" @ok="modalFormOk"></call-receipt-empty-box-modal> |
198 | 203 | |
... | ... | @@ -203,6 +208,8 @@ |
203 | 208 | <check-out-task-modal ref="checkOutModal" @ok="modalFormOk"></check-out-task-modal> |
204 | 209 | <transfer-task-modal ref="transferModal" @ok="modalFormOk"></transfer-task-modal> |
205 | 210 | <over-station-task-modal ref="overStationModal" @ok="modalFormOk"></over-station-task-modal> |
211 | + <StageingReceiptModal ref="stageingReceiptModal" @ok="modalFormOk"></StageingReceiptModal> | |
212 | + <shipment-material-modal ref="shipmentMaterialModal" @ok="modalFormOk"></shipment-material-modal> | |
206 | 213 | |
207 | 214 | </a-card> |
208 | 215 | </template> |
... | ... | @@ -231,11 +238,17 @@ import ManyEmptyOutTaskModal from "@views/system/task/modules/ManyEmptyOutTaskMo |
231 | 238 | import CheckOutTaskModal from "@views/system/task/modules/CheckOutTaskModal.vue"; |
232 | 239 | import TransferTaskModal from "@views/system/task/modules/TransferTaskModal.vue"; |
233 | 240 | import OverStationTaskModal from "@views/system/task/modules/OverStationTaskModal.vue"; |
241 | +import StageingReceiptModal from "@views/system/task/modules/StageingReceiptModal.vue"; | |
242 | +import ShipmentMaterialModal from "@views/system/task/modules/ShipmentMaterialModal.vue"; | |
243 | +import CantaleverTaskModal from "@views/system/task/modules/CantaleverTaskModal.vue"; | |
234 | 244 | |
235 | 245 | export default { |
236 | 246 | name: "AllTaskHeaderList", |
237 | 247 | mixins: [JeecgListMixin], |
238 | 248 | components: { |
249 | + CantaleverTaskModal, | |
250 | + ShipmentMaterialModal, | |
251 | + StageingReceiptModal, | |
239 | 252 | OverStationTaskModal, TransferTaskModal, |
240 | 253 | CheckOutTaskModal, |
241 | 254 | ManyEmptyOutTaskModal, EmptyOutTaskModal, CallShipmentBoxModal, BatchEmptyOutTaskModal, |
... | ... | @@ -512,6 +525,14 @@ export default { |
512 | 525 | this.selectedRowKeys = selectedRowKeys; |
513 | 526 | this.selectionRows = selectionRows; |
514 | 527 | }, |
528 | + quickShipment(){ | |
529 | + this.$refs.shipmentMaterialModal.edit(); | |
530 | + this.$refs.shipmentMaterialModal.title = "快速出库"; | |
531 | + }, | |
532 | + stageingReceipt(){ | |
533 | + this.$refs.stageingReceiptModal.edit(); | |
534 | + this.$refs.stageingReceiptModal.title = "暂存区入库"; | |
535 | + }, | |
515 | 536 | loadData(arg) { |
516 | 537 | if (!this.url.list) { |
517 | 538 | this.$message.error("请设置url.list属性!") |
... | ... | @@ -561,6 +582,11 @@ export default { |
561 | 582 | }, |
562 | 583 | quickReceipt(){ |
563 | 584 | this.$refs.materialTaskModal.edit(); |
585 | + this.$refs.materialTaskModal.title = "快速入库"; | |
586 | + }, | |
587 | + cantaleverReceipt(){ | |
588 | + this.$refs.cantaleverTaskModal.edit(); | |
589 | + this.$refs.cantaleverTaskModal.title = "悬臂库入库"; | |
564 | 590 | }, |
565 | 591 | callReceiptBox() { |
566 | 592 | this.$refs.modalForm5.edit(); |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -91,6 +91,7 @@ |
91 | 91 | <a-button v-has="'taskHeader:emptyIn'" @click="createEmptyIn()" type="primary">空托入库</a-button> |
92 | 92 | <a-button v-has="'taskHeader:manyEmptyIn'" @click="createManyEmptyIn()" type="primary">空托组入库</a-button> |
93 | 93 | <a-button v-has="'taskHeader:quickReceipt'" @click="quickReceipt()" type="primary">快速入库</a-button> |
94 | + <a-button v-has="'taskHeader:quickReceipt'" @click="stageingReceipt()" type="primary">暂存区入库</a-button> | |
94 | 95 | <a-button v-has="'taskHeader:callReceiptBox'" @click="callReceiptBox()" type="primary" >呼叫入库有货托盘</a-button> |
95 | 96 | <a-button v-has="'taskHeader:callReceiptBox'" @click="callReceiptEmptyBox()" type="primary" >呼叫入库空托盘</a-button> |
96 | 97 | <j-super-query :fieldList="superFieldList" v-has="'taskHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/> |
... | ... | @@ -200,6 +201,7 @@ |
200 | 201 | <many-empty-in-task-modal ref="manyEmptyInModal" @ok="modalFormOk"></many-empty-in-task-modal> |
201 | 202 | <update-priority ref="updatePriority" @ok="modalFormOk"></update-priority> |
202 | 203 | <MaterialTaskModal ref="materialTaskModal" @ok="modalFormOk"></MaterialTaskModal> |
204 | + <StageingReceiptModal ref="stageingReceiptModal" @ok="modalFormOk"></StageingReceiptModal> | |
203 | 205 | <call-receipt-box-modal ref="modalForm5" @ok="modalFormOk"></call-receipt-box-modal> |
204 | 206 | <call-receipt-empty-box-modal ref="modalForm6" @ok="modalFormOk"></call-receipt-empty-box-modal> |
205 | 207 | |
... | ... | @@ -225,12 +227,14 @@ import MaterialTaskModal from "./modules/MaterialTaskModal"; |
225 | 227 | import CallReceiptBoxModal from "@views/system/task/modules/CallReceiptBoxModal"; |
226 | 228 | import CallReceiptEmptyBoxModal from "@views/system/task/modules/CallReceiptEmptyBoxModal"; |
227 | 229 | import VideoModal from "@views/system/task/VideoModal.vue"; |
230 | +import StageingReceiptModal from "@views/system/task/modules/StageingReceiptModal.vue"; | |
228 | 231 | |
229 | 232 | |
230 | 233 | export default { |
231 | 234 | name: "ReceiptTaskHeaderList", |
232 | 235 | mixins: [JeecgListMixin], |
233 | 236 | components: { |
237 | + StageingReceiptModal, | |
234 | 238 | VideoModal, |
235 | 239 | CallReceiptEmptyBoxModal, |
236 | 240 | CallReceiptBoxModal, |
... | ... | @@ -574,6 +578,10 @@ export default { |
574 | 578 | this.$refs.materialTaskModal.edit(); |
575 | 579 | this.$refs.materialTaskModal.title = "快速入库"; |
576 | 580 | }, |
581 | + stageingReceipt(){ | |
582 | + this.$refs.stageingReceiptModal.edit(); | |
583 | + this.$refs.stageingReceiptModal.title = "暂存区入库"; | |
584 | + }, | |
577 | 585 | handlePriority(record){ |
578 | 586 | this.$refs.updatePriority.edit(record); |
579 | 587 | this.$refs.updatePriority.title = "修改优先级"; |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TaskDetailList.vue
ant-design-vue-jeecg/src/views/system/task/modules/CantaleverTaskModal.vue
0 → 100644
1 | +<template> | |
2 | + <a-modal | |
3 | + :title="title" | |
4 | + :width="800" | |
5 | + :visible="visible" | |
6 | + :maskClosable="false" | |
7 | + :confirmLoading="confirmLoading" | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel"> | |
10 | + | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model"> | |
13 | + | |
14 | + <!-- 子表单区域 --> | |
15 | + <a-tabs defaultActiveKey="1"> | |
16 | + <a-tab-pane tab="物料信息" key="1"> | |
17 | + <div> | |
18 | + <a-row type="flex" style="margin-bottom:10px" :gutter="24"> | |
19 | + <a-col :span="12">物料编码</a-col> | |
20 | + <a-col :span="8">数量</a-col> | |
21 | + <a-col :span="4">操作</a-col> | |
22 | + </a-row> | |
23 | + <a-row type="flex" style="margin-bottom:-20px" :gutter="24" v-for="(item, index) in quickMainModel.receiptEntityList" :key="index"> | |
24 | + <a-col style="display: none"> | |
25 | + <a-form-model-item> | |
26 | + <a-input placeholder="id" v-model="item.id"/> | |
27 | + </a-form-model-item> | |
28 | + </a-col> | |
29 | + <a-col :span="12"> | |
30 | + <a-form-model-item> | |
31 | + <j-search-select-tag | |
32 | + placeholder="请选择" | |
33 | + v-model="item.materialCode" | |
34 | + :dict="'material,name,code'" | |
35 | + :pageSize="5" | |
36 | + :async="true"> | |
37 | + </j-search-select-tag> | |
38 | + </a-form-model-item> | |
39 | + </a-col> | |
40 | + <a-col :span="8"> | |
41 | + <a-form-model-item> | |
42 | + <a-input placeholder="数量" v-model="item.qty"/> | |
43 | + </a-form-model-item> | |
44 | + </a-col> | |
45 | + <a-col :span="4"> | |
46 | + <a-form-model-item> | |
47 | + <a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/> | |
48 | + </a-form-model-item> | |
49 | + </a-col> | |
50 | + </a-row> | |
51 | + <a-button type="dashed" style="width: 100%;margin-top: 10px" @click="addRowCustom"><a-icon type="plus"/>添加物料信息</a-button> | |
52 | + </div> | |
53 | + </a-tab-pane> | |
54 | + </a-tabs> | |
55 | + </a-form-model> | |
56 | + </a-spin> | |
57 | + </a-modal> | |
58 | +</template> | |
59 | + | |
60 | +<script> | |
61 | + | |
62 | +import JEditableTable from '@/components/jeecg/JEditableTable' | |
63 | +import {cantaleverReceipt, execute, quickReceipt} from '@/api/api' | |
64 | +import JDate from '@/components/jeecg/JDate' | |
65 | +import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer"; | |
66 | + | |
67 | +export default { | |
68 | + name: 'CantaleverTaskModal', | |
69 | + components: { | |
70 | + JDate, JEditableTable,JSelectMultiCanUseContainer | |
71 | + }, | |
72 | + data() { | |
73 | + return { | |
74 | + title: '悬臂库入库', | |
75 | + visible: false, | |
76 | + confirmLoading: false, | |
77 | + model: {}, | |
78 | + labelCol: { | |
79 | + xs: {span: 24}, | |
80 | + sm: {span: 4} | |
81 | + }, | |
82 | + wrapperCol: { | |
83 | + xs: {span: 24}, | |
84 | + sm: {span: 24} | |
85 | + }, | |
86 | + activeKey: '1', | |
87 | + quickMainModel: { | |
88 | + receiptEntityList: [{}], | |
89 | + }, | |
90 | + // 客户信息 | |
91 | + url: { | |
92 | + add: '/test/jeecgOrderMain/add', | |
93 | + edit: '/test/jeecgOrderMain/edit', | |
94 | + } | |
95 | + } | |
96 | + }, | |
97 | + created() { | |
98 | + }, | |
99 | + methods: { | |
100 | + handleOk() { | |
101 | + this.validateFields() | |
102 | + }, | |
103 | + handleCancel() { | |
104 | + this.visible = false | |
105 | + }, | |
106 | + | |
107 | + addRowCustom() { | |
108 | + this.quickMainModel.receiptEntityList.push({}); | |
109 | + this.$forceUpdate(); | |
110 | + }, | |
111 | + delRowCustom(index) { | |
112 | + console.log(index) | |
113 | + this.quickMainModel.receiptEntityList.splice(index, 1); | |
114 | + this.$forceUpdate(); | |
115 | + }, | |
116 | + addRowTicket() { | |
117 | + this.quickMainModel.jeecgOrderTicketList.push({}); | |
118 | + console.log(this.quickMainModel.jeecgOrderTicketList) | |
119 | + this.$forceUpdate(); | |
120 | + }, | |
121 | + delRowTicket(index) { | |
122 | + console.log(index) | |
123 | + this.quickMainModel.jeecgOrderTicketList.splice(index, 1); | |
124 | + this.$forceUpdate(); | |
125 | + }, | |
126 | + | |
127 | + edit(record) { | |
128 | + this.visible = true | |
129 | + this.activeKey = '1' | |
130 | + this.quickMainModel = Object.assign({ | |
131 | + receiptEntityList: [{}] | |
132 | + }, record); | |
133 | + }, | |
134 | + /** 触发表单验证 */ | |
135 | + validateFields() { | |
136 | + // 触发表单验证 | |
137 | + this.$refs.form.validate(valid => { | |
138 | + //alert(JSON.stringify(this.quickMainModel)); | |
139 | + this.receipt(this.quickMainModel); | |
140 | + }) | |
141 | + }, | |
142 | + | |
143 | + receipt(record) { | |
144 | + this.confirmLoading = true | |
145 | + this.model = Object.assign({}, record); | |
146 | + cantaleverReceipt(this.model).then((res) => { | |
147 | + this.loading = false; | |
148 | + if (res.success) { | |
149 | + this.$message.success(res.message); | |
150 | + this.$emit('ok'); | |
151 | + this.visible = false | |
152 | + } else { | |
153 | + this.$message.error(res.message); | |
154 | + } | |
155 | + this.confirmLoading = false | |
156 | + }); | |
157 | + }, | |
158 | + } | |
159 | +} | |
160 | +</script> | |
0 | 161 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/task/modules/StageingReceiptModal.vue
0 → 100644
1 | +<template> | |
2 | + <a-modal | |
3 | + :title="title" | |
4 | + :width="800" | |
5 | + :visible="visible" | |
6 | + :maskClosable="false" | |
7 | + :confirmLoading="confirmLoading" | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel"> | |
10 | + | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model"> | |
13 | + <!-- 主表单区域 --> | |
14 | + <a-row class="form-row" :gutter="24"> | |
15 | + <a-col :lg="12"> | |
16 | + <a-form-model-item label="托盘号" :rules="[{ required: true, message: '请输入托盘号!' }]"> | |
17 | + <a-input placeholder="请输入托盘号" v-model="quickMainModel.containerCode"/> | |
18 | + </a-form-model-item> | |
19 | + </a-col> | |
20 | + <a-col :lg="12"> | |
21 | + <a-form-model-item label="暂存区" :rules="[{ required: true, message: '请输入暂存区位置!' }]"> | |
22 | + <a-input placeholder="请输入暂存区位置" v-model="quickMainModel.fromPort"/> | |
23 | + </a-form-model-item> | |
24 | + </a-col> | |
25 | + </a-row> | |
26 | + <!-- 子表单区域 --> | |
27 | + <a-tabs defaultActiveKey="1"> | |
28 | + <a-tab-pane tab="物料信息" key="1"> | |
29 | + <div> | |
30 | + <a-row type="flex" style="margin-bottom:10px" :gutter="24"> | |
31 | + <a-col :span="12">物料编码</a-col> | |
32 | + <a-col :span="8">数量</a-col> | |
33 | + <a-col :span="4">操作</a-col> | |
34 | + </a-row> | |
35 | + <a-row type="flex" style="margin-bottom:-20px" :gutter="24" v-for="(item, index) in quickMainModel.receiptEntityList" :key="index"> | |
36 | + <a-col style="display: none"> | |
37 | + <a-form-model-item> | |
38 | + <a-input placeholder="id" v-model="item.id"/> | |
39 | + </a-form-model-item> | |
40 | + </a-col> | |
41 | + <a-col :span="12"> | |
42 | + <a-form-model-item> | |
43 | + <j-search-select-tag | |
44 | + placeholder="请选择" | |
45 | + v-model="item.materialCode" | |
46 | + :dict="'material,name,code'" | |
47 | + :pageSize="5" | |
48 | + :async="true"> | |
49 | + </j-search-select-tag> | |
50 | + </a-form-model-item> | |
51 | + </a-col> | |
52 | + <a-col :span="8"> | |
53 | + <a-form-model-item> | |
54 | + <a-input placeholder="数量" v-model="item.qty"/> | |
55 | + </a-form-model-item> | |
56 | + </a-col> | |
57 | + <a-col :span="4"> | |
58 | + <a-form-model-item> | |
59 | + <a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/> | |
60 | + </a-form-model-item> | |
61 | + </a-col> | |
62 | + </a-row> | |
63 | + <a-button type="dashed" style="width: 100%;margin-top: 10px" @click="addRowCustom"><a-icon type="plus"/>添加物料信息</a-button> | |
64 | + </div> | |
65 | + </a-tab-pane> | |
66 | + </a-tabs> | |
67 | + </a-form-model> | |
68 | + </a-spin> | |
69 | + </a-modal> | |
70 | +</template> | |
71 | + | |
72 | +<script> | |
73 | + | |
74 | +import JEditableTable from '@/components/jeecg/JEditableTable' | |
75 | +import {execute, quickReceipt, stageingReceipt} from '@/api/api' | |
76 | +import JDate from '@/components/jeecg/JDate' | |
77 | +import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer"; | |
78 | + | |
79 | +export default { | |
80 | + name: 'StageingReceiptModal', | |
81 | + components: { | |
82 | + JDate, JEditableTable,JSelectMultiCanUseContainer | |
83 | + }, | |
84 | + data() { | |
85 | + return { | |
86 | + title: '暂存区入库', | |
87 | + visible: false, | |
88 | + confirmLoading: false, | |
89 | + model: {}, | |
90 | + labelCol: { | |
91 | + xs: {span: 24}, | |
92 | + sm: {span: 4} | |
93 | + }, | |
94 | + wrapperCol: { | |
95 | + xs: {span: 24}, | |
96 | + sm: {span: 24} | |
97 | + }, | |
98 | + activeKey: '1', | |
99 | + quickMainModel: { | |
100 | + receiptEntityList: [{}], | |
101 | + }, | |
102 | + // 客户信息 | |
103 | + url: { | |
104 | + add: '/test/jeecgOrderMain/add', | |
105 | + edit: '/test/jeecgOrderMain/edit', | |
106 | + } | |
107 | + } | |
108 | + }, | |
109 | + created() { | |
110 | + }, | |
111 | + methods: { | |
112 | + handleOk() { | |
113 | + this.validateFields() | |
114 | + }, | |
115 | + handleCancel() { | |
116 | + this.visible = false | |
117 | + }, | |
118 | + | |
119 | + addRowCustom() { | |
120 | + this.quickMainModel.receiptEntityList.push({}); | |
121 | + this.$forceUpdate(); | |
122 | + }, | |
123 | + delRowCustom(index) { | |
124 | + console.log(index) | |
125 | + this.quickMainModel.receiptEntityList.splice(index, 1); | |
126 | + this.$forceUpdate(); | |
127 | + }, | |
128 | + addRowTicket() { | |
129 | + this.quickMainModel.jeecgOrderTicketList.push({}); | |
130 | + console.log(this.quickMainModel.jeecgOrderTicketList) | |
131 | + this.$forceUpdate(); | |
132 | + }, | |
133 | + delRowTicket(index) { | |
134 | + console.log(index) | |
135 | + this.quickMainModel.jeecgOrderTicketList.splice(index, 1); | |
136 | + this.$forceUpdate(); | |
137 | + }, | |
138 | + | |
139 | + edit(record) { | |
140 | + this.visible = true | |
141 | + this.activeKey = '1' | |
142 | + this.quickMainModel = Object.assign({ | |
143 | + receiptEntityList: [{}] | |
144 | + }, record); | |
145 | + }, | |
146 | + /** 触发表单验证 */ | |
147 | + validateFields() { | |
148 | + // 触发表单验证 | |
149 | + this.$refs.form.validate(valid => { | |
150 | + //alert(JSON.stringify(this.quickMainModel)); | |
151 | + this.receipt(this.quickMainModel); | |
152 | + }) | |
153 | + }, | |
154 | + | |
155 | + receipt(record) { | |
156 | + this.confirmLoading = true | |
157 | + this.model = Object.assign({}, record); | |
158 | + stageingReceipt(this.model).then((res) => { | |
159 | + this.loading = false; | |
160 | + if (res.success) { | |
161 | + this.$message.success(res.message); | |
162 | + this.$emit('ok'); | |
163 | + this.visible = false | |
164 | + } else { | |
165 | + this.$message.error(res.message); | |
166 | + } | |
167 | + this.confirmLoading = false | |
168 | + }); | |
169 | + }, | |
170 | + } | |
171 | +} | |
172 | +</script> | |
0 | 173 | \ No newline at end of file |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -539,7 +539,10 @@ public class WcsServiceImpl implements WcsService { |
539 | 539 | Integer minTaskPosition = Collections.min(positionList); |
540 | 540 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByLocationCodeAndNotPosition(fromLocationCode, positionList, warehouseCode); |
541 | 541 | List<Integer> inventoryPositionList = inventoryDetailList.stream().map(InventoryDetail::getPosition).collect(Collectors.toList()); |
542 | - Integer minInventoryPosition = Collections.min(inventoryPositionList); | |
542 | + Integer minInventoryPosition = 0; | |
543 | + if (CollectionUtils.isNotEmpty(inventoryPositionList)) { | |
544 | + minInventoryPosition = Collections.min(inventoryPositionList); | |
545 | + } | |
543 | 546 | if (minTaskPosition < minInventoryPosition) { |
544 | 547 | TaskHeader unCompleteTaskHeader = taskHeaderService.getUnCompleteTransferTaskByFromLocationCode(fromLocationCode, warehouseCode); |
545 | 548 | if (unCompleteTaskHeader != null) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
... | ... | @@ -45,4 +45,6 @@ public interface IContainerService extends IService<Container> { |
45 | 45 | List<Container> getContainerListByCodeList(List<String> containerCodeList, String warehouseCode); |
46 | 46 | |
47 | 47 | List<Container> getCanUseListContainer(Container container, String warehouseCode); |
48 | + | |
49 | + List<Container> getCanDeleteListLSContainer(String warehouseCode); | |
48 | 50 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
... | ... | @@ -248,6 +248,18 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
251 | + @Override | |
252 | + public List<Container> getCanDeleteListLSContainer(String warehouseCode) { | |
253 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
254 | + containerLambdaQueryWrapper.eq(Container::getContainerTypeCode, QuantityConstant.CONTAINER_TYPE_LS) | |
255 | + .eq(Container::getWarehouseCode, warehouseCode) | |
256 | + .eq(Container::getLocationCode, QuantityConstant.EMPTY_STRING) | |
257 | + .eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_EMPTY) | |
258 | + .eq(Container::getFillStatus, QuantityConstant.STATUS_CONTAINER_FILL_EMPTY); | |
259 | + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | |
260 | + return containerList; | |
261 | + } | |
262 | + | |
251 | 263 | private int getStartNumber(String containerTypeCode, String warehouseCode) { |
252 | 264 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
253 | 265 | containerLambdaQueryWrapper.eq(Container::getContainerTypeCode, containerTypeCode).eq(Container::getWarehouseCode, warehouseCode) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoDeleteTask.java
... | ... | @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import lombok.extern.slf4j.Slf4j; |
7 | 7 | import org.jeecg.common.util.DateUtils; |
8 | 8 | import org.jeecg.modules.wms.api.erp.service.IErpService; |
9 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
10 | +import org.jeecg.modules.wms.config.container.service.IContainerService; | |
9 | 11 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
10 | 12 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
11 | 13 | import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; |
... | ... | @@ -18,12 +20,14 @@ import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
18 | 20 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
19 | 21 | import org.jeecg.utils.StringUtils; |
20 | 22 | import org.jeecg.utils.constant.QuantityConstant; |
23 | +import org.jeecg.utils.support.ApiAuthentication; | |
21 | 24 | import org.quartz.*; |
22 | 25 | import org.springframework.util.CollectionUtils; |
23 | 26 | |
24 | 27 | import javax.annotation.Resource; |
25 | 28 | import java.util.Date; |
26 | 29 | import java.util.List; |
30 | +import java.util.stream.Collectors; | |
27 | 31 | |
28 | 32 | /** |
29 | 33 | * 删除完成的单据 |
... | ... | @@ -44,15 +48,28 @@ public class AutoDeleteTask implements Job { |
44 | 48 | |
45 | 49 | @Resource |
46 | 50 | private IErpService erpService; |
51 | + | |
47 | 52 | @Resource |
48 | 53 | private IHuahengMultiHandlerService huahengMultiHandlerService; |
54 | + | |
49 | 55 | @Resource |
50 | 56 | private IParameterConfigurationService parameterConfigurationService; |
57 | + | |
51 | 58 | @Resource |
52 | 59 | private ITaskHeaderService taskHeaderService; |
60 | + | |
53 | 61 | @Resource |
54 | 62 | private IInventoryTransactionService inventoryTransactionService; |
55 | 63 | |
64 | + @Resource | |
65 | + private IContainerService containerService; | |
66 | + | |
67 | + private String parameter; | |
68 | + | |
69 | + public void setParameter(String parameter) { | |
70 | + this.parameter = parameter; | |
71 | + } | |
72 | + | |
56 | 73 | @Override |
57 | 74 | public void execute(JobExecutionContext context) throws JobExecutionException { |
58 | 75 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_DELETE_RECEIPT); |
... | ... | @@ -63,38 +80,66 @@ public class AutoDeleteTask implements Job { |
63 | 80 | if (DELETE_RECEIPT == QuantityConstant.NOT_DELETE_RECEIPT) { |
64 | 81 | return; |
65 | 82 | } |
83 | + // 入库单:按照 id 升序排序,先删除 id 小的记录,只保留最新的 100 条记录 | |
66 | 84 | LambdaQueryWrapper<ReceiptHeader> receiptHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
67 | - receiptHeaderLambdaQueryWrapper.eq(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED).isNull(ReceiptHeader::getReferCode) | |
68 | - .le(ReceiptHeader::getCreateTime, DateUtil.offsetDay(new Date(), -30)); | |
85 | + receiptHeaderLambdaQueryWrapper | |
86 | + .eq(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED) | |
87 | + .isNull(ReceiptHeader::getReferCode) | |
88 | + .orderByAsc(ReceiptHeader::getId); | |
69 | 89 | List<ReceiptHeader> receiptHeaderList = receiptHeaderService.list(receiptHeaderLambdaQueryWrapper); |
70 | - log.info(String.format(" AutoDeleteTask 执行任务! receiptHeaderList :" + receiptHeaderList + "时间" + DateUtils.getTimestamp())); | |
71 | - for (ReceiptHeader receiptHeader : receiptHeaderList) { | |
72 | - receiptHeaderService.delMain(String.valueOf(receiptHeader.getId()), QuantityConstant.WMS_COMPLETE_DELETE_RECEIPT); | |
90 | + log.info(String.format("AutoDeleteTask receiptHeaderList: %s, 时间: %s", receiptHeaderList, DateUtils.getTimestamp())); | |
91 | + if (receiptHeaderList.size() > 10) { | |
92 | + int countToDelete = receiptHeaderList.size() - 10; | |
93 | + for (int i = 0; i < countToDelete; i++) { | |
94 | + ReceiptHeader receiptHeader = receiptHeaderList.get(i); | |
95 | + receiptHeaderService.delMain(String.valueOf(receiptHeader.getId()), QuantityConstant.WMS_COMPLETE_DELETE_RECEIPT); | |
96 | + } | |
73 | 97 | } |
98 | + | |
99 | + // 出库单:按照 id 升序排序,先删除 id 小的记录,只保留最新的 100 条记录 | |
74 | 100 | LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
75 | - shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED).isNull(ShipmentHeader::getReferCode) | |
76 | - .le(ShipmentHeader::getCreateTime, DateUtil.offsetDay(new Date(), -30)); | |
101 | + shipmentHeaderLambdaQueryWrapper | |
102 | + .eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED) | |
103 | + .isNull(ShipmentHeader::getReferCode) | |
104 | + .orderByAsc(ShipmentHeader::getId); | |
77 | 105 | List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper); |
78 | - log.info(String.format(" AutoDeleteTask 执行任务! shipmentHeaderList :" + shipmentHeaderList + "时间" + DateUtils.getTimestamp())); | |
79 | - for (ShipmentHeader shipmentHeader : shipmentHeaderList) { | |
80 | - shipmentHeaderService.delMain(String.valueOf(shipmentHeader.getId()), QuantityConstant.WMS_COMPLETE_DELETE_RECEIPT); | |
106 | + log.info(String.format("AutoDeleteTask shipmentHeaderList: %s, 时间: %s", shipmentHeaderList, DateUtils.getTimestamp())); | |
107 | + if (shipmentHeaderList.size() > 10) { | |
108 | + int countToDelete = shipmentHeaderList.size() - 10; | |
109 | + for (int i = 0; i < countToDelete; i++) { | |
110 | + ShipmentHeader shipmentHeader = shipmentHeaderList.get(i); | |
111 | + shipmentHeaderService.delMain(String.valueOf(shipmentHeader.getId()), QuantityConstant.WMS_COMPLETE_DELETE_RECEIPT); | |
112 | + } | |
81 | 113 | } |
114 | + | |
115 | + // 任务:按照 id 升序排序,先删除 id 小的记录,只保留最新的 100 条记录 | |
82 | 116 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
83 | - taskHeaderLambdaQueryWrapper.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED).ne(TaskHeader::getExceptionState, | |
84 | - QuantityConstant.EXCEPTION_TASK_ERROR).le(TaskHeader::getCreateTime, DateUtil.offsetDay(new Date(), -30)); | |
117 | + taskHeaderLambdaQueryWrapper | |
118 | + .eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED) | |
119 | + .ne(TaskHeader::getExceptionState, QuantityConstant.EXCEPTION_TASK_ERROR) | |
120 | + .orderByAsc(TaskHeader::getId); | |
85 | 121 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
86 | - log.info(String.format(" AutoDeleteTask 执行任务! taskHeaderList :" + taskHeaderList + "时间" + DateUtils.getTimestamp())); | |
87 | - for (TaskHeader taskHeader : taskHeaderList) { | |
88 | - taskHeaderService.delMain(taskHeader.getId()); | |
122 | + log.info(String.format("AutoDeleteTask taskHeaderList: %s, 时间: %s", taskHeaderList, DateUtils.getTimestamp())); | |
123 | + if (taskHeaderList.size() > 10) { | |
124 | + int countToDelete = taskHeaderList.size() - 10; | |
125 | + for (int i = 0; i < countToDelete; i++) { | |
126 | + TaskHeader taskHeader = taskHeaderList.get(i); | |
127 | + taskHeaderService.delMain(taskHeader.getId()); | |
128 | + } | |
89 | 129 | } |
90 | 130 | |
131 | + | |
91 | 132 | LambdaQueryWrapper<InventoryTransaction> inventoryTransactionLambdaQueryWrapper = Wrappers.lambdaQuery(); |
92 | 133 | inventoryTransactionLambdaQueryWrapper.le(InventoryTransaction::getCreateTime, DateUtil.offsetDay(new Date(), -360)); |
93 | 134 | List<InventoryTransaction> inventoryTransactionList = inventoryTransactionService.list(inventoryTransactionLambdaQueryWrapper); |
94 | - log.info(String.format(" AutoDeleteTask 执行任务! inventoryTransactionList :" + inventoryTransactionList + "时间" + DateUtils.getTimestamp())); | |
95 | 135 | if (!CollectionUtils.isEmpty(inventoryTransactionList)) { |
96 | 136 | inventoryTransactionService.batchDelete(inventoryTransactionList); |
97 | 137 | } |
98 | 138 | |
139 | + List<Container> containerList = containerService.getCanDeleteListLSContainer(QuantityConstant.DEFAULT_WAREHOUSE); | |
140 | + if (!CollectionUtils.isEmpty(containerList)) { | |
141 | + List<Integer> containerIdList = containerList.stream().map(Container::getId).collect(Collectors.toList()); | |
142 | + containerService.removeByIds(containerIdList); | |
143 | + } | |
99 | 144 | } |
100 | 145 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -504,6 +504,9 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
504 | 504 | if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { |
505 | 505 | type = QuantityConstant.PORT_TYPE_OUT; |
506 | 506 | } |
507 | + if (zoneCode.equals(QuantityConstant.ZONE_B)) { | |
508 | + type = QuantityConstant.PORT_TYPE_OUT; | |
509 | + } | |
507 | 510 | String fromLocationCode = shipmentContainerHeader.getFromLocationCode(); |
508 | 511 | if (StringUtils.isEmpty(fromLocationCode)) { |
509 | 512 | throw new JeecgBootException("自动出库, 没有起始库位编码"); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/IAgvTaskService.java
... | ... | @@ -35,7 +35,7 @@ public interface IAgvTaskService extends IService<AgvTask> { |
35 | 35 | |
36 | 36 | AgvTask getAgvTaskByPort(String portCode, String warehouseCode); |
37 | 37 | |
38 | - AgvTask getAgvTaskBuContainerCode(String containerCode, String warehouseCode); | |
38 | + AgvTask getAgvTaskByContainerCode(String containerCode, String warehouseCode); | |
39 | 39 | |
40 | 40 | AgvTask getAgvTaskBuFromPort(String fromPortCode, String warehouseCode); |
41 | 41 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java
... | ... | @@ -61,7 +61,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl |
61 | 61 | // throw new JeecgBootException("生成AGV任务,锁定容器失败:" + containerCode); |
62 | 62 | // } |
63 | 63 | // } |
64 | - if (agvTaskService.getAgvTaskBuContainerCode(containerCode, warehouseCode) != null) { | |
64 | + if (agvTaskService.getAgvTaskByContainerCode(containerCode, warehouseCode) != null) { | |
65 | 65 | return Result.error("生成AGV任务失败,已经生成AGV任务"); |
66 | 66 | } |
67 | 67 | agvTask.setWarehouseCode(warehouseCode); |
... | ... | @@ -208,7 +208,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl |
208 | 208 | } |
209 | 209 | |
210 | 210 | @Override |
211 | - public AgvTask getAgvTaskBuContainerCode(String containerCode, String warehouseCode) { | |
211 | + public AgvTask getAgvTaskByContainerCode(String containerCode, String warehouseCode) { | |
212 | 212 | LambdaQueryWrapper<AgvTask> agvTaskLambdaQueryWrapper = Wrappers.lambdaQuery(); |
213 | 213 | agvTaskLambdaQueryWrapper.eq(AgvTask::getContainerCode, containerCode).eq(AgvTask::getWarehouseCode, warehouseCode).lt(AgvTask::getStatus, |
214 | 214 | QuantityConstant.AGV_TASK_STATUS_COMPLETED); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -30,10 +30,7 @@ import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
30 | 30 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
31 | 31 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
32 | 32 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
33 | -import org.jeecg.modules.wms.task.taskHeader.entity.CantaleverTransfer; | |
34 | -import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity; | |
35 | -import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; | |
36 | -import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | |
33 | +import org.jeecg.modules.wms.task.taskHeader.entity.*; | |
37 | 34 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; |
38 | 35 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
39 | 36 | import org.jeecg.utils.ConvertUtils; |
... | ... | @@ -911,6 +908,46 @@ public class TaskHeaderController extends HuahengBaseController { |
911 | 908 | } |
912 | 909 | |
913 | 910 | /** |
911 | + * 快速入库 | |
912 | + * @return | |
913 | + */ | |
914 | + @AutoLog(value = "悬臂库入库", operateType = 2) | |
915 | + @PostMapping("cantaleverReceipt") | |
916 | + @ApiOperation("悬臂库入库") | |
917 | + public Result cantaleverReceipt(@RequestBody QucikReceiptEntity qucikReceiptEntity, HttpServletRequest req) { | |
918 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
919 | + qucikReceiptEntity.setWarehouseCode(warehouseCode); | |
920 | + Result result = handleMultiProcess("cantaleverReceipt", new MultiProcessListener() { | |
921 | + @Override | |
922 | + public Result<?> doProcess() { | |
923 | + Result result = taskHeaderService.cantaleverReceipt(qucikReceiptEntity); | |
924 | + return result; | |
925 | + } | |
926 | + }); | |
927 | + return result; | |
928 | + } | |
929 | + | |
930 | + /** | |
931 | + * 暂存区入库 | |
932 | + * @return | |
933 | + */ | |
934 | + @AutoLog(value = "暂存区入库", operateType = 2) | |
935 | + @PostMapping("stageingReceipt") | |
936 | + @ApiOperation("暂存区入库") | |
937 | + public Result stageingReceipt(@RequestBody StageingReceiptEntity stageingReceiptEntity, HttpServletRequest req) { | |
938 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
939 | + stageingReceiptEntity.setWarehouseCode(warehouseCode); | |
940 | + Result result = handleMultiProcess("stageingReceipt", new MultiProcessListener() { | |
941 | + @Override | |
942 | + public Result<?> doProcess() { | |
943 | + Result result = taskHeaderService.stageingReceipt(stageingReceiptEntity); | |
944 | + return result; | |
945 | + } | |
946 | + }); | |
947 | + return result; | |
948 | + } | |
949 | + | |
950 | + /** | |
914 | 951 | * 快速出库 |
915 | 952 | * @return |
916 | 953 | */ |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/StageingReceiptEntity.java
0 → 100644
1 | +package org.jeecg.modules.wms.task.taskHeader.entity; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +@Data | |
8 | +public class StageingReceiptEntity { | |
9 | + | |
10 | + private String containerCode; | |
11 | + private String fromPort; | |
12 | + private String toPort; | |
13 | + private String warehouseCode; | |
14 | + private List<ReceiptEntity> receiptEntityList; | |
15 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... | ... | @@ -10,6 +10,7 @@ import org.jeecg.modules.wms.config.location.entity.Location; |
10 | 10 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
11 | 11 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
12 | 12 | import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity; |
13 | +import org.jeecg.modules.wms.task.taskHeader.entity.StageingReceiptEntity; | |
13 | 14 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
14 | 15 | |
15 | 16 | import com.baomidou.mybatisplus.extension.service.IService; |
... | ... | @@ -501,6 +502,19 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
501 | 502 | Result quickReceipt(QucikReceiptEntity qucikReceiptEntity); |
502 | 503 | |
503 | 504 | /** |
505 | + * add | |
506 | + * @return | |
507 | + */ | |
508 | + Result cantaleverReceipt(QucikReceiptEntity qucikReceiptEntity); | |
509 | + | |
510 | + | |
511 | + /** | |
512 | + * add | |
513 | + * @return | |
514 | + */ | |
515 | + Result stageingReceipt(StageingReceiptEntity stageingReceiptEntity); | |
516 | + | |
517 | + /** | |
504 | 518 | * 切换任务 |
505 | 519 | * @param id |
506 | 520 | * @return |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -63,6 +63,8 @@ import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetai |
63 | 63 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl.CycleCountDetailChildServiceImpl; |
64 | 64 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl.CycleCountDetailServiceImpl; |
65 | 65 | import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.impl.CycleCountHeaderServiceImpl; |
66 | +import org.jeecg.modules.wms.task.agvTask.entity.AgvTask; | |
67 | +import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService; | |
66 | 68 | import org.jeecg.modules.wms.task.taskHeader.entity.*; |
67 | 69 | import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper; |
68 | 70 | import org.jeecg.modules.wms.task.taskHeader.mapper.TaskHeaderMapper; |
... | ... | @@ -204,6 +206,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
204 | 206 | @Resource |
205 | 207 | private IAddressService addressService; |
206 | 208 | |
209 | + @Resource | |
210 | + private IAgvTaskService agvTaskService; | |
207 | 211 | |
208 | 212 | @Override |
209 | 213 | @Transactional |
... | ... | @@ -1580,11 +1584,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1580 | 1584 | return Result.error("创建移库任务失败,起始库位:" + fromLocationCode + "和目标库位:" + toLocationCode + "是同一个"); |
1581 | 1585 | } |
1582 | 1586 | String containerCode = fromLocation.getContainerCode(); |
1583 | - TaskHeader unComleteTask = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode); | |
1584 | - if (unComleteTask != null) { | |
1585 | - Container container = containerService.createLSContainer(warehouseCode); | |
1586 | - containerCode = container.getCode(); | |
1587 | - } | |
1587 | +// TaskHeader unComleteTask = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode); | |
1588 | +// if (unComleteTask != null) { | |
1589 | +// Container container = containerService.createLSContainer(warehouseCode); | |
1590 | +// containerCode = container.getCode(); | |
1591 | +// } | |
1588 | 1592 | List<InventoryDetail> toInventoryDetailList = inventoryDetailService.getInventoryDetailListByLocationCode(toLocationCode, warehouseCode); |
1589 | 1593 | List<InventoryDetail> totalInventoryDetailList = new ArrayList<>(); |
1590 | 1594 | if (CollectionUtils.isNotEmpty(toInventoryDetailList)) { |
... | ... | @@ -1671,9 +1675,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1671 | 1675 | if (!success) { |
1672 | 1676 | throw new JeecgBootException("创建移库任务时,创建任务失败"); |
1673 | 1677 | } |
1674 | - if (!taskHeaderService.updateTaskRoadWay(containerCode, fromLocationCode, warehouseCode)) { | |
1675 | - throw new JeecgBootException("创建任务时,更新巷道值失败"); | |
1676 | - } | |
1678 | +// if (!taskHeaderService.updateTaskRoadWay(containerCode, fromLocationCode, warehouseCode)) { | |
1679 | +// throw new JeecgBootException("创建任务时,更新巷道值失败"); | |
1680 | +// } | |
1677 | 1681 | List<TaskDetail> taskDetailList = new ArrayList<>(); |
1678 | 1682 | fromInventoryDetailList = fromInventoryDetailList.stream().sorted(new Comparator<InventoryDetail>() { |
1679 | 1683 | @Override |
... | ... | @@ -3177,6 +3181,259 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3177 | 3181 | return Result.OK("快速入库成功"); |
3178 | 3182 | } |
3179 | 3183 | |
3184 | + @Override | |
3185 | + @Transactional(rollbackFor = Exception.class) | |
3186 | + public Result cantaleverReceipt(QucikReceiptEntity qucikReceiptEntity) { | |
3187 | + boolean success = false; | |
3188 | + String containerCode = qucikReceiptEntity.getContainerCode(); | |
3189 | + List<ReceiptEntity> receiptEntityList = qucikReceiptEntity.getReceiptEntityList(); | |
3190 | + String toPort = qucikReceiptEntity.getToPort(); | |
3191 | + String warehouseCode = qucikReceiptEntity.getWarehouseCode(); | |
3192 | + List<Receive> receiveList = new ArrayList<>(); | |
3193 | +// if (StringUtils.isEmpty(containerCode)) { | |
3194 | +// return Result.error("快速入库,容器编码为空"); | |
3195 | +// } | |
3196 | + if (StringUtils.isEmpty(warehouseCode)) { | |
3197 | + return Result.error("悬臂库入库,仓库编码为空"); | |
3198 | + } | |
3199 | + if (StringUtils.isEmpty(receiptEntityList)) { | |
3200 | + return Result.error("悬臂库入库,入库信息为空"); | |
3201 | + } | |
3202 | + Container container = containerService.createLSContainer(warehouseCode); | |
3203 | + if (container == null) { | |
3204 | + return Result.error("悬臂库入库,没有找到容器" + containerCode); | |
3205 | + } | |
3206 | + containerCode = container.getCode(); | |
3207 | +// Port port = portService.getPortByCode(toPort, warehouseCode); | |
3208 | +// if (port != null) { | |
3209 | +// int portType = Integer.parseInt(port.getType()); | |
3210 | +// if (portType == QuantityConstant.PORT_TYPE_OUT) { | |
3211 | +// return Result.error("快速入库,不能选择出库口" + toPort); | |
3212 | +// } | |
3213 | +// } | |
3214 | + for (ReceiptEntity receiptEntity : receiptEntityList) { | |
3215 | + if(receiptEntity.getQty().compareTo(BigDecimal.ZERO) == 0) { | |
3216 | + continue; | |
3217 | + } | |
3218 | + if(receiptEntity.getQty().compareTo(BigDecimal.ONE) != 0) { | |
3219 | + throw new JeecgBootException("悬臂库入库,入库数量只能是1"); | |
3220 | + } | |
3221 | + } | |
3222 | + if (receiptEntityList.size() > 1) { | |
3223 | + throw new JeecgBootException("悬臂库入库,每次只能入1个"); | |
3224 | + } | |
3225 | + String receiptType = QuantityConstant.RECEIPT_BILL_TYPE_QTR; | |
3226 | + String remark = "快速入库"; | |
3227 | + ReceiptHeader receiptHeader = new ReceiptHeader(); | |
3228 | + receiptHeader.setWarehouseCode(warehouseCode); | |
3229 | + receiptHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); | |
3230 | + receiptHeader.setType(receiptType); | |
3231 | + receiptHeader.setRemark(remark); | |
3232 | + Result result = receiptHeaderService.saveReceiptHeader(receiptHeader); | |
3233 | + if (!result.isSuccess()) { | |
3234 | + throw new JeecgBootException("快速入库, 创建入库单头失败" + result.getMessage()); | |
3235 | + } | |
3236 | + for (ReceiptEntity receiptEntity : receiptEntityList) { | |
3237 | + BigDecimal qty = receiptEntity.getQty(); | |
3238 | + String materialCode = receiptEntity.getMaterialCode(); | |
3239 | + if (StringUtils.isEmpty(materialCode)) { | |
3240 | + throw new JeecgBootException("快速入库, 物料编码为空"); | |
3241 | + } | |
3242 | + if (qty == null) { | |
3243 | + throw new JeecgBootException("快速入库, 数量必须填写"); | |
3244 | + } | |
3245 | + if (qty.compareTo(BigDecimal.ZERO) <= 0) { | |
3246 | + throw new JeecgBootException("快速入库, 数量必须大于0"); | |
3247 | + } | |
3248 | + ReceiptDetail receiptDetail = new ReceiptDetail(); | |
3249 | + receiptDetail.setWarehouseCode(warehouseCode); | |
3250 | + receiptDetail.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); | |
3251 | + receiptDetail.setReceiptCode(receiptHeader.getCode()); | |
3252 | + receiptDetail.setReceiptId(receiptHeader.getId()); | |
3253 | + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
3254 | + receiptDetail.setQty(qty); | |
3255 | + Material material = materialService.getMaterialByCode(materialCode); | |
3256 | + if (material == null) { | |
3257 | + throw new JeecgBootException("快速入库, 获取物料:" + materialCode + " 信息失败"); | |
3258 | + } | |
3259 | + receiptDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD); | |
3260 | + receiptDetail.setMaterialCode(materialCode); | |
3261 | + receiptDetail.setMaterialName(material.getName()); | |
3262 | + receiptDetail.setMaterialSpec(material.getSpec()); | |
3263 | + receiptDetail.setMaterialUnit(material.getUnit()); | |
3264 | + success = receiptDetailService.save(receiptDetail); | |
3265 | + if (!success) { | |
3266 | + throw new JeecgBootException("快速入库, 保存入库单详情失败"); | |
3267 | + } | |
3268 | + | |
3269 | + Receive receive = new Receive(); | |
3270 | + receive.setId(receiptDetail.getId()); | |
3271 | + receive.setContainerCode(containerCode); | |
3272 | + receive.setMaterialCode(materialCode); | |
3273 | + receive.setMaterialName(receiptDetail.getMaterialName()); | |
3274 | + receive.setMaterialSpec(receiptDetail.getMaterialSpec()); | |
3275 | + receive.setMaterialUnit(receiptDetail.getMaterialUnit()); | |
3276 | + receive.setInventoryStatus(receiptDetail.getInventoryStatus()); | |
3277 | + receive.setQty(receiptDetail.getQty()); | |
3278 | + receive.setTaskQty(receiptDetail.getQty()); | |
3279 | + receiveList.add(receive); | |
3280 | + } | |
3281 | + result = receiveService.receiving(receiveList, warehouseCode); | |
3282 | + if (!result.isSuccess()) { | |
3283 | + throw new JeecgBootException(result.getMessage()); | |
3284 | + } | |
3285 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); | |
3286 | + if (receiptContainerHeader == null) { | |
3287 | + throw new JeecgBootException(result.getMessage()); | |
3288 | + } | |
3289 | + receiptContainerHeader.setToPort(toPort); | |
3290 | + success = receiptContainerHeaderService.updateById(receiptContainerHeader); | |
3291 | + if (!success) { | |
3292 | + throw new JeecgBootException("快速入库,更新入库组盘头失败"); | |
3293 | + } | |
3294 | + result = receiptContainerHeaderService.createReceiptTask(receiptContainerHeader, warehouseCode); | |
3295 | + if (!result.isSuccess()) { | |
3296 | + throw new JeecgBootException(result.getMessage()); | |
3297 | + } | |
3298 | +// TaskHeader taskHeader = (TaskHeader)result.getResult(); | |
3299 | +// if (taskHeader.getTaskType() == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { | |
3300 | +// if (port == null) { | |
3301 | +// throw new JeecgBootException("快速入库, 生成补充任务时必须有入库口"); | |
3302 | +// } | |
3303 | +// } | |
3304 | + if (!receiptHeaderService.updateReceiptHeader(receiptHeader.getId())) { | |
3305 | + throw new JeecgBootException("快速入库, 更新入库表单头失败"); | |
3306 | + } | |
3307 | + return Result.OK("快速入库成功"); | |
3308 | + } | |
3309 | + | |
3310 | + @Override | |
3311 | + @Transactional(rollbackFor = Exception.class) | |
3312 | + public Result stageingReceipt(StageingReceiptEntity stageingReceiptEntity) { | |
3313 | + boolean success = false; | |
3314 | + String containerCode = stageingReceiptEntity.getContainerCode(); | |
3315 | + List<ReceiptEntity> receiptEntityList = stageingReceiptEntity.getReceiptEntityList(); | |
3316 | + String fromPort = stageingReceiptEntity.getFromPort(); | |
3317 | + String toPort = stageingReceiptEntity.getToPort(); | |
3318 | + toPort = "P1001"; | |
3319 | + String warehouseCode = stageingReceiptEntity.getWarehouseCode(); | |
3320 | + List<Receive> receiveList = new ArrayList<>(); | |
3321 | + if (StringUtils.isEmpty(containerCode)) { | |
3322 | + return Result.error("快速入库,容器编码为空"); | |
3323 | + } | |
3324 | + if (StringUtils.isEmpty(warehouseCode)) { | |
3325 | + return Result.error("快速入库,仓库编码为空"); | |
3326 | + } | |
3327 | + if (StringUtils.isEmpty(receiptEntityList)) { | |
3328 | + return Result.error("快速入库,入库信息为空"); | |
3329 | + } | |
3330 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
3331 | + if (container == null) { | |
3332 | + return Result.error("快速入库,没有找到容器" + containerCode); | |
3333 | + } | |
3334 | + Port port = portService.getPortByCode(toPort, warehouseCode); | |
3335 | + if (port != null) { | |
3336 | + int portType = Integer.parseInt(port.getType()); | |
3337 | + if (portType == QuantityConstant.PORT_TYPE_OUT) { | |
3338 | + return Result.error("快速入库,不能选择出库口" + toPort); | |
3339 | + } | |
3340 | + } | |
3341 | + String receiptType = QuantityConstant.RECEIPT_BILL_TYPE_QTR; | |
3342 | + String remark = "快速入库"; | |
3343 | + ReceiptHeader receiptHeader = new ReceiptHeader(); | |
3344 | + receiptHeader.setWarehouseCode(warehouseCode); | |
3345 | + receiptHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); | |
3346 | + receiptHeader.setType(receiptType); | |
3347 | + receiptHeader.setRemark(remark); | |
3348 | + Result result = receiptHeaderService.saveReceiptHeader(receiptHeader); | |
3349 | + if (!result.isSuccess()) { | |
3350 | + throw new JeecgBootException("快速入库, 创建入库单头失败" + result.getMessage()); | |
3351 | + } | |
3352 | + for (ReceiptEntity receiptEntity : receiptEntityList) { | |
3353 | + BigDecimal qty = receiptEntity.getQty(); | |
3354 | + String materialCode = receiptEntity.getMaterialCode(); | |
3355 | + if (StringUtils.isEmpty(materialCode)) { | |
3356 | + throw new JeecgBootException("快速入库, 物料编码为空"); | |
3357 | + } | |
3358 | + if (qty == null) { | |
3359 | + throw new JeecgBootException("快速入库, 数量必须填写"); | |
3360 | + } | |
3361 | + if (qty.compareTo(BigDecimal.ZERO) <= 0) { | |
3362 | + throw new JeecgBootException("快速入库, 数量必须大于0"); | |
3363 | + } | |
3364 | + ReceiptDetail receiptDetail = new ReceiptDetail(); | |
3365 | + receiptDetail.setWarehouseCode(warehouseCode); | |
3366 | + receiptDetail.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); | |
3367 | + receiptDetail.setReceiptCode(receiptHeader.getCode()); | |
3368 | + receiptDetail.setReceiptId(receiptHeader.getId()); | |
3369 | + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
3370 | + receiptDetail.setQty(qty); | |
3371 | + Material material = materialService.getMaterialByCode(materialCode); | |
3372 | + if (material == null) { | |
3373 | + throw new JeecgBootException("快速入库, 获取物料:" + materialCode + " 信息失败"); | |
3374 | + } | |
3375 | + receiptDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD); | |
3376 | + receiptDetail.setMaterialCode(materialCode); | |
3377 | + receiptDetail.setMaterialName(material.getName()); | |
3378 | + receiptDetail.setMaterialSpec(material.getSpec()); | |
3379 | + receiptDetail.setMaterialUnit(material.getUnit()); | |
3380 | + success = receiptDetailService.save(receiptDetail); | |
3381 | + if (!success) { | |
3382 | + throw new JeecgBootException("快速入库, 保存入库单详情失败"); | |
3383 | + } | |
3384 | + | |
3385 | + Receive receive = new Receive(); | |
3386 | + receive.setId(receiptDetail.getId()); | |
3387 | + receive.setContainerCode(containerCode); | |
3388 | + receive.setMaterialCode(materialCode); | |
3389 | + receive.setMaterialName(receiptDetail.getMaterialName()); | |
3390 | + receive.setMaterialSpec(receiptDetail.getMaterialSpec()); | |
3391 | + receive.setMaterialUnit(receiptDetail.getMaterialUnit()); | |
3392 | + receive.setInventoryStatus(receiptDetail.getInventoryStatus()); | |
3393 | + receive.setQty(receiptDetail.getQty()); | |
3394 | + receive.setTaskQty(receiptDetail.getQty()); | |
3395 | + receiveList.add(receive); | |
3396 | + } | |
3397 | + result = receiveService.receiving(receiveList, warehouseCode); | |
3398 | + if (!result.isSuccess()) { | |
3399 | + throw new JeecgBootException(result.getMessage()); | |
3400 | + } | |
3401 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); | |
3402 | + if (receiptContainerHeader == null) { | |
3403 | + throw new JeecgBootException(result.getMessage()); | |
3404 | + } | |
3405 | + receiptContainerHeader.setToPort(toPort); | |
3406 | + success = receiptContainerHeaderService.updateById(receiptContainerHeader); | |
3407 | + if (!success) { | |
3408 | + throw new JeecgBootException("快速入库,更新入库组盘头失败"); | |
3409 | + } | |
3410 | + result = receiptContainerHeaderService.createReceiptTask(receiptContainerHeader, warehouseCode); | |
3411 | + if (!result.isSuccess()) { | |
3412 | + throw new JeecgBootException(result.getMessage()); | |
3413 | + } | |
3414 | + TaskHeader taskHeader = (TaskHeader)result.getResult(); | |
3415 | + if (taskHeader.getTaskType() == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { | |
3416 | + if (port == null) { | |
3417 | + throw new JeecgBootException("快速入库, 生成补充任务时必须有入库口"); | |
3418 | + } | |
3419 | + } | |
3420 | + if (!receiptHeaderService.updateReceiptHeader(receiptHeader.getId())) { | |
3421 | + throw new JeecgBootException("快速入库, 更新入库表单头失败"); | |
3422 | + } | |
3423 | + | |
3424 | + AgvTask agvTask = new AgvTask(); | |
3425 | + agvTask.setWarehouseCode(warehouseCode); | |
3426 | + agvTask.setTaskType(QuantityConstant.AGV_TYPE_TAKE_AND_RELEASE); | |
3427 | + agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_BUILD); | |
3428 | + agvTask.setContainerCode(containerCode); | |
3429 | + agvTask.setFromPort(fromPort); | |
3430 | + agvTask.setToPort(toPort); | |
3431 | + agvTask.setPriority(10); | |
3432 | + result = agvTaskService.addAgvTask(agvTask, warehouseCode); | |
3433 | + log.info(String.format("AutoCreateAgvTask 生成AGV任务执行:" + result.getMessage())); | |
3434 | + return Result.OK("快速入库成功"); | |
3435 | + } | |
3436 | + | |
3180 | 3437 | /** |
3181 | 3438 | * 切换任务 |
3182 | 3439 | * 1. 判断满足切换任务的条件 |
... | ... | @@ -4587,7 +4844,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
4587 | 4844 | } |
4588 | 4845 | String receiptType = QuantityConstant.SHIPMENT_BILL_TYPE_QTC; |
4589 | 4846 | String remark = "快速出库"; |
4590 | - String zoneCode = "L"; | |
4847 | + String zoneCode = "A"; | |
4848 | + for (ReceiptEntity receiptEntity : receiptEntityList) { | |
4849 | + BigDecimal qty = receiptEntity.getQty(); | |
4850 | + String materialCode = receiptEntity.getMaterialCode(); | |
4851 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByMaterialCode(materialCode, warehouseCode); | |
4852 | + if (CollectionUtils.isNotEmpty(inventoryDetailList)) { | |
4853 | + InventoryDetail inventoryDetail = inventoryDetailList.get(0); | |
4854 | + zoneCode = inventoryDetail.getZoneCode(); | |
4855 | + } | |
4856 | + } | |
4591 | 4857 | ShipmentHeader shipmentHeader = new ShipmentHeader(); |
4592 | 4858 | shipmentHeader.setWarehouseCode(warehouseCode); |
4593 | 4859 | shipmentHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); |
... | ... |