|
|
|
@ -260,6 +260,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseRetentionScanClient warehouseRetentionScanClient; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionBillLadingScanService distributionBillLadingScanService; |
|
|
|
|
|
|
|
|
|
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
|
|
|
|
|
|
|
|
|
|
// @Lazy
|
|
|
|
@ -4971,7 +4974,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
map.put("费用统计", fua); |
|
|
|
|
|
|
|
|
|
String popHtml = TemplateUtil.popTemplate("自提配送单", map, html); |
|
|
|
|
String popHtml = TemplateUtil.popTemplate("自提清单", map, html); |
|
|
|
|
PrintPreviewVO printPreviewVO = new PrintPreviewVO(); |
|
|
|
|
printPreviewVO.setTemplateId(template.getId()); |
|
|
|
|
printPreviewVO.setTemplateHtml(popHtml); |
|
|
|
@ -5001,50 +5004,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) |
|
|
|
|
.ne(DistributionDeliveryDetailsEntity::getStockStatus, ReservationOrderStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!detailsEntities.isEmpty()) { |
|
|
|
|
Map<Long, List<DistributionDeliveryDetailsEntity>> inventoryMap = detailsEntities.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId)); |
|
|
|
|
List<Long> inventoryIds = detailsEntities.stream().map(DistributionDeliveryDetailsEntity::getStockListId).collect(Collectors.toList()); |
|
|
|
|
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(inventoryIds); |
|
|
|
|
if (!distributionStockListEntities.isEmpty()) { |
|
|
|
|
for (DistributionStockListEntity distributionStockListEntity : distributionStockListEntities) { |
|
|
|
|
Map<String, Object> tempMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
tempMap.put("序号", a); |
|
|
|
|
|
|
|
|
|
tempMap.put("运单号", distributionStockListEntity.getIncomingBatch()); |
|
|
|
|
tempMap.put("合同号", distributionStockListEntity.getOrderCode()); |
|
|
|
|
tempMap.put("物料名称", distributionStockListEntity.getDescriptionGoods()); |
|
|
|
|
//构建产品明细
|
|
|
|
|
Map<String, Object> map1 = new HashMap<>(); |
|
|
|
|
map1.put("物料编码", distributionStockListEntity.getCargoNumber()); |
|
|
|
|
map1.put("物料单位", distributionStockListEntity.getCargoUnit()); |
|
|
|
|
map1.put("物料规格", distributionStockListEntity.getCargoNorms()); |
|
|
|
|
//查询此订制品库位信息
|
|
|
|
|
DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = inventoryMap.get(distributionStockListEntity.getId()).get(0); |
|
|
|
|
Integer quantity = distributionDeliveryDetailsEntity.getQuantity(); |
|
|
|
|
map1.put("计划数量", quantity); |
|
|
|
|
hejiNum += quantity; |
|
|
|
|
tempMap.put("小计", quantity); |
|
|
|
|
tempMap.put("货位", ""); |
|
|
|
|
tempMap.put("产品明细", map1); |
|
|
|
|
tempMap.put("备货区", ""); |
|
|
|
|
ls.add(tempMap); |
|
|
|
|
a++; |
|
|
|
|
if (!mailNames.toString().contains(distributionStockListEntity.getMarketName())) { |
|
|
|
|
if (!mailNames.toString().isEmpty()) { |
|
|
|
|
mailNames.append(","); |
|
|
|
|
} |
|
|
|
|
mailNames.append(distributionStockListEntity.getMarketName()); |
|
|
|
|
} |
|
|
|
|
if (!consigneeUnit.toString().contains(distributionStockListEntity.getMarketName())) { |
|
|
|
|
if (!consigneeUnit.toString().isEmpty()) { |
|
|
|
|
consigneeUnit.append(","); |
|
|
|
|
} |
|
|
|
|
consigneeUnit.append(distributionStockListEntity.getMarketName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 构建产品明细的表头 -- 这里目前只处理了定制品和有数据的库存品,对于零担 还没有处理
|
|
|
|
@ -5098,6 +5059,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
tempMap.put("合同号", distributionStockArticleEntity.getOrderCode()); |
|
|
|
|
String materialNameStr = buildMaterialNameStr(distributionParcelListEntities); |
|
|
|
|
tempMap.put("物料名称", materialNameStr); |
|
|
|
|
tempMap.put("签收件数", 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 构建产品明细 --对于每一个订单
|
|
|
|
@ -5141,6 +5103,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ","); |
|
|
|
|
tempMap.put("备货区", stockupAreaStr); |
|
|
|
|
} |
|
|
|
|
//查询签收件数
|
|
|
|
|
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda() |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) |
|
|
|
|
.eq(DistributionBillLadingScanEntity::getStockArticleId, distributionStockArticleEntity.getId()) |
|
|
|
|
); |
|
|
|
|
if (!ladingScanEntities.isEmpty()) { |
|
|
|
|
int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); |
|
|
|
|
tempMap.put("签收件数", sum); |
|
|
|
|
} |
|
|
|
|
ls.add(tempMap); |
|
|
|
|
a++; |
|
|
|
|
|
|
|
|
@ -5148,6 +5119,62 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!detailsEntities.isEmpty()) { |
|
|
|
|
Map<Long, List<DistributionDeliveryDetailsEntity>> inventoryMap = detailsEntities.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId)); |
|
|
|
|
List<Long> inventoryIds = detailsEntities.stream().map(DistributionDeliveryDetailsEntity::getStockListId).collect(Collectors.toList()); |
|
|
|
|
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(inventoryIds); |
|
|
|
|
if (!distributionStockListEntities.isEmpty()) { |
|
|
|
|
List<Map<String, Object>> iList = new ArrayList<>(); |
|
|
|
|
for (DistributionStockListEntity distributionStockListEntity : distributionStockListEntities) { |
|
|
|
|
Map<String, Object> tempMap = new HashMap<>(); |
|
|
|
|
tempMap.put("序号", a); |
|
|
|
|
tempMap.put("批次号", distributionStockListEntity.getIncomingBatch()); |
|
|
|
|
tempMap.put("产品名称", distributionStockListEntity.getDescriptionGoods()); |
|
|
|
|
tempMap.put("单位", distributionStockListEntity.getCargoUnit()); |
|
|
|
|
tempMap.put("物料编码", distributionStockListEntity.getCargoNumber()); |
|
|
|
|
tempMap.put("物料单位", distributionStockListEntity.getCargoUnit()); |
|
|
|
|
tempMap.put("物料规格", distributionStockListEntity.getCargoNorms()); |
|
|
|
|
//构建产品明细
|
|
|
|
|
//查询此订制品库位信息
|
|
|
|
|
DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = inventoryMap.get(distributionStockListEntity.getId()).get(0); |
|
|
|
|
Integer quantity = distributionDeliveryDetailsEntity.getQuantity(); |
|
|
|
|
//查询签收数量
|
|
|
|
|
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, distributionDeliveryDetailsEntity.getBillLadingId()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
tempMap.put("签收件数", 0); |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
int sum = list.stream().filter(l -> InventorySigningStatusConstant.yiqianshou.getValue().equals(l.getStockSignfoStatus())).mapToInt(DisStockListDetailEntity::getNum).sum(); |
|
|
|
|
tempMap.put("签收件数", sum); |
|
|
|
|
} |
|
|
|
|
tempMap.put("数量", quantity); |
|
|
|
|
hejiNum += quantity; |
|
|
|
|
tempMap.put("小计", quantity); |
|
|
|
|
//这里只进行计划指定的批次库位进行整理
|
|
|
|
|
tempMap.put("货位", distributionStockListEntity.getStorageLocation()); |
|
|
|
|
tempMap.put("备货区", ""); |
|
|
|
|
tempMap.put("备货件数",distributionDeliveryDetailsEntity.getRealityQuantity()); |
|
|
|
|
iList.add(tempMap); |
|
|
|
|
a++; |
|
|
|
|
if (!mailNames.toString().contains(distributionStockListEntity.getMarketName())) { |
|
|
|
|
if (!mailNames.toString().isEmpty()) { |
|
|
|
|
mailNames.append(","); |
|
|
|
|
} |
|
|
|
|
mailNames.append(distributionStockListEntity.getMarketName()); |
|
|
|
|
} |
|
|
|
|
if (!consigneeUnit.toString().contains(distributionStockListEntity.getMarketName())) { |
|
|
|
|
if (!consigneeUnit.toString().isEmpty()) { |
|
|
|
|
consigneeUnit.append(","); |
|
|
|
|
} |
|
|
|
|
consigneeUnit.append(distributionStockListEntity.getMarketName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!iList.isEmpty()) { |
|
|
|
|
map.put("库存品集合",iList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
map.put("收货单单位", consigneeUnit.toString()); |
|
|
|
|
map.put("商场名称", mailNames.toString()); |
|
|
|
@ -5160,6 +5187,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
m1.put("合计数量", hejiNum); |
|
|
|
|
|
|
|
|
|
map.put("合计", m1); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|