nc客户编码

This commit is contained in:
zhaoqing
2026-06-02 16:22:29 +08:00
parent f3715a9f99
commit f1f3e8f5de
4 changed files with 55 additions and 2 deletions
@@ -496,4 +496,7 @@ public class ReservationStockOutOrderPO extends BaseVOEntity {
@ApiModelProperty("运输业务单号")
@Excel(name = "运输业务单号")
private String businessNumber;
@ApiModelProperty("NC客户编码")
private String customerNcCode;
}
@@ -531,4 +531,7 @@ public class ReservationStockOutOrderDO extends BaseVOEntity {
@ApiModelProperty("运输业务单号")
@Excel(name = "运输业务单号")
private String businessNumber;
@ApiModelProperty("NC客户编码")
private String customerNcCode;
}
@@ -520,4 +520,7 @@ public class ReservationStockOutOrderDTO extends ReservationStockOutOrderBaseDTO
@ApiModelProperty("运输业务单号")
@Excel(name = "运输业务单号")
private String businessNumber;
@ApiModelProperty("NC客户编码")
private String customerNcCode;
}
@@ -1379,7 +1379,51 @@ public class ReservationStockOutOrderApplicationService {
// }
// }
List<ReservationStockOutOrderPO> stockOutOrderPOS = stockOutOrderDomainService.queryList(stockOutOrderDO);
// 查询订单列表
List<ReservationStockOutOrderPO> list = stockOutOrderDomainService.queryList(stockOutOrderDO);
// ====== 批量查询NC客户编码 ======
Set<Long> shipperIdSet = list.stream()
.map(ReservationStockOutOrderPO::getShipperId)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
Map<Long, String> ncCodeMap = new HashMap<>();
if (!shipperIdSet.isEmpty()) {
try {
AjaxResult result = userServiceFeign.getCustomerNcCodeBatch(new ArrayList<>(shipperIdSet));
if (result != null && "200".equals(String.valueOf(result.get("code")))) {
Map<?, ?> dataMap = (Map<?, ?>) result.get("data");
if (dataMap != null) {
for (Map.Entry<?, ?> entry : dataMap.entrySet()) {
Long key = Long.valueOf(entry.getKey().toString());
String value = entry.getValue() != null ? entry.getValue().toString() : null;
ncCodeMap.put(key, value);
}
}
}
} catch (Exception e) {
log.error("批量查询NC客户编码失败", e);
}
}
// 前端传入的NC编码
String filterNcCode = stockOutOrderDO.getCustomerNcCode();
// 设置NC编码并过滤
List<ReservationStockOutOrderPO> filteredList = new ArrayList<>();
for (ReservationStockOutOrderPO po : list) {
String ncCode = ncCodeMap.get(po.getShipperId());
po.setCustomerNcCode(ncCode);
// 如果前端传了NC编码,判断是否一致
if (filterNcCode != null && !filterNcCode.equals(ncCode)) {
continue;
}
filteredList.add(po);
}
// for (ReservationStockOutOrderPO stockOutOrderPO : stockOutOrderPOS) {
// ReservationStockOutOrderPO stockOutOrderPO1 = stockOutOrderDomainService.getInfoChildren(stockOutOrderPO.getOutOrderId());
// List<ReservationOutMaterialDetailPO> materialDetailList = stockOutOrderPO1 != null ? stockOutOrderPO1.getMaterialDetailList() : null;
@@ -1412,7 +1456,7 @@ public class ReservationStockOutOrderApplicationService {
// BigDecimal checkSum = materialDetailList.stream().map(ReservationOutMaterialDetailPO::getCheckQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// stockOutOrderPO.setCheckQuantity(checkSum);
// }
return stockOutOrderPOS;
return filteredList;
}
}