From 4d49e44637c79808ba3dd93c9858bb6c338a2812 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 8 Apr 2024 15:47:38 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=A0=81=E6=9D=BF=E6=89=93=E6=89=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InComingServiceImpl.java | 85 ++++++++++++------- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index 7f14bd922..0ce05c922 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -61,46 +61,65 @@ public class InComingServiceImpl implements IInComingService { String packageStatus = advanceDetailEntity.getPackageStatus(); Long advanceId = advanceDetailEntity.getAdvanceId(); if("1".equals(packageStatus)){ - log.warn("############incomingPackage: 包件已入库 packageCode={} warehouseId={}",packageCode,warehouseId); - return Resp.scanFail(405,"包件已入库","包件已入库"); - } + if(incomingType != 1){ + log.warn("############incomingPackage: 包件已入库 packageCode={} warehouseId={}",packageCode,warehouseId); + return Resp.scanFail(405,"包件已入库","包件已入库"); + }else{ + if(!Objects.isNull(billladingId)){ + //先判断该包件是否已经有提货记录了 + TrunklineBillladingPackageEntity billladingPackageEntity = billladingPackageServicie.findBillladingPackage(packageCode); + if(Objects.isNull(billladingPackageEntity)){ + billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType); + } + } - if(StringUtil.isBlank(warehouseName)){ - BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId); - if(!Objects.isNull(warehouseEntity)){ - warehouseName = warehouseEntity.getName(); + //4.如果有托盘码 + if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){ + Map map = new HashMap<>(); + map.put("trayType",trayType); + map.put("trayCode",trayCode); + map.put("warehouseId",warehouseId); + map.put("orderPackageCode",packageCode); + warehouseTrayTypeClient.orderScanOrderPackageCode(map); + } } - } - - //1.修改暂存单包件入库状态 - advanceDetailService.updatePackageStatusById("1",advanceDetailId,warehouseId,warehouseName); - List incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId); - advanceService.updateIncomingWarehouseName(String.join(",",incomingWarehouseNames),advanceId); - - //2.判断包件和订单是否已经存入在库订单 - boolean b = advanceService.saveOrderAndPackage(advanceDetailEntity, warehouseId); - - if(b){ - //3.根据是否有提货单id绑定提货单 - if(!Objects.isNull(billladingId)){ - //先判断该包件是否已经有提货记录了 - TrunklineBillladingPackageEntity billladingPackageEntity = billladingPackageServicie.findBillladingPackage(packageCode); - if(Objects.isNull(billladingPackageEntity)){ - billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType); + }else{ + if(StringUtil.isBlank(warehouseName)){ + BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId); + if(!Objects.isNull(warehouseEntity)){ + warehouseName = warehouseEntity.getName(); } } - //4.如果有托盘码 - if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){ - Map map = new HashMap<>(); - map.put("trayType",trayType); - map.put("trayCode",trayCode); - map.put("warehouseId",warehouseId); - map.put("orderPackageCode",packageCode); - warehouseTrayTypeClient.orderScanOrderPackageCode(map); + //1.修改暂存单包件入库状态 + advanceDetailService.updatePackageStatusById("1",advanceDetailId,warehouseId,warehouseName); + List incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId); + advanceService.updateIncomingWarehouseName(String.join(",",incomingWarehouseNames),advanceId); + + //2.判断包件和订单是否已经存入在库订单 + boolean b = advanceService.saveOrderAndPackage(advanceDetailEntity, warehouseId); + + if(b){ + //3.根据是否有提货单id绑定提货单 + if(!Objects.isNull(billladingId)){ + //先判断该包件是否已经有提货记录了 + TrunklineBillladingPackageEntity billladingPackageEntity = billladingPackageServicie.findBillladingPackage(packageCode); + if(Objects.isNull(billladingPackageEntity)){ + billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType); + } + } + + //4.如果有托盘码 + if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){ + Map map = new HashMap<>(); + map.put("trayType",trayType); + map.put("trayCode",trayCode); + map.put("warehouseId",warehouseId); + map.put("orderPackageCode",packageCode); + warehouseTrayTypeClient.orderScanOrderPackageCode(map); + } } } - } return R.success("入库成功"); }