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
0f78e5c6
Commit
0f78e5c6
authored
Mar 27, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 好书周报数据使用数据
parent
6efd94ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
20 deletions
+140
-20
MaterialDataStaticsController.java
...web/controller/content/MaterialDataStaticsController.java
+50
-11
MaterialDataAdaptor.java
...e/web/controller/content/adaptor/MaterialDataAdaptor.java
+89
-8
MaterialReportQO.java
...an/manage/web/qo/content/statistics/MaterialReportQO.java
+1
-1
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/MaterialDataStaticsController.java
View file @
0f78e5c6
...
...
@@ -4,6 +4,8 @@ import cn.hutool.core.date.DateUtil;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.content.api.dto.material.ContentMaterialFrontDTO
;
import
com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO
;
...
...
@@ -12,7 +14,7 @@ import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import
com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor
;
import
com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO
;
import
com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO
;
import
com.gic.haoban.manage.web.qo.content.statistics.Material
PersonalUsed
QO
;
import
com.gic.haoban.manage.web.qo.content.statistics.Material
Report
QO
;
import
com.gic.haoban.manage.web.qo.content.statistics.MaterialStatisticsBaseQO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO
;
...
...
@@ -48,6 +50,8 @@ public class MaterialDataStaticsController {
private
MaterialDataAdaptor
materialDataAdaptor
;
@Autowired
private
ContentMaterialApiService
contentMaterialApiService
;
@Autowired
private
ClerkService
clerkService
;
/**
* 获取素材首页数据
...
...
@@ -183,39 +187,74 @@ public class MaterialDataStaticsController {
* @return
*/
@RequestMapping
(
path
=
"/content/material/personal/used/data"
)
public
RestResponse
<
MaterialPersonalUsedDataVO
>
queryMaterialUsedReport
(
@RequestBody
MaterialPersonalUsedQO
materialPersonalUsedQO
)
{
return
RestResponse
.
successResult
();
public
RestResponse
<
MaterialPersonalUsedDataVO
>
queryMaterialUsedReport
(
@RequestBody
MaterialReportQO
materialReportQO
)
{
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isBlank
(
materialReportQO
.
getStoreId
()))
{
storeIds
=
clerkStoreAdaptor
.
queryClerkStoreIds
(
materialReportQO
.
getClerkId
(),
materialReportQO
.
getWxEnterpriseId
());
}
else
{
storeIds
.
add
(
materialReportQO
.
getStoreId
());
}
MaterialPersonalUsedDataVO
materialPersonalUsedDataVO
=
materialDataAdaptor
.
queryMaterialUsedReport
(
materialReportQO
.
getEnterpriseId
(),
materialReportQO
.
getClerkId
(),
materialReportQO
.
getReportType
(),
storeIds
);
// 补充导购信息
ClerkDTO
clerkInfo
=
clerkService
.
getClerkByClerkId
(
materialReportQO
.
getClerkId
());
if
(
clerkInfo
!=
null
)
{
materialPersonalUsedDataVO
.
setClerkId
(
materialReportQO
.
getClerkId
());
materialPersonalUsedDataVO
.
setClerkName
(
clerkInfo
.
getClerkName
());
materialPersonalUsedDataVO
.
setImageUrl
(
clerkInfo
.
getImageUrl
());
}
return
RestResponse
.
successResult
(
materialPersonalUsedDataVO
);
}
/**
* 周/月报--查询
导购素材使用数据列表
* 周/月报--查询
门店素材使用数据 店长
*
* @param materialReportQO
* @return
*/
@RequestMapping
(
path
=
"/content/material/personal/used/data/list"
)
public
RestResponse
<
Page
<
MaterialPersonalUsedDataVO
>>
queryMaterialUsedReportList
(
@RequestBody
MaterialPersonalUsedQO
materialPersonalUsedQO
)
{
@RequestMapping
(
path
=
"/content/material/store/used/data"
)
public
RestResponse
<
MaterialStoreUsedDataVO
>
queryMaterialStoreUseReport
(
@RequestBody
MaterialReportQO
materialReportQO
)
{
return
RestResponse
.
successResult
();
}
/**
* 周/月报--查询
门店纬度素材使用数据(店长和区经)
* 周/月报--查询
区经素材使用数据 区经
*
* @param material
PersonalUsed
QO
* @param material
Report
QO
* @return
*/
@RequestMapping
(
path
=
"/content/material/store/used/data"
)
public
RestResponse
<
MaterialStoreUsedDataVO
>
queryMaterialStoreUseReport
(
@RequestBody
MaterialPersonalUsedQO
materialPersonalUsedQO
)
{
public
RestResponse
<
MaterialStoreUsedDataVO
>
queryMaterialAreaUseReport
(
@RequestBody
MaterialReportQO
materialReportQO
)
{
return
RestResponse
.
successResult
();
}
/**
* 周/月报--查询导购素材使用数据列表
*
* @return
*/
@RequestMapping
(
path
=
"/content/material/personal/used/data/list"
)
public
RestResponse
<
Page
<
MaterialPersonalUsedDataVO
>>
queryMaterialUsedReportList
(
@RequestBody
MaterialReportQO
materialReportQO
)
{
return
RestResponse
.
successResult
();
}
/**
* 周/月报--查询门店纬度素材使用数据列表
*
* @param material
PersonalUsed
QO
* @param material
Report
QO
* @return
*/
@RequestMapping
(
path
=
"/content/material/store/used/data/list"
)
public
RestResponse
<
Page
<
MaterialStoreUsedDataVO
>>
queryMaterialStoreUseReportList
(
@RequestBody
Material
PersonalUsedQO
materialPersonalUsed
QO
)
{
public
RestResponse
<
Page
<
MaterialStoreUsedDataVO
>>
queryMaterialStoreUseReportList
(
@RequestBody
Material
ReportQO
materialReport
QO
)
{
return
RestResponse
.
successResult
();
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/adaptor/MaterialDataAdaptor.java
View file @
0f78e5c6
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
content
.
adaptor
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialStoreUsedDataVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO
;
import
com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -22,8 +26,7 @@ import java.util.Map;
* @Author MUSI
* @Date 2023/3/27 10:49 AM
* @Description
* @Version
* 素材数据统计
* @Version 素材数据统计
**/
@Slf4j
@Component
...
...
@@ -47,10 +50,20 @@ public class MaterialDataAdaptor {
*/
private
static
final
String
MATERIAL_STORE_DATA
=
"data_matl_haoban_store_stats"
;
/**
* 素材导购周报数据
*/
private
static
final
String
MATERIAL_CLERK_WEEK_DATA
=
"data_cms_clerk_week_report_list"
;
/**
* 素材导购月报数据
*/
private
static
final
String
MATERIAL_CLERK_MONTH_DATA
=
"data_cms_clerk_month_report_list"
;
/**
* 查询素材首页使用数据
*
* @param enterpriseId
* @return
*/
...
...
@@ -63,7 +76,7 @@ public class MaterialDataAdaptor {
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
))
{
inlineParams
.
put
(
"storeId"
,
StringUtils
.
join
(
storeIds
,
","
));
}
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_INDEX_DATA
);
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_INDEX_DATA
);
if
(
result
.
get
(
"data"
)
==
null
)
{
return
MaterialTodayDataBO
.
empty
();
}
...
...
@@ -74,6 +87,7 @@ public class MaterialDataAdaptor {
/**
* 店长/区经
* 查询数据概览
*
* @param enterpriseId
* @param storeIds
* @param fixedDateDiff
...
...
@@ -89,7 +103,7 @@ public class MaterialDataAdaptor {
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
))
{
inlineParams
.
put
(
"storeId"
,
StringUtils
.
join
(
storeIds
,
","
));
}
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_OVERVIEW_DATA
);
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_OVERVIEW_DATA
);
if
(
result
.
get
(
"data"
)
==
null
)
{
return
new
MaterialDataOverviewVO
();
}
...
...
@@ -99,6 +113,7 @@ public class MaterialDataAdaptor {
/**
* 导购纬度数据统计
*
* @param enterpriseId
* @param storeIds
* @param fixedDateDiff
...
...
@@ -121,7 +136,7 @@ public class MaterialDataAdaptor {
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
))
{
inlineParams
.
put
(
"storeId"
,
StringUtils
.
join
(
storeIds
,
","
));
}
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_CLERK_DATA
);
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_CLERK_DATA
);
if
(
result
.
get
(
"data"
)
==
null
)
{
return
new
Page
<>();
}
...
...
@@ -135,6 +150,7 @@ public class MaterialDataAdaptor {
/**
* 门店纬度数据统计
*
* @param enterpriseId
* @param storeIds
* @param fixedDateDiff
...
...
@@ -158,7 +174,7 @@ public class MaterialDataAdaptor {
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
))
{
inlineParams
.
put
(
"storeId"
,
StringUtils
.
join
(
storeIds
,
","
));
}
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_CLERK_DATA
);
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_CLERK_DATA
);
if
(
result
.
get
(
"data"
)
==
null
)
{
return
new
Page
<>();
}
...
...
@@ -171,14 +187,79 @@ public class MaterialDataAdaptor {
}
private
Map
<
String
,
Object
>
doHttp
(
String
jsonParam
,
String
apolloKey
){
// --------------- 周报/月报 ---------------
/**
* 查询素材使用情况
*
* @param enterpriseId
* @param reportType
* @param storeIds
* @return
*/
public
MaterialPersonalUsedDataVO
queryMaterialUsedReport
(
String
enterpriseId
,
String
clerkId
,
Integer
reportType
,
List
<
String
>
storeIds
)
{
MaterialPersonalUsedDataVO
temp
=
new
MaterialPersonalUsedDataVO
();
// 获取当前时间是
DateTime
startTime
=
null
;
DateTime
endTime
=
null
;
int
bizDate
=
0
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
// 周报
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
}
else
{
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
month
(
DateUtil
.
lastMonth
());
}
temp
.
setStartTime
(
startTime
);
temp
.
setEndTime
(
endTime
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
inlineParams
=
new
HashMap
<>();
params
.
put
(
"inFields"
,
inlineParams
);
inlineParams
.
put
(
"clerkId"
,
clerkId
);
inlineParams
.
put
(
"enterprsieId"
,
enterpriseId
);
inlineParams
.
put
(
"bizDate"
,
bizDate
);
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
))
{
inlineParams
.
put
(
"storeId"
,
StringUtils
.
join
(
storeIds
,
","
));
}
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MATERIAL_CLERK_DATA
);
if
(
result
.
get
(
"data"
)
==
null
)
{
return
temp
;
}
MaterialPersonalUsedDataVO
materialPersonalUsedDataVO
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
result
.
get
(
"data"
)),
MaterialPersonalUsedDataVO
.
class
);
materialPersonalUsedDataVO
.
setStartTime
(
startTime
);
materialPersonalUsedDataVO
.
setEndTime
(
endTime
);
return
materialPersonalUsedDataVO
;
}
/**
* 查询门店/区经使用数据
* @param enterpriseId
* @param clerkId
* @param reportType
* @param storeIds
* @return
*/
public
MaterialStoreUsedDataVO
queryMaterialStoreUseReport
(
String
enterpriseId
,
String
clerkId
,
Integer
reportType
,
List
<
String
>
storeIds
)
{
return
null
;
}
private
Map
<
String
,
Object
>
doHttp
(
String
jsonParam
,
String
apolloKey
)
{
try
{
log
.
info
(
"调用接口 apolloKey:{}, 参数:{}"
,
apolloKey
,
jsonParam
);
Map
<
String
,
Object
>
result
=
DataTargetHttpUtils
.
http
(
jsonParam
,
apolloKey
);
if
(
result
==
null
)
{
return
Collections
.
emptyMap
();
}
return
result
;
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
info
(
"请求接口失败 apolloKey:{}"
,
apolloKey
,
ex
);
}
return
Collections
.
emptyMap
();
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/content/statistics/Material
PersonalUsed
QO.java
→
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/content/statistics/Material
Report
QO.java
View file @
0f78e5c6
...
...
@@ -7,7 +7,7 @@ package com.gic.haoban.manage.web.qo.content.statistics;
* @Version
* 素材
**/
public
class
Material
PersonalUsed
QO
extends
MaterialStatisticsBaseQO
{
public
class
Material
Report
QO
extends
MaterialStatisticsBaseQO
{
private
static
final
long
serialVersionUID
=
-
4105397589798480404L
;
...
...
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