提交 9ea28138 作者: xiaowang

Merge branch 'develop'

......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 77b2c8d55b316d0939f1ff0885084e77fce9e8be
newTag: b4a05ede254a22ad91bbfb75405c9e18cd4582aa
......@@ -81,4 +81,7 @@ public class MallGoodsVO implements Serializable {
@ApiModelProperty(value = "店铺id 小程序用")
private Integer userAccountId;
@ApiModelProperty(value = "单位名称")
private String companyName;
}
package com.mmc.pms.service.mall.impl;
import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
......@@ -9,6 +10,7 @@ import com.mmc.pms.entity.lease.LeasePriceStockDO;
import com.mmc.pms.entity.lease.LeaseSpecAttrDO;
import com.mmc.pms.entity.lease.LeaseSpecAttrValueDO;
import com.mmc.pms.entity.mall.*;
import com.mmc.pms.feign.UserAppApi;
import com.mmc.pms.model.lease.vo.LeaseGoodsVO;
import com.mmc.pms.model.lease.vo.LeasePriceStockVO;
import com.mmc.pms.model.mall.GoodsResourcesVO;
......@@ -45,6 +47,8 @@ public class MallGoodsServiceImpl implements MallGoodsService {
private LeaseGoodsDao leaseGoodsDao;
@Autowired
private CompanyInspectionService companyInspectionService;
@Autowired
private UserAppApi userAppApi;
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -409,9 +413,19 @@ public class MallGoodsServiceImpl implements MallGoodsService {
param.buildCurrentPage();
mallGoodsList = mallGoodsDao.listMallGoods(param);
List<MallGoodsVO> pageList = mallGoodsList.stream().map(MallGoodsDO::buildListMallGoodsVO).collect(Collectors.toList());
setCompanyName(pageList);
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
private void setCompanyName(List<MallGoodsVO> pageList) {
List<Integer> userAccountIds = pageList.stream().map(MallGoodsVO::getUserAccountId).collect(Collectors.toList());
List<CompanyInfoVO> companyInfoVOS = userAppApi.listCompanyInfoByBUIds(userAccountIds);
if (CollectionUtils.isNotEmpty(companyInfoVOS)) {
Map<Integer, String> collect = companyInfoVOS.stream().collect(Collectors.toMap(CompanyInfoVO::getBackUserAccountId, CompanyInfoVO::getCompanyName));
pageList.forEach(i -> i.setCompanyName(collect.get(i.getUserAccountId())));
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody exchange(Integer firstId, Integer secondId) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论