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
54c2a26a
Commit
54c2a26a
authored
Jun 22, 2020
by
邓实川
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计图优化,业务组员接口优化
parent
ac08b9f3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
src/main/java/cn/timer/api/controller/crm/CrmController.java
+34
-5
src/main/java/cn/timer/api/dto/crm/CrmCartogramDto.java
+2
-2
src/main/resources/mapping/crm/CrmClientDataMapper.xml
+1
-1
No files found.
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
54c2a26a
...
...
@@ -1004,6 +1004,24 @@ public class CrmController {
return
ResultUtil
.
data
(
list
,
"获取成功"
);
}
@GetMapping
(
"getBusinessManByGroupId"
)
@ApiOperation
(
value
=
"获取业务员ByGroupId"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
getBusinessManByGroupId
(
@CurrentUser
UserBean
userBean
,
Integer
gid
)
{
List
<
CrmBusinessGroupMember
>
list
=
CrmBusinessGroupMember
.
builder
().
build
()
.
selectList
(
new
LambdaQueryWrapper
<
CrmBusinessGroupMember
>().
eq
(
CrmBusinessGroupMember:
:
getGid
,
gid
)
.
select
(
CrmBusinessGroupMember:
:
getEmpNum
));
List
<
Integer
>
empNums
=
list
.
stream
().
map
(
CrmBusinessGroupMember:
:
getEmpNum
).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
Integer
empNum
:
empNums
)
{
String
name
=
getEmpName
(
getOrgCode
(
userBean
),
empNum
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"name"
,
name
);
map
.
put
(
"empNum"
,
empNum
);
result
.
add
(
map
);
}
return
ResultUtil
.
data
(
result
,
"获取成功"
);
}
// 获取公司全部业务员
private
List
<
Integer
>
getAllBusinessGroupMember
(
Integer
orgCode
,
Integer
groupId
)
{
List
<
CrmBusinessGroupMember
>
list
=
CrmBusinessGroupMember
.
builder
().
build
()
...
...
@@ -1016,13 +1034,14 @@ public class CrmController {
}
// 封装条形图数据Map
private
Map
<
String
,
Object
>
selectMap
(
Integer
orgCode
,
Integer
belonger
,
Integer
status
,
String
startCreateTime
,
String
endCreateTime
)
{
private
Map
<
String
,
Object
>
selectMap
(
Integer
orgCode
,
Integer
groupId
,
Integer
belonger
,
Integer
status
,
String
startCreateTime
,
String
endCreateTime
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Integer
num
=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientStatus
,
status
)
.
eq
(
belonger
!=
null
,
CrmClientData:
:
getBelongUser
,
belonger
)
.
eq
(
groupId
!=
null
,
CrmClientData:
:
getBelongGroup
,
groupId
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
String
name
=
"未知"
;
...
...
@@ -1051,17 +1070,17 @@ public class CrmController {
if
(
belonger
==
null
)
{
List
<
Integer
>
members
=
getAllBusinessGroupMember
(
orgCode
,
groupId
);
for
(
Integer
memberId
:
members
)
{
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
memberId
,
status
,
startCreateTime
,
endCreateTime
);
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
groupId
,
memberId
,
status
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
list
.
add
(
map
);
}
}
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
0
,
status
,
startCreateTime
,
endCreateTime
);
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
groupId
,
0
,
status
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
list
.
add
(
map
);
}
else
{
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
belonger
,
status
,
startCreateTime
,
endCreateTime
);
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
groupId
,
belonger
,
status
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
list
.
add
(
map
);
}
...
...
@@ -1088,11 +1107,21 @@ public class CrmController {
num
+=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
memberId
)
.
eq
(
groupId
!=
null
,
CrmClientData:
:
getBelongGroup
,
groupId
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
}
num
+=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
0
)
.
eq
(
groupId
!=
null
,
CrmClientData:
:
getBelongGroup
,
groupId
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
map
.
put
(
"level"
,
level
);
String
name
=
ClientTypeClass
.
builder
().
id
(
level
).
build
().
selectById
().
getName
();
map
.
put
(
"name"
,
name
);
...
...
src/main/java/cn/timer/api/dto/crm/CrmCartogramDto.java
View file @
54c2a26a
...
...
@@ -29,6 +29,6 @@ import lombok.NoArgsConstructor;
public
class
CrmCartogramDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4445892627839823485L
;
private
Integer
provinceId
;
private
String
province
;
private
Integer
provinceN
um
;
private
String
province
Name
;
private
Integer
n
um
;
}
src/main/resources/mapping/crm/CrmClientDataMapper.xml
View file @
54c2a26a
...
...
@@ -6,7 +6,7 @@
<select
id=
"crmCartogram"
resultType=
"cn.timer.api.dto.crm.CrmCartogramDto"
>
SELECT
province_id,province
,count(province_id) provinceN
um
province_id,province
as provinceName,count(province_id) n
um
FROM
crm_client_data
WHERE
...
...
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