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
09762ee2
Commit
09762ee2
authored
Jun 11, 2020
by
邓实川
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户管理-统计图优化
parent
1def50d0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
60 deletions
+94
-60
src/main/java/cn/timer/api/bean/crm/CrmClientData.java
+6
-2
src/main/java/cn/timer/api/controller/crm/CrmController.java
+86
-56
src/main/java/cn/timer/api/dao/clazz/ClientSourceClassMapper.java
+1
-1
src/main/java/cn/timer/api/dao/clazz/ClientTypeClassMapper.java
+1
-1
No files found.
src/main/java/cn/timer/api/bean/crm/CrmClientData.java
View file @
09762ee2
...
...
@@ -80,14 +80,18 @@ public class CrmClientData extends Model<CrmClientData> {
@ApiModelProperty
(
value
=
"客户邮箱"
)
private
String
clientEmail
;
@ApiModelProperty
(
value
=
"区编号"
)
private
Integer
keyId
;
@ApiModelProperty
(
value
=
"省"
)
private
String
province
;
@ApiModelProperty
(
value
=
"省id"
)
private
Integer
provinceId
;
@ApiModelProperty
(
value
=
"市"
)
private
String
city
;
@ApiModelProperty
(
value
=
"市"
)
private
Integer
cityId
;
@ApiModelProperty
(
value
=
"区"
)
private
String
district
;
@ApiModelProperty
(
value
=
"区编号"
)
private
Integer
districtId
;
@ApiModelProperty
(
value
=
"邮编"
)
private
String
zipCode
;
@ApiModelProperty
(
value
=
"详细地址"
)
...
...
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
09762ee2
...
...
@@ -207,13 +207,16 @@ public class CrmController {
Integer
empNum
=
getEmpNum
(
userBean
);
Integer
orgCode
=
getOrgCode
(
userBean
);
crmClientData
.
setCreateUser
(
empNum
);
SysRegion
district
=
getSysRegion
(
crmClientData
.
get
Key
Id
());
SysRegion
district
=
getSysRegion
(
crmClientData
.
get
District
Id
());
// crmClientData.setZipCode(district.getZipCode());
crmClientData
.
setDistrict
(
district
.
getRegionName
());
SysRegion
city
=
getSysRegion
(
district
.
getRegionCode
());
crmClientData
.
setCity
(
city
.
getRegionName
());
crmClientData
.
setCityId
(
city
.
getKeyId
());
SysRegion
province
=
getSysRegion
(
city
.
getRegionCode
());
crmClientData
.
setProvinceId
(
province
.
getKeyId
());
crmClientData
.
setProvince
(
province
.
getRegionName
());
crmClientData
.
setBelongUserName
(
getEmpName
(
orgCode
,
crmClientData
.
getBelongUser
()));
crmClientData
.
setOrgCode
(
getOrgCode
(
userBean
));
Integer
belongGroup
=
crmClientData
.
getBelongGroup
();
...
...
@@ -718,26 +721,33 @@ public class CrmController {
listAll
.
add
(
cartogram
(
orgCode
,
groupId
,
3
,
belonger
,
startCreateTime
,
endCreateTime
));
// 图3
listAll
.
add
(
cartogram
(
orgCode
,
groupId
,
4
,
belonger
,
startCreateTime
,
endCreateTime
));
// 图4
List
<
List
<
Map
<
String
,
Object
>>>
cartogram5
=
new
ArrayList
<
List
<
Map
<
String
,
Object
>>>();
// 图5
cartogram5
.
add
(
cartogram2
(
orgCode
,
groupId
,
1
,
belonger
,
startCreateTime
,
endCreateTime
));
cartogram5
.
add
(
cartogram2
(
orgCode
,
groupId
,
2
,
belonger
,
startCreateTime
,
endCreateTime
));
cartogram5
.
add
(
cartogram2
(
orgCode
,
groupId
,
3
,
belonger
,
startCreateTime
,
endCreateTime
));
List
<
Map
<
String
,
Object
>>
cartogram5
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 图5
List
<
ClientTypeClass
>
typeClasses
=
ClientTypeClass
.
builder
().
build
().
selectAll
();
for
(
ClientTypeClass
clientTypeClass
:
typeClasses
)
{
Integer
type
=
clientTypeClass
.
getId
();
Map
<
String
,
Object
>
map
=
cartogram2
(
orgCode
,
groupId
,
type
,
belonger
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
cartogram5
.
add
(
map
);
}
}
listAll
.
add
(
cartogram5
);
List
<
List
<
Map
<
String
,
Object
>>>
cartogram6
=
new
ArrayList
<
List
<
Map
<
String
,
Object
>>>();
// 图6
for
(
String
regionName
:
getRegionNameList
())
{
cartogram6
.
add
(
cartogram3
(
orgCode
,
groupId
,
regionName
,
belonger
,
startCreateTime
,
endCreateTime
));
List
<
Map
<
String
,
Object
>>
cartogram6
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 图6
for
(
Integer
keyId
:
getKeyIdList
())
{
Map
<
String
,
Object
>
map
=
cartogram3
(
orgCode
,
groupId
,
keyId
,
belonger
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
cartogram6
.
add
(
map
);
}
}
listAll
.
add
(
cartogram6
);
return
ResultUtil
.
data
(
listAll
,
"获取成功"
);
}
// 获取省份
名
private
List
<
String
>
getRegionName
List
()
{
// 获取省份
id
private
List
<
Integer
>
getKeyId
List
()
{
List
<
SysRegion
>
list
=
SysRegion
.
builder
().
build
()
.
selectList
(
new
LambdaQueryWrapper
<
SysRegion
>().
eq
(
SysRegion:
:
getLevel
,
1
));
return
list
.
stream
().
map
(
SysRegion:
:
get
RegionName
).
collect
(
Collectors
.
toList
());
.
selectList
(
new
LambdaQueryWrapper
<
SysRegion
>().
eq
(
SysRegion:
:
getLevel
,
1
)
.
select
(
SysRegion:
:
getKeyId
)
);
return
list
.
stream
().
map
(
SysRegion:
:
get
KeyId
).
collect
(
Collectors
.
toList
());
}
// 获取公司全部业务员
...
...
@@ -766,34 +776,6 @@ public class CrmController {
return
map
;
}
// 封装⚪形图数据Map1
private
Map
<
String
,
Object
>
selectMap1
(
Integer
orgCode
,
Integer
belonger
,
Integer
level
,
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:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
belonger
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
map
.
put
(
"level"
,
level
);
map
.
put
(
"num"
,
num
);
return
map
;
}
// 封装⚪形图数据Map2
private
Map
<
String
,
Object
>
selectMap2
(
Integer
orgCode
,
Integer
belonger
,
String
province
,
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:
:
getProvince
,
province
).
eq
(
CrmClientData:
:
getBelongUser
,
belonger
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
map
.
put
(
"province"
,
province
);
map
.
put
(
"num"
,
num
);
return
map
;
}
/**
* 统计图1,2,3,4
*
...
...
@@ -809,10 +791,16 @@ public class CrmController {
if
(
belonger
==
null
)
{
List
<
Integer
>
members
=
getAllBusinessGroupMember
(
orgCode
,
groupId
);
for
(
Integer
memberId
:
members
)
{
list
.
add
(
selectMap
(
orgCode
,
memberId
,
status
,
startCreateTime
,
endCreateTime
));
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
memberId
,
status
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
list
.
add
(
map
);
}
}
}
else
{
list
.
add
(
selectMap
(
orgCode
,
belonger
,
status
,
startCreateTime
,
endCreateTime
));
Map
<
String
,
Object
>
map
=
selectMap
(
orgCode
,
belonger
,
status
,
startCreateTime
,
endCreateTime
);
if
((
Integer
)
map
.
get
(
"num"
)
>
0
)
{
list
.
add
(
map
);
}
}
return
list
;
}
...
...
@@ -826,19 +814,38 @@ public class CrmController {
* @param belonger 业务员id (可不填)
* @return
*/
private
List
<
Map
<
String
,
Object
>
>
cartogram2
(
Integer
orgCode
,
Integer
groupId
,
Integer
level
,
Integer
belonger
,
private
Map
<
String
,
Object
>
cartogram2
(
Integer
orgCode
,
Integer
groupId
,
Integer
level
,
Integer
belonger
,
String
startCreateTime
,
String
endCreateTime
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Integer
num
=
0
;
if
(
belonger
==
null
)
{
List
<
Integer
>
members
=
getAllBusinessGroupMember
(
orgCode
,
groupId
);
for
(
Integer
memberId
:
members
)
{
Map
<
String
,
Object
>
map
=
selectMap1
(
orgCode
,
memberId
,
level
,
startCreateTime
,
endCreateTime
);
list
.
add
(
map
);
num
+=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
memberId
)
.
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
);
map
.
put
(
"num"
,
num
);
}
else
{
list
.
add
(
selectMap1
(
orgCode
,
belonger
,
level
,
startCreateTime
,
endCreateTime
));
num
=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getClientType
,
level
).
eq
(
CrmClientData:
:
getBelongUser
,
belonger
)
.
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
);
map
.
put
(
"num"
,
num
);
}
return
list
;
return
map
;
}
/**
...
...
@@ -850,19 +857,42 @@ public class CrmController {
* @param belonger 业务员id (可不填)
* @return
*/
private
List
<
Map
<
String
,
Object
>>
cartogram3
(
Integer
orgCode
,
Integer
groupId
,
String
province
,
Integer
belonger
,
private
Map
<
String
,
Object
>
cartogram3
(
Integer
orgCode
,
Integer
groupId
,
Integer
provinceId
,
Integer
belonger
,
String
startCreateTime
,
String
endCreateTime
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Integer
num
=
0
;
if
(
belonger
==
null
)
{
List
<
Integer
>
members
=
getAllBusinessGroupMember
(
orgCode
,
groupId
);
for
(
Integer
memberId
:
members
)
{
list
.
add
(
selectMap2
(
orgCode
,
memberId
,
province
,
startCreateTime
,
endCreateTime
));
}
num
+=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getProvinceId
,
provinceId
).
eq
(
CrmClientData:
:
getBelongUser
,
memberId
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
}
map
.
put
(
"provinceId"
,
provinceId
);
String
name
=
SysRegion
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SysRegion
>().
lambda
()
.
eq
(
SysRegion:
:
getLevel
,
1
).
eq
(
SysRegion:
:
getKeyId
,
provinceId
).
select
(
SysRegion:
:
getRegionName
))
.
getRegionName
();
map
.
put
(
"provinceName"
,
name
);
map
.
put
(
"num"
,
num
);
}
else
{
list
.
add
(
selectMap2
(
orgCode
,
belonger
,
province
,
startCreateTime
,
endCreateTime
));
num
=
CrmClientData
.
builder
().
build
()
.
selectCount
(
new
QueryWrapper
<
CrmClientData
>().
lambda
().
eq
(
CrmClientData:
:
getOrgCode
,
orgCode
)
.
eq
(
CrmClientData:
:
getProvinceId
,
provinceId
).
eq
(
CrmClientData:
:
getBelongUser
,
belonger
)
.
ge
(
StringUtils
.
isNotBlank
(
startCreateTime
),
CrmClientData:
:
getCreateTime
,
startCreateTime
)
.
le
(
StringUtils
.
isNotBlank
(
endCreateTime
),
CrmClientData:
:
getCreateTime
,
endCreateTime
));
map
.
put
(
"provinceId"
,
provinceId
);
String
name
=
SysRegion
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SysRegion
>().
lambda
()
.
eq
(
SysRegion:
:
getLevel
,
1
).
eq
(
SysRegion:
:
getKeyId
,
provinceId
).
select
(
SysRegion:
:
getRegionName
))
.
getRegionName
();
map
.
put
(
"provinceName"
,
name
);
map
.
put
(
"num"
,
num
);
}
return
list
;
return
map
;
}
// TODO 统计图
}
src/main/java/cn/timer/api/dao/clazz/C
il
entSourceClassMapper.java
→
src/main/java/cn/timer/api/dao/clazz/C
li
entSourceClassMapper.java
View file @
09762ee2
...
...
@@ -19,6 +19,6 @@ import cn.timer.api.bean.clazz.ClientSourceClass;
* @date 2020年6月8日
* @version 1.0
*/
public
interface
C
il
entSourceClassMapper
extends
BaseMapper
<
ClientSourceClass
>
{
public
interface
C
li
entSourceClassMapper
extends
BaseMapper
<
ClientSourceClass
>
{
}
src/main/java/cn/timer/api/dao/clazz/C
il
entTypeClassMapper.java
→
src/main/java/cn/timer/api/dao/clazz/C
li
entTypeClassMapper.java
View file @
09762ee2
...
...
@@ -19,6 +19,6 @@ import cn.timer.api.bean.clazz.ClientTypeClass;
* @date 2020年6月8日
* @version 1.0
*/
public
interface
C
il
entTypeClassMapper
extends
BaseMapper
<
ClientTypeClass
>
{
public
interface
C
li
entTypeClassMapper
extends
BaseMapper
<
ClientTypeClass
>
{
}
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