Browse Source

Merge branch 'dev' into pre-production

single_db
pref_mail@163.com 1 year ago
parent
commit
c13fbce7ca
  1. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  2. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  4. 178
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java
  5. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  6. 12
      blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1754,6 +1754,7 @@
logpm_distribution_signfor AS lds logpm_distribution_signfor AS lds
LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
where lddl.id=#{deliveryId}
</select> </select>
<select id="selectDeliveryById" resultType="com.logpm.distribution.vo.DistributionDeliveryListVO"> <select id="selectDeliveryById" resultType="com.logpm.distribution.vo.DistributionDeliveryListVO">
SELECT SELECT

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

@ -258,7 +258,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @param deliveryId * @param deliveryId
* @return * @return
*/ */
SignPushDataUnitDTO selectPushOldPackage(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId); List<SignPushDataUnitDTO> selectPushOldPackage(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId);
/** /**
* 推送老系统库存品包件 * 推送老系统库存品包件
@ -266,7 +266,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @param deliveryId * @param deliveryId
* @return * @return
*/ */
SignPushDataUnitDTO selectPushOldInventory(@Param("reservationId")Long reservationId, @Param("deliveryId")Long deliveryId); List<SignPushDataUnitDTO> selectPushOldInventory(@Param("reservationId")Long reservationId, @Param("deliveryId")Long deliveryId);
/** /**
* 减少装车数 * 减少装车数

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

@ -1181,7 +1181,7 @@
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 = #{resservationId} 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

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

@ -41,7 +41,7 @@ import java.util.Map;
* @author zhy * @author zhy
*/ */
@Slf4j @Slf4j
@RabbitListener(queues = RabbitConstant.CLERK_CHECK_PUSH_DATA_QUEUE) @RabbitListener(queues = RabbitConstant.TEST_RECEIVE_INFO_QUEUE)
@Component @Component
public class ClerkCheckPushDataQueueHandler { public class ClerkCheckPushDataQueueHandler {
@ -68,112 +68,114 @@ public class ClerkCheckPushDataQueueHandler {
@RabbitHandler @RabbitHandler
public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) { public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) {
//得到审核的任务ID try{
DistributionSignforDTO distributionStockEntity = (DistributionSignforDTO) map.get("messageData"); log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列");
Long signfor_id = distributionStockEntity.getId(); //得到审核的任务ID
if (ObjectUtil.isEmpty(signfor_id)) { DistributionSignforDTO distributionStockEntity = (DistributionSignforDTO) map.get("messageData");
log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); Long signfor_id = distributionStockEntity.getId();
return; if (ObjectUtil.isEmpty(signfor_id)) {
} log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空");
return;
}
//得到签收对象 //得到签收对象
DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signfor_id); DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signfor_id);
//需要检测文员是否进行复核了 //需要检测文员是否进行复核了
if (ObjectUtil.isEmpty(distributionSignforEntity)) { if (ObjectUtil.isEmpty(distributionSignforEntity)) {
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity); log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity);
return; return;
} }
// 得到配送计划 // 得到配送计划
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId()); DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId());
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) {
log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity);
return; return;
} }
// 得到配送客户
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId());
if (ObjectUtil.isEmpty(distributionReservationEntity)) {
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity);
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()); SignPushDataDTO delivery = distributionDeliveryListMapper.selectPushOldDelivery(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
//还需要配送的出库人、配送人、操作人信息 //还需要配送的出库人、配送人、操作人信息
if (Func.isNotEmpty(delivery)){ if (Func.isNotEmpty(delivery)){
if (delivery.getKind().equals("1")){ if (delivery.getKind().equals("1")){
//自主配送 //自主配送
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, delivery.getId())
); );
if (Func.isNotEmpty(distributionDeliverySelfEntity)){ if (Func.isNotEmpty(distributionDeliverySelfEntity)){
delivery.setOut_id(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); delivery.setOut_id(Long.parseLong(distributionDeliverySelfEntity.getDriverId()));
delivery.setOut_name(distributionDeliverySelfEntity.getDriverName()); delivery.setOut_name(distributionDeliverySelfEntity.getDriverName());
delivery.setOut_phone(distributionDeliverySelfEntity.getDriverPhone()); delivery.setOut_phone(distributionDeliverySelfEntity.getDriverPhone());
} }
}else { }else {
//外协 //外协
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId())); DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId()));
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)){ if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)){
delivery.setOut_name(distributionDeliveryTripartiteEntity.getDriverName()); delivery.setOut_name(distributionDeliveryTripartiteEntity.getDriverName());
delivery.setOut_phone(distributionDeliveryTripartiteEntity.getDriverPhone()); delivery.setOut_phone(distributionDeliveryTripartiteEntity.getDriverPhone());
}
} }
} R<User> userR = userClient.userInfoById(delivery.getAdministrators_id());
R<User> userR = userClient.userInfoById(delivery.getAdministrators_id()); if (Func.isNotEmpty(userR)){
if (Func.isNotEmpty(userR)){ User user = userR.getData();
User user = userR.getData(); // delivery.setAdministrators_name(user.getName());
delivery.setAdministrators_name(user.getName());
}
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(distributionStockupEntity)){
if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())){
delivery.setOut_to_id(distributionStockupEntity.getStockupUserId());
delivery.setOut_to_name(distributionStockupEntity.getStockupUser());
} }
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(distributionStockupEntity)){
if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())){
delivery.setOut_to_id(distributionStockupEntity.getStockupUserId());
delivery.setOut_to_name(distributionStockupEntity.getStockupUser());
}
} }
//查询客户信息 //查询客户信息
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId()); List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(customer)){ if (Func.isNotEmpty(customer)){
//查询客户订单 //查询客户订单
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>(); List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
if(distributionReservationEntity.getReservationNum()>0){ if(distributionReservationEntity.getReservationNum()>0){
//查询包件扫描签收 //查询包件扫描签收
SignPushDataUnitDTO pushOldPackage = distributionSignforMapper.selectPushOldPackage(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId()); List<SignPushDataUnitDTO> pushOldPackage = distributionSignforMapper.selectPushOldPackage(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(pushOldPackage)){ if (Func.isNotEmpty(pushOldPackage)){
signPushDataUnitDTOS.add(pushOldPackage); signPushDataUnitDTOS.addAll(pushOldPackage);
}
} }
}
if (distributionReservationEntity.getReservationStockListNum() > 0){ if (distributionReservationEntity.getReservationStockListNum() > 0){
//查询库存品扫描签收 //查询库存品扫描签收
SignPushDataUnitDTO pushOldInventory = distributionSignforMapper.selectPushOldInventory(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId()); List<SignPushDataUnitDTO> pushOldInventory = distributionSignforMapper.selectPushOldInventory(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(pushOldInventory)){ if (Func.isNotEmpty(pushOldInventory)){
signPushDataUnitDTOS.add(pushOldInventory); signPushDataUnitDTOS.addAll(pushOldInventory);
}
}
if (Func.isNotEmpty(signPushDataUnitDTOS)){
SignPushDataContactDTO signPushDataContactDTO = customer.get(0);
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS);
} }
}
if (Func.isNotEmpty(signPushDataUnitDTOS)){
SignPushDataContactDTO signPushDataContactDTO = customer.get(0);
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS);
}
//完成客户信息添加 //完成客户信息添加
delivery.setSignPushDataContactDTOs(customer); delivery.setSignPushDataContactDTOs(customer);
}
} }
}
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
}catch (Exception e){
e.printStackTrace();
}
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
} }

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

@ -3006,7 +3006,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
* 构建文员签收审核的参数 * 构建文员签收审核的参数
* @param distributionSignfor * @param distributionSignfor
*/ */
private void buildArgsToPushMq(DistributionSignforDTO distributionSignfor) { public void buildArgsToPushMq(DistributionSignforDTO distributionSignfor) {
Map mapState = new HashMap(); Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID()); mapState.put("messageId", CommonUtil.getUUID());
@ -3015,7 +3015,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
try{ try{
log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ",mapState); log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ",mapState);
rabbitTemplate.convertAndSend(RabbitConstant.CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.CLERK_CHECK_PUSH_DATA_ROUTING, mapState); rabbitTemplate.convertAndSend(RabbitConstant.TEST_RECEIVE_INFO_EXCHANGE, RabbitConstant.TEST_RECEIVE_INFO_ROUTING, mapState);
}catch (Exception customerException){ }catch (Exception customerException){
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! {}",customerException.getMessage()); log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! {}",customerException.getMessage());

12
blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

@ -3,6 +3,7 @@ package com.logpm.distribution;
import com.logpm.distribution.dto.DistributionSignforDTO; import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.service.IDistributionDeliveryListService; import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionSignforService; import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.impl.DistributionSignforServiceImpl;
import com.logpm.distribution.vo.print.PrintPreviewVO; import com.logpm.distribution.vo.print.PrintPreviewVO;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
@ -19,8 +20,10 @@ public class TestService {
@Autowired @Autowired
private IDistributionDeliveryListService distributionDeliveryListService; private IDistributionDeliveryListService distributionDeliveryListService;
@Autowired @Autowired
private IDistributionSignforService iDistributionSignforService; private DistributionSignforServiceImpl iDistributionSignforService;
@Test @Test
public void test2() throws Exception { public void test2() throws Exception {
@ -55,5 +58,12 @@ public class TestService {
} }
@Test
public void test5(){
DistributionSignforDTO dto = new DistributionSignforDTO();
dto.setId(1724584676191997953L);
iDistributionSignforService.buildArgsToPushMq(dto);
}
} }

Loading…
Cancel
Save