|
|
|
@ -2815,16 +2815,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
return R.fail("无仓库信息!!!"); |
|
|
|
|
} |
|
|
|
|
// if (Func.isEmpty(deliveryListDTO.getIsDeliveryDriverUpdate())){
|
|
|
|
|
// return R.fail("服务器正忙!!!");
|
|
|
|
|
// }
|
|
|
|
|
//首先对配送任务进行修改
|
|
|
|
|
//查询出配送任务的基本信息
|
|
|
|
|
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.yiwancheng.getValue())) { |
|
|
|
|
return R.fail("配送已完成..."); |
|
|
|
|
} |
|
|
|
@ -2841,7 +2833,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return R.fail("任务已装车联系司机滞留货物后进行司机切换..."); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<JSONObject> logs = new ArrayList<>(); |
|
|
|
|
//查询出原来配送信息的备货任务
|
|
|
|
|
DistributionStockupVO deliveryStockupInfo = distributionStockupMapper.getDeliveryStockupInfo(deliveryListEntity.getId()); |
|
|
|
|
//这里查询出该备货任务的执行情况,如果该任务处于已完成的状态需要创建新的备货任务,其他的备货状态则是进行备货任务的修改
|
|
|
|
@ -2862,13 +2854,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
deliveryStockupInfo.setStockupArea(stockupInfo.getGoodsAreaName()); |
|
|
|
|
} |
|
|
|
|
// ---------------------------2023-09-06 取消班组职能字段维护------------------------------------
|
|
|
|
|
// if (Func.isNotEmpty(stockupInfo.getLoaderId())) {
|
|
|
|
|
// deliveryStockupInfo.setLoaderId(stockupInfo.getLoaderId());
|
|
|
|
|
// deliveryStockupInfo.setLoaderName(stockupInfo.getLoaderName());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(stockupInfo.getLoadAndUnload())) {
|
|
|
|
|
// deliveryStockupInfo.setTeamResponsibility(stockupInfo.getLoadAndUnload());
|
|
|
|
|
// }
|
|
|
|
|
if (Func.isNotEmpty(stockupInfo.getStockupDate())) { |
|
|
|
|
deliveryStockupInfo.setStockupDate(stockupInfo.getStockupDate()); |
|
|
|
|
} |
|
|
|
@ -2928,7 +2913,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
clientTotal.getAndIncrement(); |
|
|
|
|
if (Func.isEmpty(oldClient.get(k))) { |
|
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
|
// reservationEntity.setWaybillNo(k);
|
|
|
|
|
reservationEntity.setReservationDate(reservationDate); |
|
|
|
|
reservationEntity.setReservationStatus(ReservationStatusConstant.daipeisong.getValue()); |
|
|
|
|
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue()); |
|
|
|
@ -2987,9 +2971,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(s.getOrderCode())) { |
|
|
|
|
orderNumber.add(s.getOrderCode()); |
|
|
|
|
} |
|
|
|
|
// if (Func.isNotEmpty(s.getWaybillNumber())){
|
|
|
|
|
// waybillNo.add(s.getWaybillNumber());
|
|
|
|
|
// }
|
|
|
|
|
if (Func.isNotEmpty(s.getWarehouse())) { |
|
|
|
|
warehouseName.add(s.getWarehouse()); |
|
|
|
|
} |
|
|
|
@ -3043,18 +3024,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//此时订单下的所有包件都处于预约状态,可用数为0
|
|
|
|
|
orderPackageNum.getAndAdd(dp.getQuantity()); |
|
|
|
|
//修改订单下的包件状态
|
|
|
|
|
// p.setOrderPackageReservationStatus();
|
|
|
|
|
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(dp); |
|
|
|
|
distributionAsyncService.checkStockArticleReservationStatus(dp); |
|
|
|
|
packageLockIds.add(dp.getId()); |
|
|
|
|
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单勾选包件,预约任务号:"+reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode()); |
|
|
|
|
logs.add(js); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
|
}); |
|
|
|
|
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
|
// s.setAvailableQuantity(0);
|
|
|
|
|
// distributionStockArticleService.updateById(s);
|
|
|
|
|
} else { |
|
|
|
|
packageListInfo.forEach(p -> { |
|
|
|
|
orderPackageNum.getAndAdd(p.getQuantity()); |
|
|
|
@ -3069,7 +3048,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelListService.updateById(p); |
|
|
|
|
packageLockIds.add(p.getId()); |
|
|
|
|
//这里根据包件进行订单状态的改变
|
|
|
|
|
// distributionAsyncService.checkStockArticleReservationStatus(p);
|
|
|
|
|
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单系统默认可用包件,预约任务号:"+reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode()); |
|
|
|
|
logs.add(js); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//维护订单信息
|
|
|
|
@ -3158,8 +3139,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
reservationEntity.setDeliveryPhone(String.join(",", consigneeMobile)); |
|
|
|
|
reservationEntity.setDeliveryAddress(String.join(",", consigneeAddress)); |
|
|
|
|
reservationEntity.setReceivingUnit(String.join(",", consignee)); |
|
|
|
|
// reservationEntity.setWaybillId(String.join(",", waybillId));
|
|
|
|
|
// reservationEntity.setReservationDate(date);
|
|
|
|
|
// -----------------------预约信息完善----------------------------
|
|
|
|
|
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue()); |
|
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); |
|
|
|
@ -3193,7 +3172,6 @@ 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()) |
|
|
|
@ -3217,9 +3195,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(s.getOrderCode())) { |
|
|
|
|
orderNumber.add(s.getOrderCode()); |
|
|
|
|
} |
|
|
|
|
// if (Func.isNotEmpty(s.getWaybillNumber())){
|
|
|
|
|
// waybillNo.add(s.getWaybillNumber());
|
|
|
|
|
// }
|
|
|
|
|
if (Func.isNotEmpty(s.getWarehouse())) { |
|
|
|
|
warehouseName.add(s.getWarehouse()); |
|
|
|
|
} |
|
|
|
@ -3269,7 +3244,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelListService.updateById(p); |
|
|
|
|
packageLockIds.add(p.getId()); |
|
|
|
|
//这里根据包件进行订单状态的改变
|
|
|
|
|
// distributionAsyncService.checkStockArticleReservationStatus(p);
|
|
|
|
|
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:操作已选订单包件,预约任务号:"+reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode()); |
|
|
|
|
logs.add(js); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
//查询该订单下的所有包件信息并插入该计划中
|
|
|
|
@ -3294,19 +3271,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//此时订单下的所有包件都处于预约状态,可用数为0
|
|
|
|
|
orderPackageNum.getAndAdd(dp.getQuantity()); |
|
|
|
|
//修改订单下的包件状态
|
|
|
|
|
// p.setOrderPackageReservationStatus();
|
|
|
|
|
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(dp); |
|
|
|
|
distributionAsyncService.checkStockArticleReservationStatus(dp); |
|
|
|
|
packageLockIds.add(dp.getId()); |
|
|
|
|
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:操作已选订单包件,预约任务号:"+reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode()); |
|
|
|
|
logs.add(js); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
|
}); |
|
|
|
|
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
|
// s.setAvailableQuantity(0);
|
|
|
|
|
// distributionStockArticleService.updateById(s);
|
|
|
|
|
} |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
} else { |
|
|
|
@ -3381,10 +3356,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId()) |
|
|
|
|
.eq(DistributionReservationPackageEntity::getStockArticleId, s.getId()) |
|
|
|
|
.ne(DistributionReservationPackageEntity::getPacketBarStatus, "2")); |
|
|
|
|
// List<DistributionReservationPackageEntity> distributionReservationPackageEntities = distributionReservationPackageMapper.selectList(new QueryWrapper<DistributionReservationPackageEntity>().lambda()
|
|
|
|
|
// .eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId())
|
|
|
|
|
// .eq(DistributionReservationPackageEntity::getStockArticleId, s.getId())
|
|
|
|
|
// );
|
|
|
|
|
if (Func.isEmpty(list)) { |
|
|
|
|
log.error("###########################预约包件查询错误:{}", list); |
|
|
|
|
log.error("###########################查询错误预约Id:{}", reservationEntity.getId()); |
|
|
|
@ -3513,13 +3484,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//查询出这个订单下的包件信息
|
|
|
|
|
// List<DistributionReservationPackageEntity> oldPackageList = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationEntity.getId(), reservationStockarticleEntities.get(0).getStockArticleId());
|
|
|
|
|
|
|
|
|
|
//进行预约订单中间信息的修改
|
|
|
|
|
reservationStockarticleEntity.setReservationNum(packageNum.get()); |
|
|
|
|
distributionReservationStockarticleService.updateById(reservationStockarticleEntity); |
|
|
|
|
// oldOrder.remove(s.getId());
|
|
|
|
|
//预约订单上的包件数量维护
|
|
|
|
|
packageTotal.getAndAdd(reservationStockarticleEntity.getReservationNum()); |
|
|
|
|
} |
|
|
|
@ -3622,8 +3590,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
}); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(e.getStockArticleId()); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
// stockArticleEntity.setReservationStatus(distributionReservationPackageService.judgmentStatus(Func.copy(stockArticleEntity, DistributionStockArticleDTO.class)));
|
|
|
|
|
// distributionStockArticleService.updateById(stockArticleEntity);
|
|
|
|
|
//修改预约状态和包件状态
|
|
|
|
|
} else if (e.getIsZero().equals(IsOrNoConstant.yes.getValue())) { |
|
|
|
|
//零担
|
|
|
|
|