Browse Source

推送老系统

dist.1.3.0
汤建军 11 months ago
parent
commit
450a5a9a69
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  2. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/PushNotificationDTO.java
  3. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  4. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  5. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  6. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  7. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  8. 17
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -128,6 +128,9 @@ public interface IDistributionDeliveryListClient {
@GetMapping(TOP+"/maintenanceDeliveryInfoByWarehouseId")
void maintenanceDeliveryInfoByWarehouseId(@RequestParam("warehouseId")String params);
@GetMapping(TOP+"/pushNotification")
void pushNotification(String params);
// /**
// * 根据配送任务ID查询配送司机信息

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/PushNotificationDTO.java

@ -0,0 +1,41 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 签收管理 数据传输对象实体类
*
* @author lmy
* @since 2023-06-13
*/
@Data
public class PushNotificationDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id ;
private Long warehouseId;
private String warehouseName;
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.feign;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
@ -25,6 +26,7 @@ import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.vo.DistributionRetentionScanVo;
import lombok.AllArgsConstructor;
import org.apache.logging.log4j.util.Strings;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -114,5 +116,14 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
}
/**
* @param params
*/
@Override
public void pushNotification(String params) {
distributionDeliveryListService.pushNotification(params);
}
}

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

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.PushNotificationDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
@ -350,4 +351,10 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
List<Map<String, Object>> getByReservationIds(@Param("reservationIds") List<Long> longList);
/**
* 查询需要推送老系统的签收信息
* @param warehouseIds
* @return
*/
List<PushNotificationDTO> pushNotification(@Param("warehouseIds") List<String> warehouseIds);
}

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

@ -1381,4 +1381,26 @@
</foreach>
</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%' ) <= 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=",">
#{warehouseId}
</foreach>
</if>
GROUP BY ldr.warehouse_id
</select>
</mapper>

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

@ -442,6 +442,12 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
DistributionDeliveryExcelDTO exportDistributionDeliveryListDetail(Long deliveryId);
/**
* 推送老系统
* @param params
*/
void pushNotification(String params);
/**
* 查询签收预约客户包件信息

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -53,6 +53,7 @@ import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
@ -7332,6 +7333,29 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return distributionDeliveryExcelDTO;
}
/**
* @param params
*/
@Override
public void pushNotification(String params) {
List<String> warehouseIds = null;
if (Strings.isNotBlank(params)){
warehouseIds = Arrays.stream(params.split(",")).collect(Collectors.toList());
}
List<DistributionReservationEntity> reservationEntityList = distributionReservationService.list(Wrappers.<DistributionReservationEntity>query().lambda()
.in(DistributionReservationEntity::getWarehouseId, warehouseIds)
.ne(DistributionReservationEntity::getReservationStatus, ReservationStatusConstant.yiquexiao.getValue())
.apply("(reservation_num + reservation_stock_list_num) > 0")
.apply("date_format(create_time,'%y%m%d%') <= date_format('2024-04-28','%y%m%d%')")
);
List<PushNotificationDTO> pushNotification = distributionSignforMapper.pushNotification(warehouseIds);
if (!pushNotification.isEmpty()){
for (PushNotificationDTO pushNotificationDTO : pushNotification) {
distributionAsyncService.sendReviewFactory(pushNotificationDTO.getId(), pushNotificationDTO.getWarehouseName(), pushNotificationDTO.getWarehouseId());
}
}
}
@Override
@Transactional
public void maintenanceDeliveryInfo(Long deliveryId) {

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

@ -161,6 +161,23 @@ public class DistributionDatarepair {
/**
* 推送老系统系统
* @return
*/
@XxlJob("pushNotification")
public ReturnT<String> pushNotification(String params) {
//维护配送的状态
String method = "######################DistributionDatarepair.maintenanceDeliveryStatus";
log.info(method+"维护配送订单id:{}",params);
deliveryListClient.pushNotification(params);
log.info(method+"维护配送订单结束");
return ReturnT.SUCCESS;
}

Loading…
Cancel
Save