Commit 2f616f9e1ed9af2f0c00cc55b2d44800ef906ecf
1 parent
96ed17a2
完善WMS4 出入库流程
Showing
10 changed files
with
101 additions
and
12 deletions
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerSelectModal.vue
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
ant-design-vue-jeecg/src/views/system/stocktaking/modules/AdjustmentDocModal.vue
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
... | ... | @@ -23,4 +23,7 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { |
23 | 23 | |
24 | 24 | // 求一种物料的库存之和 |
25 | 25 | BigDecimal getSumQty(InventoryDetail inventoryDetail); |
26 | + | |
27 | + // 求一种物料的可出库存之和 | |
28 | + BigDecimal getAvailSumQty(InventoryDetail inventoryDetail); | |
26 | 29 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
... | ... | @@ -65,4 +65,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
65 | 65 | BigDecimal sumQty = totalQty.subtract(totalTaskQty); |
66 | 66 | return sumQty; |
67 | 67 | } |
68 | + | |
69 | + @Override | |
70 | + public BigDecimal getAvailSumQty(InventoryDetail inventoryDetail) { | |
71 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
72 | + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryStatus, inventoryDetail.getInventoryStatus()) | |
73 | + .eq(InventoryDetail::getMaterialCode, inventoryDetail.getMaterialCode()).eq(InventoryDetail::getWarehouseCode, inventoryDetail.getWarehouseCode()) | |
74 | + .eq(StringUtils.isNotEmpty(inventoryDetail.getBatch()), InventoryDetail::getBatch, inventoryDetail.getBatch()) | |
75 | + .eq(StringUtils.isNotEmpty(inventoryDetail.getLot()), InventoryDetail::getLot, inventoryDetail.getLot()) | |
76 | + .eq(StringUtils.isNotEmpty(inventoryDetail.getProject()), InventoryDetail::getProject, inventoryDetail.getLot()) | |
77 | + .eq(InventoryDetail::getTaskQty, BigDecimal.ZERO).eq(InventoryDetail::getCompanyCode, inventoryDetail.getCompanyCode()); | |
78 | + List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); | |
79 | + if (inventoryDetailList.size() == 0) { | |
80 | + return BigDecimal.ZERO; | |
81 | + } | |
82 | + BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); | |
83 | + return totalQty; | |
84 | + } | |
68 | 85 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -128,6 +128,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
128 | 128 | LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
129 | 129 | shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode, shipmentCode).eq(ShipmentDetail::getWarehouseCode, warehouseCode); |
130 | 130 | List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(shipmentDetailLambdaQueryWrapper); |
131 | + if (shipmentDetailList.isEmpty()) { | |
132 | + return Result.error("出库单没有明细", null); | |
133 | + } | |
131 | 134 | boolean over = true; |
132 | 135 | for (ShipmentDetail shipmentDetail : shipmentDetailList) { |
133 | 136 | if (shipmentDetail.getTaskQty().compareTo(shipmentDetail.getQty()) < 0) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -16,6 +16,7 @@ import org.apache.shiro.SecurityUtils; |
16 | 16 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
17 | 17 | import org.jeecg.common.api.vo.Result; |
18 | 18 | import org.jeecg.common.aspect.annotation.AutoLog; |
19 | +import org.jeecg.common.exception.JeecgBootException; | |
19 | 20 | import org.jeecg.common.system.base.controller.JeecgController; |
20 | 21 | import org.jeecg.common.system.query.QueryGenerator; |
21 | 22 | import org.jeecg.common.system.vo.LoginUser; |
... | ... | @@ -24,7 +25,6 @@ import org.jeecg.modules.wms.api.erp.service.IErpService; |
24 | 25 | import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean; |
25 | 26 | import org.jeecg.modules.wms.api.mobile.service.IMobileService; |
26 | 27 | import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; |
27 | -import org.jeecg.modules.wms.framework.controller.HuahengBaseController; | |
28 | 28 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
29 | 29 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
30 | 30 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
... | ... | @@ -46,7 +46,6 @@ import org.springframework.web.multipart.MultipartHttpServletRequest; |
46 | 46 | import org.springframework.web.servlet.ModelAndView; |
47 | 47 | |
48 | 48 | import com.alibaba.fastjson.JSON; |
49 | -import org.jeecg.common.exception.JeecgBootException; | |
50 | 49 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
51 | 50 | import com.baomidou.mybatisplus.core.metadata.IPage; |
52 | 51 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
... | ... | @@ -203,7 +202,9 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
203 | 202 | inventoryDetail.setProject(shipmentDetail1.getProject()); |
204 | 203 | inventoryDetail.setLot(shipmentDetail1.getLot()); |
205 | 204 | BigDecimal sumQty = inventoryDetailService.getSumQty(inventoryDetail); |
205 | + BigDecimal availQty = inventoryDetailService.getAvailSumQty(inventoryDetail); | |
206 | 206 | shipmentDetail1.setInventoryQty(sumQty); |
207 | + shipmentDetail1.setAvailableQty(availQty); | |
207 | 208 | } |
208 | 209 | return Result.OK(pageList); |
209 | 210 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/entity/ShipmentDetail.java
... | ... | @@ -70,6 +70,10 @@ public class ShipmentDetail implements Serializable { |
70 | 70 | @Excel(name = "已出数量", width = 15) |
71 | 71 | @ApiModelProperty(value = "已出数量") |
72 | 72 | private java.math.BigDecimal taskQty; |
73 | + /** 可出数量 */ | |
74 | + @ApiModelProperty(value = "可出数量") | |
75 | + @TableField(exist = false) | |
76 | + private java.math.BigDecimal availableQty; | |
73 | 77 | /** 库存数量 */ |
74 | 78 | @ApiModelProperty(value = "库存数量") |
75 | 79 | @TableField(exist = false) |
... | ... | @@ -107,7 +111,8 @@ public class ShipmentDetail implements Serializable { |
107 | 111 | /** 上游行号 */ |
108 | 112 | @Excel(name = "上游行号", width = 15) |
109 | 113 | @ApiModelProperty(value = "上游行号") |
110 | - private String referLineNum; /** 备用字段1 */ | |
114 | + private String referLineNum; | |
115 | + /** 备用字段1 */ | |
111 | 116 | @Excel(name = "备用字段1", width = 15) |
112 | 117 | @ApiModelProperty(value = "备用字段1") |
113 | 118 | private String userdef1; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... | ... | @@ -219,23 +219,73 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
219 | 219 | */ |
220 | 220 | Result completeShipmentTask(TaskHeader taskHeader); |
221 | 221 | |
222 | + /** | |
223 | + * 完成盘点 | |
224 | + * @param taskHeader | |
225 | + * @return | |
226 | + */ | |
222 | 227 | Result completeCycleCountTask(TaskHeader taskHeader); |
223 | 228 | |
229 | + /** | |
230 | + * 完成空托盘入库 | |
231 | + * @param taskHeader | |
232 | + * @return | |
233 | + */ | |
224 | 234 | Result completeEmptyInTask(TaskHeader taskHeader); |
225 | 235 | |
236 | + /** | |
237 | + * 完成空托盘出库 | |
238 | + * @param taskHeader | |
239 | + * @return | |
240 | + */ | |
226 | 241 | Result completeEmptyOutTask(TaskHeader taskHeader); |
227 | 242 | |
243 | + /** | |
244 | + * 完成移库 | |
245 | + * @param taskHeader | |
246 | + * @return | |
247 | + */ | |
228 | 248 | Result completeTransferTask(TaskHeader taskHeader); |
229 | 249 | |
250 | + /** | |
251 | + * 完成出库查看 | |
252 | + * @param taskHeader | |
253 | + * @return | |
254 | + */ | |
230 | 255 | Result completeCheckOutTask(TaskHeader taskHeader); |
231 | 256 | |
257 | + /** | |
258 | + * 完成跨站 | |
259 | + * @param taskHeader | |
260 | + * @return | |
261 | + */ | |
232 | 262 | Result completeOverStationTask(TaskHeader taskHeader); |
233 | 263 | |
264 | + /** | |
265 | + * 完成空托盘组入库 | |
266 | + * @param taskHeader | |
267 | + * @return | |
268 | + */ | |
234 | 269 | Result completeManyEmptyInTask(TaskHeader taskHeader); |
235 | 270 | |
271 | + /** | |
272 | + * 完成空托盘组出库 | |
273 | + * @param taskHeader | |
274 | + * @return | |
275 | + */ | |
236 | 276 | Result completeManyEmptyOutTask(TaskHeader taskHeader); |
237 | 277 | |
278 | + /** | |
279 | + * 完成入库 | |
280 | + * @param taskHeader | |
281 | + * @return | |
282 | + */ | |
238 | 283 | Result cancelReceiptTask(TaskHeader taskHeader); |
239 | 284 | |
285 | + /** | |
286 | + * 完成出库 | |
287 | + * @param taskHeader | |
288 | + * @return | |
289 | + */ | |
240 | 290 | Result cancelShipmentTask(TaskHeader taskHeader); |
241 | 291 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1251,8 +1251,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1251 | 1251 | @Override |
1252 | 1252 | @Transactional(rollbackFor = Exception.class) |
1253 | 1253 | @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'出库任务完成'", extra = "#extraJsonString1", |
1254 | - msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1255 | - condition = "#taskDetailList.size() > 0", recordReturnValue = true) | |
1254 | + msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1255 | + condition = "#taskDetailList.size() > 0", recordReturnValue = true) | |
1256 | 1256 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务完成'", extra = "#extraJsonString1", |
1257 | 1257 | msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getFromLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", |
1258 | 1258 | recordReturnValue = true) |
... | ... | @@ -1600,6 +1600,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1600 | 1600 | if (inventoryDetail == null) { |
1601 | 1601 | throw new JeecgBootException("盘点还没完成 库存明细单据就不存在了 可能出现了问题或者所容器没成功"); |
1602 | 1602 | } |
1603 | + inventoryHeader.setLocationCode(toLocationCode); | |
1603 | 1604 | inventoryHeader.setTotalQty(inventoryHeader.getTotalQty().add(child.getGapQty())); |
1604 | 1605 | inventoryDetail.setQty(child.getCountedQty()); |
1605 | 1606 | inventoryDetailService.updateById(inventoryDetail); |
... | ... | @@ -1610,7 +1611,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1610 | 1611 | inventoryDetail.setCompanyCode(inventoryHeader.getCompanyCode()); |
1611 | 1612 | inventoryDetail.setZoneCode(inventoryHeader.getZoneCode()); |
1612 | 1613 | inventoryDetail.setContainerCode(inventoryHeader.getContainerCode()); |
1613 | - inventoryDetail.setLocationCode(inventoryHeader.getLocationCode()); | |
1614 | + inventoryDetail.setLocationCode(toLocationCode); | |
1614 | 1615 | inventoryDetail.setMaterialCode(child.getMaterialCode()); |
1615 | 1616 | inventoryDetail.setMaterialName(child.getMaterialName()); |
1616 | 1617 | inventoryDetail.setMaterialSpec(child.getMaterialSpec()); |
... | ... | @@ -1764,16 +1765,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1764 | 1765 | cycleCountHeaderService.updataHeaderStatus(cycleCountDetail.getCycleCountHeadCode()); |
1765 | 1766 | |
1766 | 1767 | // 释放库位 |
1767 | - locationService.updateStatus(cycleCountDetail.getLocationCode(), QuantityConstant.STATUS_LOCATION_EMPTY, taskHeader.getWarehouseCode()); | |
1768 | + locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
1769 | + | |
1770 | + locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
1768 | 1771 | |
1769 | 1772 | // // 还原容器状态 |
1770 | 1773 | // containerService.restoreContainer(cycleCountDetail.getContainerCode(), taskHeader.getWarehouseCode()); |
1771 | 1774 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); |
1772 | 1775 | if (inventoryDetailList.size() != 0) { |
1773 | 1776 | if (fromLocationCode.equals(toLocationCode)) { |
1774 | - success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); | |
1777 | + success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); | |
1775 | 1778 | } else { |
1776 | - success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); | |
1779 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); | |
1777 | 1780 | } |
1778 | 1781 | if (!success) { |
1779 | 1782 | throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); |
... | ... | @@ -2013,7 +2016,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2013 | 2016 | throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); |
2014 | 2017 | } |
2015 | 2018 | } else { |
2016 | - success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); | |
2019 | + if (fromLocationCode.equals(toLocationCode)) { | |
2020 | + success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); | |
2021 | + } else { | |
2022 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode); | |
2023 | + } | |
2017 | 2024 | if (!success) { |
2018 | 2025 | throw new JeecgBootException("完成出库查看任务时,更新容器状态失败"); |
2019 | 2026 | } |
... | ... |