Commit e3c74abb authored by lcl's avatar lcl

u

parent 47e4322f
...@@ -30,7 +30,7 @@ public class DCustomerController extends BaseController { ...@@ -30,7 +30,7 @@ public class DCustomerController extends BaseController {
* 供应商总台账筛选 * 供应商总台账筛选
*/ */
@PostMapping("/all/searchList") @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); return baseService.allSearchList(bo,query);
} }
......
...@@ -43,22 +43,22 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -43,22 +43,22 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
dealWithCustomerClass(bo); dealWithCustomerClass(bo);
Page<DCustomer> page = baseMapper.allSearchList(query.build(), bo); Page<DCustomer> page = baseMapper.allSearchList(query.build(), bo);
if (CollectionUtils.isNotEmpty(page.getRecords())) { 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 { try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(customer.getCustomerName()); Map<String, Object> map = opportunityRadarService.enterpriseByName(item.getCustomerName());
if (!ObjectUtils.isEmpty(map.get("data"))) { if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data")); Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
Integer companyId = MapUtil.getInt(data, "jskEid"); Integer companyId = MapUtil.getInt(data, "jskEid");
customer.setCompanyId(companyId); item.setCompanyId(companyId);
} }
}catch (Exception e){ }catch (Exception e){
// //
} }
} });
} }
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
......
...@@ -12,37 +12,29 @@ ...@@ -12,37 +12,29 @@
from d_customer from d_customer
where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475' where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerName != null and bo.customerName != '' "> and customer_name like concat('%',#{bo.customerName},'%')</if> <if test="bo.customerName != null and bo.customerName != '' "> and customer_name like concat('%',#{bo.customerName},'%')</if>
<!-- <if test="bo.region != null and bo.region != '' ">--> <if test="bo.province != null and bo.province.size > 0 and (bo.city == null or bo.city.size == 0) ">
<!-- and register_region in--> and register_province in
<!-- <foreach collection="region" item="item" open="(" separator="," close=")">--> <foreach collection="bo.province" item="item" open="(" separator="," close=")">
<!-- #{item}--> #{item}
<!-- </foreach>--> </foreach>
<!-- </if>--> </if>
<choose> <if test="bo.city != null and bo.city.size > 0 and (bo.province == null or bo.province.size == 0) ">
<when test="bo.province != null and bo.province.size > 0 and (bo.city == null or bo.city.size == 0) "> and register_city in
and register_province in <foreach collection="bo.city" item="item" open="(" separator="," close=")">
<foreach collection="province" item="item" open="(" separator="," close=")"> #{item}
#{item} </foreach>
</foreach> </if>
</when> <if test="bo.province != null and bo.province.size > 0 and bo.city != null and bo.city.size > 0 " >
<when test="bo.city != null and bo.city.size > 0 "> and ( register_province in
and register_city in <foreach collection="bo.province" item="item" open="(" separator="," close=")">
<foreach collection="city" item="item" open="(" separator="," close=")"> #{item}
#{item} </foreach>
</foreach> or register_city in
</when> <foreach collection="bo.city" item="item" open="(" separator="," close=")">
<otherwise> #{item}
and ( register_province in </foreach>
<foreach collection="province" item="item" open="(" separator="," close=")"> )
#{item} </if>
</foreach>
or register_city in
<foreach collection="city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</otherwise>
</choose>
<if test="bo.customerClass != null and bo.customerClass != '' "> <if test="bo.customerClass != null and bo.customerClass != '' ">
and customer_class in and customer_class in
<foreach collection="customerClass" item="item" open="(" separator="," close=")"> <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