Browse Source

商配订单限制增加

dist.1.3.0
汤建军 10 months ago
parent
commit
44ab7b4b38
  1. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  2. 67
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1815,7 +1815,8 @@
ldr.service_number,
ldr.cancel_reason,
ldr.is_urgent,
ldr.collection_fee
ldr.collection_fee,
ldr.signing_status
FROM
logpm_distribution_signfor AS lds
INNER JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id

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

@ -2877,7 +2877,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
newClient.forEach((k, v) -> {
HashSet<String> orderNumber = new HashSet<>();
//运单号
// HashSet<String> waybillNo = new HashSet<>();
//运单ID -------这里运单Id后续可能变更为运单号
HashSet<String> waybillId = new HashSet<>();
//订单服务号
@ -3170,7 +3169,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.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()));
Map<Long, List<DistributionReservationStockarticleEntity>> oldOrder = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));
@ -3214,12 +3212,12 @@ 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())) {
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
}
//新增订单
List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo();
if (Func.isNotEmpty(packageListInfo)) {
@ -3359,9 +3357,9 @@ 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())) {
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
}
//为该订单新增了包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
@ -3384,30 +3382,33 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
packageNum.getAndAdd(p.getQuantity());
});
//进行取消包件的数据清理
oldPackageList.forEach((a, b) -> {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
if (!oldPackageList.isEmpty()) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法取消包件");
}
DistributionReservationPackageEntity reservationPackageEntity = b.get(0);
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(reservationPackageEntity);
//取消包件的预约状态,并且进行整个订单的状态修改
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(reservationPackageEntity.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
if (Func.isNotEmpty(bladeRedis.get("warehouseId:"+myCurrentWarehouse.getId()+"orderCode:"+parcelListEntity.getOrderCode()))){
List<Long> ids = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode());
int indexOf = ids.indexOf(parcelListEntity.getId());
if (indexOf>0){
ids.remove(indexOf);
bladeRedis.set("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode(),ids);
oldPackageList.forEach((a, b) -> {
DistributionReservationPackageEntity reservationPackageEntity = b.get(0);
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(reservationPackageEntity);
//取消包件的预约状态,并且进行整个订单的状态修改
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(reservationPackageEntity.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
if (Func.isNotEmpty(bladeRedis.get("warehouseId:"+myCurrentWarehouse.getId()+"orderCode:"+parcelListEntity.getOrderCode()))){
List<Long> ids = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode());
int indexOf = ids.indexOf(parcelListEntity.getId());
if (indexOf>0){
ids.remove(indexOf);
bladeRedis.set("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode(),ids);
}
}
}
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消商配计划配车,操作方式:对已有计划订单进行勾选包件取消操作,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消商配计划配车,操作方式:对已有计划订单进行勾选包件取消操作,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
}
} else {
//查找该订单没有进行包件选择的操作, 但是存在newOrder列表中 视为该订单保持计划选择
packageNum.getAndAdd(reservationStockarticleEntity.getReservationNum());
@ -3502,11 +3503,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
});
if (Func.isNotEmpty(oldOrder)) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法取消包件");
}
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()));

Loading…
Cancel
Save