From 5e25010f64e5b26d864de4f0a6796a33cae9bf34 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Mon, 14 Oct 2024 11:27:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E4=BC=98=E5=8C=96=E9=85=8D?= =?UTF-8?q?=E9=80=81=E6=98=8E=E7=BB=86=E6=8A=A5=E8=A1=A8=E6=B6=88=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 删除一些不必要的逻辑,提高消费效率 --- .../report/QualityDeliverListener.java | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java index 5bc356999..6f89edced 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java @@ -7,7 +7,6 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataFactoryCategoryClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; @@ -20,7 +19,6 @@ import com.logpm.distribution.service.IDistributionParcelListService; import com.logpm.distribution.service.IDistributionStockArticleService; import com.logpm.distribution.service.IDistributionStockListService; import com.logpm.distribution.service.IQualityDeliverService; -import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient; import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWaybillEntity; @@ -194,11 +192,13 @@ public class QualityDeliverListener { private void saveOrUpdate(LambdaQueryWrapper wrapper, QualityDeliverEntity qualityDeliverEntity) { QualityDeliverEntity entity = null; if (ObjectUtil.isNotEmpty(wrapper)) { + wrapper.select(QualityDeliverEntity::getId); entity = qualityDeliverService.getOne(wrapper); } if (ObjectUtil.isNotEmpty(entity)) { // 修改 - qualityDeliverService.update(qualityDeliverEntity, wrapper); + qualityDeliverEntity.setId(entity.getId()); + qualityDeliverService.updateById(qualityDeliverEntity); } else { // 新增 // 初始化基础数据 @@ -262,24 +262,24 @@ public class QualityDeliverListener { qualityDeliverEntity.setEndWarehouseInTime(stockList.getWarehousingTime()); } // 品类 - if (StrUtil.isNotEmpty(materielName) && StrUtil.isNotEmpty(brandName)) { - BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity(); - factoryCategoryEntity.setMaterielName(materielName); - factoryCategoryEntity.setBrand(brandName); - factoryCategoryEntity.setType(2); - BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity); - factoryCategoryEntity.setType(1); - BasicdataFactoryCategoryEntity categoryEntity1 = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity); - if (ObjectUtil.isNotEmpty(categoryEntity)) { - qualityDeliverEntity.setCostCategoryId(categoryEntity.getCategoryId()); - qualityDeliverEntity.setCostCategory(categoryEntity.getCategory()); - } - if (ObjectUtil.isNotEmpty(categoryEntity1)) { - qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory()); - qualityDeliverEntity.setRevenueCategoryId(categoryEntity1.getCategoryId()); - } + // if (StrUtil.isNotEmpty(materielName) && StrUtil.isNotEmpty(brandName)) { + // BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity(); + // factoryCategoryEntity.setMaterielName(materielName); + // factoryCategoryEntity.setBrand(brandName); + // factoryCategoryEntity.setType(2); + // BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity); + // factoryCategoryEntity.setType(1); + // BasicdataFactoryCategoryEntity categoryEntity1 = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity); + // if (ObjectUtil.isNotEmpty(categoryEntity)) { + // qualityDeliverEntity.setCostCategoryId(categoryEntity.getCategoryId()); + // qualityDeliverEntity.setCostCategory(categoryEntity.getCategory()); + // } + // if (ObjectUtil.isNotEmpty(categoryEntity1)) { + // qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory()); + // qualityDeliverEntity.setRevenueCategoryId(categoryEntity1.getCategoryId()); + // } // TODO 从入库单上查询入库时间 - } + // } } } @@ -322,13 +322,13 @@ public class QualityDeliverListener { buildWaybillInfo(qualityDeliverEntity, waybillNumber); } // 暂存单查询结算品类 - TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode()); - if (ObjectUtil.isNotEmpty(advanceDetailEntity)) { - qualityDeliverEntity.setCostCategoryId(advanceDetailEntity.getCostCategoryId()); - qualityDeliverEntity.setCostCategory(advanceDetailEntity.getCostCategoryName()); - qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId()); - qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName()); - } + // TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode()); + // if (ObjectUtil.isNotEmpty(advanceDetailEntity)) { + // qualityDeliverEntity.setCostCategoryId(advanceDetailEntity.getCostCategoryId()); + // qualityDeliverEntity.setCostCategory(advanceDetailEntity.getCostCategoryName()); + // qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId()); + // qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName()); + // } // 构建订单相关信息 buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode()); }