|
|
|
@ -17,7 +17,9 @@ 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; |
|
|
|
@ -70,6 +72,9 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseClient warehouseClient; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BladeRedis bladeRedis; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RabbitHandler |
|
|
|
|
public void clerkCheckPushDataHandler(Map map, Message message, Channel channel) { |
|
|
|
@ -114,7 +119,7 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName()); |
|
|
|
|
if (ObjectUtils.isNotNull(warehouseEntity)) { |
|
|
|
|
// 需要增加老系统的仓库ID
|
|
|
|
|
delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId()+"")); |
|
|
|
|
delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId() + "")); |
|
|
|
|
delivery.setWarehouseName(warehouseEntity.getTitle()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -125,7 +130,7 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
//自主配送
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda() |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId()) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, delivery.getId()) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, 2) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity)) { |
|
|
|
|
delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); |
|
|
|
@ -144,6 +149,7 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
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)) { |
|
|
|
@ -161,9 +167,16 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
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); |
|
|
|
|
//查询包件扫描签收
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -177,15 +190,14 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
//查询签收图片
|
|
|
|
|
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(signPushDataUnitDTOS)) { |
|
|
|
|
SignPushDataContactDTO signPushDataContactDTO = customer.get(0); |
|
|
|
|
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS); |
|
|
|
|
if (Func.isNotEmpty(distributionSignPrintVOS)){ |
|
|
|
|
if (Func.isNotEmpty(distributionSignPrintVOS)) { |
|
|
|
|
String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(",")); |
|
|
|
|
signPushDataContactDTO.setImage(urls); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionSignforEntity.getClerkSignRemarks())){ |
|
|
|
|
if (Func.isNotEmpty(distributionSignforEntity.getClerkSignRemarks())) { |
|
|
|
|
signPushDataContactDTO.setContact(distributionSignforEntity.getClerkSignRemarks()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -198,10 +210,33 @@ public class ClerkCheckPushDataQueueHandler {
|
|
|
|
|
|
|
|
|
|
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
} 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()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|