Commit ea576dc4 by 翁国栋

crm本月待跟进列表接口去除无用字段keywordStr

parent 157d6529
...@@ -561,6 +561,7 @@ public class CrmController { ...@@ -561,6 +561,7 @@ public class CrmController {
.orderByDesc(CrmClientData::getCreateTime)); .orderByDesc(CrmClientData::getCreateTime));
} }
// 我协作的客户 // 我协作的客户
private List<CrmClientData> getMyAssociateCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status, private List<CrmClientData> getMyAssociateCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,
String like, Integer typei, String startFollowTime, String endFollowTime, String startCreateTime, String endCreateTime) { String like, Integer typei, String startFollowTime, String endFollowTime, String startCreateTime, String endCreateTime) {
...@@ -614,10 +615,7 @@ public class CrmController { ...@@ -614,10 +615,7 @@ public class CrmController {
String endFollowTime,Integer typei,Integer industry,Integer unfollowedDays) { String endFollowTime,Integer typei,Integer industry,Integer unfollowedDays) {
return CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,typei,industry), return CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,typei,industry),
getMyAssociateCilent(empNum, orgCode, groupId, status, like,typei,startFollowTime,endFollowTime,startCreateTime,endCreateTime), true).stream() getMyAssociateCilent(empNum, orgCode, groupId, status, like,typei,startFollowTime,endFollowTime,startCreateTime,endCreateTime), true);
.filter(item -> item.getLastFollowTime() != null
&& item.getLastFollowTime().before(DateUtil.offsetDay(new Date(), 0-unfollowedDays)))
.collect(Collectors.toList());
} }
private <T> List<T> getPageList(List<T> list, int pageNumber, int pageSize, Comparator<T> comparator) { private <T> List<T> getPageList(List<T> list, int pageNumber, int pageSize, Comparator<T> comparator) {
...@@ -625,6 +623,12 @@ public class CrmController { ...@@ -625,6 +623,12 @@ public class CrmController {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
// 本月待跟进的客户
private List<CrmClientData> getCilentFollowMothen(Integer empNum, Integer orgCode, Integer groupId,
Integer status,String like,String startCreateTime, String endCreateTime, String startFollowTime,
String endFollowTime,Integer typei,Integer industry,Integer unfollowedDays,String remindDay) {
return crmClientDataMapper.getToBeFollowedList(empNum, orgCode, groupId, status,like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,typei,industry,remindDay);
}
@GetMapping("getMyCilentTotal") @GetMapping("getMyCilentTotal")
@ApiOperation(value = "获取我的客户列表(全)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取我的客户列表(全)", httpMethod = "GET", notes = "接口发布说明")
...@@ -671,6 +675,12 @@ public class CrmController { ...@@ -671,6 +675,12 @@ public class CrmController {
crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status,typei,industry); crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status,typei,industry);
else if (type == 4) // 七天未跟进的客户 else if (type == 4) // 七天未跟进的客户
crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status,typei); crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status,typei);
else if(type==5) {
SimpleDateFormat df= new SimpleDateFormat("yyyy-MM");
crmClientDatas = getCilentFollowMothen(empNum, orgCode, groupId,
status, like, startCreateTime, endCreateTime, startFollowTime,
endFollowTime, typei, industry, null, df.format(new Date()));
}
else else
return ResultUtil.error("查询失败"); return ResultUtil.error("查询失败");
// Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序 // Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
...@@ -2025,7 +2035,7 @@ public class CrmController { ...@@ -2025,7 +2035,7 @@ public class CrmController {
@RequestParam(required = false) Integer followNumber, @RequestParam(required = false) Integer followNumber,
@RequestParam(required = false) Integer industry, @RequestParam(required = false) Integer industry,
@RequestParam(required = false) String remindDay) { @RequestParam(required = false) String remindDay) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
remindDay=sdf.format(new Date()); remindDay=sdf.format(new Date());
Integer empNum = getEmpNum(userBean); Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean); Integer orgCode = getOrgCode(userBean);
......
...@@ -107,4 +107,11 @@ public interface CrmClientDataMapper extends BaseMapper<CrmClientData> { ...@@ -107,4 +107,11 @@ public interface CrmClientDataMapper extends BaseMapper<CrmClientData> {
@Param("ifPhone") String ifPhone,@Param("customerowner") String customerowner, @Param("ifPhone") String ifPhone,@Param("customerowner") String customerowner,
@Param("unfollowedDays") Integer unfollowedDays, @Param("followNumber") Integer followNumber, @Param("unfollowedDays") Integer unfollowedDays, @Param("followNumber") Integer followNumber,
@Param("industry") Integer industry,@Param("gid")Integer gid,@Param("remindDay")String remindDay); @Param("industry") Integer industry,@Param("gid")Integer gid,@Param("remindDay")String remindDay);
List<CrmClientData> getToBeFollowedList(@Param("empNum") Integer empNum, @Param("orgCode") Integer orgCode,
@Param("groupId") Integer groupId, @Param("status") Integer status,
@Param("like") String like, @Param("startCreateTime") String startCreateTime,
@Param("endCreateTime") String endCreateTime, @Param("startFollowTime") String startFollowTime,
@Param("endFollowTime") String endFollowTime,@Param("type") Integer type,
@Param("industry") Integer industry,@Param("remindDay")String remindDay);
} }
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
left join crm_client_data ccd on ccd.id=crr.crm_client_id left join crm_client_data ccd on ccd.id=crr.crm_client_id
WHERE ccd.org_code = #{orgCode} WHERE ccd.org_code = #{orgCode}
AND ccd.belong_user = #{empNum} AND ccd.belong_user = #{empNum}
and crr.remind_day>=#{remindDay} and DATE_FORMAT(crr.remind_day, '%Y-%m') =#{remindDay}
and crr.delete_flag = 0 and crr.delete_flag = 0
<if test="industry != null and industry > 0"> <if test="industry != null and industry > 0">
AND ccd.industry = #{industry} AND ccd.industry = #{industry}
...@@ -265,9 +265,9 @@ ...@@ -265,9 +265,9 @@
<if test="status != null and status >= 0"> <if test="status != null and status >= 0">
AND ccd.client_status = #{status} AND ccd.client_status = #{status}
</if> </if>
<if test="keywordStr != null and keywordStr != ''"> <!-- <if test="keywordStr != null and keywordStr != ''">-->
AND ccd.belong_group IN (${keywordStr}) <!-- AND ccd.belong_group IN (${keywordStr})-->
</if> <!-- </if>-->
<if test="ifPhone != null and ifPhone != '' and ifPhone == '1'"> <if test="ifPhone != null and ifPhone != '' and ifPhone == '1'">
AND ccd.client_cellphone LIKE '%1' AND ccd.client_cellphone LIKE '%1'
</if> </if>
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
WHERE cid = ccd.id WHERE cid = ccd.id
) >= #{followNumber} ) >= #{followNumber}
</if> </if>
ORDER BY ccd.create_time DESC; ORDER BY ccd.create_time DESC
</select> </select>
<select id="getCrmClientData5" resultType="CrmClientData"> <select id="getCrmClientData5" resultType="CrmClientData">
...@@ -301,8 +301,7 @@ ...@@ -301,8 +301,7 @@
FROM crm_remind_rule crr FROM crm_remind_rule crr
left join crm_client_data ccd on ccd.id=crr.crm_client_id left join crm_client_data ccd on ccd.id=crr.crm_client_id
where crr.delete_flag = 0 where crr.delete_flag = 0
and ccd.belong_group = #{gid} and DATE_FORMAT(crr.remind_day, '%Y-%m')=#{remindDay}
and crr.remind_day>=#{remindDay}
<if test="industry != null and industry > 0"> <if test="industry != null and industry > 0">
AND ccd.industry = #{industry} AND ccd.industry = #{industry}
</if> </if>
...@@ -343,7 +342,7 @@ ...@@ -343,7 +342,7 @@
WHERE cid = ccd.id WHERE cid = ccd.id
) >= #{followNumber} ) >= #{followNumber}
</if> </if>
ORDER BY ccd.create_time DESC; ORDER BY ccd.create_time DESC
</select> </select>
<select id="getCrmClientData6" resultType="CrmClientData"> <select id="getCrmClientData6" resultType="CrmClientData">
...@@ -351,9 +350,9 @@ ...@@ -351,9 +350,9 @@
FROM crm_remind_rule crr FROM crm_remind_rule crr
left join crm_client_data ccd on ccd.id=crr.crm_client_id left join crm_client_data ccd on ccd.id=crr.crm_client_id
where crr.delete_flag = 0 where crr.delete_flag = 0
AND ccr.crm_group_member = #{empNum} AND crr.crm_group_member = #{empNum}
AND ccr.org_code = #{orgCode} AND crr.org_code = #{orgCode}
and crr.remind_day>=#{remindDay} and DATE_FORMAT(crr.remind_day, '%Y-%m')=#{remindDay}
<if test="gid != null and gid > 0"> <if test="gid != null and gid > 0">
and ccd.belong_group = #{gid} and ccd.belong_group = #{gid}
</if> </if>
...@@ -397,6 +396,51 @@ ...@@ -397,6 +396,51 @@
WHERE cid = ccd.id WHERE cid = ccd.id
) >= #{followNumber} ) >= #{followNumber}
</if> </if>
ORDER BY ccd.create_time DESC; ORDER BY ccd.create_time DESC
</select>
<select id="getToBeFollowedList" resultType="CrmClientData">
SELECT ccd.*
FROM crm_remind_rule crr
left join crm_client_data ccd on ccd.id=crr.crm_client_id
where crr.delete_flag = 0
AND crr.crm_group_member = #{empNum}
AND crr.org_code = #{orgCode}
and DATE_FORMAT(crr.remind_day, '%Y-%m')=#{remindDay}
<if test="groupId != null and groupId > 0">
and ccd.belong_group = #{groupId}
</if>
<if test="industry != null and industry > 0">
AND ccd.industry = #{industry}
</if>
<if test="groupId != null and groupId >= 0">
AND ccd.belong_group = #{groupId}
</if>
<if test="type != null and type >= 0">
AND ccd.client_type = #{type}
</if>
<if test="customerowner != null and customerowner != ''">
AND ccd.belong_user_name LIKE CONCAT('%', #{customerowner}, '%')
</if>
<if test="status != null and status >= 0">
AND ccd.client_status = #{status}
</if>
<if test="ifPhone != null and ifPhone != '' and ifPhone == '1'">
AND ccd.client_cellphone LIKE '%1'
</if>
<if test="ifPhone != null and ifPhone != '' and ifPhone == '2'">
AND (ccd.client_cellphone IS NULL OR ccd.client_cellphone = '')
</if>
<if test="startCreateTime != null and startCreateTime != '' and endCreateTime != null and endCreateTime != '' ">
AND ccd.create_time BETWEEN #{startCreateTime} AND #{endCreateTime}
</if>
<if test="startFollowTime != null and endFollowTime != null">
AND ccd.last_follow_time BETWEEN #{startFollowTime} AND #{endFollowTime}
</if>
<if test="like != null and like.trim().length() > 0">
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if>
ORDER BY ccd.create_time DESC
</select> </select>
</mapper> </mapper>
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