Commit 77473808cdab56d67434a56e759d60a95b765b94
1 parent
f0071b48
分拣任务 分配库位可以只有两个空闲库位
Showing
12 changed files
with
94 additions
and
30 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -147,6 +147,8 @@ export const switchTask = (params) => postAction('/task/taskHeader/switchTask?id |
147 | 147 | export const autoCombination = (params) => postAction('/shipment/shipmentCombination/autoCombination', params); |
148 | 148 | //自动出库 |
149 | 149 | export const autoShipment = (params) => postAction('/shipment/shipmentHeader/autoShipment', params); |
150 | +//自动预配盘出库 | |
151 | +export const autoShipmentAdvice = (params) => postAction('/shipment/shipmentHeader/autoShipmentAdvice', params); | |
150 | 152 | //创建出库任务 |
151 | 153 | export const createShipmentTask = (params) => postAction('/shipment/shipmentCombination/createShipmentTask', params); |
152 | 154 | //批量创建出库任务 |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/modules/SelectInvContainerHeader.vue
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | |
29 | 29 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
30 | 30 | <a-form-item label="物料编码"> |
31 | - <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode" disabled=""></a-input> | |
31 | + <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode" ></a-input> | |
32 | 32 | </a-form-item> |
33 | 33 | </a-col> |
34 | 34 | |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -220,7 +220,9 @@ |
220 | 220 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus <= 200)) |
221 | 221 | || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button><a-divider type="vertical"/></a> |
222 | 222 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus <= 200)) |
223 | - || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipment(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">自动出库</a-button></a> | |
223 | + || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipment(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">自动出库</a-button><a-divider type="vertical"/></a> | |
224 | + <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus <= 200)) | |
225 | + || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentAdvice(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">预配盘出库</a-button><a-divider type="vertical"/></a> | |
224 | 226 | <a-dropdown v-if="(record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1') || (record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null)"> |
225 | 227 | <a class="ant-dropdown-link"><a-divider type="vertical"/>更多 <a-icon type="down"/></a> |
226 | 228 | <a-menu slot="overlay"> |
... | ... | @@ -266,7 +268,7 @@ import {getCompanyList, backErpShipment, getZoneList} from '@/api/api' |
266 | 268 | import {getShipmentTypeList} from '@/api/api' |
267 | 269 | import {getCustomerList} from '@/api/api' |
268 | 270 | import {autoCombination} from '@/api/api' |
269 | -import {createShipmentAuditFlow, getDocumentAduitFlow, mergeShipment, autoShipment} from '@/api/api' | |
271 | +import {createShipmentAuditFlow, getDocumentAduitFlow, mergeShipment, autoShipment, autoShipmentAdvice} from '@/api/api' | |
270 | 272 | import store from '@/store' |
271 | 273 | import ShipmentAuditModal from "./modules/ShipmentAuditModal"; |
272 | 274 | import FlowProcess from "../flow/FlowProcess"; |
... | ... | @@ -453,6 +455,7 @@ export default { |
453 | 455 | } |
454 | 456 | }, |
455 | 457 | methods: { |
458 | + autoShipmentAdvice, | |
456 | 459 | mergeShipment() { |
457 | 460 | if (this.selectedRowKeys.length <= 1) { |
458 | 461 | this.$message.warning('至少选择两条记录!') |
... | ... | @@ -659,6 +662,18 @@ export default { |
659 | 662 | this.searchQuery(); |
660 | 663 | }); |
661 | 664 | }, |
665 | + autoShipmentAdvice(record) { | |
666 | + this.loading = true; | |
667 | + autoShipmentAdvice(record).then((res) => { | |
668 | + if (res.success) { | |
669 | + this.$message.success(res.message); | |
670 | + } else { | |
671 | + this.$message.warning(res.message) | |
672 | + } | |
673 | + this.loading = false; | |
674 | + this.searchQuery(); | |
675 | + }); | |
676 | + }, | |
662 | 677 | loadData(arg) { |
663 | 678 | if (!this.url.list) { |
664 | 679 | this.$message.error("请设置url.list属性!") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/impl/AcsServiceImpl.java
... | ... | @@ -251,8 +251,14 @@ public class AcsServiceImpl implements IAcsService { |
251 | 251 | int allocationRule = Integer.parseInt(value); |
252 | 252 | String materialAreaCode = null; |
253 | 253 | |
254 | - String locationCode = | |
255 | - locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, null, warehouseCode, containerCode, materialAreaCode, null); | |
254 | + boolean bypass = false; | |
255 | + if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT || taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT | |
256 | + || taskType == QuantityConstant.TASK_TYPE_CHECK_OUT || taskType == QuantityConstant.TASK_TYPE_CYCLECOUNT | |
257 | + || taskType == QuantityConstant.TASK_TYPE_QUALITY) { | |
258 | + bypass = true; | |
259 | + } | |
260 | + String locationCode = locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, null, warehouseCode, containerCode, | |
261 | + materialAreaCode, null, bypass); | |
256 | 262 | if (StringUtils.isEmpty(locationCode)) { |
257 | 263 | return Result.error("分配库位时,没有库位可分配"); |
258 | 264 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationService.java
... | ... | @@ -8,10 +8,10 @@ public interface LocationAllocationService { |
8 | 8 | * 获得库位分配的库位 |
9 | 9 | */ |
10 | 10 | String allocation(int locationRule, List<String> locationTypeCodeList, int high, String zoneCode, List<Integer> raodWays, String warehouseCode, |
11 | - String containerCode, String materialAreaCode, String materialCode); | |
11 | + String containerCode, String materialAreaCode, String materialCode, boolean bypass); | |
12 | 12 | |
13 | 13 | String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
14 | - String materialCode); | |
14 | + String materialCode, boolean bypass); | |
15 | 15 | |
16 | 16 | String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
17 | 17 | String materialCode); |
... | ... | @@ -34,7 +34,7 @@ public interface LocationAllocationService { |
34 | 34 | * 排除巷道,如果这个巷道分配了超过2个库位,那么就不往这边分库位了,避免堵死的情况 |
35 | 35 | * @param roadWays |
36 | 36 | * @param warehouseCode |
37 | - * @param warehouseCode2 | |
37 | + * @param warehouseCode2 | |
38 | 38 | * @return |
39 | 39 | */ |
40 | 40 | List<Integer> removeRoadWaysByPreLocations(List<Integer> roadWays, String zoneCode, String warehouseCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java
... | ... | @@ -65,7 +65,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
65 | 65 | @Override |
66 | 66 | @Transactional(rollbackFor = Exception.class) |
67 | 67 | public String allocation(int locationRule, List<String> locationTypeCodeList, int high, String zoneCode, List<Integer> raodWays, String warehouseCode, |
68 | - String containerCode, String materialAreaCode, String materialCode) { | |
68 | + String containerCode, String materialAreaCode, String materialCode, boolean bypass) { | |
69 | 69 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
70 | 70 | if (container == null) { |
71 | 71 | throw new JeecgBootException("分配库位时,容器为空"); |
... | ... | @@ -88,7 +88,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
88 | 88 | List<String> mergelocationTypeCodeList = locationTypeCodeList.stream().filter(item -> locationTypeCodes.contains(item)).collect(toList()); |
89 | 89 | switch (locationRule) { |
90 | 90 | case QuantityConstant.DOUBLE_FORK: |
91 | - return locationAllocationService.doubleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode, materialCode); | |
91 | + return locationAllocationService.doubleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode, materialCode, | |
92 | + bypass); | |
92 | 93 | case QuantityConstant.SINGLE_FORK: |
93 | 94 | return locationAllocationService.singleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode, materialCode); |
94 | 95 | } |
... | ... | @@ -101,7 +102,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
101 | 102 | @Override |
102 | 103 | @Transactional(rollbackFor = Exception.class) |
103 | 104 | public String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
104 | - String materialCode) { | |
105 | + String materialCode, boolean bypass) { | |
105 | 106 | if (roadWays == null || roadWays.size() < 1) { |
106 | 107 | roadWays = locationService.getRoadWayByZoneCode(zoneCode, warehouseCode); |
107 | 108 | } |
... | ... | @@ -110,6 +111,12 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
110 | 111 | if (StringUtils.isNotEmpty(value)) { |
111 | 112 | reserveNumber = Integer.parseInt(value); |
112 | 113 | } |
114 | + /** | |
115 | + * 分拣类型任务,重入的任务,可以烧要求空闲库位 | |
116 | + */ | |
117 | + if (bypass) { | |
118 | + reserveNumber = 2; | |
119 | + } | |
113 | 120 | value = parameterConfigurationService.getValueByCode(QuantityConstant.DOUBLE_FORK_SEARCH_LOCATION); |
114 | 121 | int searchNumber = 20; |
115 | 122 | if (StringUtils.isNotEmpty(value)) { |
... | ... | @@ -191,7 +198,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
191 | 198 | public String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
192 | 199 | String materialCode) { |
193 | 200 | if (roadWays == null || roadWays.size() < 1) { |
194 | - roadWays = locationService.getRoadWayByZoneCode(zoneCode,warehouseCode); | |
201 | + roadWays = locationService.getRoadWayByZoneCode(zoneCode, warehouseCode); | |
195 | 202 | } |
196 | 203 | List<Integer> removeRoadWays = new ArrayList<>(); |
197 | 204 | // 寻找可用巷道,空闲的空库位低于设定值,那么这个巷道就不能用来分配库位 |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -201,8 +201,14 @@ public class WcsServiceImpl implements WcsService { |
201 | 201 | } |
202 | 202 | } |
203 | 203 | } |
204 | + boolean bypass = false; | |
205 | + if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT || taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT | |
206 | + || taskType == QuantityConstant.TASK_TYPE_CHECK_OUT || taskType == QuantityConstant.TASK_TYPE_CYCLECOUNT | |
207 | + || taskType == QuantityConstant.TASK_TYPE_QUALITY) { | |
208 | + bypass = true; | |
209 | + } | |
204 | 210 | locationCode = locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, |
205 | - materialAreaCode, materialCode); | |
211 | + materialAreaCode, materialCode, bypass); | |
206 | 212 | if (StringUtils.isEmpty(locationCode)) { |
207 | 213 | return Result.error("分配库位时,没有库位可分配"); |
208 | 214 | } |
... | ... | @@ -657,9 +663,10 @@ public class WcsServiceImpl implements WcsService { |
657 | 663 | Material material = materialService.getMaterialByCode(materialCode); |
658 | 664 | materialAreaCode = material.getMaterialareaCode(); |
659 | 665 | } |
666 | + boolean bypass = true; | |
660 | 667 | // 4. WMS重新分配库位编码 |
661 | 668 | String locationCode = locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, |
662 | - materialAreaCode, null); | |
669 | + materialAreaCode, null, bypass); | |
663 | 670 | if (StringUtils.isEmpty(locationCode)) { |
664 | 671 | return Result.error("重入处理失败, 没有库位可分配"); |
665 | 672 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -598,6 +598,11 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
598 | 598 | if (inventoryDetailTaskQty.compareTo(inventoryDetailQty) > 0) { |
599 | 599 | return Result.error("配盘时, 库存详情的任务数量不能超过库存数量"); |
600 | 600 | } |
601 | + inventoryDetail.setTaskQty(inventoryDetailTaskQty); | |
602 | + success = inventoryDetailService.updateTaskQtyById(inventoryDetailTaskQty, inventoryDetail.getId()); | |
603 | + if (!success) { | |
604 | + throw new JeecgBootException("配盘时, 更新库存详情失败"); | |
605 | + } | |
601 | 606 | shipmentDetailTaskQty = shipmentDetailTaskQty.add(shipmentQty); |
602 | 607 | if (shipmentDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) { |
603 | 608 | return Result.error("配盘时, 出库详情的任务数量必须大于0"); |
... | ... | @@ -1257,9 +1262,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
1257 | 1262 | taskHeader.setContainerCode(containerCode); |
1258 | 1263 | taskHeader.setToPortCode(shipmentContainerHeader.getToPort()); |
1259 | 1264 | taskHeader.setFromLocationCode(fromLocationCode); |
1260 | - if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { | |
1261 | - taskHeader.setToLocationCode(fromLocationCode); | |
1262 | - } | |
1263 | 1265 | taskHeader.setShipmentContainerHeaderId(shipmentContainerHeader.getId()); |
1264 | 1266 | success = taskHeaderService.save(taskHeader); |
1265 | 1267 | if (!success) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/impl/ShipmentContainerAdviceServiceImpl.java
... | ... | @@ -8,6 +8,8 @@ import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.mapper.ShipmentCon |
8 | 8 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; |
9 | 9 | import org.springframework.stereotype.Service; |
10 | 10 | |
11 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
12 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
11 | 13 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
12 | 14 | |
13 | 15 | /** |
... | ... | @@ -27,7 +29,11 @@ public class ShipmentContainerAdviceServiceImpl extends ServiceImpl<ShipmentCont |
27 | 29 | |
28 | 30 | @Override |
29 | 31 | public List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentCode(String shipmentCode, String warehouseCode) { |
30 | - return null; | |
32 | + LambdaQueryWrapper<ShipmentContainerAdvice> shipmentContainerAdviceLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
33 | + shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getShipmentCode, shipmentCode).eq(ShipmentContainerAdvice::getWarehouseCode, | |
34 | + warehouseCode); | |
35 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = list(shipmentContainerAdviceLambdaQueryWrapper); | |
36 | + return shipmentContainerAdviceList; | |
31 | 37 | } |
32 | 38 | |
33 | 39 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -494,7 +494,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
494 | 494 | sequence++; |
495 | 495 | ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerId); |
496 | 496 | if (shipmentContainerHeader == null) { |
497 | - throw new JeecgBootException("自动出库, 没有找到出库表头:" + shipmentContainerId); | |
497 | + throw new JeecgBootException("自动预配盘出库, 没有找到出库表头:" + shipmentContainerId); | |
498 | 498 | } |
499 | 499 | int taskType = shipmentContainerHeader.getTaskType(); |
500 | 500 | int type = QuantityConstant.PORT_TYPE_PICK; |
... | ... | @@ -503,36 +503,36 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
503 | 503 | } |
504 | 504 | String fromLocationCode = shipmentContainerHeader.getFromLocationCode(); |
505 | 505 | if (StringUtils.isEmpty(fromLocationCode)) { |
506 | - throw new JeecgBootException("自动出库, 没有起始库位编码"); | |
506 | + throw new JeecgBootException("自动预配盘出库, 没有起始库位编码"); | |
507 | 507 | } |
508 | 508 | Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); |
509 | 509 | if (fromLocation == null) { |
510 | - throw new JeecgBootException("自动出库, 没有起始库位" + fromLocationCode); | |
510 | + throw new JeecgBootException("自动预配盘出库, 没有起始库位" + fromLocationCode); | |
511 | 511 | } |
512 | 512 | Integer roadWay = fromLocation.getRoadWay(); |
513 | 513 | List<Port> portList = portService.getPortListByType(type, roadWay, zoneCode, warehouseCode); |
514 | 514 | if (portList == null) { |
515 | - throw new JeecgBootException("自动出库, 没有合适的出库口"); | |
515 | + throw new JeecgBootException("自动预配盘出库, 没有合适的出库口"); | |
516 | 516 | } |
517 | 517 | Port port = portList.get(0); |
518 | 518 | shipmentContainerHeader.setToPort(port.getCode()); |
519 | 519 | boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); |
520 | 520 | if (!success) { |
521 | - throw new JeecgBootException("自动出库, 更新出库组盘头失败"); | |
521 | + throw new JeecgBootException("自动预配盘出库, 更新出库组盘头失败"); | |
522 | 522 | } |
523 | - result = huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber); | |
523 | + result = shipmentCombinationService.createCallShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber); | |
524 | 524 | if (!result.isSuccess()) { |
525 | - throw new JeecgBootException("自动出库, " + result.getMessage()); | |
525 | + throw new JeecgBootException("自动预配盘出库, " + result.getMessage()); | |
526 | 526 | } |
527 | 527 | String containerCode = shipmentContainerHeader.getContainerCode(); |
528 | 528 | if (StringUtils.isEmpty(containerCode)) { |
529 | - throw new JeecgBootException("自动出库, 容器号为空"); | |
529 | + throw new JeecgBootException("自动预配盘出库, 容器号为空"); | |
530 | 530 | } |
531 | 531 | TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode); |
532 | 532 | if (taskHeader == null) { |
533 | - throw new JeecgBootException("自动出库, 没有找到容器号对应任务" + containerCode); | |
533 | + throw new JeecgBootException("自动预配盘出库, 没有找到容器号对应任务" + containerCode); | |
534 | 534 | } |
535 | 535 | } |
536 | - return Result.OK("自动出库成功"); | |
536 | + return Result.OK("自动预配盘出库成功"); | |
537 | 537 | } |
538 | 538 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java
... | ... | @@ -152,6 +152,8 @@ public class TaskHeader implements Serializable { |
152 | 152 | private Integer roadWay; |
153 | 153 | @ApiModelProperty(value = "呼叫料盒") |
154 | 154 | private Integer callBox; |
155 | + @ApiModelProperty(value = "下发WCS") | |
156 | + private Integer toWcs; | |
155 | 157 | /** 备用字段1 */ |
156 | 158 | @Excel(name = "备用字段1", width = 15) |
157 | 159 | @ApiModelProperty(value = "备用字段1") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -565,8 +565,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
565 | 565 | return Result.error("创建空托盘组入库任务时,没有获取到库位高度"); |
566 | 566 | } |
567 | 567 | int high = locationHigh.getHigh(); |
568 | + boolean bypass = false; | |
568 | 569 | String toLocationCode = |
569 | - allocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, null, null); | |
570 | + allocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, null, null, bypass); | |
570 | 571 | if (StringUtils.isEmpty(toLocationCode)) { |
571 | 572 | throw new JeecgBootException("创建空托盘组入库任务时,目标库位为空"); |
572 | 573 | } |
... | ... | @@ -1381,6 +1382,22 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1381 | 1382 | if (taskDetailList.isEmpty()) { |
1382 | 1383 | int allow = parameterConfigurationService.getValueIntByCode(QuantityConstant.RULE_CALL_BOX_ALLOW_EMPTY); |
1383 | 1384 | if (allow == QuantityConstant.RULE_ALLOW_EMPTY) { |
1385 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); | |
1386 | + if (CollectionUtils.isNotEmpty(inventoryDetailList)) { | |
1387 | + for (InventoryDetail inventoryDetail : inventoryDetailList) { | |
1388 | + if (!inventoryDetailService.updateTaskQtyById(BigDecimal.ZERO, inventoryDetail.getId())) { | |
1389 | + throw new JeecgBootException("完成出库任务,更新库存明细任务数量失败"); | |
1390 | + } | |
1391 | + } | |
1392 | + } | |
1393 | + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(taskHeader.getShipmentContainerHeaderId()); | |
1394 | + if (shipmentContainerHeader != null) { | |
1395 | + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
1396 | + success = shipmentContainerHeaderService.updateStatusById(QuantityConstant.SHIPMENT_CONTAINER_FINISHED, shipmentContainerHeader.getId()); | |
1397 | + if (!success) { | |
1398 | + throw new JeecgBootException("完成出库任务,更新出库组盘头失败"); | |
1399 | + } | |
1400 | + } | |
1384 | 1401 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, |
1385 | 1402 | fromLocationCode, toLocationCode, warehouseCode); |
1386 | 1403 | if (!result.isSuccess()) { |
... | ... | @@ -1444,7 +1461,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1444 | 1461 | if (inventoryDetail == null) { |
1445 | 1462 | throw new JeecgBootException("完成出库任务,出库任务没有找到库存详情" + taskDetail.getFromInventoryDetailId()); |
1446 | 1463 | } |
1447 | - BigDecimal taskQty = inventoryDetail.getTaskQty().subtract(taskDetail.getQty()); | |
1464 | + BigDecimal taskQty = BigDecimal.ZERO; | |
1448 | 1465 | BigDecimal qty = inventoryDetail.getQty().subtract(taskDetail.getQty()); |
1449 | 1466 | inventoryDetail.setTaskQty(taskQty); |
1450 | 1467 | inventoryDetail.setQty(qty); |
... | ... |