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
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
where lddl.id=#{deliveryId}
</select>
<select id="selectDeliveryById" resultType="com.logpm.distribution.vo.DistributionDeliveryListVO">
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
* @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
* @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
AND ldpl.is_deleted = 0
WHERE
ldl.reservation_id = #{resservationId}
ldl.reservation_id = #{reservationId}
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != 1
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
*/
@Slf4j
@RabbitListener(queues = RabbitConstant.CLERK_CHECK_PUSH_DATA_QUEUE)
@RabbitListener(queues = RabbitConstant.TEST_RECEIVE_INFO_QUEUE)
@Component
public class ClerkCheckPushDataQueueHandler {
@ -68,112 +68,114 @@ public class ClerkCheckPushDataQueueHandler {
@RabbitHandler
public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) {
//得到审核的任务ID
DistributionSignforDTO distributionStockEntity = (DistributionSignforDTO) map.get("messageData");
Long signfor_id = distributionStockEntity.getId();
if (ObjectUtil.isEmpty(signfor_id)) {
log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空");
return;
}
try{
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列");
//得到审核的任务ID
DistributionSignforDTO distributionStockEntity = (DistributionSignforDTO) map.get("messageData");
Long signfor_id = distributionStockEntity.getId();
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)) {
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;
}
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());
//还需要配送的出库人、配送人、操作人信息
if (Func.isNotEmpty(delivery)){
if (delivery.getKind().equals("1")){
//自主配送
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId())
.eq(DistributionDeliverySelfEntity::getIsMaster, delivery.getId())
);
if (Func.isNotEmpty(distributionDeliverySelfEntity)){
delivery.setOut_id(Long.parseLong(distributionDeliverySelfEntity.getDriverId()));
delivery.setOut_name(distributionDeliverySelfEntity.getDriverName());
delivery.setOut_phone(distributionDeliverySelfEntity.getDriverPhone());
}
}else {
//外协
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId()));
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)){
delivery.setOut_name(distributionDeliveryTripartiteEntity.getDriverName());
delivery.setOut_phone(distributionDeliveryTripartiteEntity.getDriverPhone());
//组合配送信息
SignPushDataDTO delivery = distributionDeliveryListMapper.selectPushOldDelivery(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
//还需要配送的出库人、配送人、操作人信息
if (Func.isNotEmpty(delivery)){
if (delivery.getKind().equals("1")){
//自主配送
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId())
.eq(DistributionDeliverySelfEntity::getIsMaster, delivery.getId())
);
if (Func.isNotEmpty(distributionDeliverySelfEntity)){
delivery.setOut_id(Long.parseLong(distributionDeliverySelfEntity.getDriverId()));
delivery.setOut_name(distributionDeliverySelfEntity.getDriverName());
delivery.setOut_phone(distributionDeliverySelfEntity.getDriverPhone());
}
}else {
//外协
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId()));
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)){
delivery.setOut_name(distributionDeliveryTripartiteEntity.getDriverName());
delivery.setOut_phone(distributionDeliveryTripartiteEntity.getDriverPhone());
}
}
}
R<User> userR = userClient.userInfoById(delivery.getAdministrators_id());
if (Func.isNotEmpty(userR)){
User user = userR.getData();
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());
R<User> userR = userClient.userInfoById(delivery.getAdministrators_id());
if (Func.isNotEmpty(userR)){
User user = userR.getData();
// 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());
}
}
}
//查询客户信息
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(customer)){
//查询客户订单
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
if(distributionReservationEntity.getReservationNum()>0){
//查询包件扫描签收
SignPushDataUnitDTO pushOldPackage = distributionSignforMapper.selectPushOldPackage(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(pushOldPackage)){
signPushDataUnitDTOS.add(pushOldPackage);
//查询客户信息
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(customer)){
//查询客户订单
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
if(distributionReservationEntity.getReservationNum()>0){
//查询包件扫描签收
List<SignPushDataUnitDTO> pushOldPackage = distributionSignforMapper.selectPushOldPackage(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(pushOldPackage)){
signPushDataUnitDTOS.addAll(pushOldPackage);
}
}
}
if (distributionReservationEntity.getReservationStockListNum() > 0){
//查询库存品扫描签收
SignPushDataUnitDTO pushOldInventory = distributionSignforMapper.selectPushOldInventory(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(pushOldInventory)){
signPushDataUnitDTOS.add(pushOldInventory);
if (distributionReservationEntity.getReservationStockListNum() > 0){
//查询库存品扫描签收
List<SignPushDataUnitDTO> pushOldInventory = distributionSignforMapper.selectPushOldInventory(distributionSignforEntity.getReservationId(),distributionSignforEntity.getDeliveryId());
if (Func.isNotEmpty(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
*/
private void buildArgsToPushMq(DistributionSignforDTO distributionSignfor) {
public void buildArgsToPushMq(DistributionSignforDTO distributionSignfor) {
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
@ -3015,7 +3015,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
try{
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){
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.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.impl.DistributionSignforServiceImpl;
import com.logpm.distribution.vo.print.PrintPreviewVO;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@ -19,8 +20,10 @@ public class TestService {
@Autowired
private IDistributionDeliveryListService distributionDeliveryListService;
@Autowired
private IDistributionSignforService iDistributionSignforService;
private DistributionSignforServiceImpl iDistributionSignforService;
@Test
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