|
|
|
@ -3541,10 +3541,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
Integer signingNum = distributionLoadscanMapper.selectSigningNumByReservationId(reservationId); |
|
|
|
|
//判断当前客户是否签收完成了
|
|
|
|
|
if (signingNum > 0){ |
|
|
|
|
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
}else { |
|
|
|
|
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); |
|
|
|
|
} |
|
|
|
|
if (signingNum == 0){ |
|
|
|
|
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.updateById(reservationEntity); |
|
|
|
|
|
|
|
|
@ -3603,6 +3604,44 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
//取消库存品包件
|
|
|
|
|
if (Func.isEmpty(distributionCancelReservationPackageDTO.getInventoryPackageIds())){ |
|
|
|
|
log.error(method+"InventoryPackageIds参数缺失"); |
|
|
|
|
return R.fail("请联系管理员...."); |
|
|
|
|
} |
|
|
|
|
String[] invenPackageIds = distributionCancelReservationPackageDTO.getInventoryPackageIds().split(","); |
|
|
|
|
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionCancelReservationPackageDTO.getReservationId()); |
|
|
|
|
if (Func.isNotEmpty(disStockListDetailEntities)){ |
|
|
|
|
for (String invenPackageId : invenPackageIds) { |
|
|
|
|
List<DisStockListDetailEntity> inventory = disStockListDetailEntities.stream().filter(inven -> inven.getId().equals(Long.parseLong(invenPackageId))).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(inventory) &&inventory.size() == 1){ |
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = inventory.get(0); |
|
|
|
|
if (disStockListDetailEntity.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue()) |
|
|
|
|
||disStockListDetailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())){ |
|
|
|
|
log.info(method+"检测当前取消包件存在装车或者签收操作:inventoryPackageId{}",disStockListDetailEntity.getId()); |
|
|
|
|
throw new RuntimeException("包件存在装车、签收,无法进行取消"); |
|
|
|
|
} |
|
|
|
|
//库存品配送包件的取消操作
|
|
|
|
|
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()); |
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
//维护对应预约的配送库存品品类数据
|
|
|
|
|
distributionReservationStocklistService.maintenanceReservationStockList(distributionCancelReservationPackageDTO.getReservationId()); |
|
|
|
|
//进行冻结数量的扣减
|
|
|
|
|
distributionStockListMapper.decreaseStockListQuantityOccupied(disStockListDetailEntity.getStockListId(),disStockListDetailEntity.getNum()); |
|
|
|
|
}else { |
|
|
|
|
log.error(method+"库存品包件信息异常");; |
|
|
|
|
throw new RuntimeException("库存品包件信息异常"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error(method+"预约单没有库存品包件"); |
|
|
|
|
return R.fail("此预约任务无库存品包件...."); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
//维护预约单状态
|
|
|
|
|
this.maintenanceReservationInfo(distributionCancelReservationPackageDTO.getReservationId()); |
|
|
|
|
//维护预约单数量
|
|
|
|
|