From 358949394a9ce1c3333b577eab031be30649d757 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 9 Oct 2023 18:43:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=AC=A7=E6=B4=BE=E4=BF=9D=E5=AD=98=E5=8C=85?= =?UTF-8?q?=E4=BB=B6=E5=88=B0=E6=96=B0=E7=B3=BB=E7=BB=9F=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E5=8C=85=E4=BB=B6=E6=95=B0=E6=8D=AEbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PanFactoryDataServiceImpl.java | 93 ++++++++++--------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index eb346be5b..4e2348f23 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -37,7 +37,6 @@ import com.logpm.factory.snm.entity.PanPackageInfo; import com.logpm.factory.snm.entity.PanPackageList; import com.logpm.oldproject.entity.AdvanceDetailEntity; import com.logpm.oldproject.entity.AdvanceEntity; -import com.logpm.oldproject.entity.OrderDetailEntity; import com.logpm.oldproject.entity.WayBillEntity; import com.logpm.oldproject.feign.*; import com.logpm.oldproject.vo.DistributionParcelListEntityVO; @@ -574,59 +573,63 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNo(unitNo); // WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo); - DistributionParcelListEntity entity = new DistributionParcelListEntity(); - BeanUtil.copyProperties(vo, entity); - entity.setOrderPackageCode(vo.getPacketBarCode()); - entity.setConditions(1); - entity.setWarehouse(distributionStockArticleEntity.getWarehouse()); - entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId()); - entity.setStockArticleId(distributionStockArticleEntity.getId()); - entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue()); - entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue()); - entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); - entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue()); - entity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.daibeihuo.getValue()); - entity.setOrderCode(distributionStockArticleEntity.getOrderCode()); - entity.setServiceNumber(distributionStockArticleEntity.getServiceNumber()); - entity.setWaybillNumber(waybillNo); + if(Objects.isNull(vo)){ + logger.warn("##############saveOrderPackage: 未在老系统查询到包件数据 unitNo={}",unitNo); + }else{ + DistributionParcelListEntity entity = new DistributionParcelListEntity(); + BeanUtil.copyProperties(vo, entity); + entity.setOrderPackageCode(vo.getPacketBarCode()); + entity.setConditions(1); + entity.setWarehouse(distributionStockArticleEntity.getWarehouse()); + entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId()); + entity.setStockArticleId(distributionStockArticleEntity.getId()); + entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue()); + entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue()); + entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); + entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue()); + entity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.daibeihuo.getValue()); + entity.setOrderCode(distributionStockArticleEntity.getOrderCode()); + entity.setServiceNumber(distributionStockArticleEntity.getServiceNumber()); + entity.setWaybillNumber(waybillNo); // if(ObjectUtil.isNotEmpty(warehouseWaybill)){ // entity.setWarehouseId(warehouseWaybill.getId()); // } - // 增加 进销商 名称 编码 发站仓 + // 增加 进销商 名称 编码 发站仓 - entity.setSendWarehouseName(distributionStockArticleEntity.getSendWarehouseName()); - entity.setSendWarehouseId(distributionStockArticleEntity.getSendWarehouseId()); + entity.setSendWarehouseName(distributionStockArticleEntity.getSendWarehouseName()); + entity.setSendWarehouseId(distributionStockArticleEntity.getSendWarehouseId()); - //收货仓库 - entity.setAcceptWarehouseName(distributionStockArticleEntity.getAcceptWarehouseName()); - entity.setAcceptWarehouseId(distributionStockArticleEntity.getAcceptWarehouseId()); + //收货仓库 + entity.setAcceptWarehouseName(distributionStockArticleEntity.getAcceptWarehouseName()); + entity.setAcceptWarehouseId(distributionStockArticleEntity.getAcceptWarehouseId()); - //进销售 - entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); - entity.setDealerName(distributionStockArticleEntity.getDealerName()); - entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime)); + //进销售 + entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); + entity.setDealerName(distributionStockArticleEntity.getDealerName()); + entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime)); - // 绑定部门--仓库 - if (!Objects.isNull(basicdataWarehouseEntity)) { - entity.setCreateDept(basicdataWarehouseEntity.getDepartment()); - } - entity.setCreateUser(1123598821738675201L); - entity.setTenantId(TenantNum.HUITONGCODE); - if (StringUtil.isNoneBlank(entity.getMaterialName()) && StringUtil.isNoneBlank(entity.getMaterialCode())) { - // 查询物料信息 - String sku = ""; - BasicMaterialEntity basicMaterialEntity = basicMaterialClient.getMaterialOwn(entity.getMaterialCode(), entity.getMaterialName(), sku); - if (ObjectUtils.isNotNull(basicMaterialEntity)) { - entity.setMaterialId(basicMaterialEntity.getId()); - entity.setMaterialCode(basicMaterialEntity.getProductCode()); - entity.setMaterialUnit(basicMaterialEntity.getLogpmUnit()); + // 绑定部门--仓库 + if (!Objects.isNull(basicdataWarehouseEntity)) { + entity.setCreateDept(basicdataWarehouseEntity.getDepartment()); + } + entity.setCreateUser(1123598821738675201L); + entity.setTenantId(TenantNum.HUITONGCODE); + if (StringUtil.isNoneBlank(entity.getMaterialName()) && StringUtil.isNoneBlank(entity.getMaterialCode())) { + // 查询物料信息 + String sku = ""; + BasicMaterialEntity basicMaterialEntity = basicMaterialClient.getMaterialOwn(entity.getMaterialCode(), entity.getMaterialName(), sku); + if (ObjectUtils.isNotNull(basicMaterialEntity)) { + entity.setMaterialId(basicMaterialEntity.getId()); + entity.setMaterialCode(basicMaterialEntity.getProductCode()); + entity.setMaterialUnit(basicMaterialEntity.getLogpmUnit()); + } + } + boolean b = distributionParcelListClient.add(entity); + if (!b) { + logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); + throw new CustomerException(405, "保存包件信息失败"); } - } - boolean b = distributionParcelListClient.add(entity); - if (!b) { - logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); - throw new CustomerException(405, "保存包件信息失败"); } }