From 458cce6c966c2a245dbe033620a8f8a49521aa46 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sun, 7 Apr 2024 19:26:53 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=9B=98=E7=82=B9=E6=B3=A8=E9=87=8A=E6=97=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/BasicdataClientClient.java | 3 +- .../service/impl/AsyncDataServiceImpl.java | 864 +++++++++--------- 2 files changed, 434 insertions(+), 433 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java index c1ff28cbb..97402e729 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java @@ -68,7 +68,8 @@ public class BasicdataClientClient implements IBasicdataClientClient { @GetMapping(API_PREFIX+"/findByName") public BasicdataClientEntity findByName(String customerName) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("client_name",customerName); + queryWrapper.eq("client_name",customerName) + .eq("is_deleted",0); return basicdataClientService.getOne(queryWrapper); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java index 597701e75..67dbadba3 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java @@ -210,444 +210,444 @@ public class AsyncDataServiceImpl implements IAsyncDataService { }else{ if(questTarget.equals(2)){ - if(isChangeAt == 1){ - List upShelfZeroOrderDTOS = new ArrayList<>(); - UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO(); - upShelfZeroOrderDTO.setOrderCode(orderCode); - upShelfZeroOrderDTO.setAllocationId(Long.parseLong(allocationId)); - upShelfZeroOrderDTO.setEnterNum(stockNum); - upShelfZeroOrderDTOS.add(upShelfZeroOrderDTO); - if(!Objects.isNull(groundingAllocationId)){ - if(StringUtil.isNotBlank(allocationId)){ - R r = updownTypeService.downZeroOrder(upShelfZeroOrderDTOS, warehouseId,"盘点零担下架"); - if(r.getCode() == 200){ - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); - } - } - } - }else{ - if(StringUtil.isNotBlank(trayCode)){ - R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托"); - if(r.getCode() == 200){ - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); - } - } - } - } - } - }else { - if(StringUtil.isNotBlank(newTrayCode)){ - if(StringUtil.isNotBlank(allocationId)){ - R r = updownTypeService.downZeroOrder(upShelfZeroOrderDTOS, warehouseId,"盘点零担下架"); - if(r.getCode() == 200){ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); - String trayType = "100"; - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - List zeroList = new ArrayList<>(); - ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); - zeroOrderVO.setOrderId(orderId); - zeroOrderVO.setOrderCode(orderCode); - zeroOrderVO.setNum(stockNum); - zeroList.add(zeroOrderVO); - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - //打托 - trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); - }else{ - if(!nowStockNum.equals(0)){ - zeroList.get(0).setNum(nowStockNum); - trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); - } - } - } - }else{ - if(StringUtil.isNotBlank(trayCode)){ - R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托"); - if(r.getCode() == 200){ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); - String trayType = "100"; - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - List zeroList = new ArrayList<>(); - ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); - zeroOrderVO.setOrderId(orderId); - zeroOrderVO.setOrderCode(orderCode); - zeroOrderVO.setNum(stockNum); - zeroList.add(zeroOrderVO); - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - //打托 - trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); - }else{ - if(!nowStockNum.equals(0)){ - zeroList.get(0).setNum(nowStockNum); - trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); - } - } - } - }else{ - - BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode); - if(Objects.isNull(trayEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId)); - continue; - } - Long newTrayId = trayEntity.getId(); - Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId); - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(!Objects.isNull(newAllocationId)){ - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,newAllocationId,warehouseId,"盘点零担上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,newAllocationId,warehouseId,"盘点零担上架"); - } - } - }else{ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); - String trayType = "100"; - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - List zeroList = new ArrayList<>(); - ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); - zeroOrderVO.setOrderId(orderId); - zeroOrderVO.setOrderCode(orderCode); - zeroOrderVO.setNum(stockNum); - zeroList.add(zeroOrderVO); - if(Objects.isNull(nowStockNum)){ - //打托 - trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); - }else{ - if(!nowStockNum.equals(0)){ - zeroList.get(0).setNum(nowStockNum); - trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); - } - } - } - } - } - } - } - } - - if(isChange == 1 && isChangeAt == 0){ - - if(StringUtil.isNotBlank(allocationId)){ - List upShelfZeroOrderDTOS = new ArrayList<>(); - UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO(); - upShelfZeroOrderDTO.setOrderCode(orderCode); - upShelfZeroOrderDTO.setAllocationId(Long.parseLong(allocationId)); - upShelfZeroOrderDTO.setEnterNum(stockNum); - upShelfZeroOrderDTOS.add(upShelfZeroOrderDTO); - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(!Objects.isNull(nowStockNum) && stockNum-nowStockNum != 0){ - upShelfZeroOrderDTOS.get(0).setEnterNum(stockNum-nowStockNum); - updownTypeService.downZeroOrder(upShelfZeroOrderDTOS,warehouseId,"盘点下架零担"); - } - }else{ - if(StringUtil.isNotBlank(trayCode)){ - R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托"); - if(r.getCode() == 200){ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); - String trayType = "100"; - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - List zeroList = new ArrayList<>(); - ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); - zeroOrderVO.setOrderId(orderId); - zeroOrderVO.setOrderCode(orderCode); - zeroOrderVO.setNum(nowStockNum); - zeroList.add(zeroOrderVO); - //打托 - trayTypeService.enterZeroOrderByTrayCode(trayType,trayCode,zeroList,warehouseId,"盘点零担打托"); - } - } - } - - } - - }else if (questTarget.equals(3)){ - - DistributionStockListEntity stockListEntity = distributionStockListClient.getStockListById(stockId); - if(Objects.isNull(stockListEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品信息不存在stockId="+stockId,tenantId,userId,nickName,deptId)); - continue; - } - Long marketId = stockListEntity.getMarketId(); - String cargoNumber = stockListEntity.getCargoNumber(); - String incomingBatch = stockListEntity.getIncomingBatch(); - Long materialId = stockListEntity.getMaterialId(); - if(isChangeAt == 1){ - if(!Objects.isNull(groundingAllocationId)){ - if(StringUtil.isNotBlank(allocationId)){ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - R r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架"); - if(r.getCode() == 200){ - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfStockList.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); - } - } - } - }else{ - if(StringUtil.isNotBlank(trayCode)){ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); +// if(isChangeAt == 1){ +// List upShelfZeroOrderDTOS = new ArrayList<>(); +// UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO(); +// upShelfZeroOrderDTO.setOrderCode(orderCode); +// upShelfZeroOrderDTO.setAllocationId(Long.parseLong(allocationId)); +// upShelfZeroOrderDTO.setEnterNum(stockNum); +// upShelfZeroOrderDTOS.add(upShelfZeroOrderDTO); +// if(!Objects.isNull(groundingAllocationId)){ +// if(StringUtil.isNotBlank(allocationId)){ +// R r = updownTypeService.downZeroOrder(upShelfZeroOrderDTOS, warehouseId,"盘点零担下架"); +// if(r.getCode() == 200){ +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); +// } +// } +// } +// }else{ +// if(StringUtil.isNotBlank(trayCode)){ +// R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托"); +// if(r.getCode() == 200){ +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架"); +// } +// } +// } +// } +// } +// }else { +// if(StringUtil.isNotBlank(newTrayCode)){ +// if(StringUtil.isNotBlank(allocationId)){ +// R r = updownTypeService.downZeroOrder(upShelfZeroOrderDTOS, warehouseId,"盘点零担下架"); +// if(r.getCode() == 200){ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); +// String trayType = "100"; +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// List zeroList = new ArrayList<>(); +// ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); +// zeroOrderVO.setOrderId(orderId); +// zeroOrderVO.setOrderCode(orderCode); +// zeroOrderVO.setNum(stockNum); +// zeroList.add(zeroOrderVO); +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// //打托 +// trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); +// }else{ +// if(!nowStockNum.equals(0)){ +// zeroList.get(0).setNum(nowStockNum); +// trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); +// } +// } +// } +// }else{ +// if(StringUtil.isNotBlank(trayCode)){ +// R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托"); +// if(r.getCode() == 200){ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); +// String trayType = "100"; +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// List zeroList = new ArrayList<>(); +// ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); +// zeroOrderVO.setOrderId(orderId); +// zeroOrderVO.setOrderCode(orderCode); +// zeroOrderVO.setNum(stockNum); +// zeroList.add(zeroOrderVO); +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// //打托 +// trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); +// }else{ +// if(!nowStockNum.equals(0)){ +// zeroList.get(0).setNum(nowStockNum); +// trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); +// } +// } +// } +// }else{ +// +// BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode); +// if(Objects.isNull(trayEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long newTrayId = trayEntity.getId(); +// Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId); +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(!Objects.isNull(newAllocationId)){ +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,newAllocationId,warehouseId,"盘点零担上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,newAllocationId,warehouseId,"盘点零担上架"); +// } +// } +// }else{ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); +// String trayType = "100"; +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// List zeroList = new ArrayList<>(); +// ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); +// zeroOrderVO.setOrderId(orderId); +// zeroOrderVO.setOrderCode(orderCode); +// zeroOrderVO.setNum(stockNum); +// zeroList.add(zeroOrderVO); +// if(Objects.isNull(nowStockNum)){ +// //打托 +// trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); +// }else{ +// if(!nowStockNum.equals(0)){ +// zeroList.get(0).setNum(nowStockNum); +// trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托"); +// } +// } +// } +// } +// } +// } +// } +// } +// +// if(isChange == 1 && isChangeAt == 0){ +// +// if(StringUtil.isNotBlank(allocationId)){ +// List upShelfZeroOrderDTOS = new ArrayList<>(); +// UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO(); +// upShelfZeroOrderDTO.setOrderCode(orderCode); +// upShelfZeroOrderDTO.setAllocationId(Long.parseLong(allocationId)); +// upShelfZeroOrderDTO.setEnterNum(stockNum); +// upShelfZeroOrderDTOS.add(upShelfZeroOrderDTO); +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(!Objects.isNull(nowStockNum) && stockNum-nowStockNum != 0){ +// upShelfZeroOrderDTOS.get(0).setEnterNum(stockNum-nowStockNum); +// updownTypeService.downZeroOrder(upShelfZeroOrderDTOS,warehouseId,"盘点下架零担"); +// } +// }else{ +// if(StringUtil.isNotBlank(trayCode)){ +// R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托"); +// if(r.getCode() == 200){ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); // String trayType = "100"; // if(!Objects.isNull(entityByTrayCode)){ // trayType = entityByTrayCode.getTrayType(); // } - WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId); - if(Objects.isNull(trayGoodsEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId)); - continue; - } - Long trayGoodsId = trayGoodsEntity.getId(); - R r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托"); - if(r.getCode() == 200){ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(groundingAllocationId); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfStockList.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); - } - } - } - }else{ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(groundingAllocationId); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfStockList.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); - } - } - } - } - }else { - if(StringUtil.isNotBlank(newTrayCode)){ - if(StringUtil.isNotBlank(allocationId)){ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - R r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架"); - if(r.getCode() == 200){ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); - String trayType = "100"; - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - //打托 - trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - }else{ - if(!nowStockNum.equals(0)){ - trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - } - } - } - }else{ - if(StringUtil.isNotBlank(trayCode)){ - BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode); - if(Objects.isNull(trayEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在trayCode="+trayCode,tenantId,userId,nickName,deptId)); - continue; - } - Long oldTrayId = trayEntity.getId(); - Long oldAllocationId = taryAllocationService.getAllocationIdByTrayId(oldTrayId); - String trayType = "100"; - R r = null; - if(!Objects.isNull(oldAllocationId)){ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架"); - }else{ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId); - if(Objects.isNull(trayGoodsEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId)); - continue; - } - Long trayGoodsId = trayGoodsEntity.getId(); - r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托"); - } - if(r.getCode() == 200){ - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - //打托 - trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - }else{ - if(!nowStockNum.equals(0)){ - trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - } - } - } - }else{ - BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode); - if(Objects.isNull(trayEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId)); - continue; - } - Long newTrayId = trayEntity.getId(); - Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId); - if(!Objects.isNull(newAllocationId)){ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(groundingAllocationId); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - updownTypeService.upShelfStockList(upShelfStockList,newAllocationId,warehouseId,"盘点无数据库存品上架"); - }else{ - if(!nowStockNum.equals(0)){ - upShelfStockList.get(0).setEnterNum(nowStockNum); - updownTypeService.upShelfStockList(upShelfStockList,newAllocationId,warehouseId,"盘点无数据库存品上架"); - } - } - }else{ - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); - String trayType = "100"; - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - List zeroList = new ArrayList<>(); - ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); - zeroOrderVO.setOrderId(orderId); - zeroOrderVO.setOrderCode(orderCode); - zeroOrderVO.setNum(stockNum); - zeroList.add(zeroOrderVO); - //查询目前在库件数 - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(Objects.isNull(nowStockNum)){ - //打托 - trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - }else{ - if(!nowStockNum.equals(0)){ - trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - } - } - } +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// List zeroList = new ArrayList<>(); +// ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); +// zeroOrderVO.setOrderId(orderId); +// zeroOrderVO.setOrderCode(orderCode); +// zeroOrderVO.setNum(nowStockNum); +// zeroList.add(zeroOrderVO); +// //打托 +// trayTypeService.enterZeroOrderByTrayCode(trayType,trayCode,zeroList,warehouseId,"盘点零担打托"); +// } +// } +// } +// +// } - } - } - } - } - } + }else if (questTarget.equals(3)){ - if(isChange == 1 && isChangeAt == 0){ - //暂不处理数量问题 - if(StringUtil.isNotBlank(allocationId)){ - List upShelfStockList = new ArrayList<>(); - UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); - upShelfStockDTO.setMarketId(marketId); - upShelfStockDTO.setMaterialCode(cargoNumber); - upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); - upShelfStockDTO.setEnterNum(stockNum); - upShelfStockDTO.setIncomingBatch(incomingBatch); - upShelfStockList.add(upShelfStockDTO); - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - if(!Objects.isNull(nowStockNum) && stockNum-nowStockNum != 0){ - upShelfStockList.get(0).setEnterNum(stockNum-nowStockNum); - updownTypeService.downStock(upShelfStockList,warehouseId,"盘点无数据库存品下架"); - } - }else{ - if (StringUtil.isNotBlank(trayCode)){ - String trayType = "100"; - TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); - if(!Objects.isNull(entityByTrayCode)){ - trayType = entityByTrayCode.getTrayType(); - } - WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId); - if(Objects.isNull(trayGoodsEntity)){ - syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId)); - continue; - } - Long trayGoodsId = trayGoodsEntity.getId(); - R r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托"); - if(r.getCode() == 200){ - Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); - trayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,cargoNumber,marketId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); - } - } - } - } +// DistributionStockListEntity stockListEntity = distributionStockListClient.getStockListById(stockId); +// if(Objects.isNull(stockListEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品信息不存在stockId="+stockId,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long marketId = stockListEntity.getMarketId(); +// String cargoNumber = stockListEntity.getCargoNumber(); +// String incomingBatch = stockListEntity.getIncomingBatch(); +// Long materialId = stockListEntity.getMaterialId(); +// if(isChangeAt == 1){ +// if(!Objects.isNull(groundingAllocationId)){ +// if(StringUtil.isNotBlank(allocationId)){ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// R r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架"); +// if(r.getCode() == 200){ +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfStockList.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); +// } +// } +// } +// }else{ +// if(StringUtil.isNotBlank(trayCode)){ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); +//// String trayType = "100"; +//// if(!Objects.isNull(entityByTrayCode)){ +//// trayType = entityByTrayCode.getTrayType(); +//// } +// WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId); +// if(Objects.isNull(trayGoodsEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long trayGoodsId = trayGoodsEntity.getId(); +// R r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托"); +// if(r.getCode() == 200){ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(groundingAllocationId); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfStockList.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); +// } +// } +// } +// }else{ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(groundingAllocationId); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfStockList.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架"); +// } +// } +// } +// } +// }else { +// if(StringUtil.isNotBlank(newTrayCode)){ +// if(StringUtil.isNotBlank(allocationId)){ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// R r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架"); +// if(r.getCode() == 200){ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); +// String trayType = "100"; +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// //打托 +// trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// }else{ +// if(!nowStockNum.equals(0)){ +// trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// } +// } +// } +// }else{ +// if(StringUtil.isNotBlank(trayCode)){ +// BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode); +// if(Objects.isNull(trayEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在trayCode="+trayCode,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long oldTrayId = trayEntity.getId(); +// Long oldAllocationId = taryAllocationService.getAllocationIdByTrayId(oldTrayId); +// String trayType = "100"; +// R r = null; +// if(!Objects.isNull(oldAllocationId)){ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架"); +// }else{ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId); +// if(Objects.isNull(trayGoodsEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long trayGoodsId = trayGoodsEntity.getId(); +// r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托"); +// } +// if(r.getCode() == 200){ +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// //打托 +// trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// }else{ +// if(!nowStockNum.equals(0)){ +// trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// } +// } +// } +// }else{ +// BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode); +// if(Objects.isNull(trayEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long newTrayId = trayEntity.getId(); +// Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId); +// if(!Objects.isNull(newAllocationId)){ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(groundingAllocationId); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// updownTypeService.upShelfStockList(upShelfStockList,newAllocationId,warehouseId,"盘点无数据库存品上架"); +// }else{ +// if(!nowStockNum.equals(0)){ +// upShelfStockList.get(0).setEnterNum(nowStockNum); +// updownTypeService.upShelfStockList(upShelfStockList,newAllocationId,warehouseId,"盘点无数据库存品上架"); +// } +// } +// }else{ +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId); +// String trayType = "100"; +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// List zeroList = new ArrayList<>(); +// ZeroOrderVO zeroOrderVO = new ZeroOrderVO(); +// zeroOrderVO.setOrderId(orderId); +// zeroOrderVO.setOrderCode(orderCode); +// zeroOrderVO.setNum(stockNum); +// zeroList.add(zeroOrderVO); +// //查询目前在库件数 +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(Objects.isNull(nowStockNum)){ +// //打托 +// trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// }else{ +// if(!nowStockNum.equals(0)){ +// trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// } +// } +// } +// +// } +// } +// } +// } +// } +// +// if(isChange == 1 && isChangeAt == 0){ +// //暂不处理数量问题 +// if(StringUtil.isNotBlank(allocationId)){ +// List upShelfStockList = new ArrayList<>(); +// UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); +// upShelfStockDTO.setMarketId(marketId); +// upShelfStockDTO.setMaterialCode(cargoNumber); +// upShelfStockDTO.setAllocationId(Long.parseLong(allocationId)); +// upShelfStockDTO.setEnterNum(stockNum); +// upShelfStockDTO.setIncomingBatch(incomingBatch); +// upShelfStockList.add(upShelfStockDTO); +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// if(!Objects.isNull(nowStockNum) && stockNum-nowStockNum != 0){ +// upShelfStockList.get(0).setEnterNum(stockNum-nowStockNum); +// updownTypeService.downStock(upShelfStockList,warehouseId,"盘点无数据库存品下架"); +// } +// }else{ +// if (StringUtil.isNotBlank(trayCode)){ +// String trayType = "100"; +// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId); +// if(!Objects.isNull(entityByTrayCode)){ +// trayType = entityByTrayCode.getTrayType(); +// } +// WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId); +// if(Objects.isNull(trayGoodsEntity)){ +// syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId)); +// continue; +// } +// Long trayGoodsId = trayGoodsEntity.getId(); +// R r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托"); +// if(r.getCode() == 200){ +// Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child"); +// trayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,cargoNumber,marketId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托"); +// } +// } +// } +// } }else { syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,数据类型错误questTarget="+questTarget,tenantId,userId,nickName,deptId));