From f112deebbf1b1e4eaf659ac7ad869185ebf8276f Mon Sep 17 00:00:00 2001 From: judy <278197488@qq.com> Date: Fri, 19 Jul 2024 13:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9Cbillhead=20=E5=92=8Cbillbody?= =?UTF-8?q?=E7=9A=84=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shkj/wms/plc/PlcEventTask.java | 9 ++- .../shkj/wms/scheduled/ScheduledTasks.java | 43 +++++++------- .../wms/service/IPutInOutStorageService.java | 6 ++ .../impl/BusinDataTaskServiceImpl.java | 8 ++- .../service/impl/BusinPickupServiceImpl.java | 14 ++--- .../impl/PutInOutStorageServiceImpl.java | 57 +++++++++++-------- .../wms/service/impl/StackServiceImpl.java | 14 ++--- 7 files changed, 87 insertions(+), 64 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java index c300a07..2cf8c90 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java +++ b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java @@ -531,7 +531,8 @@ public class PlcEventTask { if (booleanResult.getCode() == HttpStatus.SUCCESS) { checkValue = true; } - } else if (taskType.equals(TaskTypeEnum.seat_adjustment.getValue())) { + } + else if (taskType.equals(TaskTypeEnum.seat_adjustment.getValue())) { // 处理货位调整的库存 BaseLocationQueryBo bo = new BaseLocationQueryBo(); bo.setLocationRow(businDataTaskServiceById.getFromRow()); @@ -565,7 +566,8 @@ public class PlcEventTask { if (changeType) { checkValue = true; } - } else if (TaskTypeEnum.normal_out.getValue().equals(taskType) + } + else if (TaskTypeEnum.normal_out.getValue().equals(taskType) || TaskTypeEnum.urgent_out.getValue().equals(taskType) || TaskTypeEnum.abnormal_delivery.getValue().equals(taskType) || TaskTypeEnum.punching_out.getValue().equals(taskType) @@ -578,7 +580,8 @@ public class PlcEventTask { if (delStock) { checkValue = true; } - } else { + } + else { if (taskType.equals(TaskTypeEnum.emptyContainer_out.getValue())) { //处理 15空治具出库 库存 BusinDpscontainerRecord oneByTask = businDpsContainerRecordMapper.selectByTaskid(String.valueOf(taskId)); diff --git a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java index 6b53379..7b5130f 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java +++ b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java @@ -513,15 +513,15 @@ public class ScheduledTasks { //生成入库单 if (randome.equals("P01")) { - Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); //生成入库单成功 - if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { - businDataTaskVo.setTransId(stringResult.getData()); - } else { +// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { +// businDataTaskVo.setTransId(stringResult.getData()); +// } else { businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); businDataTaskVo.setExceptionMsg("生成入库单失败"); - } + //} } } @@ -964,7 +964,7 @@ public class ScheduledTasks { exeBo.setBaseLocationVo(locationVo); exeBo.setTransNo("1"); exeBo.setTransQual("1"); - iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // iPutInOutStorageService.exeTaskPutinStorage(exeBo); //获取巷道对应的立库输送线接驳口 pointQueryBo.setTunnel(tunnel); pointQueryBo.setDirection("0"); @@ -1102,8 +1102,8 @@ public class ScheduledTasks { if (ObjectUtils.isNotEmpty(businDataTask) && ObjectUtils.isNotEmpty(businDataTask.getFromLayer())) { if (ObjectUtils.isNotEmpty(businTaskExeBo)) { ////生成出库单 - Result billResult = iPutInOutStorageService.exeTaskPutinStorage(businTaskExeBo); - businDataTask.setTransId(billResult.getData()); + // Result billResult = iPutInOutStorageService.exeTaskPutinStorage(businTaskExeBo); + // businDataTask.setTransId(billResult.getData()); } //添加货位预占和库存预占 //获取货位信息 @@ -1278,8 +1278,8 @@ public class ScheduledTasks { exeBo.setTransNo("2"); exeBo.setTransQual("2"); ////生成出库单 - Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); - businDataTaskVo.setTransId(billResult.getData()); + // Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // businDataTaskVo.setTransId(billResult.getData()); } else { businDataTaskVo.setExceptionMsg("下发堆垛机指令失败"); businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); @@ -1385,8 +1385,8 @@ public class ScheduledTasks { exeBo.setTransNo("2"); exeBo.setTransQual("2"); - Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); - businDataTaskVo.setTransId(billResult.getData()); + // Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // businDataTaskVo.setTransId(billResult.getData()); //添加货位预占和库存预占 //获取货位信息 baseLocationVo.setLocationStatus("4"); @@ -1536,8 +1536,8 @@ public class ScheduledTasks { exeBo.setTransNo("2"); exeBo.setTransQual("2"); - Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); - businDataTaskVo.setTransId(billResult.getData()); + // Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // businDataTaskVo.setTransId(billResult.getData()); //添加货位预占和库存预占 //获取货位信息 baseLocationVo.setLocationStatus("4"); @@ -1984,6 +1984,7 @@ public class ScheduledTasks { businDataTaskVo.setToLayer(locationVo.getLayer()); businDataTaskVo.setToRow(locationVo.getLocationRow()); businDataTaskVo.setTunnel(tunnel); + businDataTaskVo.setLocationId(locationVo.getId()); //获取货位对应的巷道及巷道对应的设备信息 pointQueryBo.setTunnel(tunnel); pointQueryBo.setDirection("0"); @@ -2112,15 +2113,15 @@ public class ScheduledTasks { //生成入库单 if (randome.equals("P01")) { - Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); //生成入库单成功 - if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { - businDataTaskVo.setTransId(stringResult.getData()); - } else { - businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); - businDataTaskVo.setExceptionMsg("生成入库单失败"); - } +// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { +// businDataTaskVo.setTransId(stringResult.getData()); +// } else { + // businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); + // businDataTaskVo.setExceptionMsg("生成入库单失败"); + // } } } diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/IPutInOutStorageService.java b/shkj-wms/src/main/java/com/shkj/wms/service/IPutInOutStorageService.java index bfbfda4..1b2d2a7 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/IPutInOutStorageService.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/IPutInOutStorageService.java @@ -20,6 +20,12 @@ public interface IPutInOutStorageService extends IService { /** 自动入库*/ public Result saveBusinBillTaskData(MachineHandAddBo bo,String type); + + /** + * 下挂生成相关任务 + * @param bo + * @return + */ public Result saveBusinBillTaskData(MachineHandAddBo bo); /** diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java index d565745..106d49c 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java @@ -541,6 +541,9 @@ public class BusinDataTaskServiceImpl extends ServiceImpl billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // Result billResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); //扣除库存 List DataTaskGoodsList = baseDeriveTraverseVo.getBusinDataTaskGoodsList(); for (BusinDataTaskGoodsVo dateTaskgoods : DataTaskGoodsList @@ -2010,6 +2013,9 @@ public class BusinDataTaskServiceImpl extends ServiceImpl stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); //生成入库单成功 - if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { - businDataTask.setTransId(stringResult.getData()); - } else { - businDataTask.setTaskStatus(TaskStatusEnum.err.getValue()); - businDataTask.setExceptionMsg("生成入库单失败"); - } +// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { +// businDataTask.setTransId(stringResult.getData()); +// } else { + // businDataTask.setTaskStatus(TaskStatusEnum.err.getValue()); + // businDataTask.setExceptionMsg("生成入库单失败"); + // } iBusinDataTaskService.updateById(businDataTask); } } diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java index 6e6066a..77a4450 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java @@ -124,7 +124,15 @@ public class PutInOutStorageServiceImpl extends ServiceImpl saveBusinBillTaskData(MachineHandAddBo bo) { @@ -1031,17 +1039,16 @@ public class PutInOutStorageServiceImpl extends ServiceImpl businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(taskId); //获取要入库的物料信息 - List bodyInOutDatas = iBusinBillheadService.getBillHeadBodyInOutData(bodyQueryBo); + //List bodyInOutDatas = iBusinBillheadService.getBillHeadBodyInOutData(bodyQueryBo); if(businDataTask.getTaskType().equals(TaskTypeEnum.emptyCon.getValue()) || businDataTask.getTaskType().equals(TaskTypeEnum.empty_in.getValue())){ //改货位状态 - //获取货位 -// BaseLocation baseLocation = iBaseLocationService.getOne(new LambdaQueryWrapper() -// .eq(BaseLocation::getLocationColumn, businDataTask.getToColumn()) -// .eq(BaseLocation::getLayer, businDataTask.getToLayer()) -// .eq(BaseLocation::getLocationRow, businDataTask.getToRow()) -// .eq(BaseLocation::getLocationStatus,"4")); - BaseLocation baseLocation = iBaseLocationService.getById(businDataTask.getLocationId()); baseLocation.setLocationStatus("2"); //添加库存 //TODO 空治具出库是没有处理库存流程 考虑入库时是否添加库存 @@ -1062,10 +1069,10 @@ public class PutInOutStorageServiceImpl extends ServiceImpl0?Result.ok():Result.err(); } if (businDataTask.getTaskType().equals(TaskTypeEnum.scancode_err.getValue())){ - BaseLocation baseLocation = iBaseLocationService.getOne(new LambdaQueryWrapper() - .eq(BaseLocation::getLocationColumn, businDataTask.getToColumn()) - .eq(BaseLocation::getLayer, businDataTask.getToLayer()) - .eq(BaseLocation::getLocationRow, businDataTask.getToRow())); +// BaseLocation baseLocation = iBaseLocationService.getOne(new LambdaQueryWrapper() +// .eq(BaseLocation::getLocationColumn, businDataTask.getToColumn()) +// .eq(BaseLocation::getLayer, businDataTask.getToLayer()) +// .eq(BaseLocation::getLocationRow, businDataTask.getToRow())); baseLocation.setLocationStatus("2"); SysStockDetail sysStockDetail = new SysStockDetail(); sysStockDetail.setQty(new BigDecimal("1")); @@ -1083,7 +1090,7 @@ public class PutInOutStorageServiceImpl extends ServiceImpl0?Result.ok():Result.err(); } - if(ObjectUtils.isEmpty(bodyInOutDatas)){ + if(ObjectUtils.isEmpty(businDataTaskGoodsVos)){ return Result.err().msg("没有要处理的库存信息"); } Long locationCode=0L; @@ -1093,24 +1100,24 @@ public class PutInOutStorageServiceImpl extends ServiceImpl barcodesIns = new ArrayList<>(); + locationCode = baseLocation.getId(); + BaseArea baseArea = iBaseAreaService.getById(baseLocation.getAreaId()); + storageCode = baseArea.getStorageId(); + batch = businDataTask.getBatch(); + containerCode = businDataTask.getContainerId(); List goods = new ArrayList(); - for (BusinBillHeadbodyInVo bodyInOutData : bodyInOutDatas) { - locationCode = bodyInOutData.getLocationCode(); - storageCode = bodyInOutData.getStorageCode(); - batch = bodyInOutData.getBatch(); - isRepair += Integer.valueOf(bodyInOutData.getIsRepair()); - isPunching += Integer.valueOf(bodyInOutData.getIsPunching()); - containerCode = bodyInOutData.getContainerCode(); + for (BusinDataTaskGoodsVo taskGoodsVo : businDataTaskGoodsVos) { + isRepair += Integer.valueOf(taskGoodsVo.getIsRepair()); + isPunching += Integer.valueOf(taskGoodsVo.getIsPunching()); + Map goodsMap =new HashMap(); - goodsMap.put("goodsNo",bodyInOutData.getGoodsNo()); - goodsMap.put("qrCode",bodyInOutData.getQrCode()); + goodsMap.put("goodsNo",taskGoodsVo.getGoodsNo()); + goodsMap.put("qrCode",taskGoodsVo.getQrCode()); goods.add(goodsMap); - // TODO 测试注释 要打开 //更改入库条码状态 BaseBarcodesIn baseBarcodesIn = iBaseBarcodesInService.getOne(new LambdaQueryWrapper() - .eq(BaseBarcodesIn::getQrCode, bodyInOutData.getQrCode()).last("limit 1")); - + .eq(BaseBarcodesIn::getQrCode, taskGoodsVo.getQrCode()).last("limit 1")); baseBarcodesIn.setInStatus("4"); baseBarcodesIn.setInDate(DateUtils.getDate()); barcodesIns.add(baseBarcodesIn); diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java index 51f2daa..c3e5495 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java @@ -417,14 +417,14 @@ public class StackServiceImpl implements IStackService { businDataTaskVo.setTaskPath(toLocation); businDataTaskVo.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); //生成入库单 - Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); + // Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); //生成入库单成功 - if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { - businDataTaskVo.setTransId(stringResult.getData()); - } else { - businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); - businDataTaskVo.setExceptionMsg("生成入库单失败"); - } +// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { +// businDataTaskVo.setTransId(stringResult.getData()); +// } else { +// businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); +// businDataTaskVo.setExceptionMsg("生成入库单失败"); + //} //修改冲孔完成 BasePunchRecord basePunchRecord = iBasePunchRecordService.getOne(new LambdaQueryWrapper() .eq(BasePunchRecord::getTaskCode,Long.valueOf(endIdArr[0]))