|
@@ -718,15 +718,19 @@ public class KwpGoodsService {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- //价格梯度信息
|
|
|
|
|
|
|
+ //价格信息
|
|
|
Map<Long, List<KwpGoodsPriceRange>> priceRangeMap = kwpGoodsPriceRangeService.getByGoodsIds(goodsIds).stream()
|
|
Map<Long, List<KwpGoodsPriceRange>> priceRangeMap = kwpGoodsPriceRangeService.getByGoodsIds(goodsIds).stream()
|
|
|
.collect(Collectors.groupingBy(KwpGoodsPriceRange::getGoodsId));
|
|
.collect(Collectors.groupingBy(KwpGoodsPriceRange::getGoodsId));
|
|
|
//用户信息
|
|
//用户信息
|
|
|
Map<Long, UserCacheResDto> userMap = remoteSystemService.queryUserCacheMapByIds(userIds);
|
|
Map<Long, UserCacheResDto> userMap = remoteSystemService.queryUserCacheMapByIds(userIds);
|
|
|
-
|
|
|
|
|
|
|
+ //供应企业信息
|
|
|
|
|
+ List<EntCacheResDto> entList = new ArrayList<>();
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(supplyEntIds)) {
|
|
|
|
|
+ entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
|
|
|
|
|
+ }
|
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.PRODUCT_NAME_TYPE.getType(),
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.PRODUCT_NAME_TYPE.getType(),
|
|
|
DictTypeEnum.UNIT_TYPE.getType(), DictTypeEnum.TAX_RATE.getType(), DictTypeEnum.GOODS_STATUS.getType()));
|
|
DictTypeEnum.UNIT_TYPE.getType(), DictTypeEnum.TAX_RATE.getType(), DictTypeEnum.GOODS_STATUS.getType()));
|
|
|
- Map<String, String> productNameMap, unitMap, goodsStatusMap;
|
|
|
|
|
|
|
+ Map<String, String> productNameMap, unitMap, goodsStatusMap;
|
|
|
if (CollectionUtils.isNotEmpty(dict)) {
|
|
if (CollectionUtils.isNotEmpty(dict)) {
|
|
|
productNameMap = dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
productNameMap = dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
|
unitMap = dict.get(DictTypeEnum.UNIT_TYPE.getType());
|
|
unitMap = dict.get(DictTypeEnum.UNIT_TYPE.getType());
|
|
@@ -736,13 +740,16 @@ public class KwpGoodsService {
|
|
|
unitMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
unitMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
goodsStatusMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
goodsStatusMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
}
|
|
}
|
|
|
|
|
+ Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
list.forEach(e -> {
|
|
list.forEach(e -> {
|
|
|
Long id = e.getId();
|
|
Long id = e.getId();
|
|
|
GoodsList goodsList = BeanUtils.copyProperties(e, GoodsList.class);
|
|
GoodsList goodsList = BeanUtils.copyProperties(e, GoodsList.class);
|
|
|
|
|
+ UserCacheResDto manager = userMap.get(e.getManager());
|
|
|
UserCacheResDto createUser = userMap.get(e.getCreateBy());
|
|
UserCacheResDto createUser = userMap.get(e.getCreateBy());
|
|
|
goodsList.setStatusLabel(CollectionUtils.isNotEmpty(goodsStatusMap) ? goodsStatusMap.get(String.valueOf(goodsList.getStatus())) : null)
|
|
goodsList.setStatusLabel(CollectionUtils.isNotEmpty(goodsStatusMap) ? goodsStatusMap.get(String.valueOf(goodsList.getStatus())) : null)
|
|
|
.setGoodsTypeLabel(CollectionUtils.isNotEmpty(productNameMap) ? productNameMap.get(goodsList.getGoodsType()) : null)
|
|
.setGoodsTypeLabel(CollectionUtils.isNotEmpty(productNameMap) ? productNameMap.get(goodsList.getGoodsType()) : null)
|
|
|
.setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(goodsList.getUnit()) : null)
|
|
.setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(goodsList.getUnit()) : null)
|
|
|
|
|
+ .setSupplyEnt(entMap.get(e.getSupplyEntId()))
|
|
|
.setThumb(FileUtils.splice(e.getThumb()))
|
|
.setThumb(FileUtils.splice(e.getThumb()))
|
|
|
.setCreateByName(Objects.nonNull(createUser) ? createUser.getName() : null);
|
|
.setCreateByName(Objects.nonNull(createUser) ? createUser.getName() : null);
|
|
|
List<KwpGoodsPriceRange> priceRanges = priceRangeMap.get(id);
|
|
List<KwpGoodsPriceRange> priceRanges = priceRangeMap.get(id);
|