From d137f8ca440f19f1979beeaa2f693907826d38c0 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 6 May 2024 18:58:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=80=81=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/SignPushDataContactDTO.java | 14 ++++++++ .../logpm/oldproject/dto/SignPushDataDTO.java | 5 +++ .../DistributionDeliveryListController.java | 4 --- .../feign/DistributionSignforClient.java | 32 ++++++++++++++++- .../mapper/DistributionDeliveryListMapper.xml | 11 +++++- .../mapper/DistributionReservationMapper.xml | 4 ++- .../mapper/DistributionSignforMapper.xml | 8 ++--- .../mapper/DistrilbutionBillLadingMapper.xml | 5 +-- .../ClerkCheckPushBillDataQueueHandler.java | 35 ++++++++++++++++++- .../ClerkCheckPushDataQueueHandler.java | 33 +++++++++++++++++ .../DistributionDeliveryListServiceImpl.java | 12 ++++++- 11 files changed, 148 insertions(+), 15 deletions(-) diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataContactDTO.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataContactDTO.java index 88d03b7ef..05af57c97 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataContactDTO.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataContactDTO.java @@ -28,6 +28,20 @@ public class SignPushDataContactDTO { * 配送id */ private Long distributionId; + /** + * 签收人ID + */ + private Long signUserId; + + /** + * 签收人名称 + */ + private String signUserName; + + /** + * 签收人名称 + */ + private String signUserPhone; /** * 计划装车数 */ diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataDTO.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataDTO.java index 8d3274728..2f41008d2 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataDTO.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataDTO.java @@ -125,6 +125,11 @@ public class SignPushDataDTO { */ private String kind; + /** + * 操作人 + */ + private String deliveryType; + /** * 复核时间 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 8a31df23e..863f0fbb9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -315,10 +315,6 @@ public class DistributionDeliveryListController extends BladeController { @ApiOperationSupport(order = 9) @ApiOperation(value = "导出数据", notes = "传入distributionDeliveryList") public R exportDistributionDeliveryList(@ApiIgnore @RequestParam Map distributionDeliveryList, BladeUser bladeUser, HttpServletResponse response) { - BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ - return R.fail(403,"未授权仓库!!!"); - } List list = distributionDeliveryListService.exportDistributionDeliveryList(distributionDeliveryList); ExcelUtil.export(response, "配送管理数据" + DateUtil.time(), "配送管理数据表", list, DistributionDeliveryListExcel.class); return R.status(true); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java index f60ef670f..5f949c6c6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java @@ -232,7 +232,7 @@ public class DistributionSignforClient implements IDistributionSignforClient { signPushDataContactDTO.setContact(distributionSignforEntity.getClerkSignRemarks()); } } - + buildReservationNameAndPhone(customer); //完成客户信息添加 delivery.setSignPushDataContactDTOs(customer); } @@ -277,4 +277,34 @@ public class DistributionSignforClient implements IDistributionSignforClient { } } + + + + private void buildReservationNameAndPhone(List customers) { + for (SignPushDataContactDTO signPushDataUnitDTO : customers) { + User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId()); + log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user); + if (user == null) { + R userT = userClient.userInfoById(signPushDataUnitDTO.getSignUserId()); + if (userT.isSuccess()) { + user = userT.getData(); + bladeRedis.setEx(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId(), user, 3600L); + } + } + if (ObjectUtils.isNotNull(user)) { + assert user != null; + signPushDataUnitDTO.setSignUserName(user.getName()); + if (ObjectUtils.isNotEmpty(user.getPhone())){ + signPushDataUnitDTO.setSignUserPhone(user.getPhone()); + }else { + if (ObjectUtils.isNotEmpty(user.getAccount())){ + signPushDataUnitDTO.setSignUserPhone(user.getAccount()); + }else { + log.info("用户无电话号码且账号信息为空>>用户名称:{}",user.getName()); + } + } + } + + } + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 1e32d1365..4918a1739 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -408,6 +408,15 @@ AND lddl.delivery_status =#{params.deliveryStatus} + + AND lddl.warehouse_id =#{params.warehouseId} + + + AND lddl.warehouse_id IN + + #{warehouseId} + + GROUP BY lddl.id @@ -1906,7 +1915,7 @@ lddl.warehouse_id AS warehouseId, lddl.warehouse_name AS warehouseName, lds.signing_time AS reviewTime, - CASE lddl.type + CASE lddl.type, WHEN 1 THEN 2 WHEN 2 THEN 1 END type, diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 5c9cb09c3..d328268e0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -1368,7 +1368,9 @@ (lds.received_quantity + lds.receivedin_quantity) AS sign, lds.signing_status AS state, lds.create_time AS createTime, - lds.update_time AS updateTime + lds.update_time AS updateTime, + lds.signee_id AS signUserId, + lds.signee_name AS signUserName FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id AND ldr.is_deleted = 0 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 814753913..77aca1984 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -1175,7 +1175,7 @@ lddl.train_number AS transNo, ldpl.waybill_number AS waybillNo, ldpl.order_code AS orderSelfNum, - ldpl.order_package_code AS unitNo, + IFNULL(ldpl.order_package_code ,'')AS unitNo, ldpl.quantity AS num, ldl.signfor_state AS type, ldl.scan_time AS operateTime, @@ -1206,7 +1206,7 @@ lddl.train_number AS transNo, ldpl.waybill_number AS waybillNo, ldpl.order_code AS orderSelfNum, - ldpl.order_package_code AS unitNo, + IFNULL(ldpl.order_package_code ,'')AS unitNo, ldpl.quantity AS num, ldl.signfor_state AS type, ldl.signing_time AS operateTime, @@ -1238,7 +1238,7 @@ lddl.train_number AS trans_no, ldsl.incoming_batch AS waybill_no, ldsl.incoming_batch AS orderSelfNum, - ldsld.stock_package_code AS unitNo, + IFNULL(ldpl.order_package_code ,'')AS unitNo, ldl.signfor_state AS type, ldl.create_time AS operateTime, ldl.create_user AS administratorsId, @@ -1273,7 +1273,7 @@ lddl.train_number AS trans_no, ldsl.incoming_batch AS waybill_no, lddl.order_code AS orderSelfNum, - ldsld.stock_package_code AS unitNo, + IFNULL(ldpl.order_package_code ,'')AS unitNo, ldl.signfor_state AS type, ldl.signing_time AS operateTime, ldl.signing_user_id AS administratorsId, diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 1515885d2..dbf42eb3a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -621,6 +621,7 @@ lww.warehouse_address AS address, 1 AS state, ldbl.create_time AS createTime, + ldbl.update_user AS signUserId, ldbl.update_time AS updateTime, ldbl.remark AS content, ldbl.consignee AS contact, @@ -649,7 +650,7 @@ IFNULL(SUM(ldbls.quantity),0) AS actual_plan, IFNULL(SUM(ldbls.quantity),0) AS delivery, IFNULL(SUM(ldbls.quantity),0) AS sign, - (SELECT GROUP_CONCAT(site) FROM logpm_distribution_print WHERE bill_lading_id = ldbl.id GROUP BY bill_lading_id) + (SELECT GROUP_CONCAT(site) FROM logpm_distribution_print WHERE bill_lading_id = ldbl.id GROUP BY bill_lading_id), FROM logpm_distrilbution_bill_lading AS ldbl LEFT JOIN logpm_distribution_bill_lading_scan AS ldbls ON ldbls.bill_lading_id = ldbl.id AND ldbls.is_deleted = 0 @@ -666,7 +667,7 @@ ldbl.pickup_batch AS transNo, ldsa.waybill_number AS waybillNo, ldsa.order_code AS orderSelfNum, - ldbls.packet_bar_code AS unitNo, + IFNULL(ldbls.packet_bar_code,'') AS unitNo, 2 AS type, 1 AS isLoading, 1 AS is_out, diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushBillDataQueueHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushBillDataQueueHandler.java index a805e91b8..3b0bce9f9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushBillDataQueueHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushBillDataQueueHandler.java @@ -149,7 +149,7 @@ public class ClerkCheckPushBillDataQueueHandler { buildNameAndPhone(pushOldPackageSigning); signPushDataUnitDTOS.addAll(pushOldPackageSigning); } - + buildClientNameAndPhone(customer); //完成客户信息添加 delivery.setSignPushDataContactDTOs(customer); } @@ -196,4 +196,37 @@ public class ClerkCheckPushBillDataQueueHandler { } } + + /** + * 构建名称和电话号码 + * + * @param customer + */ + private void buildClientNameAndPhone(List customer) { + for (SignPushDataContactDTO signPushDataUnitDTO : customer) { + User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId()); + log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user); + if (user == null) { + R userT = userClient.userInfoById(signPushDataUnitDTO.getSignUserId()); + if (userT.isSuccess()) { + user = userT.getData(); + bladeRedis.setEx(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId(), user, 3600L); + } + } + if (ObjectUtils.isNotNull(user)) { + assert user != null; + signPushDataUnitDTO.setSignUserName(user.getName()); + if (ObjectUtils.isNotEmpty(user.getPhone())){ + signPushDataUnitDTO.setSignUserPhone(user.getPhone()); + }else { + if (ObjectUtils.isNotEmpty(user.getAccount())){ + signPushDataUnitDTO.setSignUserPhone(user.getAccount()); + }else { + log.info("用户无电话号码且账号信息为空>>用户名称:{}",user.getName()); + } + } + } + + } + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java index 397152461..5a80af890 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java @@ -215,7 +215,9 @@ public class ClerkCheckPushDataQueueHandler { } //完成客户信息添加 + buildReservationNameAndPhone(customer); delivery.setSignPushDataContactDTOs(customer); + } } @@ -259,6 +261,37 @@ public class ClerkCheckPushDataQueueHandler { } } + } + } /** + * 构建名称和电话号码 + * + * @param customers + */ + private void buildReservationNameAndPhone(List customers) { + for (SignPushDataContactDTO signPushDataUnitDTO : customers) { + User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId()); + log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user); + if (user == null) { + R userT = userClient.userInfoById(signPushDataUnitDTO.getSignUserId()); + if (userT.isSuccess()) { + user = userT.getData(); + bladeRedis.setEx(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId(), user, 3600L); + } + } + if (ObjectUtils.isNotNull(user)) { + assert user != null; + signPushDataUnitDTO.setSignUserName(user.getName()); + if (ObjectUtils.isNotEmpty(user.getPhone())){ + signPushDataUnitDTO.setSignUserPhone(user.getPhone()); + }else { + if (ObjectUtils.isNotEmpty(user.getAccount())){ + signPushDataUnitDTO.setSignUserPhone(user.getAccount()); + }else { + log.info("用户无电话号码且账号信息为空>>用户名称:{}",user.getName()); + } + } + } + } } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 74bc20fd7..7038e1b2b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -266,7 +266,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl deliveryId = Func.toLongList((String) distributionDeliveryList.get("ids")); distributionDeliveryList.put("ids",deliveryId); } - + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if (Func.isEmpty(myCurrentWarehouse)){ + //未选择仓库查看当前登录人可以进行操作的仓库 + List warehouseList = warehouseClient.getMyWarehouseList(); + if (!warehouseList.isEmpty()){ + List ids = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + distributionDeliveryList.put("warehouseIds",ids); + } + }else { + distributionDeliveryList.put("warehouseId",myCurrentWarehouse.getId()); + } List list = new ArrayList<>(); From 03240aef4efc906020d7ef17cc42225dbfe31935 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 7 May 2024 10:46:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E6=9F=A5=E8=AF=A2bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml index 15d3b59a0..80ac88d1f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml @@ -36,6 +36,7 @@ left join logpm_warehouse_waybill lww on lww.id = ltwt.waybill_id where 1=1 + and ltwt.warehouse_id in #{item}