|
@@ -173,19 +173,19 @@ public class KwpWantBuyService {
|
|
|
Map<Long, String> entMap = entList.stream()
|
|
Map<Long, String> entMap = entList.stream()
|
|
|
.collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
.collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.TRADE_TYPE.getType(),
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.TRADE_TYPE.getType(),
|
|
|
- DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.GOODS_STATUS.getType()));
|
|
|
|
|
- Map<String, String> tradeMap, productNameMap, goodsStatusMap;
|
|
|
|
|
|
|
+ DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.WANT_BUY_STATUS.getType()));
|
|
|
|
|
+ Map<String, String> tradeMap, productNameMap, statusMap;
|
|
|
if (CollectionUtils.isEmpty(dict)) {
|
|
if (CollectionUtils.isEmpty(dict)) {
|
|
|
tradeMap = new HashMap<>();
|
|
tradeMap = new HashMap<>();
|
|
|
productNameMap = new HashMap<>();
|
|
productNameMap = new HashMap<>();
|
|
|
- goodsStatusMap = new HashMap<>();
|
|
|
|
|
|
|
+ statusMap = new HashMap<>();
|
|
|
} else {
|
|
} else {
|
|
|
tradeMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ?
|
|
tradeMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ?
|
|
|
new HashMap<>() : dict.get(DictTypeEnum.TRADE_TYPE.getType());
|
|
new HashMap<>() : dict.get(DictTypeEnum.TRADE_TYPE.getType());
|
|
|
productNameMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType())) ?
|
|
productNameMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType())) ?
|
|
|
new HashMap<>() : dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
new HashMap<>() : dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
|
- goodsStatusMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.GOODS_STATUS.getType())) ?
|
|
|
|
|
- new HashMap<>() : dict.get(DictTypeEnum.GOODS_STATUS.getType());
|
|
|
|
|
|
|
+ statusMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.WANT_BUY_STATUS.getType())) ?
|
|
|
|
|
+ new HashMap<>() : dict.get(DictTypeEnum.WANT_BUY_STATUS.getType());
|
|
|
}
|
|
}
|
|
|
//把查询出来的集合wantBuyTradings里面对的tranding 转成字符串放在String里面
|
|
//把查询出来的集合wantBuyTradings里面对的tranding 转成字符串放在String里面
|
|
|
wantBuyDto.forEach(wantBuySelectRes -> {
|
|
wantBuyDto.forEach(wantBuySelectRes -> {
|
|
@@ -194,7 +194,7 @@ public class KwpWantBuyService {
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
wantBuySelectRes.setTradings(String.join(Global.COMMA, tradings));
|
|
wantBuySelectRes.setTradings(String.join(Global.COMMA, tradings));
|
|
|
wantBuySelectRes.setGoodsTypeLabel(productNameMap.get(wantBuySelectRes.getGoodsType()));
|
|
wantBuySelectRes.setGoodsTypeLabel(productNameMap.get(wantBuySelectRes.getGoodsType()));
|
|
|
- wantBuySelectRes.setStatusLabel(goodsStatusMap.get(String.valueOf(wantBuySelectRes.getStatus())));
|
|
|
|
|
|
|
+ wantBuySelectRes.setStatusLabel(statusMap.get(String.valueOf(wantBuySelectRes.getStatus())));
|
|
|
wantBuySelectRes.setEntName(Objects.nonNull(entMap.get(wantBuySelectRes.getEntId())) ? entMap.get(wantBuySelectRes.getEntId()) : null);
|
|
wantBuySelectRes.setEntName(Objects.nonNull(entMap.get(wantBuySelectRes.getEntId())) ? entMap.get(wantBuySelectRes.getEntId()) : null);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -543,17 +543,24 @@ public class KwpWantBuyService {
|
|
|
if (CollectionUtils.isEmpty(wantBuyDto)) {
|
|
if (CollectionUtils.isEmpty(wantBuyDto)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
|
|
+ // 获取供应企业信息
|
|
|
|
|
+ Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntCacheMapByIds(
|
|
|
|
|
+ wantBuyDto.stream().map(WantBuySelectRes::getEntId).collect(Collectors.toList()));
|
|
|
|
|
+ // 字典信息
|
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.TRADE_TYPE.getType(),
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.TRADE_TYPE.getType(),
|
|
|
- DictTypeEnum.PRODUCT_NAME_TYPE.getType()));
|
|
|
|
|
- Map<String, String> tradeMap, productNameMap;
|
|
|
|
|
|
|
+ DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.WANT_BUY_STATUS.getType()));
|
|
|
|
|
+ Map<String, String> tradeMap, productNameMap, statusMap;
|
|
|
if (CollectionUtils.isEmpty(dict)) {
|
|
if (CollectionUtils.isEmpty(dict)) {
|
|
|
tradeMap = new HashMap<>();
|
|
tradeMap = new HashMap<>();
|
|
|
productNameMap = new HashMap<>();
|
|
productNameMap = new HashMap<>();
|
|
|
|
|
+ statusMap = new HashMap<>();
|
|
|
} else {
|
|
} else {
|
|
|
tradeMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ?
|
|
tradeMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ?
|
|
|
new HashMap<>() : dict.get(DictTypeEnum.TRADE_TYPE.getType());
|
|
new HashMap<>() : dict.get(DictTypeEnum.TRADE_TYPE.getType());
|
|
|
productNameMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType())) ?
|
|
productNameMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType())) ?
|
|
|
new HashMap<>() : dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
new HashMap<>() : dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
|
|
|
+ statusMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.WANT_BUY_STATUS.getType())) ?
|
|
|
|
|
+ new HashMap<>() : dict.get(DictTypeEnum.WANT_BUY_STATUS.getType());
|
|
|
}
|
|
}
|
|
|
List<WantBuyExport> result = new ArrayList<>();
|
|
List<WantBuyExport> result = new ArrayList<>();
|
|
|
AtomicInteger i = new AtomicInteger(1);
|
|
AtomicInteger i = new AtomicInteger(1);
|
|
@@ -562,7 +569,10 @@ public class KwpWantBuyService {
|
|
|
List<String> tradings = e.getWantBuyTradings().stream()
|
|
List<String> tradings = e.getWantBuyTradings().stream()
|
|
|
.map(wantBuyTradingRes -> tradeMap.get(wantBuyTradingRes.getTrading()))
|
|
.map(wantBuyTradingRes -> tradeMap.get(wantBuyTradingRes.getTrading()))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
- export.setSerialNumber(String.valueOf(i.getAndIncrement())).setTradings(String.join(Global.COMMA, tradings))
|
|
|
|
|
|
|
+ export.setSerialNumber(String.valueOf(i.getAndIncrement()))
|
|
|
|
|
+ .setStatusLabel(statusMap.get(String.valueOf(e.getStatus())))
|
|
|
|
|
+ .setEntName(Objects.nonNull(entMap.get(e.getEntId())) ? entMap.get(e.getEntId()).getFirmName() : null)
|
|
|
|
|
+ .setTradings(String.join(Global.COMMA, tradings))
|
|
|
.setGoodsTypeLabel(productNameMap.get(e.getGoodsType()))
|
|
.setGoodsTypeLabel(productNameMap.get(e.getGoodsType()))
|
|
|
.setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
|
|
.setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
|
|
|
.setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()));
|
|
.setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()));
|