Browse Source

自提打印模板

master
汤建军 6 months ago
parent
commit
f45d926c55
  1. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  2. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockOrdercodeRecoServiceImpl.java
  3. 114
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java

@ -1329,6 +1329,7 @@ public class DistributionStockupAppController extends BladeController {
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId());
warehouseUpdownGoodsEntity.setAssociationValue(byId.getCargoNumber());
warehouseUpdownGoodsEntity.setAssociationType("4");
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId());
locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
@ -1346,10 +1347,10 @@ public class DistributionStockupAppController extends BladeController {
//查询包件信息
if (ObjectUtils.isNotNull(list) && list.size() > 1) {
return Resp.scanFail("查询到重复包条信息!!", "查询到重复包条信息!!");
return Resp.scanFail("查询到重复包条信息!!", "查询到重复包条信息!!");
}
if (ObjectUtils.isNull(list)) {
return Resp.scanFail("没有查询到包件信息 ! ", "没有查询到包件信息 ! ");
return Resp.scanFail("没有查询到包件信息!", "没有查询到包件信息 ! ");
}
log.info(">>>>> obj {}", list.get(0).getConditions());

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockOrdercodeRecoServiceImpl.java

@ -90,14 +90,14 @@ public class DisStockOrdercodeRecoServiceImpl extends BaseServiceImpl<DisStockOr
warehouseUpdownGoodsEntity.setAssociationType("4");
warehouseUpdownGoodsEntity.setAssociationValue(cargoNumber);
warehouseUpdownGoodsEntity.setMarketName(mallName);
warehouseUpdownGoodsEntity.setAllocationId(allocationId);
List<WarehouseUpdownGoodsEntity> locationStockListInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if (Func.isNotEmpty(locationStockListInformation)){
List<String> IncomingBatchs = locationStockListInformation.stream().map(WarehouseUpdownGoodsEntity::getIncomingBatch).collect(Collectors.toList());
List<DistributionStockListEntity> distributionStockListEntity = distributionStockListMapper.selectList(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getCargoNumber, cargoNumber)
.eq(DistributionStockListEntity::getMarketName,mallName)
.eq(DistributionStockListEntity::getMarketName,mallName)
.in(DistributionStockListEntity::getIncomingBatch, IncomingBatchs)
.orderByAsc(DistributionStockListEntity::getCreateTime)
);
if (Func.isNotEmpty(distributionStockListEntity)){

114
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -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);
}

Loading…
Cancel
Save