|
|
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.sckw.core.common.enums.enums.DictEnum;
|
|
|
+import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
@@ -20,12 +22,10 @@ import com.sckw.product.dao.KwpGoodsMapper;
|
|
|
import com.sckw.product.enums.GoodsStatusEnum;
|
|
|
import com.sckw.product.model.*;
|
|
|
import com.sckw.product.model.vo.req.*;
|
|
|
-import com.sckw.product.model.vo.res.BuildingMaterialsMarketList;
|
|
|
-import com.sckw.product.model.vo.res.GoodsDetail;
|
|
|
-import com.sckw.product.model.vo.res.GoodsDropList;
|
|
|
-import com.sckw.product.model.vo.res.GoodsList;
|
|
|
+import com.sckw.product.model.vo.res.*;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
@@ -82,6 +82,9 @@ public class KwpGoodsService {
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void addShelves(AddGoodsParam addGoodsParam) {
|
|
|
+ if (Objects.equals(addGoodsParam.getTrading(), DictEnum.TRADE_TYPE_0.getValue()) && Objects.isNull(addGoodsParam.getAdvancePrice())) {
|
|
|
+ throw new BusinessException("交易方式为预付款时,预付款最低限额不能为空!");
|
|
|
+ }
|
|
|
Long entId = LoginUserHolder.getEntId();
|
|
|
//添加商品信息
|
|
|
KwpGoods goods = BeanUtils.copyProperties(addGoodsParam, KwpGoods.class);
|
|
|
@@ -151,19 +154,28 @@ public class KwpGoodsService {
|
|
|
throw new BusinessException("当前商品信息为空!");
|
|
|
}
|
|
|
GoodsDetail detail = BeanUtils.copyProperties(goods, GoodsDetail.class);
|
|
|
+ List<EntCacheResDto> entCacheList = remoteSystemService.queryEntCacheByIds(Arrays.asList(detail.getEntId(), detail.getSupplyEntId()));
|
|
|
+ Map<Long, String> entMap = entCacheList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
+ detail.setEnt(entMap.get(detail.getEntId())).setSupplyEnt(entMap.get(detail.getSupplyEntId()));
|
|
|
+ UserCacheResDto managerInfo = remoteSystemService.queryUserCacheById(detail.getManager());
|
|
|
+ if (Objects.nonNull(managerInfo)) {
|
|
|
+ detail.setManagerName(managerInfo.getName()).setManagerPhone(managerInfo.getPhone());
|
|
|
+ }
|
|
|
+ detail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), detail.getGoodsType()))
|
|
|
+ .setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(detail.getStatus())));
|
|
|
//商品图片信息
|
|
|
List<KwpGoodsImage> goodsImages = kwpGoodsImageService.getByGoodsId(id);
|
|
|
- List<GoodsImages> images = BeanUtils.copyToList(goodsImages, GoodsImages.class);
|
|
|
+ List<GoodsImagesDetail> images = BeanUtils.copyToList(goodsImages, GoodsImagesDetail.class);
|
|
|
//商品价格段信息
|
|
|
List<KwpGoodsPriceRange> priceRanges = kwpGoodsPriceRangeService.getByGoodsId(id);
|
|
|
- List<GoodsPriceRanges> ranges = BeanUtils.copyToList(priceRanges, GoodsPriceRanges.class);
|
|
|
+ List<GoodsPriceRangesDetail> ranges = BeanUtils.copyToList(priceRanges, GoodsPriceRangesDetail.class);
|
|
|
//商品属性信息
|
|
|
List<KwpGoodsAttribute> attributesList = kwpGoodsAttributeService.getByGoodsId(id);
|
|
|
- List<GoodsAttributes> attributes = BeanUtils.copyToList(attributesList, GoodsAttributes.class);
|
|
|
+ List<GoodsAttributesDetail> attributes = BeanUtils.copyToList(attributesList, GoodsAttributesDetail.class);
|
|
|
//商品地址信息
|
|
|
KwpGoodsAddress goodsAddress = kwpGoodsAddressService.getByGoodsId(id);
|
|
|
- AddressInfo addressInfo = BeanUtils.copyProperties(goodsAddress, AddressInfo.class);
|
|
|
-
|
|
|
+ AddressInfoDetail addressInfo = BeanUtils.copyProperties(goodsAddress, AddressInfoDetail.class);
|
|
|
+ addressInfo.setTypeName(DictEnum.getLabel(DictTypeEnum.ADDRESS_TYPE.getType(), addressInfo.getType()));
|
|
|
detail.setImages(images).setPriceRanges(ranges).setAttributes(attributes).setAddressInfo(addressInfo);
|
|
|
|
|
|
return detail;
|
|
|
@@ -207,13 +219,13 @@ public class KwpGoodsService {
|
|
|
private void updateGoodsOtherInfo(UpdateGoodsParam param) {
|
|
|
Long goodsId = param.getId();
|
|
|
//更新商品地址信息
|
|
|
- kwpGoodsAddressService.delByGoodsId(goodsId);
|
|
|
+ kwpGoodsAddressService.delByGoodsIds(Collections.singletonList(goodsId));
|
|
|
KwpGoodsAddress address = BeanUtils.copyProperties(param.getAddressInfo(), KwpGoodsAddress.class);
|
|
|
address.setGoodsId(goodsId);
|
|
|
kwpGoodsAddressService.insert(address);
|
|
|
|
|
|
//更新商品属性信息
|
|
|
- kwpGoodsAttributeService.delByGoodsId(goodsId);
|
|
|
+ kwpGoodsAttributeService.delByGoodsIds(Collections.singletonList(goodsId));
|
|
|
if (CollectionUtils.isNotEmpty(param.getAttributes())) {
|
|
|
List<KwpGoodsAttribute> list = new ArrayList<>(param.getAttributes().size());
|
|
|
param.getAttributes().forEach(e -> {
|
|
|
@@ -225,7 +237,7 @@ public class KwpGoodsService {
|
|
|
}
|
|
|
|
|
|
//更新商品图片信息
|
|
|
- kwpGoodsImageService.delByGoodsId(goodsId);
|
|
|
+ kwpGoodsImageService.delByGoodsIds(Collections.singletonList(goodsId));
|
|
|
if (CollectionUtils.isNotEmpty(param.getImages())) {
|
|
|
List<KwpGoodsImage> list = new ArrayList<>(param.getImages().size());
|
|
|
param.getImages().forEach(e -> {
|
|
|
@@ -237,7 +249,7 @@ public class KwpGoodsService {
|
|
|
}
|
|
|
|
|
|
//更新商品价格梯度信息
|
|
|
- kwpGoodsPriceRangeService.delByGoodsId(goodsId);
|
|
|
+ kwpGoodsPriceRangeService.delByGoodsIds(Collections.singletonList(goodsId));
|
|
|
if (CollectionUtils.isNotEmpty(param.getPriceRanges())) {
|
|
|
List<KwpGoodsPriceRange> list = new ArrayList<>(param.getPriceRanges().size());
|
|
|
param.getPriceRanges().forEach(e -> {
|
|
|
@@ -260,7 +272,7 @@ public class KwpGoodsService {
|
|
|
if (StringUtils.isBlank(param.getName())) {
|
|
|
throw new BusinessException("商品名称不能为空!");
|
|
|
}
|
|
|
- if (Objects.isNull(param.getTypeId())) {
|
|
|
+ if (StringUtils.isBlank(param.getGoodsType())) {
|
|
|
throw new BusinessException("商品类型不能为空!");
|
|
|
}
|
|
|
if (StringUtils.isBlank(param.getUnit())) {
|
|
|
@@ -275,9 +287,12 @@ public class KwpGoodsService {
|
|
|
if (Objects.isNull(param.getTaxRate())) {
|
|
|
throw new BusinessException("发票税率不能为空!");
|
|
|
}
|
|
|
- if (Objects.isNull(param.getTrading())) {
|
|
|
+ if (StringUtils.isBlank(param.getTrading())) {
|
|
|
throw new BusinessException("交易方式不能为空!");
|
|
|
}
|
|
|
+ if (Objects.equals(param.getTrading(), DictEnum.TRADE_TYPE_0.getValue()) && Objects.isNull(param.getAdvancePrice())) {
|
|
|
+ throw new BusinessException("交易方式为预付款时,预付款最低限额不能为空!");
|
|
|
+ }
|
|
|
if (CollectionUtils.isEmpty(param.getPriceRanges())) {
|
|
|
throw new BusinessException("价格梯度不能为空!");
|
|
|
}
|
|
|
@@ -307,27 +322,49 @@ public class KwpGoodsService {
|
|
|
IPage<KwpGoods> goodsIpage = getGoodsLists(params, isPage);
|
|
|
List<KwpGoods> goodsLists = goodsIpage.getRecords();
|
|
|
if (CollectionUtils.isEmpty(goodsLists)) {
|
|
|
- return PageResult.build(params.getPage(), params.getPageSize(), (int) goodsIpage.getTotal(), Collections.emptyList());
|
|
|
+ return PageResult.build(params.getPage(), params.getPageSize(), goodsIpage.getTotal(), Collections.emptyList());
|
|
|
}
|
|
|
List<GoodsList> result = new ArrayList<>(goodsLists.size());
|
|
|
- List<Long> goodsIds = goodsLists.stream().map(KwpGoods::getId).toList();
|
|
|
+ List<Long> goodsIds = new ArrayList<>(goodsLists.size());
|
|
|
+ List<Long> supplyEntIds = new ArrayList<>(goodsLists.size());
|
|
|
+ List<Long> userIds = new ArrayList<>();
|
|
|
+ goodsLists.forEach(e -> {
|
|
|
+ goodsIds.add(e.getId());
|
|
|
+ supplyEntIds.add(e.getSupplyEntId());
|
|
|
+ userIds.add(e.getManager());
|
|
|
+ userIds.add(e.getCreateBy());
|
|
|
+ });
|
|
|
//地址信息
|
|
|
Map<Long, KwpGoodsAddress> addressMap = kwpGoodsAddressService.getByGoodsIds(goodsIds)
|
|
|
.stream().collect(Collectors.toMap(KwpGoodsAddress::getGoodsId, e -> e, (k1, k2) -> k1));
|
|
|
//价格梯度信息
|
|
|
Map<Long, List<KwpGoodsPriceRange>> priceRangeMap = kwpGoodsPriceRangeService.getByGoodsIds(goodsIds)
|
|
|
.stream().collect(Collectors.groupingBy(KwpGoodsPriceRange::getGoodsId));
|
|
|
-
|
|
|
+ //用户信息
|
|
|
+ List<UserCacheResDto> userList = remoteSystemService.queryUserCacheByIds(userIds);
|
|
|
+ Map<Long, UserCacheResDto> userMap = userList.stream().collect(Collectors.toMap(UserCacheResDto::getId, e -> e, (k1, k2) -> k1));
|
|
|
+ //供应企业信息
|
|
|
+ List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
|
|
|
+ Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
goodsLists.forEach(e -> {
|
|
|
Long id = e.getId();
|
|
|
GoodsList goodsList = BeanUtils.copyProperties(e, GoodsList.class);
|
|
|
- goodsList.setAddress(Objects.isNull(addressMap.get(id)) ? null : addressMap.get(id).getDetailAddress());
|
|
|
+ UserCacheResDto manager = userMap.get(e.getManager());
|
|
|
+ UserCacheResDto createUser = userMap.get(e.getCreateBy());
|
|
|
+ goodsList.setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(goodsList.getStatus())))
|
|
|
+ .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), goodsList.getGoodsType()))
|
|
|
+ .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), goodsList.getTrading()))
|
|
|
+ .setManageName(Objects.nonNull(manager) ? manager.getName() : null)
|
|
|
+ .setPhone(Objects.nonNull(manager) ? manager.getPhone() : null)
|
|
|
+ .setSupplyEnt(Objects.nonNull(entMap.get(e.getSupplyEntId())) ? entMap.get(e.getSupplyEntId()) : null)
|
|
|
+ .setAddress(Objects.isNull(addressMap.get(id)) ? null : addressMap.get(id).getDetailAddress())
|
|
|
+ .setCreateByName(Objects.nonNull(createUser) ? createUser.getName() : null);
|
|
|
List<KwpGoodsPriceRange> priceRanges = priceRangeMap.get(id);
|
|
|
- goodsList.setHighestPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(priceRanges.size() - 1).getPrice());
|
|
|
- goodsList.setLowestPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(0).getPrice());
|
|
|
+ goodsList.setHighestPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(priceRanges.size() - 1).getPrice())
|
|
|
+ .setLowestPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(0).getPrice());
|
|
|
result.add(goodsList);
|
|
|
});
|
|
|
- return PageResult.build(params.getPage(), params.getPageSize(), (int) goodsIpage.getTotal(), result);
|
|
|
+ return PageResult.build(params.getPage(), params.getPageSize(), goodsIpage.getTotal(), result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -338,6 +375,13 @@ public class KwpGoodsService {
|
|
|
* @return: java.util.List<com.sckw.product.model.KwpGoods>
|
|
|
*/
|
|
|
private IPage<KwpGoods> getGoodsLists(SelectGoodsListParam params, Boolean isPage) {
|
|
|
+ List<Long> entIds = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(params.getKeywords())) {
|
|
|
+ List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByName(params.getKeywords());
|
|
|
+ if (CollectionUtils.isNotEmpty(entList)) {
|
|
|
+ entIds = entList.stream().map(EntCacheResDto::getId).toList();
|
|
|
+ }
|
|
|
+ }
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
if (CollectionUtils.isNotEmpty(params.getIds())) {
|
|
|
wrapper.in(KwpGoods::getId, params.getIds());
|
|
|
@@ -346,13 +390,14 @@ public class KwpGoodsService {
|
|
|
.ge(Objects.nonNull(params.getStartCreateTime()), KwpGoods::getCreateTime, params.getStartCreateTime())
|
|
|
.le(Objects.nonNull(params.getEndCreateTime()), KwpGoods::getCreateTime, params.getEndCreateTime())
|
|
|
.in(CollectionUtils.isNotEmpty(params.getTradings()), KwpGoods::getTrading, params.getTradings())
|
|
|
- .in(CollectionUtils.isNotEmpty(params.getTypeIds()), KwpGoods::getTypeId, params.getTypeIds())
|
|
|
+ .in(CollectionUtils.isNotEmpty(params.getGoodsTypes()), KwpGoods::getGoodsType, params.getGoodsTypes())
|
|
|
+ .in(CollectionUtils.isNotEmpty(entIds), KwpGoods::getSupplyEntId, entIds)
|
|
|
.in(CollectionUtils.isNotEmpty(params.getStatus()), KwpGoods::getStatus, params.getStatus());
|
|
|
}
|
|
|
wrapper.eq(KwpGoods::getEntId, LoginUserHolder.getEntId()).eq(KwpGoods::getDelFlag, Global.NO).orderByDesc(KwpGoods::getCreateTime);
|
|
|
IPage<KwpGoods> goodsIpage = new Page<>();
|
|
|
- Page<KwpGoods> page = new Page<>(params.getPage(), params.getPageSize());
|
|
|
if (isPage) {
|
|
|
+ Page<KwpGoods> page = new Page<>(params.getPage(), params.getPageSize());
|
|
|
goodsIpage = kwpGoodsMapper.selectPage(page, wrapper);
|
|
|
} else {
|
|
|
List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
|
|
|
@@ -400,10 +445,8 @@ public class KwpGoodsService {
|
|
|
List<GoodsListExport> list = new ArrayList<>();
|
|
|
goodsLists.forEach(e -> {
|
|
|
GoodsListExport export = BeanUtils.copyProperties(e, GoodsListExport.class);
|
|
|
- export.setStatus(GoodsStatusEnum.getNameByCode(e.getStatus()))
|
|
|
- .setType("砂石").setTaxRate(String.valueOf(e.getTaxRate())).setAmount(String.valueOf(e.getAmount()))
|
|
|
- .setTrading("线下付款").setHighestPrice(String.valueOf(e.getHighestPrice()))
|
|
|
- .setLowestPrice(String.valueOf(e.getLowestPrice()))
|
|
|
+ export.setTaxRate(String.valueOf(e.getTaxRate())).setAmount(String.valueOf(e.getAmount()))
|
|
|
+ .setHighestPrice(String.valueOf(e.getHighestPrice())).setLowestPrice(String.valueOf(e.getLowestPrice()))
|
|
|
.setAddedTime(Objects.isNull(e.getAddedTime()) ? null : DateUtil.getDateTime(e.getAddedTime()))
|
|
|
.setAddedTime(Objects.isNull(e.getShelfTime()) ? null : DateUtil.getDateTime(e.getShelfTime()));
|
|
|
list.add(export);
|
|
|
@@ -464,6 +507,7 @@ public class KwpGoodsService {
|
|
|
* @Param ids:
|
|
|
* @return: void
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void batchDelete(List<Long> ids) {
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.in(KwpGoods::getId, ids).in(KwpGoods::getStatus, 0, 2)
|
|
|
@@ -475,6 +519,10 @@ public class KwpGoodsService {
|
|
|
LambdaUpdateWrapper<KwpGoods> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
updateWrapper.set(KwpGoods::getDelFlag, Global.YES).in(KwpGoods::getId, ids);
|
|
|
kwpGoodsMapper.update(null, updateWrapper);
|
|
|
+ kwpGoodsAddressService.delByGoodsIds(ids);
|
|
|
+ kwpGoodsAttributeService.delByGoodsIds(ids);
|
|
|
+ kwpGoodsImageService.delByGoodsIds(ids);
|
|
|
+ kwpGoodsPriceRangeService.delByGoodsIds(ids);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -483,18 +531,49 @@ public class KwpGoodsService {
|
|
|
* @author: yzc
|
|
|
* @date: 2023-07-06 9:38
|
|
|
* @Param params:
|
|
|
- * @return: java.util.List<com.sckw.product.model.vo.res.BuildingMaterialsMarketList>
|
|
|
+ * @return: com.sckw.core.model.page.PageResult
|
|
|
*/
|
|
|
- public List<BuildingMaterialsMarketList> buildingMaterialsMarketList(BuildingMaterialsMarketListParam params) {
|
|
|
- List<Long> typeIds = params.getCategoryIds();
|
|
|
+ public PageResult buildingMaterialsMarketList(BuildingMaterialsMarketListParam params) {
|
|
|
+ Page<KwpGoods> page = new Page<>(params.getPage(), params.getPageSize());
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.like(StringUtils.isNotBlank(params.getKeywords()), KwpGoods::getName, params.getKeywords())
|
|
|
- .in(CollectionUtils.isNotEmpty(typeIds), KwpGoods::getTypeId, typeIds)
|
|
|
+ .in(CollectionUtils.isNotEmpty(params.getGoodsTypes()), KwpGoods::getGoodsType, params.getGoodsTypes())
|
|
|
.in(CollectionUtils.isNotEmpty(params.getTradings()), KwpGoods::getTrading, params.getTradings())
|
|
|
.eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode()).eq(KwpGoods::getDelFlag, Global.NO);
|
|
|
- List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
|
|
|
- List<BuildingMaterialsMarketList> result = BeanUtils.copyToList(list, BuildingMaterialsMarketList.class);
|
|
|
- return result;
|
|
|
+ Page<KwpGoods> kwpGoodsPage = kwpGoodsMapper.selectPage(page, wrapper);
|
|
|
+ List<KwpGoods> list = kwpGoodsPage.getRecords();
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ return PageResult.build(params.getPage(), params.getPageSize(), kwpGoodsPage.getTotal(), Collections.emptyList());
|
|
|
+ }
|
|
|
+ List<BuildingMaterialsMarketList> result = new ArrayList<>(list.size());
|
|
|
+ List<Long> goodsIds = new ArrayList<>(list.size());
|
|
|
+ List<Long> supplyEntIds = new ArrayList<>(list.size());
|
|
|
+ list.forEach(e -> {
|
|
|
+ goodsIds.add(e.getId());
|
|
|
+ supplyEntIds.add(e.getSupplyEntId());
|
|
|
+ });
|
|
|
+ //地址信息
|
|
|
+ Map<Long, KwpGoodsAddress> addressMap = kwpGoodsAddressService.getByGoodsIds(goodsIds)
|
|
|
+ .stream().collect(Collectors.toMap(KwpGoodsAddress::getGoodsId, e -> e, (k1, k2) -> k1));
|
|
|
+ //价格梯度信息
|
|
|
+ Map<Long, List<KwpGoodsPriceRange>> priceRangeMap = kwpGoodsPriceRangeService.getByGoodsIds(goodsIds)
|
|
|
+ .stream().collect(Collectors.groupingBy(KwpGoodsPriceRange::getGoodsId));
|
|
|
+ //供应企业信息
|
|
|
+ List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
|
|
|
+ Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
+
|
|
|
+ list.forEach(e -> {
|
|
|
+ BuildingMaterialsMarketList materials = BeanUtils.copyProperties(e, BuildingMaterialsMarketList.class);
|
|
|
+ KwpGoodsAddress address = addressMap.get(e.getId());
|
|
|
+ List<KwpGoodsPriceRange> priceRanges = priceRangeMap.get(e.getId());
|
|
|
+ materials.setAddress(Objects.isNull(address) ? null : address.getCityName() + address.getDetailAddress())
|
|
|
+ .setPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(0).getPrice())
|
|
|
+ .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
|
|
|
+ .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
|
|
|
+ .setSupplyEnt(entMap.get(e.getSupplyEntId()));
|
|
|
+ result.add(materials);
|
|
|
+ });
|
|
|
+ return PageResult.build(params.getPage(), params.getPageSize(), kwpGoodsPage.getTotal(), result);
|
|
|
}
|
|
|
|
|
|
|