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
434d8e8a
Commit
434d8e8a
authored
Jun 22, 2020
by
邓实川
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计图优化,业务组员接口优化
parent
9dcdcc77
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 @
434d8e8a
...
@@ -1004,6 +1004,24 @@ public class CrmController {
...
@@ -1004,6 +1004,24 @@ public class CrmController {
return
ResultUtil
.
data
(
list
,
"获取成功"
);
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
)
{
private
List
<
Integer
>
getAllBusinessGroupMember
(
Integer
orgCode
,
Integer
groupId
)
{
List
<
CrmBusinessGroupMember
>
list
=
CrmBusinessGroupMember
.
builder
().
build
()
List
<
CrmBusinessGroupMember
>
list
=
CrmBusinessGroupMember
.
builder
().
build
()
...
@@ -1016,13 +1034,14 @@ public class CrmController {
...
@@ -1016,13 +1034,14 @@ public class CrmController {
}
}
// 封装条形图数据Map
// 封装条形图数据Map
private
Map
<
String
,
Object
>
selectMap
(
Integer
orgCode
,
Integer
belonger
,
Integer
status
,
String
startCreateTime
,
private
Map
<
String
,
Object
>
selectMap
(
Integer
orgCode
,
Integer
groupId
,
Integer
belonger
,
Integer
status
,
String
endCreateTime
)
{
String
startCreateTime
,
String
endCreateTime
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Integer
num
=
CrmClientData
.
builder
().
build
()
Integer
num
=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientStatus
,
status
)
.
eq
(
CrmClientData:
:
getClientStatus
,
status
)
.
eq
(
belonger
!=
null
,
CrmClientData:
:
getBelongUser
,
belonger
)
.
eq
(
belonger
!=
null
,
CrmClientData:
:
getBelongUser
,
belonger
)
.
eq
(
groupId
!=
null
,
CrmClientData:
:
getBelongGroup
,
groupId
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
String
name
=
"未知"
;
String
name
=
"未知"
;
...
@@ -1051,17 +1070,17 @@ public class CrmController {
...
@@ -1051,17 +1070,17 @@ public class CrmController {
if
(
belonger
==
null
)
{
if
(
belonger
==
null
)
{
List
<
Integer
>
members
=
getAllBusinessGroupMember
(
orgCode
,
groupId
);
List
<
Integer
>
members
=
getAllBusinessGroupMember
(
orgCode
,
groupId
);
for
(
Integer
memberId
:
members
)
{
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
)
{
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
list
.
add
(
map
);
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
)
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
list
.
add
(
map
);
list
.
add
(
map
);
}
else
{
}
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
)
{
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
list
.
add
(
map
);
list
.
add
(
map
);
}
}
...
@@ -1088,11 +1107,21 @@ public class CrmController {
...
@@ -1088,11 +1107,21 @@ public class CrmController {
num
+=
CrmClientData
.
builder
().
build
()
num
+=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
memberId
)
.
eq
(
CrmClientData:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
memberId
)
.
eq
(
groupId
!=
null
,
CrmClientData:
:
getBelongGroup
,
groupId
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
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
);
map
.
put
(
"level"
,
level
);
String
name
=
ClientTypeClass
.
builder
().
id
(
level
).
build
().
selectById
().
getName
();
String
name
=
ClientTypeClass
.
builder
().
id
(
level
).
build
().
selectById
().
getName
();
map
.
put
(
"name"
,
name
);
map
.
put
(
"name"
,
name
);
...
...
src/main/java/cn/timer/api/dto/crm/CrmCartogramDto.java
View file @
434d8e8a
...
@@ -29,6 +29,6 @@ import lombok.NoArgsConstructor;
...
@@ -29,6 +29,6 @@ import lombok.NoArgsConstructor;
public
class
CrmCartogramDto
implements
Serializable
{
public
class
CrmCartogramDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4445892627839823485L
;
private
static
final
long
serialVersionUID
=
-
4445892627839823485L
;
private
Integer
provinceId
;
private
Integer
provinceId
;
private
String
province
;
private
String
province
Name
;
private
Integer
provinceN
um
;
private
Integer
n
um
;
}
}
src/main/resources/mapping/crm/CrmClientDataMapper.xml
View file @
434d8e8a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<select
id=
"crmCartogram"
<select
id=
"crmCartogram"
resultType=
"cn.timer.api.dto.crm.CrmCartogramDto"
>
resultType=
"cn.timer.api.dto.crm.CrmCartogramDto"
>
SELECT
SELECT
province_id,province
,count(province_id) provinceN
um
province_id,province
as provinceName,count(province_id) n
um
FROM
FROM
crm_client_data
crm_client_data
WHERE
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