From 1a70c5dedfaf7a79071f6fafa508239b16021422 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 17 Oct 2024 23:56:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=B5=8B?= =?UTF-8?q?=E8=AF=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factorydata/util/FactoryDataUtil.java | 1 + .../BasicdataDriverArteryController.java | 25 ++++++++++++------- .../mapper/TrunklineCarsLoadMapper.xml | 4 +-- .../impl/TrunklineCarsLoadServiceImpl.java | 12 ++++++--- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/util/FactoryDataUtil.java b/blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/util/FactoryDataUtil.java index cff09564f..526e31648 100644 --- a/blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/util/FactoryDataUtil.java +++ b/blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/util/FactoryDataUtil.java @@ -29,6 +29,7 @@ public class FactoryDataUtil { factorys.put(BrandEnums.MTMM.getValue(), FactoryDataConstants.Mq.RoutingKeys.MENGTIAN_NODE_DATA_PUSH); factorys.put(BrandEnums.MHJ.getValue(), FactoryDataConstants.Mq.RoutingKeys.MWH_NODE_DATA_PUSH); // 皮阿诺 + factorys.put(BrandEnums.PAN.getValue(), FactoryDataConstants.Mq.RoutingKeys.PIANO_NODE_DATA_PUSH); // 欧派 factorys.put(BrandEnums.OP.getValue(), FactoryDataConstants.Mq.RoutingKeys.OPPEIN_NODE_DATA_PUSH); // 金牌 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java index e807b80ea..711134592 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java @@ -37,6 +37,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.log.exception.ServiceException; @@ -198,15 +199,7 @@ public class BasicdataDriverArteryController extends BladeController { boolean save = basicdataDriverArteryService.save(basicdataDriverArtery); if (save) { - Long driverId = basicdataDriverArtery.getId(); - List warehouseIds = basicdataDriverArtery.getWarehouseIds(); - List driverWarehouseList = new ArrayList<>(); - for (Long warehouseId : warehouseIds) { - BasicdataDriverWarehouseEntity basicdataDriverWarehouseEntity = new BasicdataDriverWarehouseEntity(); - basicdataDriverWarehouseEntity.setWarehouseId(warehouseId); - basicdataDriverWarehouseEntity.setDriverId(driverId); - driverWarehouseList.add(basicdataDriverWarehouseEntity); - } + List driverWarehouseList = getBasicdataDriverWarehouseEntities(basicdataDriverArtery); basicdataDriverWarehouseService.saveBatch(driverWarehouseList); } @@ -217,6 +210,20 @@ public class BasicdataDriverArteryController extends BladeController { return R.status(save); } + @NotNull + private static List getBasicdataDriverWarehouseEntities(BasicdataDriverArteryDTO basicdataDriverArtery) { + Long driverId = basicdataDriverArtery.getId(); + List warehouseIds = basicdataDriverArtery.getWarehouseIds(); + List driverWarehouseList = new ArrayList<>(); + for (Long warehouseId : warehouseIds) { + BasicdataDriverWarehouseEntity basicdataDriverWarehouseEntity = new BasicdataDriverWarehouseEntity(); + basicdataDriverWarehouseEntity.setWarehouseId(warehouseId); + basicdataDriverWarehouseEntity.setDriverId(driverId); + driverWarehouseList.add(basicdataDriverWarehouseEntity); + } + return driverWarehouseList; + } + /** * 司机信息表 修改 */ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index f1a455164..7b80290d1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml @@ -693,13 +693,11 @@ select dpl.brand_name brand,dpl.order_code,dpl.waybill_number, dpl.send_warehouse_id startWarehouseId,dpl.send_warehouse_name startWarehouseName, dpl.accept_warehouse_id endWarehouseId,dpl.accept_warehouse_name endWarehouseName, - group_concat(dpl.order_package_code) packageCode + dpl.order_package_code packageCode from logpm_trunkline_cars_load_scan t left join logpm_distribution_parcel_list dpl on dpl.order_package_code = t.scan_code and dpl.warehouse_id = #{warehouseId} where t.load_id = #{loadId} and dpl.id is not null - group by dpl.brand_name,dpl.send_warehouse_id,dpl.send_warehouse_name , - dpl.accept_warehouse_id ,dpl.accept_warehouse_name ,dpl.order_code,dpl.waybill_number diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 9be5baed2..9ee43206d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -472,8 +472,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl> brandMap = brands.stream().collect(Collectors.groupingBy(LoadScanBrandDTO::getBrand)); + for (Map.Entry> entry : brandMap.entrySet()) { + List value = entry.getValue(); + LoadScanBrandDTO brand = value.get(0); + String packageCode = value.stream().map(LoadScanBrandDTO::getPackageCode).collect(Collectors.joining(",")); if (StrUtil.isEmpty(packageCode)) { continue; } @@ -505,7 +509,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl{ - return PushData.builder() + return PushData.builder() .packageCode(data) .warehouseName(warehouseEntity.getName()) .orderCode(brand.getOrderCode()) @@ -4945,7 +4949,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl list = trunklineCarsLoadScanService.findNoFinalNodeData(loadId, warehouseId); - if (Objects.isNull(list) || list.size() == 0) { + if (Objects.isNull(list) || list.isEmpty()) { return R.success("未有需要添加目的仓的数据"); } else { return R.data(list);