From 596e420b091afbc7aea421636bae4f270e579c5e Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Tue, 1 Apr 2025 17:48:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add:=E4=BF=AE=E5=A4=8D=E5=95=86=E5=AE=B6?= =?UTF-8?q?=E7=AB=AF=E6=9A=82=E5=AD=98=E4=BD=86=E5=85=A5=E5=BA=93=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../suofeiya/job/SpiderDataJob.java | 1 + .../impl/TrunklineAdvanceServiceImpl.java | 29 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/SpiderDataJob.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/SpiderDataJob.java index 966ba7c03..eb649d33f 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/SpiderDataJob.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/SpiderDataJob.java @@ -194,6 +194,7 @@ public class SpiderDataJob { packageInfoEntity.setUpdateTime(new Date()); packageInfoEntity.setIsDeleted(0); packageInfoEntity.setStatus(1); + packageInfoEntity.setDealerName(spiderInforEntity.getBindBussiness()); // 判断这个包条是否存在鱼数据库 如果不存在 则执行 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java index 028f13378..84a0e6acb 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java @@ -39,8 +39,11 @@ import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; +import org.springblade.system.entity.Tenant; +import org.springblade.system.feign.ISysClient; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -65,6 +68,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl advanceDetailEntities, Long warehouseId) { - BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); + + + Integer isTransfer; + + R tenant = sysClient.getTenant(AuthUtil.getTenantId()); + if(tenant.isSuccess()){ + Tenant data = tenant.getData(); + if(new Integer(2).equals(data.getTenantType())){ + isTransfer=0; + } else { + isTransfer = 1; + } + } else { + isTransfer = 1; + } + + + BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); if (Objects.isNull(warehouseEntity)) { log.warn("############saveOrderAndPackages: 仓库信息不存在warehouseId={}", warehouseId); throw new CustomerException(405, "仓库信息不存在"); @@ -1010,7 +1031,11 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl Date: Tue, 1 Apr 2025 17:49:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=89=A9=E6=96=99=E4=BD=93=E7=A7=AF=E9=87=8D?= =?UTF-8?q?=E9=87=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OpenOrderServiceImpl.java | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 126bd274a..ddc003d52 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -1821,6 +1821,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService { dto.setOrderCode(dto.getOrderCode().trim()); dto.setOrderPackageCode(dto.getOrderPackageCode().trim()); }); + + List materialEntities = basicMaterialClient.findAllList(); + //把materialEntities转化成以productCode和productName拼接为key的Map + Map materialEntityMap = materialEntities.stream().collect(Collectors.toMap(item -> item.getProductCode() + "&&" + item.getName(), item -> item)); + + //排除pacakgeDetailExcelDTOS中的orderPackageCode为空的元素 pacakgeDetailExcelDTOS = pacakgeDetailExcelDTOS.stream().filter(item -> StringUtil.isNotBlank(item.getOrderPackageCode())).collect(Collectors.toList()); //把importStandardOuPaiDTOS中orderPackageCode相同的元素去重 @@ -2077,16 +2083,37 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceDetailModel.setQuantity(1); advanceDetailModel.setServiceNum(pacakgeDetailExcelDTO.getServiceNum()); advanceDetailModel.setPackageStatus("0"); + + String materialName = pacakgeDetailExcelDTO.getMaterialName(); + String materialCode = pacakgeDetailExcelDTO.getMaterialCode(); + advanceDetailModel.setMaterialName(materialName); + advanceDetailModel.setMaterialCode(materialCode); + if (!Objects.isNull(pacakgeDetailExcelDTO.getVolume())) { advanceDetailModel.setVolume(new BigDecimal(pacakgeDetailExcelDTO.getVolume())); } else { advanceDetailModel.setVolume(BigDecimal.ZERO); + + BasicMaterialEntity basicMaterialEntity = materialEntityMap.get(materialCode + "&&" + materialName); + + if (!Objects.isNull(basicMaterialEntity)) { + advanceDetailModel.setMaterialId(basicMaterialEntity.getId()); + + String weight = basicMaterialEntity.getWeight(); + if (StringUtil.isBlank(weight)) { + weight = "0"; + } + String volume2 = basicMaterialEntity.getVolume(); + if (StringUtil.isBlank(volume2)) { + volume2 = "0"; + } + advanceDetailModel.setWeight(new BigDecimal(weight)); + advanceDetailModel.setVolume(new BigDecimal(volume2)); + } + } - String materialName = pacakgeDetailExcelDTO.getMaterialName(); - String materialCode = pacakgeDetailExcelDTO.getMaterialCode(); - advanceDetailModel.setMaterialName(materialName); - advanceDetailModel.setMaterialCode(materialCode); + // if (StringUtil.isNotBlank(materialCode) && StringUtil.isNotBlank(materialName)) {