Commit 250d9de50d50d71bfcbcc490eef528a7579f424d
Merge branch 'develop' of http://git.huahengcloud.com/wms/wms4.git into develop
Showing
17 changed files
with
395 additions
and
28 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -310,6 +310,8 @@ export const addInventoryDetail = (params) => postAction('/inventory/inventoryDe |
310 | 310 | export const reduceInventoryDetail = (params) => postAction('/inventory/inventoryDetail/reduceInventoryDetail', params); |
311 | 311 | // 根据库位编码查询库存详情 |
312 | 312 | export const getInventoryDetailByLocationCode = (params) => getAction('/inventory/inventoryDetail/list', params); |
313 | +//快速出库 | |
314 | +export const quickShipment = (params) => postAction("/task/taskHeader/quickShipment", params); | |
313 | 315 | |
314 | 316 | // 中转HTTP请求 |
315 | 317 | export const transitRESTful = { |
... | ... |
ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiSomeContainer.vue
... | ... | @@ -27,17 +27,18 @@ export default { |
27 | 27 | }, |
28 | 28 | data() { |
29 | 29 | return { |
30 | - url: {list: '/inventory/inventoryDetail/queryPageListList'}, | |
30 | + url: {list: '/inventory/inventoryDetail/querySomeInventory'}, | |
31 | 31 | columns: [ |
32 | 32 | {title: '容器编码', align: 'center', dataIndex: 'containerCode'}, |
33 | 33 | {title: '库位编码', align: 'center', width: '15%', dataIndex: 'locationCode'}, |
34 | - { | |
35 | - title: '库区', align: 'center', width: '15%', dataIndex: 'zoneCode', key: 'zoneCode', | |
36 | - scopedSlots: {customRender: 'zoneCode'} | |
37 | - }, | |
34 | + // { | |
35 | + // title: '库区', align: 'center', width: '15%', dataIndex: 'zoneCode', key: 'zoneCode', | |
36 | + // scopedSlots: {customRender: 'zoneCode'} | |
37 | + // }, | |
38 | 38 | {title: '物料编码', align: 'center', width: '15%', dataIndex: 'materialCode'}, |
39 | 39 | {title: '物料名称', align: 'center', width: '15%', dataIndex: 'materialName'}, |
40 | 40 | {title: '物料数量', align: 'center', width: '15%', dataIndex: 'qty'}, |
41 | + {title: '托盘填充度', align: 'center', width: '15%', dataIndex: 'fillDensity'}, | |
41 | 42 | ], |
42 | 43 | // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件 |
43 | 44 | default: { |
... | ... |
ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
... | ... | @@ -191,15 +191,15 @@ export default { |
191 | 191 | {required: true, message: '请选择角色!', trigger: "change" , validator: 'click'} |
192 | 192 | ], |
193 | 193 | password: [ |
194 | - {validator: this.validateToNextPassword, trigger: 'change'}], | |
194 | + {required: true, message: '请选择仓库!',validator: this.validateToNextPassword, trigger: 'change'}], | |
195 | 195 | confirmpassword: [{required: true, message: '请重新输入登录密码!',}, |
196 | 196 | {validator: this.compareToFirstPassword,}], |
197 | 197 | realname: [{required: true, message: '请输入用户名称!'}], |
198 | - phone: [{required: true, message: '请输入手机号!'}, {validator: this.validatePhone}], | |
199 | - email: [{validator: this.validateEmail}], | |
198 | + // phone: [{required: true, message: '请输入手机号!'}, {validator: this.validatePhone}], | |
199 | + // email: [{validator: this.validateEmail}], | |
200 | 200 | roles: {}, |
201 | - workNo: [{required: true, message: '请输入工号'}, | |
202 | - {validator: this.validateWorkNo}], | |
201 | + // workNo: [{required: true, message: '请输入工号'}, | |
202 | + // {validator: this.validateWorkNo}], | |
203 | 203 | telephone: [{pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码'},], |
204 | 204 | }, |
205 | 205 | departIdShow: false, |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -31,6 +31,7 @@ |
31 | 31 | </a-select> |
32 | 32 | </a-form-item> |
33 | 33 | </a-col> |
34 | + <template v-if="toggleSearchStatus"> | |
34 | 35 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
35 | 36 | <a-form-item label="入库单类型"> |
36 | 37 | <a-select |
... | ... | @@ -74,7 +75,6 @@ |
74 | 75 | </a-select> |
75 | 76 | </a-form-item> |
76 | 77 | </a-col> |
77 | - <template v-show="toggleSearchStatus"> | |
78 | 78 | <a-col :xl="12" :lg="14" :md="16" :sm="24"> |
79 | 79 | <a-form-item label="创建日期"> |
80 | 80 | <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择开始时间" |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -37,6 +37,7 @@ |
37 | 37 | </a-select> |
38 | 38 | </a-form-item> |
39 | 39 | </a-col> |
40 | + <template v-if="toggleSearchStatus"> | |
40 | 41 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
41 | 42 | <a-form-item label="出库单类型"> |
42 | 43 | <a-select |
... | ... | @@ -80,7 +81,6 @@ |
80 | 81 | </a-select> |
81 | 82 | </a-form-item> |
82 | 83 | </a-col> |
83 | - <template v-if="toggleSearchStatus"> | |
84 | 84 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
85 | 85 | <a-form-item label="出库单备注"> |
86 | 86 | <a-input placeholder="请输入出库单备注" v-model="queryParam.remark"></a-input> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | </a-form-item> |
47 | 47 | </a-col> |
48 | 48 | <template v-if="toggleSearchStatus"> |
49 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
49 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
50 | 50 | <a-form-item label="起始出入口"> |
51 | 51 | <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPortCode"></a-input> |
52 | 52 | </a-form-item> |
... | ... | @@ -92,6 +92,7 @@ |
92 | 92 | <a-button @click="batchCreateEmptyOut()" v-has="'taskHeader:manyEmptyOut'" type="primary">批量空托出库</a-button> |
93 | 93 | <a-button @click="createManyEmptyOut()" v-has="'taskHeader:manyEmptyOut'" type="primary">空托组出库</a-button> |
94 | 94 | <a-button v-has="'taskHeader:callShipmentBox'" @click="callShipmentBox()" type="primary" >呼叫出库托盘</a-button> |
95 | + <a-button v-has="'taskHeader:quickShipment'" @click="quickShipment()" type="primary">快速出库</a-button> | |
95 | 96 | <j-super-query :fieldList="superFieldList" v-has="'taskHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/> |
96 | 97 | <a-button v-has="'taskHeader:export'" type="primary" icon="download" @click="handleExportXls('任务表')">导出</a-button> |
97 | 98 | </div> |
... | ... | @@ -188,6 +189,7 @@ |
188 | 189 | <many-empty-out-task-modal ref="manyEmptyOutModal" @ok="modalFormOk"></many-empty-out-task-modal> |
189 | 190 | <update-priority ref="updatePriority" @ok="modalFormOk"></update-priority> |
190 | 191 | <call-shipment-box-modal ref="modalForm5" @ok="modalFormOk"></call-shipment-box-modal> |
192 | + <shipment-material-modal ref="shipmentMaterialModal" @ok="modalFormOk"></shipment-material-modal> | |
191 | 193 | |
192 | 194 | </a-card> |
193 | 195 | </template> |
... | ... | @@ -201,18 +203,20 @@ import TaskDetailList from './TaskDetailList' |
201 | 203 | import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
202 | 204 | import '@/assets/less/TableExpand.less' |
203 | 205 | import {completeTaskByWMS, cancelTask, batchCreateEmptyOut} from '@/api/api' |
204 | -import {execute} from '@/api/api' | |
206 | +import {execute, quickShipment} from '@/api/api' | |
205 | 207 | import {getZoneList, handleEmptyOut, handlePickupError, handleDoubleIn, switchTask} from '@/api/api' |
206 | 208 | import EmptyOutTaskModal from './modules/EmptyOutTaskModal' |
207 | 209 | import BatchEmptyOutTaskModal from './modules/BatchEmptyOutTaskModal' |
208 | 210 | import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal"; |
209 | 211 | import CallShipmentBoxModal from "@views/system/task/modules/CallShipmentBoxModal"; |
210 | 212 | import UpdatePriority from "@views/system/task/modules/UpdatePriority.vue"; |
213 | +import ShipmentMaterialModal from "@views/system/task/modules/ShipmentMaterialModal.vue"; | |
211 | 214 | |
212 | 215 | export default { |
213 | 216 | name: "ShipmentTaskHeaderList", |
214 | 217 | mixins: [JeecgListMixin], |
215 | 218 | components: { |
219 | + ShipmentMaterialModal, | |
216 | 220 | CallShipmentBoxModal, |
217 | 221 | ManyEmptyOutTaskModal, |
218 | 222 | EmptyOutTaskModal, |
... | ... | @@ -469,6 +473,10 @@ export default { |
469 | 473 | this.$refs.modalForm5.edit(); |
470 | 474 | this.$refs.modalForm5.title = "呼叫出库托盘"; |
471 | 475 | }, |
476 | + quickShipment(){ | |
477 | + this.$refs.shipmentMaterialModal.edit(); | |
478 | + this.$refs.shipmentMaterialModal.title = "快速出库"; | |
479 | + }, | |
472 | 480 | loadFrom() { |
473 | 481 | getZoneList().then((res) => { |
474 | 482 | if (res.success) { |
... | ... |
ant-design-vue-jeecg/src/views/system/task/modules/CallShipmentBoxModal.vue
ant-design-vue-jeecg/src/views/system/task/modules/ShipmentMaterialModal.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="8">--> | |
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="10">--> | |
21 | +<!-- <a-form-model-item label="入库口">--> | |
22 | +<!--<!– <a-input placeholder="请输入入库口" v-model="quickMainModel.toPort"/>–>--> | |
23 | +<!-- <j-search-select-tag--> | |
24 | +<!-- placeholder="请选择入库口"--> | |
25 | +<!-- v-model="quickMainModel.toPort"--> | |
26 | +<!-- dict="port,name,code,type!='2'"--> | |
27 | +<!-- :pageSize="5"--> | |
28 | +<!-- :async="true">--> | |
29 | +<!-- </j-search-select-tag>--> | |
30 | +<!-- </a-form-model-item>--> | |
31 | +<!-- </a-col>--> | |
32 | +<!-- </a-row>--> | |
33 | + <!-- 子表单区域 --> | |
34 | + <a-tabs defaultActiveKey="1"> | |
35 | + <a-tab-pane tab="物料信息" key="1"> | |
36 | + <div> | |
37 | + <a-row type="flex" style="margin-bottom:10px" :gutter="24"> | |
38 | + <a-col :span="12">物料编码</a-col> | |
39 | + <a-col :span="8">数量</a-col> | |
40 | + <a-col :span="4">操作</a-col> | |
41 | + </a-row> | |
42 | + <a-row type="flex" style="margin-bottom:-20px" :gutter="24" v-for="(item, index) in quickMainModel.receiptEntityList" :key="index"> | |
43 | + <a-col style="display: none"> | |
44 | + <a-form-model-item> | |
45 | + <a-input placeholder="id" v-model="item.id"/> | |
46 | + </a-form-model-item> | |
47 | + </a-col> | |
48 | + <a-col :span="12"> | |
49 | + <a-form-model-item> | |
50 | + <j-search-select-tag | |
51 | + placeholder="请选择" | |
52 | + v-model="item.materialCode" | |
53 | + :dict="'material,name,code'" | |
54 | + :pageSize="5" | |
55 | + :async="true"> | |
56 | + </j-search-select-tag> | |
57 | + </a-form-model-item> | |
58 | + </a-col> | |
59 | + <a-col :span="8"> | |
60 | + <a-form-model-item> | |
61 | + <a-input placeholder="数量" v-model="item.qty"/> | |
62 | + </a-form-model-item> | |
63 | + </a-col> | |
64 | + <a-col :span="4"> | |
65 | + <a-form-model-item> | |
66 | + <a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/> | |
67 | + </a-form-model-item> | |
68 | + </a-col> | |
69 | + </a-row> | |
70 | + <a-button type="dashed" style="width: 100%;margin-top: 10px" @click="addRowCustom"><a-icon type="plus"/>添加物料信息</a-button> | |
71 | + </div> | |
72 | + </a-tab-pane> | |
73 | + </a-tabs> | |
74 | + </a-form-model> | |
75 | + </a-spin> | |
76 | + </a-modal> | |
77 | +</template> | |
78 | + | |
79 | +<script> | |
80 | + | |
81 | +import JEditableTable from '@/components/jeecg/JEditableTable' | |
82 | +import {execute, quickReceipt, quickShipment} from '@/api/api' | |
83 | +import JDate from '@/components/jeecg/JDate' | |
84 | +import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer"; | |
85 | + | |
86 | +export default { | |
87 | + name: 'ShipmentMaterialModal', | |
88 | + components: { | |
89 | + JDate, JEditableTable,JSelectMultiCanUseContainer | |
90 | + }, | |
91 | + data() { | |
92 | + return { | |
93 | + title: '快速出库', | |
94 | + visible: false, | |
95 | + confirmLoading: false, | |
96 | + model: {}, | |
97 | + labelCol: { | |
98 | + xs: {span: 24}, | |
99 | + sm: {span: 4} | |
100 | + }, | |
101 | + wrapperCol: { | |
102 | + xs: {span: 24}, | |
103 | + sm: {span: 24} | |
104 | + }, | |
105 | + activeKey: '1', | |
106 | + quickMainModel: { | |
107 | + receiptEntityList: [{}], | |
108 | + }, | |
109 | + // 客户信息 | |
110 | + url: { | |
111 | + add: '/test/jeecgOrderMain/add', | |
112 | + edit: '/test/jeecgOrderMain/edit', | |
113 | + } | |
114 | + } | |
115 | + }, | |
116 | + created() { | |
117 | + }, | |
118 | + methods: { | |
119 | + handleOk() { | |
120 | + this.validateFields() | |
121 | + }, | |
122 | + handleCancel() { | |
123 | + this.visible = false | |
124 | + }, | |
125 | + | |
126 | + addRowCustom() { | |
127 | + this.quickMainModel.receiptEntityList.push({}); | |
128 | + this.$forceUpdate(); | |
129 | + }, | |
130 | + delRowCustom(index) { | |
131 | + console.log(index) | |
132 | + this.quickMainModel.receiptEntityList.splice(index, 1); | |
133 | + this.$forceUpdate(); | |
134 | + }, | |
135 | + addRowTicket() { | |
136 | + this.quickMainModel.jeecgOrderTicketList.push({}); | |
137 | + console.log(this.quickMainModel.jeecgOrderTicketList) | |
138 | + this.$forceUpdate(); | |
139 | + }, | |
140 | + delRowTicket(index) { | |
141 | + console.log(index) | |
142 | + this.quickMainModel.jeecgOrderTicketList.splice(index, 1); | |
143 | + this.$forceUpdate(); | |
144 | + }, | |
145 | + | |
146 | + edit(record) { | |
147 | + this.visible = true | |
148 | + this.activeKey = '1' | |
149 | + this.quickMainModel = Object.assign({ | |
150 | + receiptEntityList: [{}] | |
151 | + }, record); | |
152 | + }, | |
153 | + /** 触发表单验证 */ | |
154 | + validateFields() { | |
155 | + // 触发表单验证 | |
156 | + this.$refs.form.validate(valid => { | |
157 | + //alert(JSON.stringify(this.quickMainModel)); | |
158 | + this.quickShipment(this.quickMainModel); | |
159 | + }) | |
160 | + }, | |
161 | + | |
162 | + quickShipment(record) { | |
163 | + this.confirmLoading = true | |
164 | + this.model = Object.assign({}, record); | |
165 | + quickShipment(this.model).then((res) => { | |
166 | + this.loading = false; | |
167 | + if (res.success) { | |
168 | + this.$message.success(res.message); | |
169 | + this.$emit('ok'); | |
170 | + this.visible = false | |
171 | + } else { | |
172 | + this.$message.error(res.message); | |
173 | + } | |
174 | + this.confirmLoading = false | |
175 | + }); | |
176 | + }, | |
177 | + } | |
178 | +} | |
179 | +</script> | |
0 | 180 | \ No newline at end of file |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.api.wcs.service; |
2 | 2 | |
3 | +import java.math.BigDecimal; | |
3 | 4 | import java.net.SocketException; |
4 | 5 | import java.util.ArrayList; |
5 | 6 | import java.util.Date; |
... | ... | @@ -39,6 +40,8 @@ import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContai |
39 | 40 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
40 | 41 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService; |
41 | 42 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; |
43 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice; | |
44 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; | |
42 | 45 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
43 | 46 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
44 | 47 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; |
... | ... | @@ -109,14 +112,14 @@ public class WcsServiceImpl implements WcsService { |
109 | 112 | |
110 | 113 | @Resource |
111 | 114 | private IContainerTypeService containerTypeService; |
112 | - | |
113 | 115 | @Resource |
114 | 116 | private ILockStationService lockStationService; |
115 | - | |
116 | 117 | @Resource |
117 | 118 | private IInventoryDetailService inventoryDetailService; |
118 | 119 | @Resource |
119 | 120 | private IWarehouseService warehouseService; |
121 | + @Resource | |
122 | + private IShipmentContainerAdviceService shipmentContainerAdviceService; | |
120 | 123 | |
121 | 124 | /** |
122 | 125 | * 库位分配 |
... | ... | @@ -355,6 +358,11 @@ public class WcsServiceImpl implements WcsService { |
355 | 358 | return Result.OK(resultList); |
356 | 359 | } |
357 | 360 | |
361 | + /** | |
362 | + * 返回Flag 0:不允许返回 1:可以回库 2:去叠盘 | |
363 | + * @param taskNo | |
364 | + * @return | |
365 | + */ | |
358 | 366 | @Override |
359 | 367 | @Transactional(rollbackFor = Exception.class) |
360 | 368 | public Result back(String taskNo) { |
... | ... | @@ -362,23 +370,37 @@ public class WcsServiceImpl implements WcsService { |
362 | 370 | if (taskHeader == null) { |
363 | 371 | return Result.error("没有找到任务,不允许回库, 任务号:" + taskNo); |
364 | 372 | } |
365 | - // 返回1 表示回库 | |
366 | - // 返回2 表示去叠盘 | |
367 | 373 | int flag = 1; |
368 | 374 | int taskType = taskHeader.getTaskType(); |
369 | 375 | if (taskType != QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { |
370 | 376 | return Result.error("任务号" + taskNo + "不是分拣任务"); |
371 | 377 | } |
372 | 378 | String containerCode = taskHeader.getContainerCode(); |
379 | + String warehouseCode = taskHeader.getWarehouseCode(); | |
373 | 380 | if (StringUtils.isEmpty(containerCode)) { |
374 | 381 | return Result.error("任务号" + taskNo + "没有托盘号"); |
375 | 382 | } |
376 | - List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, taskHeader.getWarehouseCode()); | |
383 | + if (StringUtils.isEmpty(warehouseCode)) { | |
384 | + return Result.error("任务号" + taskNo + "没有仓库编码"); | |
385 | + } | |
386 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); | |
377 | 387 | if (CollectionUtils.isEmpty(inventoryDetailList)) { |
378 | 388 | flag = 2; // 返回2 表示叠盘 |
379 | 389 | return Result.OK("任务ID:" + taskHeader.getId() + " 允许去叠盘", flag); |
380 | 390 | } |
381 | 391 | flag = 1; // 返回1 表示回库 |
392 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = | |
393 | + shipmentContainerAdviceService.getShipmentContainerAdviceListByContainerCode(containerCode, warehouseCode); | |
394 | + if (CollectionUtils.isNotEmpty(shipmentContainerAdviceList)) { | |
395 | + for (ShipmentContainerAdvice shipmentContainerAdvice : shipmentContainerAdviceList) { | |
396 | + BigDecimal qty = shipmentContainerAdvice.getQty(); | |
397 | + BigDecimal taskQty = shipmentContainerAdvice.getTaskQty(); | |
398 | + if (taskQty.compareTo(qty) < 0) { | |
399 | + flag = 0; // 返回0 表示不允许回库 | |
400 | + return Result.OK("任务ID:" + taskHeader.getId() + " 不允许回库", flag); | |
401 | + } | |
402 | + } | |
403 | + } | |
382 | 404 | return Result.OK("任务ID:" + taskHeader.getId() + " 允许回库", flag); |
383 | 405 | } |
384 | 406 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/zone/service/IZoneService.java
... | ... | @@ -14,7 +14,9 @@ import com.baomidou.mybatisplus.extension.service.IService; |
14 | 14 | */ |
15 | 15 | public interface IZoneService extends IService<Zone> { |
16 | 16 | |
17 | - Zone getZoneByCode(String zoneCode, String wareohuseCode); | |
17 | + Zone getZoneByCode(String zoneCode, String warehouseCode); | |
18 | + | |
19 | + List<Zone> getZoneListByType(String zoneType, String warehouseCode); | |
18 | 20 | |
19 | 21 | List<Zone> getAllZoneList(String wareohuseCode); |
20 | 22 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/zone/service/impl/ZoneServiceImpl.java
... | ... | @@ -21,14 +21,22 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
21 | 21 | public class ZoneServiceImpl extends ServiceImpl<ZoneMapper, Zone> implements IZoneService { |
22 | 22 | |
23 | 23 | @Override |
24 | - public Zone getZoneByCode(String zoneCode, String wareohuseCode) { | |
24 | + public Zone getZoneByCode(String zoneCode, String warehouseCode) { | |
25 | 25 | LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery(); |
26 | - zoneLambdaQueryWrapper.eq(Zone::getCode, zoneCode).eq(Zone::getWarehouseCode, wareohuseCode); | |
26 | + zoneLambdaQueryWrapper.eq(Zone::getCode, zoneCode).eq(Zone::getWarehouseCode, warehouseCode); | |
27 | 27 | Zone zone = getOne(zoneLambdaQueryWrapper); |
28 | 28 | return zone; |
29 | 29 | } |
30 | 30 | |
31 | 31 | @Override |
32 | + public List<Zone> getZoneListByType(String zoneType, String warehouseCode) { | |
33 | + LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
34 | + zoneLambdaQueryWrapper.eq(Zone::getType, zoneType).eq(Zone::getWarehouseCode, warehouseCode); | |
35 | + List<Zone> zoneList = list(zoneLambdaQueryWrapper); | |
36 | + return zoneList; | |
37 | + } | |
38 | + | |
39 | + @Override | |
32 | 40 | public List<Zone> getAllZoneList(String wareohuseCode) { |
33 | 41 | LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery(); |
34 | 42 | zoneLambdaQueryWrapper.eq(Zone::getWarehouseCode, wareohuseCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryDetail/controller/InventoryDetailController.java
... | ... | @@ -4,7 +4,9 @@ import java.math.BigDecimal; |
4 | 4 | import java.util.Arrays; |
5 | 5 | import java.util.Date; |
6 | 6 | import java.util.List; |
7 | +import java.util.stream.Collectors; | |
7 | 8 | |
9 | +import javax.annotation.Resource; | |
8 | 10 | import javax.servlet.http.HttpServletRequest; |
9 | 11 | import javax.servlet.http.HttpServletResponse; |
10 | 12 | |
... | ... | @@ -12,6 +14,8 @@ import org.jeecg.common.api.vo.Result; |
12 | 14 | import org.jeecg.common.aspect.annotation.AutoLog; |
13 | 15 | import org.jeecg.common.system.base.controller.JeecgController; |
14 | 16 | import org.jeecg.common.system.query.QueryGenerator; |
17 | +import org.jeecg.modules.wms.config.zone.entity.Zone; | |
18 | +import org.jeecg.modules.wms.config.zone.service.IZoneService; | |
15 | 19 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
16 | 20 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
17 | 21 | import org.jeecg.utils.HuahengJwtUtil; |
... | ... | @@ -44,6 +48,9 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, |
44 | 48 | @Autowired |
45 | 49 | private IInventoryDetailService inventoryDetailService; |
46 | 50 | |
51 | + @Resource | |
52 | + private IZoneService zoneService; | |
53 | + | |
47 | 54 | /** |
48 | 55 | * 分页列表查询 |
49 | 56 | * @param inventoryDetail |
... | ... | @@ -99,6 +106,41 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, |
99 | 106 | return Result.OK(pageList); |
100 | 107 | } |
101 | 108 | |
109 | + /** | |
110 | + * 分页列表查询 | |
111 | + * @param inventoryDetail | |
112 | + * @param pageNo | |
113 | + * @param pageSize | |
114 | + * @param req | |
115 | + * @return | |
116 | + */ | |
117 | + @AutoLog(value = "库存详情-查询有货托盘") | |
118 | + @ApiOperation(value = "库存详情-查询有货托盘", notes = "库存详情-查询有货托盘") | |
119 | + @GetMapping(value = "/querySomeInventory") | |
120 | + public Result<IPage<InventoryDetail>> querySomeInventory(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
121 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
122 | + Date inventoryAge = null; | |
123 | + if (inventoryDetail.getInventoryAge() != null) { | |
124 | + inventoryAge = DateUtil.offsetDay(new Date(), 0 - inventoryDetail.getInventoryAge()); | |
125 | + inventoryDetail.setInventoryAge(null); | |
126 | + } | |
127 | + String zoneType = "L"; | |
128 | + List<Zone> zoneList = zoneService.getZoneListByType(zoneType, HuahengJwtUtil.getWarehouseCodeByToken(req)); | |
129 | + if (StringUtils.isNull(zoneList)) { | |
130 | + return Result.error("没有找到立库区库存"); | |
131 | + } | |
132 | + List<String> zoneCodeList = zoneList.stream().map(Zone::getCode).collect(Collectors.toList()); | |
133 | + HuahengJwtUtil.setWarehouseCode(req, inventoryDetail); | |
134 | + QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | |
135 | + queryWrapper.lt(inventoryAge != null, "create_time", inventoryAge); | |
136 | + queryWrapper.lambda().in(InventoryDetail::getZoneCode, zoneCodeList); | |
137 | + queryWrapper.lambda().groupBy(InventoryDetail::getContainerCode); | |
138 | + Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | |
139 | + IPage<InventoryDetail> pageList = inventoryDetailService.queryPage(page, queryWrapper); | |
140 | + inventoryDetailService.calculateInventoryAge(pageList.getRecords());// 计算库龄 | |
141 | + return Result.OK(pageList); | |
142 | + } | |
143 | + | |
102 | 144 | @ApiOperation(value = "库存详情-分页列表查询", notes = "库存详情-分页列表查询") |
103 | 145 | @GetMapping(value = "/selectContainerlist") |
104 | 146 | public Result<IPage<InventoryDetail>> selectContainerlist(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/IShipmentContainerAdviceService.java
... | ... | @@ -30,6 +30,8 @@ public interface IShipmentContainerAdviceService extends IService<ShipmentContai |
30 | 30 | |
31 | 31 | List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentCode(String shipmentCode, String warehouseCode); |
32 | 32 | |
33 | + List<ShipmentContainerAdvice> getShipmentContainerAdviceListByContainerCode(String containerCode, String warehouseCode); | |
34 | + | |
33 | 35 | List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentContainerId(int shipmentContainerId); |
34 | 36 | |
35 | 37 | Result reduceInventoryDetailBySn(String snList, String warehouseCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/impl/ShipmentContainerAdviceServiceImpl.java
... | ... | @@ -152,6 +152,15 @@ public class ShipmentContainerAdviceServiceImpl extends ServiceImpl<ShipmentCont |
152 | 152 | } |
153 | 153 | |
154 | 154 | @Override |
155 | + public List<ShipmentContainerAdvice> getShipmentContainerAdviceListByContainerCode(String containerCode, String warehouseCode) { | |
156 | + LambdaQueryWrapper<ShipmentContainerAdvice> shipmentContainerAdviceLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
157 | + shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getContainerCode, containerCode) | |
158 | + .eq(ShipmentContainerAdvice::getWarehouseCode, warehouseCode).lt(ShipmentContainerAdvice::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
159 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = list(shipmentContainerAdviceLambdaQueryWrapper); | |
160 | + return shipmentContainerAdviceList; | |
161 | + } | |
162 | + | |
163 | + @Override | |
155 | 164 | public List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentContainerId(int shipmentContainerId) { |
156 | 165 | LambdaQueryWrapper<ShipmentContainerAdvice> shipmentContainerAdviceLambdaQueryWrapper = Wrappers.lambdaQuery(); |
157 | 166 | shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getShipmentContainerId, shipmentContainerId).lt(ShipmentContainerAdvice::getStatus, |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -850,6 +850,27 @@ public class TaskHeaderController extends HuahengBaseController { |
850 | 850 | } |
851 | 851 | |
852 | 852 | /** |
853 | + * 快速出库 | |
854 | + * @return | |
855 | + */ | |
856 | + @AutoLog(value = "快速出库") | |
857 | + @PostMapping("quickShipment") | |
858 | + @ApiOperation("快速出库") | |
859 | + @ResponseBody | |
860 | + public Result quickShipment(@RequestBody QucikReceiptEntity qucikReceiptEntity, HttpServletRequest req) { | |
861 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
862 | + qucikReceiptEntity.setWarehouseCode(warehouseCode); | |
863 | + Result result = handleMultiProcess("quickShipment", new MultiProcessListener() { | |
864 | + @Override | |
865 | + public Result<?> doProcess() { | |
866 | + Result result = taskHeaderService.quickShipment(qucikReceiptEntity); | |
867 | + return result; | |
868 | + } | |
869 | + }); | |
870 | + return result; | |
871 | + } | |
872 | + | |
873 | + /** | |
853 | 874 | * 质检登记 |
854 | 875 | * @return |
855 | 876 | */ |
... | ... | @@ -880,7 +901,7 @@ public class TaskHeaderController extends HuahengBaseController { |
880 | 901 | @PostMapping("updatePriority") |
881 | 902 | @ApiOperation("修改优先级") |
882 | 903 | @ResponseBody |
883 | - public Result updatePriority(@RequestBody @RequestParam(name = "id") String id, @RequestParam(name = "priority") String priority, HttpServletRequest req) { | |
904 | + public Result updatePriority(@RequestBody @RequestParam(name = "id") String id, @RequestParam(name = "priority") String priority, HttpServletRequest req) { | |
884 | 905 | Result result = handleMultiProcess("updatePriority", new MultiProcessListener() { |
885 | 906 | @Override |
886 | 907 | public Result<?> doProcess() { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... | ... | @@ -9,7 +9,6 @@ import org.jeecg.common.api.vo.Result; |
9 | 9 | 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 | -import org.jeecg.modules.wms.report.dto.ReportPerformanceAssessmentDto; | |
13 | 12 | import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity; |
14 | 13 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
15 | 14 | |
... | ... | @@ -453,7 +452,13 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
453 | 452 | */ |
454 | 453 | List<String> findCommonData(List<String> dataList1, List<String> dataList2, boolean flag); |
455 | 454 | |
456 | - boolean delMain (Integer id); | |
455 | + boolean delMain(Integer id); | |
457 | 456 | |
458 | 457 | Result updatePriority(String id, String priority); |
458 | + | |
459 | + /** | |
460 | + * add | |
461 | + * @return | |
462 | + */ | |
463 | + Result quickShipment(QucikReceiptEntity qucikReceiptEntity); | |
459 | 464 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -355,7 +355,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
355 | 355 | } |
356 | 356 | log.info("完成创建移库任务,起始库位" + fromLocationCode + ",目的库位" + toLocationCode); |
357 | 357 | return Result.OK("创建移库任务成功", taskHeader); |
358 | - | |
359 | 358 | } |
360 | 359 | |
361 | 360 | @Override |
... | ... | @@ -3575,4 +3574,71 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
3575 | 3574 | } |
3576 | 3575 | return Result.ok("修改优先级成功"); |
3577 | 3576 | } |
3577 | + | |
3578 | + @Override | |
3579 | + @Transactional(rollbackFor = Exception.class) | |
3580 | + public Result quickShipment(QucikReceiptEntity qucikReceiptEntity) { | |
3581 | + boolean success = false; | |
3582 | + List<ReceiptEntity> receiptEntityList = qucikReceiptEntity.getReceiptEntityList(); | |
3583 | + String warehouseCode = qucikReceiptEntity.getWarehouseCode(); | |
3584 | + if (StringUtils.isEmpty(warehouseCode)) { | |
3585 | + return Result.error("快速出库,仓库编码为空"); | |
3586 | + } | |
3587 | + if (StringUtils.isEmpty(receiptEntityList)) { | |
3588 | + return Result.error("快速出库,出库信息为空"); | |
3589 | + } | |
3590 | + String receiptType = QuantityConstant.SHIPMENT_BILL_TYPE_QTC; | |
3591 | + String remark = "快速出库"; | |
3592 | + String zoneCode = "L"; | |
3593 | + ShipmentHeader shipmentHeader = new ShipmentHeader(); | |
3594 | + shipmentHeader.setWarehouseCode(warehouseCode); | |
3595 | + shipmentHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); | |
3596 | + shipmentHeader.setType(receiptType); | |
3597 | + shipmentHeader.setRemark(remark); | |
3598 | + shipmentHeader.setZoneCode(zoneCode); | |
3599 | + Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader); | |
3600 | + if (!result.isSuccess()) { | |
3601 | + throw new JeecgBootException("快速出库, 创建出库单头失败" + result.getMessage()); | |
3602 | + } | |
3603 | + for (ReceiptEntity receiptEntity : receiptEntityList) { | |
3604 | + BigDecimal qty = receiptEntity.getQty(); | |
3605 | + String materialCode = receiptEntity.getMaterialCode(); | |
3606 | + if (StringUtils.isEmpty(materialCode)) { | |
3607 | + throw new JeecgBootException("快速出库, 物料编码为空"); | |
3608 | + } | |
3609 | + if (qty.compareTo(BigDecimal.ZERO) <= 0) { | |
3610 | + throw new JeecgBootException("快速出库, 单据数量必须大于0"); | |
3611 | + } | |
3612 | + ShipmentDetail shipmentDetail = new ShipmentDetail(); | |
3613 | + shipmentDetail.setWarehouseCode(warehouseCode); | |
3614 | + shipmentDetail.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); | |
3615 | + shipmentDetail.setShipmentCode(shipmentHeader.getCode()); | |
3616 | + shipmentDetail.setShipmentId(shipmentHeader.getId()); | |
3617 | + shipmentDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
3618 | + shipmentDetail.setZoneCode(zoneCode); | |
3619 | + shipmentDetail.setQty(qty); | |
3620 | + Material material = materialService.getMaterialByCode(materialCode); | |
3621 | + if (material == null) { | |
3622 | + throw new JeecgBootException("快速出库, 获取物料:" + materialCode + " 信息失败"); | |
3623 | + } | |
3624 | + shipmentDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD); | |
3625 | + shipmentDetail.setMaterialCode(materialCode); | |
3626 | + shipmentDetail.setMaterialName(material.getName()); | |
3627 | + shipmentDetail.setMaterialSpec(material.getSpec()); | |
3628 | + shipmentDetail.setMaterialUnit(material.getUnit()); | |
3629 | + success = shipmentDetailService.save(shipmentDetail); | |
3630 | + if (!success) { | |
3631 | + throw new JeecgBootException("快速出库, 保存出库单详情失败"); | |
3632 | + } | |
3633 | + | |
3634 | + } | |
3635 | + if (!shipmentHeaderService.updateShipmentHeader(shipmentHeader.getId())) { | |
3636 | + throw new JeecgBootException("快速出库, 更新出库单失败"); | |
3637 | + } | |
3638 | + result = shipmentHeaderService.autoShipment(shipmentHeader.getCode(), warehouseCode); | |
3639 | + if (!result.isSuccess()) { | |
3640 | + throw new JeecgBootException("快速出库, 更新出库表单头失败"); | |
3641 | + } | |
3642 | + return Result.OK("快速出库成功"); | |
3643 | + } | |
3578 | 3644 | } |
... | ... |