Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
ea576dc4
Commit
ea576dc4
authored
Aug 07, 2023
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm本月待跟进列表接口去除无用字段keywordStr
parent
157d6529
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
17 deletions
+78
-17
src/main/java/cn/timer/api/controller/crm/CrmController.java
+15
-5
src/main/java/cn/timer/api/dao/crm/CrmClientDataMapper.java
+7
-0
src/main/resources/mapping/crm/CrmClientDataMapper.xml
+56
-12
No files found.
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
ea576dc4
...
...
@@ -561,6 +561,7 @@ public class CrmController {
.
orderByDesc
(
CrmClientData:
:
getCreateTime
));
}
// 我协作的客户
private
List
<
CrmClientData
>
getMyAssociateCilent
(
Integer
empNum
,
Integer
orgCode
,
Integer
groupId
,
Integer
status
,
String
like
,
Integer
typei
,
String
startFollowTime
,
String
endFollowTime
,
String
startCreateTime
,
String
endCreateTime
)
{
...
...
@@ -614,10 +615,7 @@ public class CrmController {
String
endFollowTime
,
Integer
typei
,
Integer
industry
,
Integer
unfollowedDays
)
{
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
()
.
filter
(
item
->
item
.
getLastFollowTime
()
!=
null
&&
item
.
getLastFollowTime
().
before
(
DateUtil
.
offsetDay
(
new
Date
(),
0
-
unfollowedDays
)))
.
collect
(
Collectors
.
toList
());
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
typei
,
startFollowTime
,
endFollowTime
,
startCreateTime
,
endCreateTime
),
true
);
}
private
<
T
>
List
<
T
>
getPageList
(
List
<
T
>
list
,
int
pageNumber
,
int
pageSize
,
Comparator
<
T
>
comparator
)
{
...
...
@@ -625,6 +623,12 @@ public class CrmController {
.
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"
)
@ApiOperation
(
value
=
"获取我的客户列表(全)"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
...
...
@@ -671,6 +675,12 @@ public class CrmController {
crmClientDatas
=
getMyStarCilent
(
empNum
,
orgCode
,
groupId
,
status
,
typei
,
industry
);
else
if
(
type
==
4
)
// 七天未跟进的客户
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
return
ResultUtil
.
error
(
"查询失败"
);
// Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
...
...
@@ -2025,7 +2035,7 @@ public class CrmController {
@RequestParam
(
required
=
false
)
Integer
followNumber
,
@RequestParam
(
required
=
false
)
Integer
industry
,
@RequestParam
(
required
=
false
)
String
remindDay
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM
-dd
"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
remindDay
=
sdf
.
format
(
new
Date
());
Integer
empNum
=
getEmpNum
(
userBean
);
Integer
orgCode
=
getOrgCode
(
userBean
);
...
...
src/main/java/cn/timer/api/dao/crm/CrmClientDataMapper.java
View file @
ea576dc4
...
...
@@ -107,4 +107,11 @@ public interface CrmClientDataMapper extends BaseMapper<CrmClientData> {
@Param
(
"ifPhone"
)
String
ifPhone
,
@Param
(
"customerowner"
)
String
customerowner
,
@Param
(
"unfollowedDays"
)
Integer
unfollowedDays
,
@Param
(
"followNumber"
)
Integer
followNumber
,
@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
);
}
src/main/resources/mapping/crm/CrmClientDataMapper.xml
View file @
ea576dc4
...
...
@@ -248,7 +248,7 @@
left join crm_client_data ccd on ccd.id=crr.crm_client_id
WHERE ccd.org_code = #{orgCode}
AND ccd.belong_user = #{empNum}
and
crr.remind_day>
=#{remindDay}
and
DATE_FORMAT(crr.remind_day, '%Y-%m')
=#{remindDay}
and crr.delete_flag = 0
<if
test=
"industry != null and industry > 0"
>
AND ccd.industry = #{industry}
...
...
@@ -265,9 +265,9 @@
<if
test=
"status != null and status >= 0"
>
AND ccd.client_status = #{status}
</if>
<if
test=
"keywordStr != null and keywordStr != ''"
>
AND ccd.belong_group IN (${keywordStr})
</if
>
<!-- <if test="keywordStr != null and keywordStr != ''">--
>
<!-- AND ccd.belong_group IN (${keywordStr})-->
<!-- </if>--
>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '1'"
>
AND ccd.client_cellphone LIKE '%1'
</if>
...
...
@@ -293,7 +293,7 @@
WHERE cid = ccd.id
) >= #{followNumber}
</if>
ORDER BY ccd.create_time DESC
;
ORDER BY ccd.create_time DESC
</select>
<select
id=
"getCrmClientData5"
resultType=
"CrmClientData"
>
...
...
@@ -301,8 +301,7 @@
FROM crm_remind_rule crr
left join crm_client_data ccd on ccd.id=crr.crm_client_id
where crr.delete_flag = 0
and ccd.belong_group = #{gid}
and crr.remind_day>=#{remindDay}
and DATE_FORMAT(crr.remind_day, '%Y-%m')=#{remindDay}
<if
test=
"industry != null and industry > 0"
>
AND ccd.industry = #{industry}
</if>
...
...
@@ -343,7 +342,7 @@
WHERE cid = ccd.id
) >= #{followNumber}
</if>
ORDER BY ccd.create_time DESC
;
ORDER BY ccd.create_time DESC
</select>
<select
id=
"getCrmClientData6"
resultType=
"CrmClientData"
>
...
...
@@ -351,9 +350,9 @@
FROM crm_remind_rule crr
left join crm_client_data ccd on ccd.id=crr.crm_client_id
where crr.delete_flag = 0
AND c
c
r.crm_group_member = #{empNum}
AND c
c
r.org_code = #{orgCode}
and
crr.remind_day>
=#{remindDay}
AND c
r
r.crm_group_member = #{empNum}
AND c
r
r.org_code = #{orgCode}
and
DATE_FORMAT(crr.remind_day, '%Y-%m')
=#{remindDay}
<if
test=
"gid != null and gid > 0"
>
and ccd.belong_group = #{gid}
</if>
...
...
@@ -397,6 +396,51 @@
WHERE cid = ccd.id
) >= #{followNumber}
</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>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment