市场活动查询调整-客户的来源档案增加种植户档案
This commit is contained in:
		
							parent
							
								
									474f7ad50d
								
							
						
					
					
						commit
						4298b83f94
					
				|  | @ -479,7 +479,7 @@ public class PlantuserApi { | |||
|                         params.put("documentsStatus", documentsStatus); | ||||
|                     } | ||||
|                     if (StringUtil.isNotEmpty(status) && status.contains(",")) { | ||||
|                         params.put("statusArr", status); | ||||
|                         params.put("statusArr", status.split(",", -1)); | ||||
|                     } else { | ||||
|                         params.put("status", status); | ||||
|                     } | ||||
|  |  | |||
|  | @ -62,7 +62,6 @@ public class ViewMeetingExcel { | |||
|             @ApiParam(required = false, value = "营销code 2.虚拟 3.实际") @RequestParam(required = false) String code, | ||||
|             @ApiParam(required = false, value = "经销商id") @RequestParam(required = false) String dealersId, | ||||
|             @ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName, | ||||
|             @ApiParam(required = false, value = "客户类型编码") @RequestParam(required = false) String clientType, | ||||
|             @ApiParam(required = false, value = "业务员id") @RequestParam(required = false) String staffId, | ||||
|             HttpServletRequest request, HttpServletResponse response) throws Exception { | ||||
|         Map<String, Object> params = new HashMap<String, Object>(); | ||||
|  | @ -83,12 +82,9 @@ public class ViewMeetingExcel { | |||
|         params.put("endDate", endDate); | ||||
|         params.put("dealersId", dealersId); | ||||
|         params.put("distributorName", distributorName); | ||||
|         params.put("clientType", clientType); | ||||
|         params.put("staffId", staffId); | ||||
|         params.put("page", 1); | ||||
|         params.put("pageSize", 10000); | ||||
|         PageInfo pageInfo = viewMeetingService.pageList(params, ".pageList"); | ||||
|         EasyPoiUtils.exportExcel(pageInfo.getList(), ViewMeeting.class, "市场活动导出", response); | ||||
|         List list = viewMeetingService.listAll(params, ".pageList"); | ||||
|         EasyPoiUtils.exportExcel(list, ViewMeeting.class, "市场活动导出", response); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
|  | @ -137,7 +137,6 @@ public class ViewMeetingApi extends BaseController { | |||
|             @ApiParam(required = false, value = "营销code 2.虚拟 3.实际") @RequestParam(required = false) String code, | ||||
|             @ApiParam(required = false, value = "客户id") @RequestParam(required = false) String dealersId, | ||||
|             @ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName, | ||||
|             @ApiParam(required = false, value = "客户类型编码") @RequestParam(required = false) String clientType, | ||||
|             @ApiParam(required = false, value = "业务员id") @RequestParam(required = false) String staffId, | ||||
|             @ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(required = true) String page, | ||||
|             @ApiParam(required = true, value = "显示数量", defaultValue = "10") @RequestParam(required = true) String pageSize, | ||||
|  | @ -161,7 +160,6 @@ public class ViewMeetingApi extends BaseController { | |||
|         paramsMap.put("createEndDate", createEndDate); | ||||
|         paramsMap.put("dealersId", dealersId); | ||||
|         paramsMap.put("distributorName", distributorName); | ||||
|         paramsMap.put("clientType", clientType); | ||||
|         paramsMap.put("staffId", staffId); | ||||
|         paramsMap.put("page", page); | ||||
|         paramsMap.put("pageSize", pageSize); | ||||
|  |  | |||
|  | @ -55,7 +55,6 @@ public class ViewMeetingController extends BaseController { | |||
|             @ApiParam(required = false, value = "营销code 2.虚拟 3.实际") @RequestParam(required = false) String code, | ||||
|             @ApiParam(required = false, value = "经销商id") @RequestParam(required = false) String dealersId, | ||||
|             @ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName, | ||||
|             @ApiParam(required = false, value = "客户类型编码") @RequestParam(required = false) String clientType, | ||||
|             @ApiParam(required = false, value = "业务员id") @RequestParam(required = false) String staffId, | ||||
|             @ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(required = true) String page, | ||||
|             @ApiParam(required = true, value = "显示数量", defaultValue = "10") @RequestParam(required = true) String pageSize, | ||||
|  | @ -79,7 +78,6 @@ public class ViewMeetingController extends BaseController { | |||
|         paramsMap.put("endDate", endDate); | ||||
|         paramsMap.put("dealersId", dealersId); | ||||
|         paramsMap.put("distributorName", distributorName); | ||||
|         paramsMap.put("clientType", clientType); | ||||
|         paramsMap.put("staffId", staffId); | ||||
|         paramsMap.put("page", page); | ||||
|         paramsMap.put("pageSize", pageSize); | ||||
|  |  | |||
|  | @ -140,7 +140,7 @@ | |||
|         a.id, a.type_id, a.type_code, a.activity_content, a.activity_date, a.sem_id, a.ancestors, a.staff_id, | ||||
|         a.dealers_id, a.client_type, a.region, a.company_id, a.create_user, a.staff_size, a.site, a.longitude, a.latitude, a.activity_img, a.videos, | ||||
|         a.create_time, a.view_no, a.remark, a.status, a.auditor, a.audit_time, a.audit_content, a.process_instance_id, a.menu_code, a.area_code, | ||||
|         b.distributor_name, c.area_name, d.dict_name typeName, e.name staff_name, f.dict_name clientTypeName | ||||
|         a.distributor_name, c.area_name, d.dict_name typeName, e.name staff_name, f.dict_name clientTypeName | ||||
|         FROM crm_marketing_activity a | ||||
|         left join crm_distributor_user_info b on a.dealers_id = b.id | ||||
|         left join crm_marketing_area_info c on a.sem_id = c.id | ||||
|  | @ -172,10 +172,7 @@ | |||
|                 and a.dealers_id = #{dealersId} | ||||
|             </if> | ||||
|             <if test="distributorName != null and distributorName != ''"> | ||||
|                 and b.distributor_name = #{distributorName} | ||||
|             </if> | ||||
|             <if test="clientType != null and clientType != ''"> | ||||
|                 and b.distributor_level = #{clientType} | ||||
|                 and a.distributor_name = #{distributorName} | ||||
|             </if> | ||||
|             <if test="staffId != null and staffId != ''"> | ||||
|                 and a.staff_id = #{staffId} | ||||
|  | @ -320,7 +317,6 @@ | |||
|     <!-- 汇总参与人数 --> | ||||
|     <select id="viewNumPersion" parameterType="map" resultType="Integer"> | ||||
|         select sum(a.staff_size) as participantsNum from crm_marketing_activity a | ||||
|         left join crm_distributor_user_info b on a.dealers_id = b.id | ||||
|         <where> | ||||
|             <if test="createTime !=null and createTime !=''"> | ||||
|                 and a.create_time LIKE '%' || #{createTime} || '%' | ||||
|  | @ -334,101 +330,13 @@ | |||
|             <if test="areaId !=null and areaId !=''"> | ||||
|                 and a.sem_id = #{areaId} | ||||
|             </if> | ||||
|             <if test="companyId !=null and companyId !=''"> | ||||
|                 and a.company_id = #{companyId} | ||||
|             </if> | ||||
|             <if test="userId !=null and userId != ''"> | ||||
|                 and ( | ||||
|                 a.dealers_id LIKE '%' || #{userId} || '%' | ||||
|                 OR | ||||
|                 a.staff_id LIKE '%' || #{userId} || '%' | ||||
|                 ) | ||||
|             </if> | ||||
|             <if test="flag !=null and flag !=''"> | ||||
|                 <!-- 前端传营销区域 --> | ||||
|                 <if test="flag == 1"> | ||||
|                     <if test="areaId1 !=null and areaId1 !=''"> | ||||
|                         and (a.ancestors LIKE '%' || #{areaId1} || '%' | ||||
|                         or | ||||
|                         a.sem_id = #{areaId1} | ||||
|                         ) | ||||
|                     </if> | ||||
|                     <if test="areaId2 !=null and areaId2 !=''"> | ||||
|                         and a.sem_id = #{areaId2} | ||||
|                     </if> | ||||
|                     <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                         and a.sem_id in | ||||
|                         <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                             #{item} | ||||
|                         </foreach> | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <!-- 不传参数 包含本区域及下属区域和自定义 --> | ||||
|                 <if test="flag == 2"> | ||||
|                     <if test="areaId1 !=null and areaId1 !=''"> | ||||
|                         and (a.ancestors LIKE '%' || #{areaId1} || '%' | ||||
|                         or | ||||
|                         a.sem_id = #{areaId1} | ||||
|                         <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                             or a.sem_id in | ||||
|                             <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                                 #{item} | ||||
|                             </foreach> | ||||
|                         </if> | ||||
|                         ) | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <!-- 不传参数 包含本区域及下属区域和自定义 --> | ||||
|                 <if test="flag ==3"> | ||||
|                     <if test="areaId2 !=null and areaId2 !=''"> | ||||
|                         and (a.sem_id = #{areaId2} | ||||
|                         <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                             or a.sem_id in | ||||
|                             <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                                 #{item} | ||||
|                             </foreach> | ||||
|                         </if> | ||||
|                         ) | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <if test="flag ==4"> | ||||
|                     <if test="regions !=null and regions !=''"> | ||||
|                         and ( | ||||
|                         a.region in | ||||
|                         <foreach collection="regions" item="item" open="(" close=")" separator=","> | ||||
|                             #{item} | ||||
|                         </foreach> | ||||
|                         <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                             or a.sem_id in | ||||
|                             <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                                 #{item} | ||||
|                             </foreach> | ||||
|                         </if> | ||||
|                         ) | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <if test="flag ==5"> | ||||
|                     <if test="region !=null and region !=''"> | ||||
|                         and a.region = #{region} | ||||
|                     </if> | ||||
|                     <if test="adcodes !=null and adcodes !=''"> | ||||
|                         and a.region in | ||||
|                         <foreach collection="adcodes" item="item" open="(" close=")" separator=","> | ||||
|                             #{item} | ||||
|                         </foreach> | ||||
|                     </if> | ||||
|                     <if test="areaId !=null and areaId !=''"> | ||||
|                         and a.sem_id = #{areaId} | ||||
|                     </if> | ||||
|                 </if> | ||||
|             </if> | ||||
|             <include refid="selectSql"/> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
|     <!-- 市场活动数据统计 --> | ||||
|     <select id="countActivity" parameterType="map" resultType="Integer"> | ||||
|         select count(1) as num from crm_marketing_activity a | ||||
|         left join crm_distributor_user_info b on a.dealers_id = b.id | ||||
|         <where> | ||||
|             <if test="year !=null and year !=''"> | ||||
|                 and a.create_time LIKE '%' || #{year} || '%' | ||||
|  | @ -436,94 +344,7 @@ | |||
|             <if test="laststart != null and laststart !='' and lastend != null and lastend !=''"> | ||||
|                 and SUBSTR(a.create_time,1,7) BETWEEN #{laststart} AND #{lastend} | ||||
|             </if> | ||||
|             <if test="companyId !=null and companyId !=''"> | ||||
|                 and a.company_id = #{companyId} | ||||
|             </if> | ||||
|             <if test="userId !=null and userId != ''"> | ||||
|                 and ( | ||||
|                 a.dealers_id LIKE '%' || #{userId} || '%' | ||||
|                 OR | ||||
|                 a.staff_id LIKE '%' || #{userId} || '%' | ||||
|                 ) | ||||
|             </if> | ||||
|             <if test="flag !=null and flag !=''"> | ||||
|                 <!-- 前端传营销区域 --> | ||||
|                 <if test="flag == 1"> | ||||
|                     <if test="areaId1 !=null and areaId1 !=''"> | ||||
|                         and (a.ancestors LIKE '%' || #{areaId1} || '%' | ||||
|                         or | ||||
|                         a.sem_id = #{areaId1} | ||||
|                         ) | ||||
|                     </if> | ||||
|                     <if test="areaId2 !=null and areaId2 !=''"> | ||||
|                         and a.sem_id = #{areaId2} | ||||
|                     </if> | ||||
|                     <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                         and a.sem_id in | ||||
|                         <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                             #{item} | ||||
|                         </foreach> | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <!-- 不传参数 包含本区域及下属区域和自定义 --> | ||||
|                 <if test="flag == 2"> | ||||
|                     <if test="areaId1 !=null and areaId1 !=''"> | ||||
|                         and (a.ancestors LIKE '%' || #{areaId1} || '%' | ||||
|                         or | ||||
|                         a.sem_id = #{areaId1} | ||||
|                         <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                             or a.sem_id in | ||||
|                             <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                                 #{item} | ||||
|                             </foreach> | ||||
|                         </if> | ||||
|                         ) | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <!-- 不传参数 包含本区域及下属区域和自定义 --> | ||||
|                 <if test="flag ==3"> | ||||
|                     <if test="areaId2 !=null and areaId2 !=''"> | ||||
|                         and (a.sem_id = #{areaId2} | ||||
|                         <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                             or a.sem_id in | ||||
|                             <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                                 #{item} | ||||
|                             </foreach> | ||||
|                         </if> | ||||
|                         ) | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <if test="flag ==4"> | ||||
|                     <if test="regions !=null and regions !=''"> | ||||
|                         and ( | ||||
|                         a.region in | ||||
|                         <foreach collection="regions" item="item" open="(" close=")" separator=","> | ||||
|                             #{item} | ||||
|                         </foreach> | ||||
|                         <if test="areaId3 !=null and areaId3 !=''"> | ||||
|                             or a.sem_id in | ||||
|                             <foreach collection="areaId3" item="item" open="(" close=")" separator=","> | ||||
|                                 #{item} | ||||
|                             </foreach> | ||||
|                         </if> | ||||
|                         ) | ||||
|                     </if> | ||||
|                 </if> | ||||
|                 <if test="flag ==5"> | ||||
|                     <if test="region !=null and region !=''"> | ||||
|                         and a.region = #{region} | ||||
|                     </if> | ||||
|                     <if test="adcodes !=null and adcodes !=''"> | ||||
|                         and a.region in | ||||
|                         <foreach collection="adcodes" item="item" open="(" close=")" separator=","> | ||||
|                             #{item} | ||||
|                         </foreach> | ||||
|                     </if> | ||||
|                     <if test="areaId !=null and areaId !=''"> | ||||
|                         and a.sem_id = #{areaId} | ||||
|                     </if> | ||||
|                 </if> | ||||
|             </if> | ||||
|             <include refid="selectSql"/> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
|  |  | |||
|  | @ -164,4 +164,8 @@ public class ViewMeeting implements Serializable { | |||
|     /** 营销区域编码 */ | ||||
|     @ApiModelProperty(hidden = true) | ||||
|     private String areaCode; | ||||
| 
 | ||||
|     /** 客户档案来源 1.经销商档案 2.种植户档案 */ | ||||
|     @ApiModelProperty(value = "客户档案来源 1.经销商档案 2.种植户档案", required = true) | ||||
|     private String sourceType; | ||||
| } | ||||
		Loading…
	
		Reference in New Issue