Browse Source

取消库存品工鞥完善、一键装车维护客户签收状态

single_db
汤建军 1 year ago
parent
commit
b0a3c888fc
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java
  2. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java

@ -64,7 +64,7 @@ public class DistributionCancelReservationPackageDTO {
/**
* 库存品包件ID
*/
private Long inventoryPackageId;
private String inventoryPackageIds;

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -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());
//维护预约单数量

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

@ -521,6 +521,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.ne(DistributionLoadscaninvnEntity::getScanStatus, 1));
BladeUser user = AuthUtil.getUser();
if (Func.isNotEmpty(loadscaninvnEntity)){
if (loadscaninvnEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
log.error(method+"库存品:"+s+"已经签收,无需重复签收");
throw new RuntimeException("库存品:"+s+"已经签收,无需重复签收");
}
//存在装车数据,进行状态变更即可
loadscaninvnEntity.setSigningUserId(user.getUserId());
loadscaninvnEntity.setSigningUser(user.getNickName());
@ -2079,6 +2083,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
distributionLoadscaninvnEntity.setOrderPackageCode(inventory.get(0).getStockPackageCode());
distributionLoadscaninvnEntity.setInventoryId(inventory.get(0).getStockListId());
distributionLoadscaninvnEntity.setInventoryPackageId(inventory.get(0).getId());
distributionLoadscaninvnEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
distributionLoadscaninvnEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscaninvnEntity.setScanUser(user.getUserName());

Loading…
Cancel
Save