Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-enterprise
Commits
568e7c9a
Commit
568e7c9a
authored
May 24, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页-渠道用户概览
parent
2a5aec9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
16 deletions
+157
-16
IndexModuleController.java
.../gic/enterprise/web/controller/IndexModuleController.java
+64
-16
ChannelUserVO.java
...n/java/com/gic/enterprise/web/vo/index/ChannelUserVO.java
+93
-0
No files found.
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/IndexModuleController.java
View file @
568e7c9a
...
...
@@ -5,9 +5,12 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.gic.data.api.dto.index.IndexChannelUserOverviewDTO
;
import
com.gic.data.api.dto.index.IndexMemberOverviewDTO
;
import
com.gic.data.api.dto.index.IndexMemberOverviewTotalDTO
;
import
com.gic.data.api.qo.index.ChannelUserOverviewQO
;
import
com.gic.data.api.qo.index.IndexMemberOverviewQO
;
import
com.gic.enterprise.web.vo.index.ChannelUserVO
;
import
com.gic.enterprise.web.vo.index.MemberCardInfoVO
;
import
com.gic.member.config.api.dto.*
;
import
com.gic.member.config.api.service.UserListFieldApiService
;
...
...
@@ -282,24 +285,12 @@ public class IndexModuleController {
param
.
setAuthStoreIdList
(
this
.
getAuthStore
());
param
.
setType
(
type
);
param
.
setBrandId
(
brandId
);
param
.
setMemberCardIdList
(
getAuth
MemberCardList
(
cardAreaId
,
enterpriseId
,
userId
));
param
.
setMemberCardIdList
(
getAuth
AreaList
(
cardAreaId
,
enterpriseId
,
userId
,
CuTypeEnum
.
MCU
));
ServiceResponse
<
List
<
IndexMemberOverviewDTO
>>
response
=
this
.
memberDataApiService
.
listMemberData
(
param
);
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
MemberDataVO
.
class
,
response
.
getResult
()));
}
private
List
<
Long
>
getAuthMemberCardList
(
Long
cardAreaId
,
Integer
enterpriseId
,
Integer
userId
)
{
if
(
cardAreaId
!=
null
)
{
return
Arrays
.
asList
(
cardAreaId
);
}
else
{
List
<
MemberCardInfoVO
>
memberCardList
=
getMbrArea
(
userId
,
enterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
memberCardList
))
{
return
memberCardList
.
stream
().
mapToLong
(
e
->
Long
.
valueOf
(
e
.
getMbrAreaId
())).
boxed
().
collect
(
Collectors
.
toList
());
}
}
return
null
;
}
/**
* 首页-会员概览-右侧
* @param cardAreaId
...
...
@@ -314,7 +305,7 @@ public class IndexModuleController {
param
.
setEntId
(
enterpriseId
);
param
.
setAuthStoreIdList
(
this
.
getAuthStore
());
param
.
setBrandId
(
brandId
);
param
.
setMemberCardIdList
(
getAuth
MemberCardList
(
cardAreaId
,
enterpriseId
,
userId
));
param
.
setMemberCardIdList
(
getAuth
AreaList
(
cardAreaId
,
enterpriseId
,
userId
,
CuTypeEnum
.
MCU
));
ServiceResponse
<
IndexMemberOverviewTotalDTO
>
memberData
=
this
.
memberDataApiService
.
getMemberData
(
param
);
IndexMemberOverviewTotalDTO
data
=
memberData
.
getResult
();
...
...
@@ -332,14 +323,39 @@ public class IndexModuleController {
return
RestResponse
.
success
(
vo
);
}
/**
* 首页-渠道用户概览
* @param type
* @param cardConfigId
* @param appletConfigId
* @param serviceConfigId
* @return
*/
@RequestMapping
(
"list-member-channel-data"
)
public
RestResponse
listMemberChannelData
(
Integer
type
,
Long
cardConfigId
,
Long
appletConfigId
,
Long
serviceConfigId
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
List
<
MemberChannelDataDTO
>>
response
=
this
.
memberDataApiService
.
listMemberChannelData
(
type
,
cardConfigId
,
appletConfigId
,
serviceConfigId
,
enterpriseId
,
userId
,
this
.
getAuthStore
());
return
RestResponse
.
success
(
response
.
getResult
());
ChannelUserOverviewQO
param
=
new
ChannelUserOverviewQO
();
param
.
setEntId
(
enterpriseId
);
param
.
setAppletIdList
(
getAuthAreaList
(
appletConfigId
,
enterpriseId
,
userId
,
CuTypeEnum
.
ACU
));
param
.
setMemberCardIdList
(
getAuthAreaList
(
cardConfigId
,
enterpriseId
,
userId
,
CuTypeEnum
.
MCU
));
param
.
setServiceIdList
(
getAuthAreaList
(
serviceConfigId
,
enterpriseId
,
userId
,
CuTypeEnum
.
SCU
));
ServiceResponse
<
List
<
IndexChannelUserOverviewDTO
>>
response
=
this
.
memberDataApiService
.
listMemberChannelData
(
param
);
if
(
response
.
isSuccess
())
{
List
<
ChannelUserVO
>
result
=
response
.
getResult
().
stream
().
map
(
e
->
new
ChannelUserVO
().
setDate
(
e
.
getDateData
())
.
setAcuCount
(
e
.
getAppletUserTotal
())
.
setEcuCount
(
e
.
getEnterpriseWeChatUserTotal
())
.
setScuCount
(
e
.
getServiceUserTotal
())
.
setMcuCount
(
e
.
getMemberCardUserTotal
())).
collect
(
Collectors
.
toList
());
return
RestResponse
.
success
(
result
);
}
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
@RequestMapping
(
"get-member-channel-data"
)
public
RestResponse
getMemberChannelData
(
Integer
type
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
...
...
@@ -492,4 +508,35 @@ public class IndexModuleController {
}
return
new
ArrayList
<>();
}
/**
* 获取用户域数据
* @param userId
* @param enterpriseId
* @param cuTypeEnum
* @return
*/
private
List
<
Long
>
getAreaIdList
(
Integer
userId
,
Integer
enterpriseId
,
CuTypeEnum
cuTypeEnum
)
{
AreaSearchDTO
areaSearchDTO
=
new
AreaSearchDTO
();
areaSearchDTO
.
setCuTypes
(
Arrays
.
asList
(
cuTypeEnum
));
areaSearchDTO
.
setEnterpriseId
(
enterpriseId
);
areaSearchDTO
.
setUserId
(
userId
);
List
<
ChannelAreaInfoDTO
>
listCard
=
userListFieldApiService
.
queryCustomAreaInfo
(
areaSearchDTO
).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
listCard
)){
return
listCard
.
stream
().
map
(
e
->
e
.
getAreaId
()).
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>();
}
private
List
<
Long
>
getAuthAreaList
(
Long
cardAreaId
,
Integer
enterpriseId
,
Integer
userId
,
CuTypeEnum
cuTypeEnum
)
{
if
(
cardAreaId
!=
null
)
{
return
Arrays
.
asList
(
cardAreaId
);
}
else
{
List
<
Long
>
areaIdList
=
getAreaIdList
(
userId
,
enterpriseId
,
cuTypeEnum
);
if
(
CollectionUtils
.
isNotEmpty
(
areaIdList
))
{
return
areaIdList
;
}
}
return
null
;
}
}
\ No newline at end of file
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/vo/index/ChannelUserVO.java
0 → 100644
View file @
568e7c9a
package
com
.
gic
.
enterprise
.
web
.
vo
.
index
;
import
java.io.Serializable
;
/**
* 首页-渠道用户概览
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/5/24 10:55 AM
*/
public
class
ChannelUserVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5148011450316382963L
;
/**
* 日期
*/
private
String
date
;
/**
* 服务门店/开卡门店会员总数
*/
private
Integer
mcuCount
;
/**
* 小程序会员数
*/
private
Integer
acuCount
;
/**
* 服务号会员数
*/
private
Integer
scuCount
;
/**
* 企业微信
*/
private
Integer
ecuCount
;
public
String
getDate
()
{
return
date
;
}
public
ChannelUserVO
setDate
(
String
date
)
{
this
.
date
=
date
;
return
this
;
}
public
Integer
getMcuCount
()
{
return
mcuCount
;
}
public
ChannelUserVO
setMcuCount
(
Integer
mcuCount
)
{
this
.
mcuCount
=
mcuCount
;
return
this
;
}
public
Integer
getAcuCount
()
{
return
acuCount
;
}
public
ChannelUserVO
setAcuCount
(
Integer
acuCount
)
{
this
.
acuCount
=
acuCount
;
return
this
;
}
public
Integer
getScuCount
()
{
return
scuCount
;
}
public
ChannelUserVO
setScuCount
(
Integer
scuCount
)
{
this
.
scuCount
=
scuCount
;
return
this
;
}
public
Integer
getEcuCount
()
{
return
ecuCount
;
}
public
ChannelUserVO
setEcuCount
(
Integer
ecuCount
)
{
this
.
ecuCount
=
ecuCount
;
return
this
;
}
@Override
public
String
toString
()
{
return
"ChannelUserVO{"
+
"date='"
+
date
+
'\''
+
", mcuCount="
+
mcuCount
+
", acuCount="
+
acuCount
+
", scuCount="
+
scuCount
+
", ecuCount="
+
ecuCount
+
'}'
;
}
}
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