Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
59e2397c
Commit
59e2397c
authored
Jun 14, 2023
by
zhangweipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
目标管理进度诊断+会员消费转换
parent
cc378cc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
1 deletions
+101
-1
StoreTargetConfigController.java
...ge/web/controller/target/StoreTargetConfigController.java
+101
-1
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/target/StoreTargetConfigController.java
View file @
59e2397c
...
...
@@ -14,6 +14,7 @@ import com.gic.enterprise.api.service.StoreGroupService;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.target.DataTargetConfigNewVersionsApiService
;
import
com.gic.haoban.manage.web.exception.TargetException
;
import
com.gic.haoban.manage.web.qo.target.DataTargetMemberPyramidQO
;
import
com.gic.haoban.manage.web.qo.target.QueryDataStatisticsCommonQO
;
import
com.gic.haoban.manage.web.utils.StoreAuthUtils
;
import
com.gic.haoban.manage.web.utils.target.StoreTargetConfigHttpUtils
;
...
...
@@ -21,13 +22,19 @@ import com.gic.haoban.manage.web.vo.target.StoreTargetDisassemblyDetailVO;
import
com.gic.haoban.manage.web.vo.target.StoreTargetReachDetailVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -38,6 +45,8 @@ import java.util.stream.Collectors;
@Controller
@RequestMapping
(
"/store-target-config"
)
public
class
StoreTargetConfigController
{
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
StoreTargetConfigController
.
class
);
@Autowired
private
StoreAuthUtils
storeAuthUtils
;
@Autowired
...
...
@@ -315,4 +324,95 @@ public class StoreTargetConfigController {
}
return
storeIdList
;
}
/**
* 会员销售额(服务门店维度)拆解 树
* @param qo
* @return
*/
@RequestMapping
(
value
=
"get-member-sales-disassemble"
)
@ResponseBody
public
RestResponse
getMemberSalesDisassemble
(
QueryDataStatisticsCommonQO
qo
)
{
JSONObject
jsonObject
=
getCommon
(
qo
);
//聚合成一条
queryStoreGroupType
(
jsonObject
,
8
);
LOGGER
.
info
(
"会员销售额树 {}"
,
jsonObject
.
toJSONString
());
//总数据查询
Map
<
String
,
Object
>
totalRes
=
StoreTargetConfigHttpUtils
.
http
(
jsonObject
.
toJSONString
(),
qo
.
isYearQuery
()
?
"data_target_mgt_mbr_pay_amt_dismbl_year"
:
"data_target_mgt_mbr_pay_amt_dismbl_month"
);
LOGGER
.
info
(
"树返回 {}"
,
JSONObject
.
toJSONString
(
totalRes
));
return
StoreTargetConfigHttpUtils
.
responsePageOne
(
totalRes
);
}
/**
* 会员转化漏斗
* @param qo
* @return
*/
@RequestMapping
(
value
=
"get-consumption-conversion"
)
@ResponseBody
public
RestResponse
getConsumptionConversion
(
DataTargetMemberPyramidQO
qo
)
{
JSONObject
jsonObject
=
getCommon
(
qo
);
//聚合成一条
queryStoreGroupType
(
jsonObject
,
8
);
if
(
qo
.
getMemberType
()
!=
null
)
{
jsonObject
.
put
(
"isNewMbr"
,
qo
.
getMemberType
());
}
LOGGER
.
info
(
"会员转化漏斗 {}"
,
jsonObject
.
toJSONString
());
//总数据查询
Map
<
String
,
Object
>
totalRes
=
StoreTargetConfigHttpUtils
.
http
(
jsonObject
.
toJSONString
(),
"data_target_mgt_mbr_harch_stat"
);
LOGGER
.
info
(
"漏斗返回 {}"
,
JSONObject
.
toJSONString
(
totalRes
));
return
StoreTargetConfigHttpUtils
.
responsePageOne
(
totalRes
);
}
/**
* 会员金字塔分层
* @param qo
* @return
*/
@RequestMapping
(
value
=
"get-member-pyramid-hierarchy"
)
@ResponseBody
public
RestResponse
getMemberPyramidHierarchy
(
DataTargetMemberPyramidQO
qo
)
{
JSONObject
jsonObject
=
getCommon
(
qo
);
//聚合成一条
queryStoreGroupType
(
jsonObject
,
8
);
if
(
qo
.
getMemberType
()
!=
null
)
{
jsonObject
.
put
(
"isNewMbr"
,
qo
.
getMemberType
());
}
if
(
qo
.
getMemberConsume
()
!=
null
)
{
if
(
qo
.
getMemberConsume
()
==
1
)
{
// 今年未复购会员
jsonObject
.
put
(
"isRepchMbr"
,
0
);
}
else
if
(
qo
.
getMemberConsume
()
==
2
)
{
//今年未消费会员
jsonObject
.
put
(
"isCsmeMbr"
,
0
);
}
else
if
(
qo
.
getMemberConsume
()
==
3
)
{
//今年仅消费一次会员
jsonObject
.
put
(
"csmeCnt"
,
1
);
}
}
LOGGER
.
info
(
"会员金字塔分层 {}"
,
jsonObject
.
toJSONString
());
//总数据查询
Map
<
String
,
Object
>
totalRes
=
StoreTargetConfigHttpUtils
.
http
(
jsonObject
.
toJSONString
(),
"data_target_mgt_harch_631_stat"
);
LOGGER
.
info
(
"金字塔返回 {}"
,
JSONObject
.
toJSONString
(
totalRes
));
return
StoreTargetConfigHttpUtils
.
responsePageOne
(
totalRes
);
}
}
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