|
@@ -86,8 +86,6 @@ public class KwpGoodsService {
|
|
|
private String pcGoodsListUrl;
|
|
private String pcGoodsListUrl;
|
|
|
@Value("${goods.url.list.app}")
|
|
@Value("${goods.url.list.app}")
|
|
|
private String appGoodsListUrl;
|
|
private String appGoodsListUrl;
|
|
|
- @Value("${filePathPrefix}")
|
|
|
|
|
- private String pathPrefix;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -220,8 +218,7 @@ public class KwpGoodsService {
|
|
|
RecommendGoods recommendGoods = BeanUtils.copyProperties(e, RecommendGoods.class);
|
|
RecommendGoods recommendGoods = BeanUtils.copyProperties(e, RecommendGoods.class);
|
|
|
List<KwpGoodsPriceRange> prices = map.get(recommendGoods.getId());
|
|
List<KwpGoodsPriceRange> prices = map.get(recommendGoods.getId());
|
|
|
recommendGoods.setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(recommendGoods.getUnit()) : null)
|
|
recommendGoods.setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(recommendGoods.getUnit()) : null)
|
|
|
- .setPrice(CollectionUtils.isNotEmpty(prices) ? prices.get(0).getPrice() : null)
|
|
|
|
|
- .setThumb(StringUtils.isNotEmpty(e.getThumb()) ? pathPrefix + e.getThumb() : null);
|
|
|
|
|
|
|
+ .setPrice(CollectionUtils.isNotEmpty(prices) ? prices.get(0).getPrice() : null);
|
|
|
recommendGoodsList.add(recommendGoods);
|
|
recommendGoodsList.add(recommendGoods);
|
|
|
});
|
|
});
|
|
|
detail.setRecommendGoodsList(recommendGoodsList);
|
|
detail.setRecommendGoodsList(recommendGoodsList);
|
|
@@ -275,16 +272,7 @@ public class KwpGoodsService {
|
|
|
.setStatusLabel(CollectionUtils.isNotEmpty(goodsStatusMap) ? goodsStatusMap.get(String.valueOf(detail.getStatus())) : null)
|
|
.setStatusLabel(CollectionUtils.isNotEmpty(goodsStatusMap) ? goodsStatusMap.get(String.valueOf(detail.getStatus())) : null)
|
|
|
.setPrepaidLimitLabel(Objects.equals(detail.getPrepaidLimit(), 1) ? "是" : "否");
|
|
.setPrepaidLimitLabel(Objects.equals(detail.getPrepaidLimit(), 1) ? "是" : "否");
|
|
|
//商品图片信息
|
|
//商品图片信息
|
|
|
- if (Objects.nonNull(goods.getThumb())) {
|
|
|
|
|
- detail.setThumb(pathPrefix + goods.getThumb());
|
|
|
|
|
- }
|
|
|
|
|
List<KwpGoodsImage> goodsImages = kwpGoodsImageService.getByGoodsId(id);
|
|
List<KwpGoodsImage> goodsImages = kwpGoodsImageService.getByGoodsId(id);
|
|
|
- goodsImages.forEach(e -> {
|
|
|
|
|
- String image = e.getImage();
|
|
|
|
|
- if (StringUtils.isNotEmpty(image)) {
|
|
|
|
|
- e.setImage(pathPrefix + image);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
List<GoodsImagesDetail> images = BeanUtils.copyToList(goodsImages, GoodsImagesDetail.class);
|
|
List<GoodsImagesDetail> images = BeanUtils.copyToList(goodsImages, GoodsImagesDetail.class);
|
|
|
//商品价格段信息
|
|
//商品价格段信息
|
|
|
List<KwpGoodsPriceRange> priceRanges = kwpGoodsPriceRangeService.getByGoodsId(id);
|
|
List<KwpGoodsPriceRange> priceRanges = kwpGoodsPriceRangeService.getByGoodsId(id);
|
|
@@ -720,7 +708,6 @@ public class KwpGoodsService {
|
|
|
.setAddress(addressMap.get(id)).setSupplyEnt(entMap.get(e.getSupplyEntId()))
|
|
.setAddress(addressMap.get(id)).setSupplyEnt(entMap.get(e.getSupplyEntId()))
|
|
|
.setManageName(Objects.nonNull(manager) ? manager.getName() : null)
|
|
.setManageName(Objects.nonNull(manager) ? manager.getName() : null)
|
|
|
.setPhone(Objects.nonNull(manager) ? manager.getPhone() : null)
|
|
.setPhone(Objects.nonNull(manager) ? manager.getPhone() : null)
|
|
|
- .setThumb(Objects.nonNull(e.getThumb()) ? pathPrefix + e.getThumb() : null)
|
|
|
|
|
.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);
|
|
|
if (CollectionUtils.isNotEmpty(priceRanges)) {
|
|
if (CollectionUtils.isNotEmpty(priceRanges)) {
|
|
@@ -928,7 +915,6 @@ public class KwpGoodsService {
|
|
|
.setAddressName(Objects.isNull(address) ? null : address.getCityName())
|
|
.setAddressName(Objects.isNull(address) ? null : address.getCityName())
|
|
|
.setDetailAddress(Objects.isNull(address) ? null : address.getDetailAddress())
|
|
.setDetailAddress(Objects.isNull(address) ? null : address.getDetailAddress())
|
|
|
.setPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(0).getPrice())
|
|
.setPrice(CollectionUtils.isEmpty(priceRanges) ? null : priceRanges.get(0).getPrice())
|
|
|
- .setThumb(StringUtils.isNotEmpty(e.getThumb()) ? pathPrefix + e.getThumb() : null)
|
|
|
|
|
.setSupplyEnt(entMap.get(e.getSupplyEntId()));
|
|
.setSupplyEnt(entMap.get(e.getSupplyEntId()));
|
|
|
result.add(materials);
|
|
result.add(materials);
|
|
|
});
|
|
});
|
|
@@ -1006,11 +992,7 @@ public class KwpGoodsService {
|
|
|
* @return: java.util.List<com.sckw.product.model.KwpGoods>
|
|
* @return: java.util.List<com.sckw.product.model.KwpGoods>
|
|
|
*/
|
|
*/
|
|
|
public KwpGoods selectById(Long id) {
|
|
public KwpGoods selectById(Long id) {
|
|
|
- KwpGoods goods = kwpGoodsMapper.selectById(id);
|
|
|
|
|
- if (Objects.nonNull(goods) && StringUtils.isNotBlank(goods.getThumb())) {
|
|
|
|
|
- goods.setThumb(pathPrefix + goods.getThumb());
|
|
|
|
|
- }
|
|
|
|
|
- return goods;
|
|
|
|
|
|
|
+ return kwpGoodsMapper.selectById(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1023,13 +1005,6 @@ public class KwpGoodsService {
|
|
|
*/
|
|
*/
|
|
|
public List<KwpGoods> selectByIds(List<Long> ids) {
|
|
public List<KwpGoods> selectByIds(List<Long> ids) {
|
|
|
List<KwpGoods> list = kwpGoodsMapper.selectBatchIds(ids);
|
|
List<KwpGoods> list = kwpGoodsMapper.selectBatchIds(ids);
|
|
|
- if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
- list.forEach(e -> {
|
|
|
|
|
- if (StringUtils.isNotBlank(e.getThumb())) {
|
|
|
|
|
- e.setThumb(pathPrefix + e.getThumb());
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
return CollectionUtils.emptyIfNull(list);
|
|
return CollectionUtils.emptyIfNull(list);
|
|
|
}
|
|
}
|
|
|
|
|
|