提交 2f139ce6 作者: zhenjie

用户查询添加公司名称字段

上级 cd70cf76
......@@ -26,6 +26,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.security.NoSuchAlgorithmException;
import java.util.List;
......@@ -205,6 +206,15 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
return null;
}
List<BackUserAccountVO> accountSimpleDTOS = list.stream().map(BackUserAccountDO::buildBackUserAccountVO).collect(Collectors.toList());
List<CompanyInfoVO> companyInfoVOS = companyService.listCompanyInfoByBUIds(bUserAccountQO.getUserIds());
if (!CollectionUtils.isEmpty(companyInfoVOS)) {
Map<Integer, CompanyInfoVO> userCom = companyInfoVOS.stream().collect(Collectors.toMap(CompanyInfoVO::getBackUserAccountId, v -> v, (v1, v2) -> v2));
for (BackUserAccountVO accountSimpleDTO : accountSimpleDTOS) {
if (userCom.containsKey(accountSimpleDTO.getId())) {
accountSimpleDTO.setCompanyName(userCom.get(accountSimpleDTO.getId()).getCompanyName());
}
}
}
return accountSimpleDTOS;
}
......
......@@ -166,8 +166,8 @@
<select id="listCompanyInfoByUID" resultType="com.mmc.iuav.user.entity.CompanyInfoDO">
SELECT ci.id, ci.company_type, ci.company_name, ci.full_name, ci.province, ci.city, ci.district, ci.address,
ci.company_user_name,
ci.phone_num, ci.remark, ci.create_time, cbu.back_user_account_id,ci.content, ci.score, ci.back_img
ci.company_user_name, ci.phone_num, ci.remark, ci.create_time, ci.content, ci.score, ci.back_img
cbu.back_user_account_id,
FROM company_info ci INNER JOIN company_back_user cbu ON ci.id = cbu.company_info_id
WHERE 1 = 1
<if test="backUserIds != null">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论