Browse Source

自提推送老系统

dist.1.3.0
汤建军 11 months ago
parent
commit
fa7084540a
  1. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java
  2. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java
  3. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  4. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  5. 124
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  6. 199
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushBillDataQueueHandler.java
  7. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java
  8. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  9. 194
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupInfoServiceImpl.java
  11. 33
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java

@ -47,4 +47,9 @@ public interface IDistributionSignforClient {
@GetMapping(TOP)
BladePage<DistributionSignforEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(TOP+"push0ldSystemSignInfo")
void push0ldSystemSignInfo(@RequestParam("current") Long signingId);
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java

@ -50,4 +50,13 @@ public class DistributionSignforClient implements IDistributionSignforClient {
return BladePage.of(page);
}
/**
* @param signingId
*/
@Override
public void push0ldSystemSignInfo(Long signingId) {
distributionSignforService.push0ldSystemSignInfo(signingId);
}
}

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

@ -1382,19 +1382,19 @@
</select>
<select id="pushNotification" resultType="com.logpm.distribution.dto.PushNotificationDTO">
SELECT
lds.id AS id, ldr.warehouse_id AS warehouseId,ldr.warehouse_name AS warehouseName
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_signfor AS lds ON ldr.id = lds.reservation_id
<where>
ldr.is_deleted = 0
AND lds.is_deleted = 0
AND ( ldr.reservation_num + ldr.reservation_stock_list_num ) > 0
AND date_format( lds.signing_time, '%y%m%d%' ) &lt;= date_format(
'2024-04-28',
'%y%m%d%')
AND lds.signing_status = 2
SELECT
lds.id AS id, ldr.warehouse_id AS warehouseId,ldr.warehouse_name AS warehouseName
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_signfor AS lds ON ldr.id = lds.reservation_id
<where>
ldr.is_deleted = 0
AND lds.is_deleted = 0
AND ( ldr.reservation_num + ldr.reservation_stock_list_num ) > 0
AND date_format( lds.signing_time, '%y%m%d%' ) &lt;= date_format(
'2024-04-28',
'%y%m%d%')
AND lds.signing_status = 2
<if test="warehouseIds != null and warehouseIds.size > 0" >
AND ldr.warehouse_id in
<foreach collection="warehouseIds" item="warehouseId" index="index" open="(" close=")" separator=",">
@ -1409,6 +1409,6 @@
</if>
</where>
GROUP BY ldr.warehouse_id,lds.id
GROUP BY ldr.warehouse_id,lds.id
</select>
</mapper>

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java

@ -31,6 +31,9 @@ import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
import com.logpm.oldproject.dto.SignPushDataUnitDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -158,6 +161,27 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
*/
List<DistributionStockupOrderListVO> selectBillLadingZeroPackageList(@Param("bullLadingId")Long bullLadingId);
/**
* 推送老系统
* @param billId
* @return
*/
SignPushDataDTO getSignPushDataDTO(@Param("id")Long id);
/**
* 查询推送老系统自提客户信息
* @param billId
* @return
*/
List<SignPushDataContactDTO> selectPushOldCustomer(@Param("id")Long id);
/**
* 查询自提签署包件推送老系统
* @param billId
* @return
*/
List<SignPushDataUnitDTO> selectPushOldPackageSigning(@Param("id")Long id);
// Page<DistrilbutionBillLadingAppVO> getInventoryPage(IPage<Object> page, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity);
}

124
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -564,6 +564,130 @@
WHERE
ldrzp.reservation_id = #{bullLadingId} and ldrzp.zero_package_status in (1,3)
</select>
<select id="getSignPushDataDTO" resultType="com.logpm.oldproject.dto.SignPushDataDTO">
SELECT
ldbl.id,
ldbl.warehouse_id AS warehouseId,
lww.name AS warehouseName,
3 AS type,
3 AS finishState,
1 AS STATUS,
'自提' AS kind,
ldbl.create_user AS outToId,
ldbl.pick_up_plate AS car,
ldbl.pickup_batch AS transNo,
ldbl.create_user AS outId,
ldbl.create_user AS createTime,
ldbl.create_user AS administratorsId,
ldbl.pick_up_time AS outTime,
ldbl.update_time AS reviewTime,
ldbl.consignee AS outName,
ldbl.consignee_phone AS outPhone,
IFNULL( MIN( ldbls.create_time ), ldbl.create_time ) AS outToTime,
((
SELECT
IFNULL( sum( packet_number ), 0 )
FROM
logpm_distrilbution_bill_package
WHERE
is_deleted = 0
AND bill_lading_id = ldbl.id
AND packet_bar_status != 2
) + ( SELECT IFNULL( sum( num ), 0 ) FROM logpm_dis_stock_list_detail WHERE is_deleted = 0 AND reservation_id = ldbl.id AND stock_package_status != 2 ) + (
SELECT
IFNULL( sum( quantity ), 0 )
FROM
logpm_distribution_reservation_zero_package
WHERE
is_deleted = 0
AND reservation_id = ldbl.id
AND type = 3
AND zero_package_status != 2
)) AS plan,
IFNULL(SUM(ldbls.quantity),0) AS actualPlan,
IFNULL(SUM(ldbls.quantity),0) AS delivery,
IFNULL(SUM(ldbls.quantity),0) AS sign,
(SELECT IFNULL( SUM(stock_quantity),0) FROM logpm_distribution_stock WHERE reservation_id = ldbl.id AND is_deleted = 0) AS makeNum
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
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldbl.warehouse_id = lww.id
WHERE
ldbl.id = #{id}
</select>
<select id="selectPushOldCustomer" resultType="com.logpm.oldproject.dto.SignPushDataContactDTO">
SELECT
ldbl.id AS distributionId,
lww.warehouse_address AS address,
1 AS state,
ldbl.create_time AS createTime,
ldbl.update_time AS updateTime,
ldbl.remark AS content,
ldbl.consignee AS contact,
ldbl.consignee_phone AS phone,
IFNULL( MIN( ldbls.create_time ), ldbl.create_time ) AS outToTime,
((
SELECT
IFNULL( sum( packet_number ), 0 )
FROM
logpm_distrilbution_bill_package
WHERE
is_deleted = 0
AND bill_lading_id = ldbl.id
AND packet_bar_status != 2
) + ( SELECT IFNULL( sum( num ), 0 ) FROM logpm_dis_stock_list_detail WHERE is_deleted = 0 AND reservation_id = ldbl.id AND stock_package_status != 2 ) + (
SELECT
IFNULL( sum( quantity ), 0 )
FROM
logpm_distribution_reservation_zero_package
WHERE
is_deleted = 0
AND reservation_id = ldbl.id
AND type = 3
AND zero_package_status != 2
)) AS plan,
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)
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
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldbl.warehouse_id = lww.id
WHERE
ldbl.id = #{id}
</select>
<select id="selectPushOldPackageSigning" resultType="com.logpm.oldproject.dto.SignPushDataUnitDTO">
SELECT
ldbls.id AS id,
ldsa.warehouse_id AS warehouse_id,
ldbls.create_user AS distribution_contact_id,
ldbls.bill_lading_id AS distributionId,
ldbl.pickup_batch AS transNo,
ldsa.waybill_number AS waybillNo,
ldsa.order_code AS orderSelfNum,
ldbls.packet_bar_code AS unitNo,
2 AS type,
1 AS isLoading,
1 AS is_out,
5 AS broke_state,
ldbls.create_time AS loadingTime,
ldbls.create_time AS signTime,
ldbls.create_time AS create_time,
ldbls.create_user AS administratorsId,
ldbls.create_time AS operateTime,
ldbls.update_time AS update_time,
ldbls.quantity AS num,
ldbls.quantity AS signNum,
IF(ldsa.is_zero = 0 ,1,2) AS goods_type
FROM
logpm_distribution_bill_lading_scan AS ldbls
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbls.bill_lading_id = ldbl.id AND ldbl.is_deleted = 0
LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldbls.stock_article_id = ldsa.id AND ldsa.is_deleted = 0
WHERE
bill_lading_id = #{id}
</select>
</mapper>

199
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushBillDataQueueHandler.java

@ -0,0 +1,199 @@
package com.logpm.distribution.receiver;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.feign.IBasicdataTripartiteWarehouseClient;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.IDistributionStockService;
import com.logpm.distribution.vo.DistributionSignPrintVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
import com.logpm.oldproject.dto.SignPushDataUnitDTO;
import com.logpm.oldproject.entity.WarehouseEntity;
import com.logpm.oldproject.feign.IOldSignPushClient;
import com.logpm.oldproject.feign.IWarehouseClient;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
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.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 异常消息队列 处理器
*
* @author zhy
*/
@Slf4j
@RabbitListener(queues = RabbitConstant.CLERK_CHECK_PUSH_DATA_QUEUE)
@Component
public class ClerkCheckPushBillDataQueueHandler {
@Autowired
private IDistributionStockService distributionStockService;
@Autowired
private IOldSignPushClient oldSystemDataPushClient;
@Autowired
private DistributionSignforMapper distributionSignforMapper;
@Autowired
private DistributionDeliveryListMapper distributionDeliveryListMapper;
@Autowired
private DistributionReservationMapper distributionReservationMapper;
@Autowired
private DistributionDeliverySelfMapper distributionDeliverySelfMapper;
@Autowired
private DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper;
@Autowired
private IUserClient userClient;
@Autowired
private IBasicdataTripartiteWarehouseClient basicdataTripartiteWarehouseClient;
@Autowired
private IWarehouseClient warehouseClient;
@Autowired
private BladeRedis bladeRedis;
@Autowired
private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
@RabbitHandler
public void clerkCheckPushBillLLadingDataHandler(Map map, Message message, Channel channel) {
try {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列");
//得到审核的任务ID
DistributionSignforEntity t = (DistributionSignforEntity) map.get("messageData");
Long billId = t.getId();
if (ObjectUtil.isEmpty(billId)) {
log.info(">>>>>>>>>>>>> clerkCheckPushBillLLadingDataHandler 签收ID为空");
return;
}
//得到签收对象
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingMapper.selectById(billId);
//需要检测文员是否进行复核了
if (ObjectUtil.isEmpty(billLadingEntity)) {
log.info(">>>>>>>>>>>> clerkCheckPushBillLLadingDataHandler billLadingEntity {}", billLadingEntity);
return;
}
// 得到配送计划
// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId());
// if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) {
// log.info(">>>>>>>>>>> clerkCheckPushBillLLadingDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity);
// return;
// }
// 得到配送客户
// DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId());
// if (ObjectUtil.isEmpty(distributionReservationEntity)) {
// log.info(">>>>>>>>>>>> clerkCheckPushBillLLadingDataHandler distributionReservationEntity {}", distributionReservationEntity);
// return;
// }
//组合配送信息
SignPushDataDTO delivery = distrilbutionBillLadingMapper.getSignPushDataDTO(billId);
//还需要配送的出库人、配送人、操作人信息
if (Func.isNotEmpty(delivery)) {
R<User> userR = userClient.userInfoById(delivery.getAdministratorsId());
if (Func.isNotEmpty(userR)) {
User user = userR.getData();
delivery.setAdministratorsName(user.getName());
delivery.setAdministratorsPhone(user.getPhone());
}
// DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId());
// if (Func.isNotEmpty(distributionStockupEntity)) {
// if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())) {
// delivery.setOutToId(distributionStockupEntity.getStockupUserId());
// delivery.setOutToName(distributionStockupEntity.getStockupUser());
// }
//
// }
//查询客户信息
List<SignPushDataContactDTO> customer = distrilbutionBillLadingMapper.selectPushOldCustomer(billId);
if (Func.isNotEmpty(customer)) {
//查询客户订单
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
//查询包件扫描签收
//查询包件扫描签收
List<SignPushDataUnitDTO> pushOldPackageSigning = distrilbutionBillLadingMapper.selectPushOldPackageSigning(billId);
if (Func.isNotEmpty(pushOldPackageSigning)) {
buildNameAndPhone(pushOldPackageSigning);
signPushDataUnitDTOS.addAll(pushOldPackageSigning);
}
//完成客户信息添加
delivery.setSignPushDataContactDTOs(customer);
}
}
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
} catch (Exception 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());
log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user);
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());
if (ObjectUtils.isNotEmpty(user.getPhone())){
signPushDataUnitDTO.setAdministratorsPhone(user.getPhone());
}else {
if (ObjectUtils.isNotEmpty(user.getAccount())){
signPushDataUnitDTO.setAdministratorsPhone(user.getAccount());
}else {
log.info("用户无电话号码且账号信息为空>>用户名称:{}",user.getName());
}
}
}
}
}
}

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

@ -7,6 +7,7 @@ import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.IDistributionStockService;
import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import com.logpm.distribution.vo.DistributionSignPrintVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
@ -76,6 +77,10 @@ public class ClerkCheckPushDataQueueHandler {
private BladeRedis bladeRedis;
@Autowired
private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
@RabbitHandler
public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) {
@ -223,6 +228,7 @@ public class ClerkCheckPushDataQueueHandler {
}
/**
* 构建名称和电话号码
*

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java

@ -335,4 +335,11 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @return
*/
List<Map<String, Object>> getByReservationIds(List<Long> longList);
/**
* 推送老系统
* @param signingId
*/
void push0ldSystemSignInfo(Long signingId);
}

194
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -47,6 +47,12 @@ import com.logpm.distribution.wrapper.DistributionDisStockListWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListAppWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
import com.logpm.oldproject.dto.SignPushDataUnitDTO;
import com.logpm.oldproject.entity.WarehouseEntity;
import com.logpm.oldproject.feign.IOldSignPushClient;
import com.logpm.oldproject.feign.IWarehouseClient;
import com.logpm.warehouse.feign.IWarehouseUpdownStockUpAreaClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.extern.slf4j.Slf4j;
@ -56,6 +62,7 @@ import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.billLading.BillLadingStatusConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
@ -217,6 +224,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private BladeRedis bladeRedis;
@Autowired
private IOldSignPushClient oldSystemDataPushClient;
@Autowired
private IWarehouseClient warehouseClient;
@Autowired
private IWarehouseUpdownStockUpAreaClient warehouseUpdownStockUpAreaClient;
@ -1494,6 +1507,187 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return baseMapper.getByReservationIds(longList);
}
/**
* @param signingId
*/
@Override
public void push0ldSystemSignInfo(Long signingId) {
try {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列");
//得到审核的任务ID
if (ObjectUtil.isEmpty(signingId)) {
log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空");
return;
}
//得到签收对象
DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId);
//需要检测文员是否进行复核了
if (ObjectUtil.isEmpty(distributionSignforEntity)) {
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity);
return;
}
// 得到配送计划
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId());
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) {
log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity);
return;
}
// 得到配送客户
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId());
if (ObjectUtil.isEmpty(distributionReservationEntity)) {
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity);
return;
}
//组合配送信息
SignPushDataDTO delivery = distributionDeliveryListMapper.selectPushOldDelivery(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName());
if (ObjectUtils.isNotNull(warehouseEntity)) {
// 需要增加老系统的仓库ID
delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId() + ""));
delivery.setWarehouseName(warehouseEntity.getTitle());
}
//还需要配送的出库人、配送人、操作人信息
if (Func.isNotEmpty(delivery)) {
if ("1".equals(delivery.getKind())) {
//自主配送
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId())
.eq(DistributionDeliverySelfEntity::getIsMaster, 2)
);
if (Func.isNotEmpty(distributionDeliverySelfEntity)) {
delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId()));
delivery.setOutName(distributionDeliverySelfEntity.getDriverName());
delivery.setOutPhone(distributionDeliverySelfEntity.getDriverPhone());
}
} else {
//外协
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId()));
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)) {
delivery.setOutName(distributionDeliveryTripartiteEntity.getDriverName());
delivery.setOutPhone(distributionDeliveryTripartiteEntity.getDriverPhone());
}
}
R<User> userR = userClient.userInfoById(delivery.getAdministratorsId());
if (Func.isNotEmpty(userR)) {
User user = userR.getData();
delivery.setAdministratorsName(user.getName());
delivery.setAdministratorsPhone(user.getPhone());
}
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(distributionStockupEntity)) {
if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())) {
delivery.setOutToId(distributionStockupEntity.getStockupUserId());
delivery.setOutToName(distributionStockupEntity.getStockupUser());
}
}
//查询客户信息
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(customer)) {
//查询客户订单
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
if (distributionReservationEntity.getReservationNum() > 0) {
//查询包件扫描签收
//查询包件扫描签收
List<SignPushDataUnitDTO> pushOldPackageLoading = distributionSignforMapper.selectPushOldPackageLoading(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
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);
}
}
if (distributionReservationEntity.getReservationStockListNum() > 0) {
//查询库存品扫描签收
List<SignPushDataUnitDTO> loadingPushOldInventory = distributionSignforMapper.selectLoadingPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
List<SignPushDataUnitDTO> signingPushOldInventory = distributionSignforMapper.selectSigningPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(loadingPushOldInventory)) {
buildNameAndPhone(loadingPushOldInventory);
signPushDataUnitDTOS.addAll(loadingPushOldInventory);
}
if (Func.isNotEmpty(signingPushOldInventory)) {
buildNameAndPhone(signingPushOldInventory);
signPushDataUnitDTOS.addAll(signingPushOldInventory);
}
}
//查询签收图片
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId());
if (Func.isNotEmpty(signPushDataUnitDTOS)) {
SignPushDataContactDTO signPushDataContactDTO = customer.get(0);
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS);
if (Func.isNotEmpty(distributionSignPrintVOS)) {
String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(","));
signPushDataContactDTO.setImage(urls);
}
if (Func.isNotEmpty(distributionSignforEntity.getClerkSignRemarks())) {
signPushDataContactDTO.setContact(distributionSignforEntity.getClerkSignRemarks());
}
}
//完成客户信息添加
delivery.setSignPushDataContactDTOs(customer);
}
}
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
} catch (Exception 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());
log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user);
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());
if (ObjectUtils.isNotEmpty(user.getPhone())){
signPushDataUnitDTO.setAdministratorsPhone(user.getPhone());
}else {
if (ObjectUtils.isNotEmpty(user.getAccount())){
signPushDataUnitDTO.setAdministratorsPhone(user.getAccount());
}else {
log.info("用户无电话号码且账号信息为空>>用户名称:{}",user.getName());
}
}
}
}
}
private List<DeliveryNodeVo> handleStockUp(DistributionStockupEntity distributionStockupEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupInfoServiceImpl.java

@ -137,6 +137,7 @@ public class DistributionStockupInfoServiceImpl extends BaseServiceImpl<Distribu
//可进行备货任务的完结标识
distributionStockupInfoEntity.setStockStatus("3");
this.updateById(distributionStockupInfoEntity);
}else {
log.error(method+"预约单关联备货任务错误reservationId:{}",reservationId);
}

33
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -203,6 +203,39 @@ public class DistributionDatarepair {
}
return ReturnT.SUCCESS;
} /**
* 推送自提签收老系统系统
* @return
*/
@XxlJob("pushBillNotification")
public ReturnT<String> pushBillNotification(String params) {
// 得到当前仓库所有的签收任务
List<JSONObject> allSignfor = warehouseMappingDataMapper.findAllSignfor();
for (JSONObject entries : allSignfor) {
Long id = entries.getLong("singnforId");
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setId(id);
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("messageData", distributionSignforEntity);
mapState.put("createTime", System.currentTimeMillis());
try {
log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ", mapState);
rabbitTemplate.convertAndSend(RabbitConstant.CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.CLERK_CHECK_PUSH_DATA_ROUTING, mapState);
warehouseMappingDataMapper.updateClearSignforStatus(id, entries.getLong("warehouseId"), 1);
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! {}", customerException.getMessage());
}
}
return ReturnT.SUCCESS;
}

Loading…
Cancel
Save