Commit 1fd073880d2ca4afa96c3d01d73136e0159e20fe
1 parent
144ba5f4
库存详情增加库区类型,对操作加以限制
Showing
7 changed files
with
73 additions
and
6 deletions
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... | ... | @@ -717,6 +717,15 @@ export default { |
717 | 717 | this.$message.warning('所选数据非同库区'); |
718 | 718 | return; |
719 | 719 | } |
720 | + const isInList = this.selectRecord.some(row => { | |
721 | + if (row.zoneType != "L") { | |
722 | + return true | |
723 | + } | |
724 | + }) | |
725 | + if(isInList) { | |
726 | + this.$message.warning('所选数据非立库区类型'); | |
727 | + return; | |
728 | + } | |
720 | 729 | this.$refs.quickShipmentDetailModal.edit(this.selectRecord); |
721 | 730 | this.$refs.quickShipmentDetailModal.title = '快速出库'; |
722 | 731 | } |
... | ... | @@ -772,6 +781,15 @@ export default { |
772 | 781 | return; |
773 | 782 | } |
774 | 783 | } |
784 | + const isInList = this.selectRecord.some(row => { | |
785 | + if (row.zoneType != "P") { | |
786 | + return true | |
787 | + } | |
788 | + }) | |
789 | + if(isInList) { | |
790 | + this.$message.warning('所选数据非平库区类型'); | |
791 | + return; | |
792 | + } | |
775 | 793 | this.loading = true; |
776 | 794 | queryInventoryDetailListByMainIds(this.selectRecord).then((res) => { |
777 | 795 | this.loading = false; |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentDetailModal.vue
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | </template> |
47 | 47 | |
48 | 48 | <script> |
49 | -import { getZoneList, selectOutPort, shipmentInventoryDetail } from '@/api/api' | |
49 | +import { getZoneList, selectPickPort, shipmentInventoryDetail } from '@/api/api' | |
50 | 50 | import {getAction} from "@api/manage"; |
51 | 51 | |
52 | 52 | export default { |
... | ... | @@ -146,7 +146,7 @@ export default { |
146 | 146 | }, |
147 | 147 | getPortList() { |
148 | 148 | this.querySource.containerCode = this.model.containerCode |
149 | - selectOutPort(this.querySource).then(res => { | |
149 | + selectPickPort(this.querySource).then(res => { | |
150 | 150 | if (res.success) { |
151 | 151 | this.portList = res.result |
152 | 152 | this.visible = true |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java
... | ... | @@ -48,6 +48,10 @@ public class InventoryDetail implements Serializable { |
48 | 48 | @Excel(name = "库区", width = 15) |
49 | 49 | @ApiModelProperty(value = "库区") |
50 | 50 | private String zoneCode; |
51 | + /** 库区类型 */ | |
52 | + @Excel(name = "库区类型", width = 15) | |
53 | + @ApiModelProperty(value = "库区类型") | |
54 | + private String zoneType; | |
51 | 55 | /** 容器编码 */ |
52 | 56 | @Excel(name = "容器编码", width = 15) |
53 | 57 | @ApiModelProperty(value = "容器编码") |
... | ... | @@ -162,7 +166,6 @@ public class InventoryDetail implements Serializable { |
162 | 166 | @TableField(exist = false) |
163 | 167 | private BigDecimal shipmentQty; |
164 | 168 | |
165 | - | |
166 | 169 | public void setQty(BigDecimal qty) { |
167 | 170 | if (qty.compareTo(BigDecimal.ZERO) < 0) { |
168 | 171 | throw new JeecgBootException("库存数量必须大于0"); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java
... | ... | @@ -15,6 +15,8 @@ import org.jeecg.modules.wms.config.container.entity.Container; |
15 | 15 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
16 | 16 | import org.jeecg.modules.wms.config.location.entity.Location; |
17 | 17 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
18 | +import org.jeecg.modules.wms.config.zone.entity.Zone; | |
19 | +import org.jeecg.modules.wms.config.zone.service.IZoneService; | |
18 | 20 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
19 | 21 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
20 | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
... | ... | @@ -84,6 +86,8 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
84 | 86 | private ITaskHeaderService taskHeaderService; |
85 | 87 | @Resource |
86 | 88 | private IInventoryTransactionService inventoryTransactionService; |
89 | + @Resource | |
90 | + private IZoneService zoneService; | |
87 | 91 | |
88 | 92 | @Override |
89 | 93 | @Transactional |
... | ... | @@ -482,6 +486,14 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
482 | 486 | return false; |
483 | 487 | } |
484 | 488 | String zoneCode = toLocation.getZoneCode(); |
489 | + if (StringUtils.isEmpty(zoneCode)) { | |
490 | + return false; | |
491 | + } | |
492 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | |
493 | + if (zone == null) { | |
494 | + return false; | |
495 | + } | |
496 | + String zoneType = zone.getType(); | |
485 | 497 | boolean success = |
486 | 498 | inventoryHeaderService.updateInventoryContainerLocationZoneById(containerCode, locationCode, zoneCode, toLocation.getRoadWay(), inventoryHeader.getId()); |
487 | 499 | if (!success) { |
... | ... | @@ -494,6 +506,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
494 | 506 | inventoryDetail1.setContainerCode(containerCode); |
495 | 507 | inventoryDetail1.setLocationCode(locationCode); |
496 | 508 | inventoryDetail1.setZoneCode(zoneCode); |
509 | + inventoryDetail1.setZoneType(zoneType); | |
497 | 510 | inventoryDetail1.setRoadWay(toLocation.getRoadWay()); |
498 | 511 | updateInventoryDetailList.add(inventoryDetail1); |
499 | 512 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
... | ... | @@ -602,6 +602,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl |
602 | 602 | inventoryDetail.setWarehouseCode(warehouseCode); |
603 | 603 | inventoryDetail.setCompanyCode(receiptContainerDetail.getCompanyCode()); |
604 | 604 | inventoryDetail.setZoneCode(zoneCode); |
605 | + inventoryDetail.setZoneType(zone.getType()); | |
605 | 606 | inventoryDetail.setContainerCode(receiptContainerDetail.getContainerCode()); |
606 | 607 | inventoryDetail.setContainerStatus(QuantityConstant.STATUS_CONTAINER_EMPTY); |
607 | 608 | inventoryDetail.setLocationCode(toLocationCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java
... | ... | @@ -11,6 +11,8 @@ import org.apache.shiro.SecurityUtils; |
11 | 11 | import org.jeecg.common.api.vo.Result; |
12 | 12 | import org.jeecg.common.exception.JeecgBootException; |
13 | 13 | import org.jeecg.common.system.vo.LoginUser; |
14 | +import org.jeecg.modules.wms.config.zone.entity.Zone; | |
15 | +import org.jeecg.modules.wms.config.zone.service.IZoneService; | |
14 | 16 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
15 | 17 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
16 | 18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
... | ... | @@ -82,6 +84,8 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl<CycleCountDeta |
82 | 84 | private IShipmentDetailService shipmentDetailService; |
83 | 85 | @Resource |
84 | 86 | private ITaskHeaderService taskHeaderService; |
87 | + @Resource | |
88 | + private IZoneService zoneService; | |
85 | 89 | |
86 | 90 | @Override |
87 | 91 | @Transactional |
... | ... | @@ -176,7 +180,7 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl<CycleCountDeta |
176 | 180 | throw new JeecgBootException("更新盘点表单头失败"); |
177 | 181 | } |
178 | 182 | |
179 | - if (zoneType.equals("P")) { | |
183 | + if (zoneType.equals(QuantityConstant.ZONE_TYPE_FLAT)) { | |
180 | 184 | Result result = cycleCountDetailChildService.completePingkuConfirmGapQty(id, countedQty); |
181 | 185 | if (!result.isSuccess()) { |
182 | 186 | throw new JeecgBootException("调整平库库存失败"); |
... | ... | @@ -241,7 +245,16 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl<CycleCountDeta |
241 | 245 | // continue; |
242 | 246 | // } |
243 | 247 | String toLocationCode = inventoryHeader.getLocationCode(); |
244 | - String warehouseCode = cycleCountHeader.getWarehouseCode(); | |
248 | + String zoneCode = inventoryHeader.getZoneCode(); | |
249 | + if (StringUtils.isEmpty(zoneCode)) { | |
250 | + return Result.error("完成盘点任务时, 库区编码为空"); | |
251 | + } | |
252 | + String warehouseCode = inventoryHeader.getWarehouseCode(); | |
253 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | |
254 | + if (zone == null) { | |
255 | + return Result.error("完成盘点任务时, 库区为空"); | |
256 | + } | |
257 | + String zoneType = zone.getType(); | |
245 | 258 | String companyCode = cycleCountHeader.getCompanyCode(); |
246 | 259 | if (child.getInventoryDetaiId() != null) { |
247 | 260 | InventoryDetail inventoryDetail = inventoryDetailService.getById(child.getInventoryDetaiId()); |
... | ... | @@ -257,7 +270,8 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl<CycleCountDeta |
257 | 270 | inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); |
258 | 271 | inventoryDetail.setWarehouseCode(warehouseCode); |
259 | 272 | inventoryDetail.setCompanyCode(companyCode); |
260 | - inventoryDetail.setZoneCode(inventoryHeader.getZoneCode()); | |
273 | + inventoryDetail.setZoneCode(zoneCode); | |
274 | + inventoryDetail.setZoneType(zoneType); | |
261 | 275 | inventoryDetail.setContainerCode(inventoryHeader.getContainerCode()); |
262 | 276 | inventoryDetail.setLocationCode(toLocationCode); |
263 | 277 | inventoryDetail.setMaterialCode(child.getMaterialCode()); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1428,6 +1428,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1428 | 1428 | if (toLocation == null) { |
1429 | 1429 | return Result.error("完成入库任务时,没有找到目的库位"); |
1430 | 1430 | } |
1431 | + if (StringUtils.isEmpty(zoneCode)) { | |
1432 | + return Result.error("完成入库任务时,没有找到目的库区编码"); | |
1433 | + } | |
1434 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | |
1435 | + if (zone == null) { | |
1436 | + return Result.error("完成入库任务时,没有找到库区"); | |
1437 | + } | |
1438 | + String zoneType = zone.getType(); | |
1431 | 1439 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
1432 | 1440 | if (inventoryHeader == null) { |
1433 | 1441 | inventoryHeader = new InventoryHeader(); |
... | ... | @@ -1483,6 +1491,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1483 | 1491 | inventoryDetail.setWarehouseCode(warehouseCode); |
1484 | 1492 | inventoryDetail.setCompanyCode(taskDetail.getCompanyCode()); |
1485 | 1493 | inventoryDetail.setZoneCode(zoneCode); |
1494 | + inventoryDetail.setZoneType(zoneType); | |
1486 | 1495 | inventoryDetail.setContainerCode(taskHeader.getContainerCode()); |
1487 | 1496 | inventoryDetail.setLocationCode(toLocationCode); |
1488 | 1497 | inventoryDetail.setMaterialCode(taskDetail.getMaterialCode()); |
... | ... | @@ -2650,6 +2659,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2650 | 2659 | if (inventoryHeader == null) { |
2651 | 2660 | return Result.error("完成盘点任务时,没有找到库存头" + cycleCountDetail.getInventoryHeaderId()); |
2652 | 2661 | } |
2662 | + if (StringUtils.isEmpty(zoneCode)) { | |
2663 | + return Result.error("完成盘点任务时, 库区编码为空"); | |
2664 | + } | |
2665 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | |
2666 | + if (zone == null) { | |
2667 | + return Result.error("完成盘点任务时, 库区为空"); | |
2668 | + } | |
2669 | + String zoneType = zone.getType(); | |
2653 | 2670 | int outboundOrderId = 0; |
2654 | 2671 | String outboundOrderCode = null; |
2655 | 2672 | int warehousingOrderId = 0; |
... | ... | @@ -2673,6 +2690,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2673 | 2690 | inventoryDetail.setWarehouseCode(inventoryHeader.getWarehouseCode()); |
2674 | 2691 | inventoryDetail.setCompanyCode(inventoryHeader.getCompanyCode()); |
2675 | 2692 | inventoryDetail.setZoneCode(inventoryHeader.getZoneCode()); |
2693 | + inventoryDetail.setZoneType(zoneType); | |
2676 | 2694 | inventoryDetail.setContainerCode(inventoryHeader.getContainerCode()); |
2677 | 2695 | inventoryDetail.setLocationCode(toLocationCode); |
2678 | 2696 | inventoryDetail.setMaterialCode(child.getMaterialCode()); |
... | ... |