Commit e3c74abb authored by lcl's avatar lcl

u

parent 47e4322f
......@@ -30,7 +30,7 @@ public class DCustomerController extends BaseController {
* 供应商总台账筛选
*/
@PostMapping("/all/searchList")
public TableDataInfo<DCustomer> allSearchList(@RequestBody DCustomerSearchBo bo, PageQuery query) {
public TableDataInfo<DCustomer> allSearchList(@RequestBody DCustomerSearchBo bo,@RequestBody PageQuery query) {
return baseService.allSearchList(bo,query);
}
......
......@@ -43,22 +43,22 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
dealWithCustomerClass(bo);
Page<DCustomer> page = baseMapper.allSearchList(query.build(), bo);
if (CollectionUtils.isNotEmpty(page.getRecords())) {
for (DCustomer customer : page.getRecords()) {
page.getRecords().parallelStream().forEach(item->{
//企业合作数量
customer.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(customer.getCustomerId()));
item.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(item.getCustomerId()));
//项目合作数量
customer.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(customer.getCustomerId()));
item.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(item.getCustomerId()));
try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(customer.getCustomerName());
Map<String, Object> map = opportunityRadarService.enterpriseByName(item.getCustomerName());
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
Integer companyId = MapUtil.getInt(data, "jskEid");
customer.setCompanyId(companyId);
item.setCompanyId(companyId);
}
}catch (Exception e){
//
}
}
});
}
return TableDataInfo.build(page);
}
......
......@@ -12,37 +12,29 @@
from d_customer
where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerName != null and bo.customerName != '' "> and customer_name like concat('%',#{bo.customerName},'%')</if>
<!-- <if test="bo.region != null and bo.region != '' ">-->
<!-- and register_region in-->
<!-- <foreach collection="region" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<choose>
<when test="bo.province != null and bo.province.size > 0 and (bo.city == null or bo.city.size == 0) ">
<if test="bo.province != null and bo.province.size > 0 and (bo.city == null or bo.city.size == 0) ">
and register_province in
<foreach collection="province" item="item" open="(" separator="," close=")">
<foreach collection="bo.province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<when test="bo.city != null and bo.city.size > 0 ">
</if>
<if test="bo.city != null and bo.city.size > 0 and (bo.province == null or bo.province.size == 0) ">
and register_city in
<foreach collection="city" item="item" open="(" separator="," close=")">
<foreach collection="bo.city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<otherwise>
</if>
<if test="bo.province != null and bo.province.size > 0 and bo.city != null and bo.city.size > 0 " >
and ( register_province in
<foreach collection="province" item="item" open="(" separator="," close=")">
<foreach collection="bo.province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or register_city in
<foreach collection="city" item="item" open="(" separator="," close=")">
<foreach collection="bo.city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</otherwise>
</choose>
</if>
<if test="bo.customerClass != null and bo.customerClass != '' ">
and customer_class in
<foreach collection="customerClass" item="item" open="(" separator="," close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment