查询客户nc编码
This commit is contained in:
+2
@@ -449,4 +449,6 @@ public class ReservationStockInOrderPO extends BaseVOEntity {
|
||||
@Excel(name = "附件url")
|
||||
private String pictureUrl;
|
||||
|
||||
@ApiModelProperty("NC客户编码")
|
||||
private String customerNcCode;
|
||||
}
|
||||
+3
@@ -447,4 +447,7 @@ public class ReservationStockInOrderDO extends BaseVOEntity {
|
||||
@ApiModelProperty("附件url")
|
||||
@Excel(name = "附件url")
|
||||
private String pictureUrl;
|
||||
|
||||
@ApiModelProperty("NC客户编码")
|
||||
private String customerNcCode;
|
||||
}
|
||||
+4
@@ -445,4 +445,8 @@ public class ReservationStockInOrderDTO extends ReservationStockInOrderBaseDTO {
|
||||
@ApiModelProperty("附件url")
|
||||
@Excel(name = "附件url")
|
||||
private String pictureUrl;
|
||||
|
||||
@ApiModelProperty("NC客户编码")
|
||||
private String customerNcCode;
|
||||
|
||||
}
|
||||
+47
-1
@@ -56,6 +56,7 @@ import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 入库单ApplicationService
|
||||
@@ -2158,7 +2159,52 @@ public class ReservationStockInOrderApplicationService {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return stockInOrderDomainService.queryList(stockInOrderDO);
|
||||
// 查询订单列表
|
||||
List<ReservationStockInOrderPO> list = stockInOrderDomainService.queryList(stockInOrderDO);
|
||||
|
||||
// ====== 批量查询NC客户编码 ======
|
||||
Set<Long> shipperIdSet = list.stream()
|
||||
.map(ReservationStockInOrderPO::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 = stockInOrderDO.getCustomerNcCode();
|
||||
|
||||
// 设置NC编码并过滤
|
||||
List<ReservationStockInOrderPO> filteredList = new ArrayList<>();
|
||||
for (ReservationStockInOrderPO po : list) {
|
||||
String ncCode = ncCodeMap.get(po.getShipperId());
|
||||
po.setCustomerNcCode(ncCode);
|
||||
|
||||
// 如果前端传了NC编码,判断是否一致
|
||||
if (filterNcCode != null && !filterNcCode.equals(ncCode)) {
|
||||
continue;
|
||||
}
|
||||
filteredList.add(po);
|
||||
}
|
||||
|
||||
return filteredList;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user