|
|
|
@ -1807,27 +1807,94 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
//扫描
|
|
|
|
|
if ("1".equals(type)) { |
|
|
|
|
//库存品
|
|
|
|
|
DistrilbutionBillLadingInventoryAppVO inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId), String.valueOf(coding)); |
|
|
|
|
List<DistrilbutionBillLadingInventoryAppVO> inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId), String.valueOf(coding)); |
|
|
|
|
if (ObjectUtils.isNotNull(inventoryAppVO)) { |
|
|
|
|
//查询签收数量
|
|
|
|
|
List<DistributionBillLadingScanEntity> list = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda() |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getMaterialType, "1") |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getStockListId, inventoryAppVO.getStockListId()) |
|
|
|
|
List<Long> stocklistIds = inventoryAppVO.stream().map(DistrilbutionBillLadingInventoryAppVO::getStockListId).collect(Collectors.toList()); |
|
|
|
|
//查询该自提单所有的库存品包件信息
|
|
|
|
|
List<DisStockListDetailEntity> inventoryPackage = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, billLadingId) |
|
|
|
|
.in(DisStockListDetailEntity::getStockListId, stocklistIds) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (list.size() == inventoryAppVO.getQuantity() + 1) { |
|
|
|
|
//修改完成状态
|
|
|
|
|
distributionAsyncService.getInventoryOrderSelfPickup(inventoryAppVO.getLdddId()); |
|
|
|
|
} |
|
|
|
|
if (list.size() > inventoryAppVO.getQuantity()) { |
|
|
|
|
return Resp.scanFail("已完成!", "已完成!!"); |
|
|
|
|
Long stockListId = 0L; |
|
|
|
|
if (Func.isNotEmpty(inventoryPackage)){ |
|
|
|
|
//检测库存品包件是否都已经完成备货
|
|
|
|
|
boolean flag = inventoryPackage.stream().anyMatch(f -> Func.isEmpty(f.getStockPackageCode())); |
|
|
|
|
if (!flag){ |
|
|
|
|
return Resp.scanFail("库存品备货未完成,请联系库管人员!", "库存品备货未完成,请联系库管人员"); |
|
|
|
|
} |
|
|
|
|
//校验包件李彪是否存在满足码值的包件
|
|
|
|
|
List<DisStockListDetailEntity> collect = inventoryPackage.stream().filter(f -> coding.equals(f.getStockPackageCode())).collect(Collectors.toList()); |
|
|
|
|
if (collect.size() == 1){ |
|
|
|
|
//满足签收
|
|
|
|
|
distributionBillLadingScan.setPacketBarCode((String) coding); |
|
|
|
|
distributionBillLadingScan.setStockListId(collect.get(0).getStockListId()); |
|
|
|
|
distributionBillLadingScan.setQuantity(1); |
|
|
|
|
distributionBillLadingScanService.save(distributionBillLadingScan); |
|
|
|
|
stockListId = collect.get(0).getStockListId(); |
|
|
|
|
}else { |
|
|
|
|
//不满足签收,记录为什么不满足
|
|
|
|
|
if (collect.size() > 1){ |
|
|
|
|
//已备货库存品包件存在多条一样的
|
|
|
|
|
|
|
|
|
|
log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}",coding); |
|
|
|
|
return Resp.scanFail("系统无此编码!", "系统无此编码"); |
|
|
|
|
}else { |
|
|
|
|
//备货库存品不存在
|
|
|
|
|
return Resp.scanFail("系统无此编码!", "系统无此编码"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Map<Long, List<DistrilbutionBillLadingInventoryAppVO>> stockListMap = inventoryAppVO.stream().collect(Collectors.groupingBy(DistrilbutionBillLadingInventoryAppVO::getStockArticleId)); |
|
|
|
|
//查询签收数量
|
|
|
|
|
List<DistributionBillLadingScanEntity> list = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda() |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getMaterialType, "1") |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getStockListId, stockListId) |
|
|
|
|
); |
|
|
|
|
List<DistrilbutionBillLadingInventoryAppVO> billLadingInventoryAppVOS = stockListMap.get("stockListId"); |
|
|
|
|
if (Func.isNotEmpty(billLadingInventoryAppVOS)){ |
|
|
|
|
DistrilbutionBillLadingInventoryAppVO distrilbutionBillLadingInventoryAppVO = billLadingInventoryAppVOS.get(0); |
|
|
|
|
if (list.size() == distrilbutionBillLadingInventoryAppVO.getQuantity()) { |
|
|
|
|
//修改完成状态
|
|
|
|
|
distributionAsyncService.getInventoryOrderSelfPickup(distrilbutionBillLadingInventoryAppVO.getLdddId()); |
|
|
|
|
} |
|
|
|
|
if (list.size() > distrilbutionBillLadingInventoryAppVO.getQuantity()) { |
|
|
|
|
return Resp.scanFail("已完成!", "已完成!!"); |
|
|
|
|
} |
|
|
|
|
//修改库存品签收
|
|
|
|
|
distributionAsyncService.getInventorySelfPickup(distrilbutionBillLadingInventoryAppVO.getStockArticleId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("库存品暂未备货请联系库管人员!", "库存品暂未备货请联系库管人员"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//修改库存品签收
|
|
|
|
|
distributionAsyncService.getInventorySelfPickup(inventoryAppVO.getStockArticleId()); |
|
|
|
|
distributionBillLadingScan.setPacketBarCode((String) coding); |
|
|
|
|
distributionBillLadingScan.setStockListId(inventoryAppVO.getStockListId()); |
|
|
|
|
distributionBillLadingScan.setQuantity(1); |
|
|
|
|
distributionBillLadingScanService.save(distributionBillLadingScan); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //查询签收数量
|
|
|
|
|
// List<DistributionBillLadingScanEntity> list = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
|
|
|
|
|
// .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
|
|
|
|
|
// .eq(DistributionBillLadingScanEntity::getMaterialType, "1")
|
|
|
|
|
// .eq(DistributionBillLadingScanEntity::getStockListId, inventoryAppVO.getStockListId())
|
|
|
|
|
// );
|
|
|
|
|
// if (list.size() == inventoryAppVO.getQuantity() + 1) {
|
|
|
|
|
// //修改完成状态
|
|
|
|
|
// distributionAsyncService.getInventoryOrderSelfPickup(inventoryAppVO.getLdddId());
|
|
|
|
|
// }
|
|
|
|
|
// if (list.size() > inventoryAppVO.getQuantity()) {
|
|
|
|
|
// return Resp.scanFail("已完成!", "已完成!!");
|
|
|
|
|
// }
|
|
|
|
|
// //修改库存品签收
|
|
|
|
|
// distributionAsyncService.getInventorySelfPickup(inventoryAppVO.getStockArticleId());
|
|
|
|
|
//
|
|
|
|
|
// distributionBillLadingScan.setPacketBarCode((String) coding);
|
|
|
|
|
// distributionBillLadingScan.setStockListId(inventoryAppVO.getStockListId());
|
|
|
|
|
// distributionBillLadingScan.setQuantity(1);
|
|
|
|
|
// distributionBillLadingScanService.save(distributionBillLadingScan);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|