Browse Source

Merge branch 'dev' into pre-production

pre-production
zhaoqiaobo 1 day ago
parent
commit
17b1e70da7
  1. 15
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  3. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  4. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  6. 88
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  7. 53
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AuthPushJob.java
  8. 12
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java
  9. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java
  10. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

15
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java

@ -173,13 +173,13 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
if (signListByWaybillNumber != null && !signListByWaybillNumber.isEmpty()) {
//统计装车数量load_num
int loadNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getLoadNum).sum();
int loadNum = signListByWaybillNumber.stream().filter(e -> e.getLoadNum() !=null).mapToInt(QualityDeliverEntity::getLoadNum).sum();
// 计划配送数 plan_num
int planNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getPlanNum).sum();
int planNum = signListByWaybillNumber.stream().filter(e-> e.getPlanNum()!=null).mapToInt(QualityDeliverEntity::getPlanNum).sum();
// 计算签收数量sign_num
int signNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getSignNum).sum();
int signNum = signListByWaybillNumber.stream().filter(e-> e.getSignNum()!=null).mapToInt(QualityDeliverEntity::getSignNum).sum();
// 配送装车
QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.get(0);
@ -214,6 +214,8 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
}
//对nodeInfoVOList集合中的作业时间 按照 时间倒序排序
nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed());
result.setNodeInfoVOList(nodeInfoVOList);
// 配送签收
@ -372,6 +374,13 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
}
//对nodeInfoVOList集合中的作业时间 按照 时间倒序排序
nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed());
result.setNodeInfoVOList(nodeInfoVOList);
// 配送签收

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

@ -495,4 +495,6 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return
*/
Integer loadingNum(@Param("reservationId")Long reservationId);
void updateSignfor(@Param("deliveryId") Long deliveryId, @Param("reservationId") Long reservationId, @Param("nub") Integer packageNub, @Param("user") BladeUser user);
}

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

@ -133,6 +133,17 @@
)
WHERE
lds.reservation_id = #{reservationId}
</update>
<update id="updateSignfor">
UPDATE logpm_distribution_signfor SET
signee_name = #{user.nickName},
signee_id = #{user.userId},
received_quantity = ( received_quantity + #{nub} )
WHERE
is_deleted =0 and delivery_id = #{deliveryId} and reservation_id = #{reservationId}
</update>
<delete id="deleteByReservationAndDeliveryId">
DELETE FROM logpm_distribution_signfor

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

@ -10641,7 +10641,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
* 保存对配送清单实体所做的所有更新确保数据的一致性和准确性
* @param deliveryListEntity 配送清单实体包含所有需要更新的信息
*/
updateDeliveryListEntity(deliveryListEntity, old);
// updateDeliveryListEntity(deliveryListEntity, old);
}
private int getDeliveryQuantity(DistributionDeliveryListEntity deliveryListEntity) {
@ -10677,6 +10677,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.yiwancheng.getValue())) {
handleDeliveryLog(deliveryListEntity, AuthUtil.getUser());
}
DistributionDeliveryListEntity update = new DistributionDeliveryListEntity();
update.setId(deliveryListEntity.getId());
update.setDeliveryListLoadingStatus(deliveryListEntity.getDeliveryListLoadingStatus());
update.setDeliveryStatus(deliveryListEntity.getDeliveryStatus());
this.updateById(update);
}
@ -10751,8 +10758,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
updateById(deliveryListEntity);
log.info("配送信息状态已更新,deliveryId: {}", deliveryListEntity.getId());
Boolean b1=DeliveryStatusConstant.yiwancheng.getValue().equals(deliveryListEntity.getDeliveryStatus());
Boolean b2 =deliveryListEntity.getScannedNumber().equals(0);
// Boolean b1=DeliveryStatusConstant.yiwancheng.getValue().equals(deliveryListEntity.getDeliveryStatus());
// Boolean b2 =deliveryListEntity.getScannedNumber().equals(0);
// 推送给配送被取消的的作业节点
// if (b1&& b2) {
// // 发送配送取消的消息完成消息

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -3876,6 +3876,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
throw new RuntimeException("服务器正忙!!!");
}
DistributionReservationEntity reservationEntity = this.getById(reservationId);
DistributionReservationEntity updateEntity = new DistributionReservationEntity();
updateEntity.setId(reservationEntity.getId());
//已签收预约单不需要进行预约状态维护 预约单状态达到最终
if (!ReservationSigningStatusConstant.yiqianshou.getValue().equals(reservationEntity.getSigningStatus())) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
@ -3894,16 +3896,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
if (loadStatus) {
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
updateEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
} else {
//判断是否都为完成装车
Integer loadingNum = distributionLoadscanMapper.selectLoadingNumByReservationId(reservationId);
if (Func.isEmpty(loadingNum)) {
if (loadingNum > 0) {
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
updateEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
}
if (loadingNum == 0) {
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
updateEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
}
}
}
@ -3912,28 +3914,28 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Integer signingNum = distributionLoadscanMapper.selectSigningNumByReservationId(reservationId);
//判断当前客户是否签收完成了
if (signingNum > 0) {
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue());
updateEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue());
}
if (signingNum == 0) {
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue());
updateEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue());
}
if (stockUpStatus) {
reservationEntity.setStockStatus(ReservationStockupStatusConstant.yibeihuo.getValue());
updateEntity.setStockStatus(ReservationStockupStatusConstant.yibeihuo.getValue());
} else {
//判断是否都为完成签收
Integer stockNum = distributionStockMapper.selectStockNumByReservationId(reservationId);
//判断当前客户是否签收完成了
if (stockNum > 0) {
reservationEntity.setStockStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
updateEntity.setStockStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
} else {
reservationEntity.setStockStatus(ReservationStockupStatusConstant.weibeihuo.getValue());
updateEntity.setStockStatus(ReservationStockupStatusConstant.weibeihuo.getValue());
}
}
if ((reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum()) == 0) {
reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue());
updateEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue());
}
this.updateById(reservationEntity);
this.updateById(updateEntity);
}
}

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

@ -4377,10 +4377,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(loadscaninvnEntity.getInventoryPackageId());
distributionLoadscaninvnService.updateById(loadscaninvnEntity);
pushList.add(loadscaninvnEntity);
//维护签收数量
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
//更新签收人
Integer i = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user);
// //维护签收数量
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// //更新签收人
// Integer i = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user);
updataSignforeExtracted(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub(), user);
} else {
//库存品未进行装车
//这里装车的数据需要进行补录
@ -5200,9 +5202,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscaninvnService.updateById(loadscaninvnEntity);
distributionLoadscaninvnEntityLists.add(loadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), AuthUtil.getUser());
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// //更新签收人
// Integer m = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), AuthUtil.getUser());
//
updataSignforeExtracted(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub(), user);
distributionAsyncService.checkSignStatus(null, loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId());
}
} else {
@ -5732,9 +5737,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscaninvnService.updateById(loadscaninvnEntity);
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), AuthUtil.getUser());
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// //更新签收人
// Integer m = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), AuthUtil.getUser());
updataSignforeExtracted(loadscaninvnEntity.getDeliveryId(),loadscaninvnEntity.getReservationId(),loadscaninvnEntity.getPackageNub(),user);
packageLockIds.add(loadscaninvnEntity.getInventoryPackageId());
distributionLoadscaninvnEntityLists.add(loadscaninvnEntity);
}
@ -8043,10 +8049,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer type = distrilbutionloadingscanDTO.getType();
String barcode = "";
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(deliveryId);
if (Objects.isNull(deliveryListEntity)) {
log.error(method + "查询配送信息错误,deliveryId:{}", deliveryId);
return Resp.scanFail("查询配送信息错误,请联系管理员", "查询配送信息错误,请联系管理员");
}
DistributionDeliveryListEntity updateDeliveryListEntity =new DistributionDeliveryListEntity();
updateDeliveryListEntity.setId(deliveryListEntity.getId());
if (DeliveryStatusConstant.yiwancheng.getValue().equals(deliveryListEntity.getDeliveryStatus())) {
log.error(method + "当前配送已完成,deliveryId:{}", deliveryId);
return Resp.scanFail("当前配送已完成", "当前配送已完成");
@ -8143,10 +8152,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity = updateSignDistributionLoadscanEntity(loadscanEntity, user, parcelListEntity);
distributionLoadscanService.updateById(distributionLoadscanEntity);
//缺少一个异步维护包件签收的方法
distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
updataSignforeExtracted(distributionLoadscanEntity.getDeliveryId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub(), user);
//维护订单状态
String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
@ -8164,10 +8172,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanService.save(distributionLoadscanEntity);
//进行签收数量的修改
distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车包件数和签收包件数
distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
// //更新装车包件数和签收包件数
// distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// //更新签收人
// distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
updataSignforeExtracted(distributionLoadscanEntity.getDeliveryId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub(), user);
String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
@ -8182,9 +8193,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, warehouseId, remark);
pushList.add(distributionLoadscanEntity);
packageLockIds.add(parcelListEntity.getId());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(parcelListEntity);
DistributionParcelListEntity updateE= new DistributionParcelListEntity();
updateE.setId(parcelListEntity.getId());
updateE.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
updateE.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(updateE);
//维护签收包件状态
orderCodes.add(parcelListEntity.getOrderCode());
} else {
@ -8347,8 +8361,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setPackageNub(parcelNumberDTO.getSigningNum());
loadscanEntity.setLoadedNub(parcelNumberDTO.getSigningNum());
loadscanEntity.setSigningUserId(user.getUserId());
assert distributionDeliverySelfEntity != null;
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
@ -8459,10 +8472,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(loadscaninvnEntity.getInventoryPackageId());
distributionLoadscaninvnService.updateById(loadscaninvnEntity);
pushInventoryList.add(loadscaninvnEntity);
//维护签收数量
distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
//更新签收人
distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user);
// distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user);
updataSignforeExtracted(loadscaninvnEntity.getDeliveryId(),loadscaninvnEntity.getReservationId(),loadscaninvnEntity.getPackageNub(),user);
} else {
//存在配置要求必须装车才能进行签收
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isStrictLoading) {
@ -8577,6 +8591,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanSuccess(integer + "件", integer + "件");
}
/**
* 签收维护签收单数量 签收数量 签收人
* @param deliveryId 配送ID
* @param reservationId 预约单ID
* @param number 数量
* @param user 用户
*/
private void updataSignforeExtracted(Long deliveryId,Long reservationId,Integer number, BladeUser user) {
//缺少一个异步维护包件签收的方法
// distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// //更新签收人
// distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
distributionSignforMapper.updateSignfor(deliveryId,reservationId,number,user);
}
@Override
public R selectDistributionNewAppDeliveryListPage(DistributionAppDeliveryListDTO distributionDeliveryList) {
String method = "######################################DistributionSignforServiceImpl.selectDistributionNewAppDeliveryListPage";
@ -9384,6 +9415,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setVehicleName(loadscanEntity.getVehicleName());
distributionLoadscanEntity.setSigningUserId(user.getUserId());
distributionLoadscanEntity.setDriverId(loadscanEntity.getDriverId());
distributionLoadscanEntity.setReservationId(loadscanEntity.getReservationId());
distributionLoadscanEntity.setDeliveryId(loadscanEntity.getDeliveryId());
distributionLoadscanEntity.setPackageNub(loadscanEntity.getPackageNub());
distributionLoadscanEntity.setDriverName(loadscanEntity.getDriverName());
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue());
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.weiqianshou.getValue());

53
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AuthPushJob.java

@ -2,9 +2,15 @@ package com.logpm.factorydata.jinpai.job;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factorydata.jinpai.entity.CustomPushEntity;
import com.logpm.factorydata.jinpai.entity.FactoryNodePushEntity;
import com.logpm.factorydata.jinpai.pros.JinPaiProperties;
import com.logpm.factorydata.jinpai.service.CustomPushService;
import com.logpm.factorydata.jinpai.service.FactoryNodePushService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
@ -29,6 +35,8 @@ public class AuthPushJob {
private final CustomPushService customPushService;
private final RabbitTemplate rabbitTemplate;
private final FactoryNodePushService factoryNodePushService;
private final JinPaiProperties jinPaiProperties;
/**
* 自定义回传工厂节点作业数据
@ -59,4 +67,49 @@ public class AuthPushJob {
return ReturnT.SUCCESS;
}
/**
* 字段缺失重新推送
*
* @param param
* @return
* @throws Exception
*/
@XxlJob("rePush")
public ReturnT<String> rePush(String param) throws Exception {
// 查出数据,回推工厂
List<FactoryNodePushEntity> list = factoryNodePushService.list(Wrappers.<FactoryNodePushEntity>lambdaQuery()
.eq(FactoryNodePushEntity::getReserve1, "0").last(" limit 1"));
if (CollUtil.isNotEmpty(list)) {
FactoryNodePushEntity factoryNodePushEntity = list.get(0);
String content = factoryNodePushEntity.getContent();
JSONObject entries = JSONUtil.parseObj(content);
entries.set("passSite", entries.getStr("endSite"));
String url = jinPaiProperties.getOldSystemHost() + jinPaiProperties.getOldSystemArrivedUrl();
log.info("字段缺失重新推送:{}", JSONUtil.toJsonStr(entries));
String result = HttpUtil.post(url, JSONUtil.toJsonStr(entries));
FactoryNodePushEntity factoryNodePushEntity1 = new FactoryNodePushEntity();
factoryNodePushEntity1.setContent(JSONUtil.toJsonStr(entries));
factoryNodePushEntity1.setId(factoryNodePushEntity.getId());
factoryNodePushEntity1.setReserve1("1");
factoryNodePushEntity1.setResultContent(result);
factoryNodePushService.updateById(factoryNodePushEntity1);
List<FactoryNodePushEntity> list1 = factoryNodePushService.list(Wrappers.<FactoryNodePushEntity>lambdaQuery()
.eq(FactoryNodePushEntity::getTransportNo, factoryNodePushEntity.getTransportNo())
.eq(FactoryNodePushEntity::getOrderCode, factoryNodePushEntity.getOrderCode()));
if(CollUtil.isNotEmpty(list1)){
for (FactoryNodePushEntity nodePushEntity : list1) {
String content1 = nodePushEntity.getContent();
String url1 = jinPaiProperties.getOldSystemHost() + jinPaiProperties.getOldSystemArrivedUrl();
log.info("字段缺失重新推送:{}", JSONUtil.toJsonStr(entries));
String result1 = HttpUtil.post(url1, content1);
FactoryNodePushEntity factoryNodePushEntity2 = new FactoryNodePushEntity();
factoryNodePushEntity2.setResultContent(result1);
factoryNodePushEntity2.setId(nodePushEntity.getId());
factoryNodePushService.updateById(factoryNodePushEntity2);
}
}
}
return ReturnT.SUCCESS;
}
}

12
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java

@ -252,7 +252,11 @@ public class NodeDataPushListener {
js.set("doTime", entries.getStr("operatorTime"));
js.set("sendSite", filterDatum.getWaybillStartWarehouse());
js.set("endSite", filterDatum.getWarehouseName());
js.set("passSite", filterDatum.getDestinationWarehouse());
if (StrUtil.isNotEmpty(filterDatum.getDestinationWarehouse())) {
js.set("passSite", filterDatum.getDestinationWarehouse());
} else {
js.set("passSite", filterDatum.getWarehouseName());
}
js.set("doRemark", "");
js.set("reqSn", (RandomUtil.randomLong(100000000000000000L, 999999999999999999L)) + "");
js.set("syscode", "huitong");
@ -297,9 +301,9 @@ public class NodeDataPushListener {
.content(objects)
.build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH_DELAYED)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_NODE_DATA_PUSH)
.message(JSONUtil.toJsonStr(nodePushMsg, HutoolConfigUtil.jsonConfigByDataTimeFormat()))
.exchange(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH_DELAYED)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_NODE_DATA_PUSH)
.message(JSONUtil.toJsonStr(nodePushMsg, HutoolConfigUtil.jsonConfigByDataTimeFormat()))
// 30-109秒随机
.delay(1000 * RandomUtil.randomInt(30, 110))
.build());

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java

@ -108,6 +108,8 @@ public class AdvanceOrderMqServiceImpl implements IAdvanceOrderMqService {
advanceEntity.setCreateUserName(AuthUtil.getNickName());
advanceService.save(advanceEntity);
} else {
advanceEntity.setWaybillStatus(null);
advanceEntity.setWaybillNo(null);
advanceService.updateById(advanceEntity);
}
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -802,6 +802,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//绑定订单和运单的关系
List<TrunklineAdvanceEntity> advanceEntityList = advanceService.findListByIds(advanceIds);
List<TrunklineWaybillOrderEntity> waybillOrderEntities = new ArrayList<>();
List<TrunklineAdvanceEntity> updateAdvanceEntityList = new ArrayList<>();
Set<String> orderCodeSet = new HashSet<>();
for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) {
orderCodeSet.add(advanceEntity.getOrderCode());
@ -824,13 +825,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillOrderEntities.add(waybillOrderEntity);
// orderCodes.add(advanceEntity.getOrderCode());
advanceEntity.setWaybillStatus("1");
advanceEntity.setWaybillNo(waybillNo);
TrunklineAdvanceEntity updateAdvanceEntity = new TrunklineAdvanceEntity();
updateAdvanceEntity.setId(advanceId);
updateAdvanceEntity.setWaybillStatus("1");
updateAdvanceEntity.setWaybillNo(waybillNo);
updateAdvanceEntityList.add(updateAdvanceEntity);
}
trunklineWaybillOrderService.saveBatch(waybillOrderEntities);
//修改暂存单的状态为已开单
advanceService.updateBatchById(advanceEntityList);
advanceService.updateBatchById(updateAdvanceEntityList);
//更新暂存单包件的运单信息

Loading…
Cancel
Save