|
|
|
@ -669,8 +669,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) { |
|
|
|
|
//在客户列表进行装车
|
|
|
|
@ -1033,157 +1031,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List<Long> trayGoodIds = voGoodsLsit.stream().filter(v -> v.getAssociationType().equals("3")).map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
|
|
|
|
|
//此时经过过滤后的包件ID和托盘上的所有包件ID数量一致,视为该托盘上的均为包件
|
|
|
|
|
// if (voGoodsLsit.size() == trayGoodIds.size()) {
|
|
|
|
|
// List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.listByIds(trayGoodIds);
|
|
|
|
|
//// if (trayLoadingStatus){
|
|
|
|
|
//// return Resp.scanFail("托盘装车完毕","托盘货物已装车完毕");
|
|
|
|
|
//// }
|
|
|
|
|
//
|
|
|
|
|
// if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0 && trayLoadingStatus) {
|
|
|
|
|
// return Resp.scanFail("重复扫描", "重复扫描");
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isEmpty(parcelListEntities) || parcelListEntities.size() <= 0) {
|
|
|
|
|
// return Resp.scanFail("操作失败", "该托盘上无货物信息");
|
|
|
|
|
// }
|
|
|
|
|
//// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) {
|
|
|
|
|
//// //存在客户 这里就是针对客户进行的整托装车
|
|
|
|
|
//// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
|
//// Map<Long, DistributionParcelListEntity> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2));
|
|
|
|
|
//// boolean reservationFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(parcelListEntityMap.get(p.getId())));
|
|
|
|
|
//// if (reservationFlag) {
|
|
|
|
|
//// List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>();
|
|
|
|
|
//// for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
|
|
|
|
|
//// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
|
|
|
|
|
//// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
|
|
|
|
|
//// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
|
|
|
|
|
//// distributionParcelListService.updateById(parcelListEntity);
|
|
|
|
|
//// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) {
|
|
|
|
|
//// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
|
|
|
|
|
//// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
|
|
|
|
|
//// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
|
|
|
|
|
//// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
|
|
|
|
|
//// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
//// }
|
|
|
|
|
//// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
|
|
|
|
|
//// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
|
|
|
|
|
//// loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
|
//// loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
|
|
|
|
|
//// loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
|
|
|
|
|
//// loadscanEntity.setPackageId(parcelListEntity.getId());
|
|
|
|
|
//// loadscanEntity.setScanTime(new Date());
|
|
|
|
|
//// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
//// loadscanEntity.setScanUser(user.getUserName());
|
|
|
|
|
//// loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
|
|
|
|
|
//// loadscanEntity.setOneClick(1);
|
|
|
|
|
//// loadscanEntity.setScanType("2");
|
|
|
|
|
//// loadscanEntity.setScanStatus("1");
|
|
|
|
|
//// loadscanEntity.setIsInsert(1);
|
|
|
|
|
//// loadscanEntity.setMsg("司机按照预约整托装车");
|
|
|
|
|
//// loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode());
|
|
|
|
|
//// reservationLoadscanEntities.add(loadscanEntity);
|
|
|
|
|
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// //更新签收表的装车数量
|
|
|
|
|
//// Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
////// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
|
|
|
|
|
//// }
|
|
|
|
|
//// }
|
|
|
|
|
////// str.append("预约客户整托装车");
|
|
|
|
|
//// distributionLoadscanService.saveBatch(reservationLoadscanEntities);
|
|
|
|
|
//// //这里则进行整托装车的数据构建
|
|
|
|
|
//// } else {
|
|
|
|
|
//// return Resp.scanFail("整托装车失败", "存在其他客户货物");
|
|
|
|
|
//// }
|
|
|
|
|
//// } else {
|
|
|
|
|
//// //不存在客户 这里就是针对配送任务进行的整托装车
|
|
|
|
|
//// List<DistributionParcelListEntity> deliveryPackageList = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// Map<Long, DistributionParcelListEntity> deliveryPackageMap = deliveryPackageList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2));
|
|
|
|
|
//// boolean delivaryFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(deliveryPackageMap.get(p.getId())));
|
|
|
|
|
//// if (delivaryFlag) {
|
|
|
|
|
//// List<DistributionLoadscanEntity> deliveryLoadscanEntities = new ArrayList<>();
|
|
|
|
|
//// for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
|
|
|
|
|
//// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
|
|
|
|
|
//// //查询出这个包件属于哪个客户
|
|
|
|
|
//// DistributionReservationEntity reservationEntity = distributionDeliveryListMapper.selectReservationByPackageAndDeliveryId(parcelListEntity.getOrderPackageCode(), distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
|
|
|
|
|
//// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
|
|
|
|
|
//// distributionParcelListService.updateById(parcelListEntity);
|
|
|
|
|
//// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) {
|
|
|
|
|
//// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
|
|
|
|
|
//// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
|
|
|
|
|
//// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
|
|
|
|
|
//// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
|
|
|
|
|
//// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
//// }
|
|
|
|
|
//// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
|
|
|
|
|
//// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
|
|
|
|
|
//// //查询出这个包件属于哪个客户
|
|
|
|
|
////
|
|
|
|
|
//// loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
|
//// loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
|
|
|
|
|
//// loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
|
|
|
|
|
//// loadscanEntity.setPackageId(parcelListEntity.getId());
|
|
|
|
|
//// loadscanEntity.setReservationId(reservationEntity.getId());
|
|
|
|
|
//// loadscanEntity.setScanTime(new Date());
|
|
|
|
|
//// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
//// loadscanEntity.setScanUser(user.getUserName());
|
|
|
|
|
//// loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
|
|
|
|
|
//// loadscanEntity.setOneClick(1);
|
|
|
|
|
//// loadscanEntity.setScanType("2");
|
|
|
|
|
//// loadscanEntity.setScanStatus("1");
|
|
|
|
|
//// loadscanEntity.setIsInsert(1);
|
|
|
|
|
//// loadscanEntity.setMsg("司机按照计划整托装车");
|
|
|
|
|
//// loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode());
|
|
|
|
|
//// deliveryLoadscanEntities.add(loadscanEntity);
|
|
|
|
|
//// //更新装车时间
|
|
|
|
|
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// //更新签收表的装车数量
|
|
|
|
|
//// Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
////// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
|
|
|
|
|
//// }
|
|
|
|
|
//// }
|
|
|
|
|
////// str.append("配送计划整托装车");
|
|
|
|
|
//// distributionLoadscanService.saveBatch(deliveryLoadscanEntities);
|
|
|
|
|
//// //这里则进行整托装车的数据构建
|
|
|
|
|
//// } else {
|
|
|
|
|
//// return Resp.scanFail("整托装车失败", "存在其他客户货物");
|
|
|
|
|
//// }
|
|
|
|
|
//// }
|
|
|
|
|
// //进行装车状态维护
|
|
|
|
|
// //TODO 需要一个维护状态的异步方法
|
|
|
|
|
// distributionAsyncService.checkLoadingByDelivery(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// } else {
|
|
|
|
|
// log.error("托盘存放货物类型不单一:{}", trayTypeDataVO);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //查询已装车件数
|
|
|
|
|
// String str = getLoadingMsg(distrilbutionloadingscanDTO);
|
|
|
|
|
// return Resp.scanSuccess("装车成功", str);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Integer getCarLaodNum(Long deliveryId) { |
|
|
|
|
AtomicInteger loadingNum = new AtomicInteger(); |
|
|
|
|
Integer contNum_a = distributionLoadscanMapper.getLoadCountNum(deliveryId); |
|
|
|
@ -2756,6 +2603,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 找寻预约单ID 相同的数据进行返回 |
|
|
|
|
* |
|
|
|
|
* @param reservationStockarticleEntityLists |
|
|
|
|
* @param id |
|
|
|
|
* @return List |
|
|
|
@ -4876,7 +4724,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
public List<PrintPreviewVO> printBatch(String ids, Integer type) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicPrintTemplateEntity template = getPrintTemplate(type); |
|
|
|
|
|
|
|
|
|
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); |
|
|
|
@ -6378,7 +6225,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return aftersalesAbnormalPackageVOS; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -6429,8 +6275,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) { |
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
|
String dirverName = null; |
|
|
|
@ -7290,52 +7134,105 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public void maintenanceDeliveryInfo(Long deliveryId) { |
|
|
|
|
log.info(">>>>>>>>>>>>>>> 车次状态维护1 代码执行 deliveryId={}",deliveryId); |
|
|
|
|
String method = "###################DistributionDeliveryListServiceImpl执行方法maintenanceDeliveryInfo,"; |
|
|
|
|
if (Func.isEmpty(deliveryId)) { |
|
|
|
|
log.info(method + "参数缺失deliveryId:{}", deliveryId); |
|
|
|
|
throw new RuntimeException("服务器正忙!!!"); |
|
|
|
|
if (Objects.isNull(deliveryId)) { |
|
|
|
|
throw new IllegalArgumentException("deliveryId 不能为空"); |
|
|
|
|
} |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId); |
|
|
|
|
DistributionDeliveryListEntity old = new DistributionDeliveryListEntity(); |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = getById(deliveryId); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(deliveryListEntity, old); |
|
|
|
|
if (ObjectUtil.isEmpty(deliveryListEntity)) { |
|
|
|
|
log.info(method + "查询配送失败,deliveryId:{}", deliveryId); |
|
|
|
|
throw new RuntimeException("服务器正忙!!!"); |
|
|
|
|
throw new RuntimeException("查询配送失败"); |
|
|
|
|
} |
|
|
|
|
//查询指定配送计划装车件数
|
|
|
|
|
DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(deliveryId); |
|
|
|
|
log.info(">>>>>>>>>>>>>>> 车次状态维护2 代码执行 deliveryLoadingNum{}",deliveryLoadingNum); |
|
|
|
|
|
|
|
|
|
int loadingNum = 0; |
|
|
|
|
int deliveryQuantity = deliveryListEntity.getDeliveryNumber() + (Objects.isNull(deliveryListEntity.getInventoryNub()) ? 0 : deliveryListEntity.getInventoryNub()); |
|
|
|
|
if (Func.isNotEmpty(deliveryLoadingNum)) { |
|
|
|
|
loadingNum += deliveryLoadingNum.getInventoryLoadingQuantity() + deliveryLoadingNum.getPackageLoadingQuantity(); |
|
|
|
|
int deliveryQuantity = getDeliveryQuantity(deliveryListEntity); |
|
|
|
|
int loadingNum = getLoadingNum(deliveryId); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新配送状态。 |
|
|
|
|
* 根据配送清单实体中的信息,更新配送数量和装载数量,以反映配送的实时进展。 |
|
|
|
|
* @param deliveryListEntity 配送清单实体,包含需要更新的配送信息。 |
|
|
|
|
* @param deliveryQuantity 更新的配送数量,用于调整配送状态。 |
|
|
|
|
* @param loadingNum 装载数量,用于进一步细化配送状态的更新。 |
|
|
|
|
*/ |
|
|
|
|
updateDeliveryStatus(deliveryListEntity, deliveryQuantity, loadingNum); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新配送清单实体。 |
|
|
|
|
* 保存对配送清单实体所做的所有更新,确保数据的一致性和准确性。 |
|
|
|
|
* @param deliveryListEntity 配送清单实体,包含所有需要更新的信息。 |
|
|
|
|
*/ |
|
|
|
|
updateDeliveryListEntity(deliveryListEntity, old); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (deliveryQuantity != 0) { |
|
|
|
|
if (loadingNum == deliveryQuantity) { |
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
} else { |
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); |
|
|
|
|
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); |
|
|
|
|
private int getDeliveryQuantity(DistributionDeliveryListEntity deliveryListEntity) { |
|
|
|
|
return deliveryListEntity.getDeliveryNumber() + (Objects.isNull(deliveryListEntity.getInventoryNub()) ? 0 : deliveryListEntity.getInventoryNub()); |
|
|
|
|
} |
|
|
|
|
if (loadingNum == 0) { |
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); |
|
|
|
|
|
|
|
|
|
private int getLoadingNum(Long deliveryId) { |
|
|
|
|
DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(deliveryId); |
|
|
|
|
return Func.isNotEmpty(deliveryLoadingNum) |
|
|
|
|
? deliveryLoadingNum.getInventoryLoadingQuantity() + deliveryLoadingNum.getPackageLoadingQuantity() |
|
|
|
|
: 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
log.error(method + "查询配送无计划数量,deliveryId:{}", deliveryId); |
|
|
|
|
private void updateDeliveryStatus(DistributionDeliveryListEntity deliveryListEntity, int deliveryQuantity, int loadingNum) { |
|
|
|
|
// 检查配送数量是否为0,如果是,则记录错误日志并返回
|
|
|
|
|
if (deliveryQuantity == 0) { |
|
|
|
|
log.error("查询配送无计划数量,deliveryId: {}", deliveryListEntity.getId()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询配送内有效的客户信息
|
|
|
|
|
// 根据装载数量与配送数量的关系,设置配送装载状态
|
|
|
|
|
// 如果装载数量等于配送数量,设置为“已装车”;如果装载数量大于0但小于配送数量,设置为“部分装车”;否则设置为“未装车”
|
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus( |
|
|
|
|
loadingNum == deliveryQuantity ? DeliveryLoadingStatusConstant.yizhuangche.getValue() |
|
|
|
|
: (loadingNum > 0 ? DeliveryLoadingStatusConstant.bunfenzhuangche.getValue() : DeliveryLoadingStatusConstant.weizhuangche.getValue())); |
|
|
|
|
|
|
|
|
|
// 根据装载数量是否等于配送数量且所有配送是否已完成签收,设置配送状态
|
|
|
|
|
// 如果装载数量等于配送数量且所有配送已完成签收,设置为“已完成”;否则设置为“配送中”
|
|
|
|
|
deliveryListEntity.setDeliveryStatus(loadingNum == deliveryQuantity && isAllSignforCompleted(deliveryListEntity.getId()) |
|
|
|
|
? DeliveryStatusConstant.yiwancheng.getValue() |
|
|
|
|
: DeliveryStatusConstant.peisongzhong.getValue()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isAllSignforCompleted(Long deliveryId) { |
|
|
|
|
List<DistributionSignforEntity> signforEntities = baseMapper.selectSignforByDeliveryId(deliveryId); |
|
|
|
|
boolean flag = signforEntities.stream().allMatch(s -> SignforStatusConstant.yiqianshou.getValue().equals(s.getSigningStatus())); |
|
|
|
|
log.info(method+"维护配送状态>>>>>>>>>>>>deliveryId:{}",deliveryId); |
|
|
|
|
log.info(method+"维护配送状态>>>>>>>>>>>>状态是否满足完成:{}",flag); |
|
|
|
|
if (flag){ |
|
|
|
|
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); |
|
|
|
|
return signforEntities.stream().allMatch(s -> SignforStatusConstant.yiqianshou.getValue().equals(s.getSigningStatus())); |
|
|
|
|
} |
|
|
|
|
this.updateById(deliveryListEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateDeliveryListEntity(DistributionDeliveryListEntity deliveryListEntity, DistributionDeliveryListEntity old) { |
|
|
|
|
|
|
|
|
|
// 判断传入的对象是否是否为null
|
|
|
|
|
if (Objects.isNull(deliveryListEntity)) { |
|
|
|
|
throw new IllegalArgumentException("deliveryListEntity 不能为空"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(old)) { |
|
|
|
|
throw new IllegalArgumentException("old 不能为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(old.getDeliveryStatus()==null|| old.getDeliveryListLoadingStatus()==null){ |
|
|
|
|
updateById(deliveryListEntity); |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 判断传入的2个对象中的deliveryStatus 是否相同
|
|
|
|
|
if (deliveryListEntity.getDeliveryStatus().equals(old.getDeliveryStatus())) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//判断传入2个对象中deliveryListLoadingStatus 是否相同
|
|
|
|
|
if (deliveryListEntity.getDeliveryListLoadingStatus().equals(old.getDeliveryListLoadingStatus())) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
updateById(deliveryListEntity); |
|
|
|
|
log.info("配送信息状态已更新,deliveryId: {}", deliveryListEntity.getId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) { |
|
|
|
|
JSONObject trunklinePackageTrackLog = new JSONObject(); |
|
|
|
|