Browse Source

fix:

1.修复推送老系统的签收数据 增加 装车节点的作业人 和签收作业的作业人
2.增加配送司机多个情况下取主司机
master
pref_mail@163.com 12 months ago
parent
commit
6727b83847
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  2. 7
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataDTO.java
  3. 18
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataUnitDTO.java
  4. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  5. 46
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  6. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java

1
blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java

@ -19,6 +19,7 @@ public class RedisKeyConstant {
public static final String TASK_QUEST_CHILD_KEY ="cache:task-quest-child-key:"; public static final String TASK_QUEST_CHILD_KEY ="cache:task-quest-child-key:";
public static final String BASIC_DATA_WAREHOUSE_LIST_KEY ="cache:basic-data-warehouse-list:"; public static final String BASIC_DATA_WAREHOUSE_LIST_KEY ="cache:basic-data-warehouse-list:";
public static final String USER_NAME_PHONE_KEY ="cache:user:id:";

7
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataDTO.java

@ -106,7 +106,7 @@ public class SignPushDataDTO {
private Date createTime; private Date createTime;
/** /**
* 操作人 * 操作人ID
*/ */
private Long administratorsId; private Long administratorsId;
@ -115,6 +115,11 @@ public class SignPushDataDTO {
*/ */
private String administratorsName; private String administratorsName;
/**
* 操作人电话
*/
private String administratorsPhone;
/** /**
* 操作人 * 操作人
*/ */

18
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/dto/SignPushDataUnitDTO.java

@ -64,6 +64,10 @@ public class SignPushDataUnitDTO {
* 签收时间 * 签收时间
*/ */
private Date signTime; private Date signTime;
/**
*
*/
private Date operateTime;
/** /**
* 0未下架;1已下架 * 0未下架;1已下架
@ -99,9 +103,19 @@ public class SignPushDataUnitDTO {
private int signNum; private int signNum;
/** /**
* 创建人 * 扫描人ID
*/
private long administratorsId;
/**
* 扫描人电话
*/
private String administratorsPhone;
/**
* 扫描人名称
*/ */
private long administrators_id; private String administratorsName;
/** /**
* 标识状态1=标记[无用]2=pda回库3=pc回库4=pda签收, 5=pc签收 * 标识状态1=标记[无用]2=pda回库3=pc回库4=pda签收, 5=pc签收

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java

@ -264,7 +264,8 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @param deliveryId * @param deliveryId
* @return * @return
*/ */
List<SignPushDataUnitDTO> selectPushOldPackage(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId); List<SignPushDataUnitDTO> selectPushOldPackageLoading(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId);
List<SignPushDataUnitDTO> selectPushOldPackageSigning(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId);
/** /**
* 推送老系统库存品包件 * 推送老系统库存品包件

46
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -1167,7 +1167,7 @@
GROUP BY GROUP BY
ldr.id ldr.id
</select> </select>
<select id="selectPushOldPackage" resultType="com.logpm.oldproject.dto.SignPushDataUnitDTO"> <select id="selectPushOldPackageLoading" resultType="com.logpm.oldproject.dto.SignPushDataUnitDTO">
SELECT SELECT
ldpl.id AS id, ldpl.id AS id,
ldpl.warehouse_id AS warehouse_id, ldpl.warehouse_id AS warehouse_id,
@ -1178,8 +1178,8 @@
ldpl.order_package_code AS unitNo, ldpl.order_package_code AS unitNo,
ldpl.quantity AS num, ldpl.quantity AS num,
ldl.signfor_state AS type, ldl.signfor_state AS type,
ldl.scan_time AS loadingTime, ldl.scan_time AS operateTime,
ldl.signing_time AS signTime, ldl.created_user AS administratorsId,
IF IF
( ldl.id IS NOT NULL, 1, ldl.id ) AS is_loading, ( ldl.id IS NOT NULL, 1, ldl.id ) AS is_loading,
1 is_out, 1 is_out,
@ -1193,10 +1193,42 @@
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.package_id = ldpl.id INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.package_id = ldpl.id
AND ldpl.is_deleted = 0 AND ldpl.is_deleted = 0
WHERE WHERE
ldl.reservation_id = #{reservationId} ldl.reservation_id = #{reservationId}
AND ldl.delivery_id = #{deliveryId} AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != 1 AND ldl.scan_status != 1
AND ldl.is_deleted = 0 AND ldl.is_deleted = 0
</select>
<select id="selectPushOldPackageSigning" resultType="com.logpm.oldproject.dto.SignPushDataUnitDTO">
SELECT
ldpl.id AS id,
ldpl.warehouse_id AS warehouse_id,
lddl.id AS distributionId,
lddl.train_number AS transNo,
ldpl.waybill_number AS waybillNo,
ldpl.order_code AS orderSelfNum,
ldpl.order_package_code AS unitNo,
ldpl.quantity AS num,
ldl.signfor_state AS type,
ldl.signing_time AS operateTime,
ldl.signing_user_id AS administratorsId,
IF
( ldl.id IS NOT NULL, 1, ldl.id ) AS is_loading,
1 is_out,
ldpl.conditions AS goods_type,
ldl.received_quantity AS signNum,
5 AS broke_state
FROM
logpm_distribution_loadscan AS ldl
INNER JOIN logpm_distribution_delivery_list AS lddl ON lddl.id = ldl.delivery_id
AND lddl.is_deleted = 0
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.package_id = ldpl.id
AND ldpl.is_deleted = 0
WHERE
ldl.reservation_id = #{reservationId}
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != 1
AND ldl.is_deleted = 0
AND ldl.signfor_state = 2
</select> </select>
<select id="selectPushOldInventory" resultType="com.logpm.oldproject.dto.SignPushDataUnitDTO"> <select id="selectPushOldInventory" resultType="com.logpm.oldproject.dto.SignPushDataUnitDTO">
SELECT SELECT

53
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java

@ -17,7 +17,9 @@ import com.logpm.oldproject.feign.IWarehouseClient;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.stockup.StockAssignStatusConstant; import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
@ -70,6 +72,9 @@ public class ClerkCheckPushDataQueueHandler {
@Autowired @Autowired
private IWarehouseClient warehouseClient; private IWarehouseClient warehouseClient;
@Autowired
private BladeRedis bladeRedis;
@RabbitHandler @RabbitHandler
public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) { public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) {
@ -114,7 +119,7 @@ public class ClerkCheckPushDataQueueHandler {
WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName()); WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName());
if (ObjectUtils.isNotNull(warehouseEntity)) { if (ObjectUtils.isNotNull(warehouseEntity)) {
// 需要增加老系统的仓库ID // 需要增加老系统的仓库ID
delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId()+"")); delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId() + ""));
delivery.setWarehouseName(warehouseEntity.getTitle()); delivery.setWarehouseName(warehouseEntity.getTitle());
} }
@ -125,7 +130,7 @@ public class ClerkCheckPushDataQueueHandler {
//自主配送 //自主配送
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda() DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId()) .eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId())
.eq(DistributionDeliverySelfEntity::getIsMaster, delivery.getId()) .eq(DistributionDeliverySelfEntity::getIsMaster, 2)
); );
if (Func.isNotEmpty(distributionDeliverySelfEntity)) { if (Func.isNotEmpty(distributionDeliverySelfEntity)) {
delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId()));
@ -144,6 +149,7 @@ public class ClerkCheckPushDataQueueHandler {
if (Func.isNotEmpty(userR)) { if (Func.isNotEmpty(userR)) {
User user = userR.getData(); User user = userR.getData();
delivery.setAdministratorsName(user.getName()); delivery.setAdministratorsName(user.getName());
delivery.setAdministratorsPhone(user.getPhone());
} }
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId()); DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(distributionStockupEntity)) { if (Func.isNotEmpty(distributionStockupEntity)) {
@ -161,9 +167,16 @@ public class ClerkCheckPushDataQueueHandler {
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>(); List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
if (distributionReservationEntity.getReservationNum() > 0) { if (distributionReservationEntity.getReservationNum() > 0) {
//查询包件扫描签收 //查询包件扫描签收
List<SignPushDataUnitDTO> pushOldPackage = distributionSignforMapper.selectPushOldPackage(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); //查询包件扫描签收
if (Func.isNotEmpty(pushOldPackage)) { List<SignPushDataUnitDTO> pushOldPackageLoading = distributionSignforMapper.selectPushOldPackageLoading(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
signPushDataUnitDTOS.addAll(pushOldPackage); List<SignPushDataUnitDTO> pushOldPackageSigning = distributionSignforMapper.selectPushOldPackageSigning(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(pushOldPackageLoading)) {
buildNameAndPhone(pushOldPackageLoading);
signPushDataUnitDTOS.addAll(pushOldPackageLoading);
}
if (Func.isNotEmpty(pushOldPackageSigning)) {
buildNameAndPhone(pushOldPackageSigning);
signPushDataUnitDTOS.addAll(pushOldPackageSigning);
} }
} }
@ -177,15 +190,14 @@ public class ClerkCheckPushDataQueueHandler {
//查询签收图片 //查询签收图片
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId());
if (Func.isNotEmpty(signPushDataUnitDTOS)) { if (Func.isNotEmpty(signPushDataUnitDTOS)) {
SignPushDataContactDTO signPushDataContactDTO = customer.get(0); SignPushDataContactDTO signPushDataContactDTO = customer.get(0);
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS); signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS);
if (Func.isNotEmpty(distributionSignPrintVOS)){ if (Func.isNotEmpty(distributionSignPrintVOS)) {
String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(",")); String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(","));
signPushDataContactDTO.setImage(urls); signPushDataContactDTO.setImage(urls);
} }
if (Func.isNotEmpty(distributionSignforEntity.getClerkSignRemarks())){ if (Func.isNotEmpty(distributionSignforEntity.getClerkSignRemarks())) {
signPushDataContactDTO.setContact(distributionSignforEntity.getClerkSignRemarks()); signPushDataContactDTO.setContact(distributionSignforEntity.getClerkSignRemarks());
} }
} }
@ -198,10 +210,33 @@ public class ClerkCheckPushDataQueueHandler {
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
} catch (Exception e) { } catch (Exception e) {
log.error(">>>>> 推送老系统签收信息报错",e); log.error(">>>>> 推送老系统签收信息报错", e);
} }
} }
/**
* 构建名称和电话号码
*
* @param pushOldPackageSigning
*/
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) {
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) {
User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId());
if (user == null) {
R<User> userT = userClient.userInfoById(signPushDataUnitDTO.getAdministratorsId());
if (userT.isSuccess()) {
user = userT.getData();
bladeRedis.setEx(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId(), user, 3600L);
}
}
if (ObjectUtils.isNotNull(user)) {
assert user != null;
signPushDataUnitDTO.setAdministratorsName(user.getName());
signPushDataUnitDTO.setAdministratorsPhone(user.getPhone());
}
}
}
} }

Loading…
Cancel
Save