|
|
|
@ -122,6 +122,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
private final DistributionReservationMapper distributionReservationMapper; |
|
|
|
|
private final IDisStockListDetailService disStockListDetailService; |
|
|
|
|
private final IDistributionStockListService distributionStockListService; |
|
|
|
|
private final DistributionStockListMapper distributionStockListMapper; |
|
|
|
|
private final DistributionAddvalueMapper distributionAddvalueMapper; |
|
|
|
|
private final IDistributionAddvalueService distributionAddvalueService; |
|
|
|
|
private final IDistributionAddvaluePackageService distributionAddvaluePackageService; |
|
|
|
@ -295,6 +296,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
throw new CustomerException(403, "仓库信息不能为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(list)){ |
|
|
|
|
//满足条件此码必定为库存品
|
|
|
|
|
//判断该库存品是否属于当前客户
|
|
|
|
|
List<DisStockListDetailEntity> collect = list.stream().filter(l -> l.getReservationId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(collect)){ |
|
|
|
|
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码"); |
|
|
|
|
} |
|
|
|
|
return Resp.scanFail("此码不是订制品", "此码不是订制品"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
//查询该客户是否存在该包件信息
|
|
|
|
|
List<DistributionParcelListEntity> collect = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList()); |
|
|
|
@ -950,6 +966,18 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
// 1、查询配送任务是否存在库存品 ---- > 没有 此码无效
|
|
|
|
|
// 2、查询该客户是否存在满足的库存品 --- 没有 查看是否存在计划 窜货
|
|
|
|
|
// 3、是否异常签收
|
|
|
|
|
|
|
|
|
|
//判断扫码是否是包件
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
if (Func.isNotEmpty(parcelListEntities)){ |
|
|
|
|
boolean isHave = parcelListEntities.stream().map(DistributionParcelListEntity::getOrderPackageCode).anyMatch(c -> c.contains(distrilbutionloadingscanDTO.getBarcode())); |
|
|
|
|
if (Func.isNotEmpty(isHave)){ |
|
|
|
|
return Resp.scanFail("请在订制品页面扫描此码", "请在订制品页面扫描此码"); |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("扫描错误", "未知二维码"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
if (Func.isEmpty(detailEntities)) { |
|
|
|
|
return Resp.scanFail("此码无效", "此码无效"); |
|
|
|
@ -973,6 +1001,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
// 库存品进行装车,这里需要对库存品扫描数据进行签收的状态标记
|
|
|
|
|
loadscaninvnEntity.setSigningUserId(user.getUserId()); |
|
|
|
|
loadscaninvnEntity.setSigningUser(user.getUserName()); |
|
|
|
|
loadscaninvnEntity.setReceivedQuantity(inventory.get(0).getNum()); |
|
|
|
|
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
loadscaninvnEntity.setOneQclick(1); |
|
|
|
@ -1036,14 +1065,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer i = distributionSignforMapper.updateSignUser(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), AuthUtil.getUser()); |
|
|
|
|
|
|
|
|
|
//扣减库存
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(inventory.get(0).getStockListId()); |
|
|
|
|
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - distributionLoadscaninvnEntity.getPackageNub()); |
|
|
|
|
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - distributionLoadscaninvnEntity.getPackageNub()); |
|
|
|
|
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + distributionLoadscaninvnEntity.getPackageNub()); |
|
|
|
|
distributionStockListService.updateById(stockListEntity); |
|
|
|
|
distributionAsyncService.checkSignStatus(null, distributionLoadscaninvnEntity.getReservationId(),distributionLoadscaninvnEntity.getDeliveryId()); |
|
|
|
|
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(),distributionLoadscaninvnEntity.getLoadedNub()); |
|
|
|
|
// //扣减库存
|
|
|
|
|
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(inventory.get(0).getStockListId());
|
|
|
|
|
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - distributionLoadscaninvnEntity.getPackageNub());
|
|
|
|
|
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - distributionLoadscaninvnEntity.getPackageNub());
|
|
|
|
|
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + distributionLoadscaninvnEntity.getPackageNub());
|
|
|
|
|
// distributionStockListService.updateById(stockListEntity);
|
|
|
|
|
// distributionAsyncService.checkSignStatus(null, distributionLoadscaninvnEntity.getReservationId(),distributionLoadscaninvnEntity.getDeliveryId());
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} else if (inventory.size() == 0) { |
|
|
|
@ -1068,7 +1098,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanFail("操作失败", "操作失败"); |
|
|
|
|
} |
|
|
|
|
distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
return Resp.scanSuccess("签收成功", "签收成功"); |
|
|
|
|
String str = checkSignNum(distrilbutionloadingscanDTO); |
|
|
|
|
return Resp.scanSuccess("签收成功", str); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
|
|
|
|
|