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
6cc08c2a
Commit
6cc08c2a
authored
Sep 03, 2020
by
ilal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
4aa62ad0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
src/main/java/cn/timer/api/controller/crm/CrmController.java
+17
-13
No files found.
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
6cc08c2a
...
...
@@ -518,8 +518,9 @@ public class CrmController {
.
eq
(
status
!=
null
&&
status
>
0
,
CrmClientData:
:
getClientStatus
,
status
).
eq
(
typei
!=
null
&&
typei
>
0
,
CrmClientData:
:
getClientType
,
typei
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
)
.
ge
(
StringUtils
.
isNotBlank
(
startFollowTime
),
CrmClientData:
:
getCreateTime
,
startFollowTime
)
.
le
(
StringUtils
.
isNotBlank
(
endFollowTime
),
CrmClientData:
:
getCreateTime
,
endFollowTime
).
like
(!
StrUtil
.
isBlank
(
like
),
CrmClientData:
:
getBelongUserName
,
like
).
or
()
.
ge
(
StringUtils
.
isNotBlank
(
startFollowTime
),
CrmClientData:
:
getLastFollowTime
,
startFollowTime
)
.
le
(
StringUtils
.
isNotBlank
(
endFollowTime
),
CrmClientData:
:
getLastFollowTime
,
endFollowTime
).
like
(!
StrUtil
.
isBlank
(
like
),
CrmClientData:
:
getBelongUserName
,
like
).
or
()
.
like
(!
StrUtil
.
isBlank
(
like
),
CrmClientData:
:
getClientName
,
like
).
or
()
.
like
(!
StrUtil
.
isBlank
(
like
),
CrmClientData:
:
getClientCellphone
,
like
)
.
orderByDesc
(
CrmClientData:
:
getCreateTime
));
...
...
@@ -527,7 +528,7 @@ public class CrmController {
// 我协作的客户
private
List
<
CrmClientData
>
getMyAssociateCilent
(
Integer
empNum
,
Integer
orgCode
,
Integer
groupId
,
Integer
status
,
String
like
)
{
String
like
,
Integer
typei
,
String
startFollowTime
,
String
endFollowTime
)
{
List
<
CrmClientAssociate
>
crmClientAssociates
=
CrmClientAssociate
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
CrmClientAssociate
>().
lambda
().
eq
(
CrmClientAssociate:
:
getAssociateId
,
empNum
)
.
eq
(
CrmClientAssociate:
:
getOrgCode
,
orgCode
).
select
(
CrmClientAssociate:
:
getCid
));
...
...
@@ -537,7 +538,10 @@ public class CrmController {
CrmClientData
crmClientData
=
CrmClientData
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getId
,
cid
)
.
eq
(
groupId
!=
null
&&
groupId
>
0
,
CrmClientData:
:
getBelongGroup
,
groupId
)
.
eq
(
status
!=
null
&&
status
>
0
,
CrmClientData:
:
getClientStatus
,
status
)
.
eq
(
status
!=
null
&&
status
>
0
,
CrmClientData:
:
getClientStatus
,
status
).
eq
(
typei
!=
null
&&
typei
>
0
,
CrmClientData:
:
getClientType
,
typei
)
.
ge
(
StringUtils
.
isNotBlank
(
startFollowTime
),
CrmClientData:
:
getLastFollowTime
,
startFollowTime
)
.
le
(
StringUtils
.
isNotBlank
(
endFollowTime
),
CrmClientData:
:
getLastFollowTime
,
endFollowTime
)
.
like
(!
StrUtil
.
isBlank
(
like
),
CrmClientData:
:
getClientName
,
like
).
or
()
.
like
(!
StrUtil
.
isBlank
(
like
),
CrmClientData:
:
getClientCellphone
,
like
));
if
(
crmClientData
!=
null
)
...
...
@@ -548,20 +552,20 @@ public class CrmController {
// 我的全部客户
private
List
<
CrmClientData
>
getMyTotalCilent
(
Integer
empNum
,
Integer
orgCode
,
Integer
groupId
,
Integer
status
,
String
like
,
Integer
type
)
{
String
like
,
Integer
type
i
)
{
return
CheckUtil
.
distinct
(
getMyCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
null
,
null
,
null
,
null
,
null
),
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
),
true
);
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
typei
,
null
,
null
),
true
);
}
// 我关注的客户
private
List
<
CrmClientData
>
getMyStarCilent
(
Integer
empNum
,
Integer
orgCode
,
Integer
groupId
,
Integer
status
,
Integer
type
)
{
private
List
<
CrmClientData
>
getMyStarCilent
(
Integer
empNum
,
Integer
orgCode
,
Integer
groupId
,
Integer
status
,
Integer
type
i
)
{
return
getMyTotalCilent
(
empNum
,
orgCode
,
groupId
,
status
,
null
,
null
).
stream
()
.
filter
(
item
->
item
.
getStar
().
equals
(
1
)).
collect
(
Collectors
.
toList
());
}
// 七天未跟进的客户
private
List
<
CrmClientData
>
getCilentFollowOvertime
(
Integer
empNum
,
Integer
orgCode
,
Integer
groupId
,
Integer
status
,
Integer
type
)
{
Integer
status
,
Integer
type
i
)
{
return
getMyTotalCilent
(
empNum
,
orgCode
,
groupId
,
status
,
null
,
null
).
stream
()
.
filter
(
item
->
item
.
getLastFollowTime
()
!=
null
&&
item
.
getLastFollowTime
().
before
(
DateUtil
.
offsetDay
(
new
Date
(),
-
7
)))
...
...
@@ -600,17 +604,17 @@ public class CrmController {
List
<
CrmClientData
>
crmClientDatas
=
null
;
if
(
type
==
null
||
type
==
0
)
{
// 全部客户(去重)
List
<
CrmClientData
>
myClient
=
getMyCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
startCreateTime
,
endCreateTime
,
startFollowTime
,
endFollowTime
,
typei
);
List
<
CrmClientData
>
myAsso
=
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
);
List
<
CrmClientData
>
myAsso
=
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
typei
,
startFollowTime
,
endFollowTime
);
crmClientDatas
=
CheckUtil
.
distinct
(
myClient
,
myAsso
,
true
).
stream
()
.
filter
(
CheckUtil
.
distinctByKey
(
CrmClientData:
:
getId
)).
collect
(
Collectors
.
toList
());
}
else
if
(
type
==
1
)
// 我负责的客户
crmClientDatas
=
getMyCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
startCreateTime
,
endCreateTime
,
startFollowTime
,
endFollowTime
,
type
);
else
if
(
type
==
2
)
// 我协作的客户
crmClientDatas
=
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
);
crmClientDatas
=
getMyAssociateCilent
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
typei
,
startFollowTime
,
endFollowTime
);
else
if
(
type
==
3
)
// 我关注的客户
crmClientDatas
=
getMyStarCilent
(
empNum
,
orgCode
,
groupId
,
status
,
type
);
crmClientDatas
=
getMyStarCilent
(
empNum
,
orgCode
,
groupId
,
status
,
type
i
);
else
if
(
type
==
4
)
// 七天未跟进的客户
crmClientDatas
=
getCilentFollowOvertime
(
empNum
,
orgCode
,
groupId
,
status
,
type
);
crmClientDatas
=
getCilentFollowOvertime
(
empNum
,
orgCode
,
groupId
,
status
,
type
i
);
else
return
ResultUtil
.
error
(
"查询失败"
);
// Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
...
...
@@ -853,7 +857,7 @@ public class CrmController {
@RequestBody
CrmClientContacts
crmClientContacts
)
{
Integer
cid
=
crmClientContacts
.
getCid
();
if
(
crmClientContacts
.
getId
()
==
null
)
{
if
(
crmClientContacts
.
getId
()
==
null
||
crmClientContacts
.
getId
().
equals
(
0
)
)
{
if
(
cid
==
null
)
return
ResultUtil
.
error
(
"编辑失败,请传入客户id"
);
...
...
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