Browse Source

Merge branch 'fix_bug_2024-01-16' into dev

# Conflicts:
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
single_db
汤建军 1 year ago
parent
commit
20ba4ad569
  1. 39
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  2. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

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

@ -2622,9 +2622,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询出配送任务的基本信息
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryListDTO.getId());
Long deliveryListEntityId = deliveryListEntity.getId();
if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.peisongzhong.getValue())) {
return R.fail("正在配送中...");
}
// if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.peisongzhong.getValue())) {
// return R.fail("正在配送中...");
// }
if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.yiwancheng.getValue())) {
return R.fail("配送已完成...");
}
@ -2967,16 +2967,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//根据配送计划和运单号查询出该预约
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
// DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntityId, k);
// DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
// .eq(DistributionSignforEntity::getReservationId, reservationEntity.getId())
// .eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId())
// );
// if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
// log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
// throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
// }
// DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntityId, k);
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, reservationEntity.getId())
.eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId())
);
//查询出该预约下的订单信息
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
@ -3023,6 +3020,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//此订单包件数量统计
AtomicInteger orderPackageNum = new AtomicInteger();
if (Func.isEmpty(oldOrder.get(s.getId()))) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
}
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//新增订单
@ -3155,6 +3156,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(packageListInfo)) {
packageListInfo.forEach(p -> {
if (Func.isEmpty(oldPackageList.get(p.getId()))) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
}
//为该订单新增了包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setReservationId(reservationEntity.getId());
@ -3173,6 +3178,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
});
//进行取消包件的数据清理
oldPackageList.forEach((a, b) -> {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
}
DistributionReservationPackageEntity reservationPackageEntity = b.get(0);
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(reservationPackageEntity);
@ -3268,6 +3277,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
});
if (Func.isNotEmpty(oldOrder)) {
oldOrder.forEach((m, n) -> {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
}
DistributionReservationStockarticleEntity reservationStockarticleEntity = n.get(0);
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda().eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId()).eq(DistributionReservationPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()));

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

@ -1114,25 +1114,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
public R signfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String nickName = null;
Long userId = null;
//思路: 在于一个客户下不会出现重复的包条码
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "仓库信息不能为空");
}
try {
nickName = AuthUtil.getNickName();
userId = AuthUtil.getUserId();
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
throw new CustomerException("当前登录信息不已失效,请重新登录");
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
//思路: 在于一个客户下不会出现重复的包条码
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (Func.isEmpty(parcelListEntity)) {
return Resp.scanFail("包件信息不存在", "包件信息不存在");
@ -1268,11 +1264,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护签收包件状态
distributionStockArticleService.maintenanceOrderInfo(collect.get(0).getOrderCode(),myCurrentWarehouse.getId());
//推送信息至工厂
distributionAsyncService.sendFactory(collect.get(0), simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(),nickName);
//TODO 这里就需要一个异步的包件状态维护方法
} else if (Func.isEmpty(collect)) {
//这里就需要对该包件信息是否属于该配送计划进行判定。如果属于该配送计划则是串货。不是那么则需要提示是否异常签收或者返回的操作
//查询配送计划中是否存在该包件
@ -1281,7 +1274,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (Func.isNotEmpty(one) && one.getConditions() == 2) {
log.error("#####################此包件不是定制品{}", one.getConditions());
log.error("#####################此包件不是定制品", one.getConditions());
return Resp.scanFail("此包件不是定制品", "此包件不是定制品");
}
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
@ -1290,7 +1283,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(distributionParcelListEntities) && distributionParcelListEntities.size() == 1) {
//这里按道理也具备签收条件,需要标注该装车记录不正常
log.error("#####################distributionParcelListEntities窜货{}", distributionParcelListEntities);
log.error("#####################distributionParcelListEntities窜货", distributionParcelListEntities);
return Resp.scanFail("窜货", "窜货");
} else {
//判断该货物是否属于该客户
@ -1318,6 +1311,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccess("签收成功", str);
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
throw new CustomerException("当前登录信息不已失效,请重新登录");
}
}
@Override

Loading…
Cancel
Save