|
|
@ -252,6 +252,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IBasicdataDriverArteryClient arteryClient; |
|
|
|
private IBasicdataDriverArteryClient arteryClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IDistributionDeliveryDetailsService distributionDeliveryDetailsService; |
|
|
|
|
|
|
|
|
|
|
|
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
|
|
|
|
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
|
|
|
|
|
|
|
|
|
|
|
|
// @Lazy
|
|
|
|
// @Lazy
|
|
|
@ -4849,14 +4852,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
List<DistrilbutionBillPackageEntity> distrilbutionBillPackageEntities = distrilbutionBillPackageMapper.selectList(distrilbutionBillStockEntityLambdaQueryWrapper); |
|
|
|
List<DistrilbutionBillPackageEntity> distrilbutionBillPackageEntities = distrilbutionBillPackageMapper.selectList(distrilbutionBillStockEntityLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 得到所以的订单列表
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = new ArrayList<>(); |
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = null; |
|
|
|
|
|
|
|
if (!distrilbutionBillPackageEntities.isEmpty()) { |
|
|
|
if (!distrilbutionBillPackageEntities.isEmpty()) { |
|
|
|
List<Long> ids = distrilbutionBillPackageEntities.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList()); |
|
|
|
List<Long> ids = distrilbutionBillPackageEntities.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList()); |
|
|
|
distributionParcelListEntities = distributionParcelListMapper.selectBatchIds(ids); |
|
|
|
distributionParcelListEntities = distributionParcelListMapper.selectBatchIds(ids); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("自提单号", distrilbutionBillLadingEntity.getPickupBatch()); |
|
|
|
map.put("自提单号", distrilbutionBillLadingEntity.getPickupBatch()); |
|
|
|
String fileTypeName = QRCodeUtil.createCodeToFile(map.get("自提单号").toString()); |
|
|
|
String fileTypeName = QRCodeUtil.createCodeToFile(map.get("自提单号").toString()); |
|
|
@ -4864,9 +4868,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
// map.put("收货单单位", reservationEntity.getReceivingUnit());//收货单单位
|
|
|
|
// map.put("收货单单位", reservationEntity.getReceivingUnit());//收货单单位
|
|
|
|
// map.put("商场名称", reservationEntity.getStoreName());//商场名称
|
|
|
|
// map.put("商场名称", reservationEntity.getStoreName());//商场名称
|
|
|
|
// 构建map集合中收货单和商场名称
|
|
|
|
// 构建map集合中收货单和商场名称
|
|
|
|
if (!distributionParcelListEntities.isEmpty() && !distrilbutionBillStockEntities.isEmpty()){ |
|
|
|
|
|
|
|
buildMapByDistrilbutionBillLadingEntity(map, distrilbutionBillStockEntities, distributionParcelListEntities, distrilbutionBillLadingEntity); |
|
|
|
buildMapByDistrilbutionBillLadingEntity(map, distrilbutionBillStockEntities, distributionParcelListEntities, distrilbutionBillLadingEntity); |
|
|
|
} |
|
|
|
|
|
|
|
map.put("提货人", distrilbutionBillLadingEntity.getConsignee());//提货人
|
|
|
|
map.put("提货人", distrilbutionBillLadingEntity.getConsignee());//提货人
|
|
|
|
map.put("联系电话", distrilbutionBillLadingEntity.getConsigneePhone());//收货人电话
|
|
|
|
map.put("联系电话", distrilbutionBillLadingEntity.getConsigneePhone());//收货人电话
|
|
|
|
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(distrilbutionBillLadingEntity.getWarehouseId()); |
|
|
|
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(distrilbutionBillLadingEntity.getWarehouseId()); |
|
|
@ -4919,24 +4922,71 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
private void buildMapByDistrilbutionBillLadingEntity(Map<String, Object> map, List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities, List<DistributionParcelListEntity> distributionParcelListEntities, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { |
|
|
|
private void buildMapByDistrilbutionBillLadingEntity(Map<String, Object> map, List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities, List<DistributionParcelListEntity> distributionParcelListEntities, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { |
|
|
|
|
|
|
|
|
|
|
|
// 查询订单集合
|
|
|
|
// 查询订单集合
|
|
|
|
Set<Long> ids = new HashSet<Long>(); |
|
|
|
int a = 1; |
|
|
|
for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : distrilbutionBillStockEntities) { |
|
|
|
List<Map<String, Object>> ls = new ArrayList<>(); |
|
|
|
ids.add(distrilbutionBillStockEntity.getStockArticleId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 得到所以的订单列表
|
|
|
|
|
|
|
|
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(ids); |
|
|
|
|
|
|
|
// 获取订单中的商城和收货单位
|
|
|
|
// 获取订单中的商城和收货单位
|
|
|
|
StringBuilder consigneeUnit = new StringBuilder(); |
|
|
|
StringBuilder consigneeUnit = new StringBuilder(); |
|
|
|
StringBuilder mailNames = new StringBuilder(); |
|
|
|
StringBuilder mailNames = new StringBuilder(); |
|
|
|
List<Map<String, Object>> ls = new ArrayList<>(); |
|
|
|
int hejiNum = 0; |
|
|
|
|
|
|
|
Map<String, Object> m = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询库存品信息
|
|
|
|
|
|
|
|
List<DistributionDeliveryDetailsEntity> detailsEntities = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda() |
|
|
|
|
|
|
|
.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()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int a = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 构建产品明细的表头 -- 这里目前只处理了定制品和有数据的库存品,对于零担 还没有处理
|
|
|
|
// 构建产品明细的表头 -- 这里目前只处理了定制品和有数据的库存品,对于零担 还没有处理
|
|
|
|
List<Map<String, Object>> listMapTemp = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> listMapTemp = new ArrayList<>(); |
|
|
|
Map<String, Object> m = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int hejiNum = 0; |
|
|
|
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
if (StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())) { |
|
|
|
if (StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())) { |
|
|
|
distributionParcelListEntity.setThirdProduct("其它"); |
|
|
|
distributionParcelListEntity.setThirdProduct("其它"); |
|
|
@ -4952,9 +5002,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
// 加入到集合中的去 目的是为了获取分类头部
|
|
|
|
// 加入到集合中的去 目的是为了获取分类头部
|
|
|
|
listMapTemp.add(m); |
|
|
|
listMapTemp.add(m); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!distrilbutionBillStockEntities.isEmpty()) { |
|
|
|
|
|
|
|
List<Long> ids = distrilbutionBillStockEntities.stream().map(DistrilbutionBillStockEntity::getStockArticleId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 得到所以的订单列表
|
|
|
|
|
|
|
|
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(ids); |
|
|
|
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) { |
|
|
|
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) { |
|
|
|
|
|
|
|
Map<String, Object> tempMap = new HashMap<>(); |
|
|
|
// 需要从所有的包件的
|
|
|
|
// 需要从所有的包件的
|
|
|
|
List<DistributionParcelListEntity> ts = new ArrayList<>(); |
|
|
|
List<DistributionParcelListEntity> ts = new ArrayList<>(); |
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
@ -4976,7 +5029,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
consigneeUnit.append(distributionStockArticleEntity.getConsigneeUnit()); |
|
|
|
consigneeUnit.append(distributionStockArticleEntity.getConsigneeUnit()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> tempMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tempMap.put("序号", a); |
|
|
|
tempMap.put("序号", a); |
|
|
|
tempMap.put("运单号", distributionStockArticleEntity.getWaybillNumber()); |
|
|
|
tempMap.put("运单号", distributionStockArticleEntity.getWaybillNumber()); |
|
|
@ -5032,18 +5084,29 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("收货单单位", consigneeUnit.toString()); |
|
|
|
map.put("收货单单位", consigneeUnit.toString()); |
|
|
|
map.put("商场名称", mailNames.toString()); |
|
|
|
map.put("商场名称", mailNames.toString()); |
|
|
|
|
|
|
|
|
|
|
|
map.put("明细", ls); |
|
|
|
map.put("明细", ls); |
|
|
|
Map<String, Object> m1 = new HashMap<>(); |
|
|
|
Map<String, Object> m1 = new HashMap<>(); |
|
|
|
|
|
|
|
if (!m.isEmpty()) { |
|
|
|
m1.put("产品明细", m); |
|
|
|
m1.put("产品明细", m); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m1.put("合计数量", hejiNum); |
|
|
|
m1.put("合计数量", hejiNum); |
|
|
|
map.put("合计", m1); |
|
|
|
map.put("合计", m1); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建分类明细 |
|
|
|
* 构建分类明细 |
|
|
|
* |
|
|
|
* |
|
|
|