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
f7c0113e
Commit
f7c0113e
authored
Apr 08, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 素材数据接口
parent
5f379eaf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
41 deletions
+120
-41
MaterialReportContext.java
...ervice/pojo/bo/content/context/MaterialReportContext.java
+9
-2
MaterialDataAdaptor.java
.../service/service/content/adaptor/MaterialDataAdaptor.java
+4
-14
MaterialReportBuilder.java
...ervice/service/content/adaptor/MaterialReportBuilder.java
+35
-9
MaterialReportServiceTest.java
...age3-service/src/test/java/MaterialReportServiceTest.java
+4
-3
test.java
haoban-manage3-service/src/test/java/test.java
+43
-0
MaterialDataStaticsController.java
...web/controller/content/MaterialDataStaticsController.java
+1
-1
MaterialDataAdaptor.java
...e/web/controller/content/adaptor/MaterialDataAdaptor.java
+19
-12
MaterialReportQO.java
...an/manage/web/qo/content/statistics/MaterialReportQO.java
+5
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/content/context/MaterialReportContext.java
View file @
f7c0113e
...
@@ -83,6 +83,11 @@ public class MaterialReportContext {
...
@@ -83,6 +83,11 @@ public class MaterialReportContext {
private
String
materialReportUrl
;
private
String
materialReportUrl
;
/**
/**
* 周期事件
*/
private
String
bizDate
;
/**
* 构建好办小程序消息
* 构建好办小程序消息
*
*
* @return
* @return
...
@@ -144,8 +149,10 @@ public class MaterialReportContext {
...
@@ -144,8 +149,10 @@ public class MaterialReportContext {
public
String
extendParams
(
String
storeId
)
{
public
String
extendParams
(
String
storeId
)
{
JSONObject
params
=
new
JSONObject
();
JSONObject
params
=
new
JSONObject
();
// 此处页面链接 最长128个字节
// 此处页面链接 最长128个字节
params
.
put
(
"s"
,
storeId
);
// storeId_reportType_bizDate
params
.
put
(
"t"
,
this
.
reportType
);
String
key
=
String
.
format
(
"%s_%s_%s"
,
storeId
,
this
.
reportType
,
this
.
bizDate
);
params
.
put
(
"k"
,
key
);
// params.put("t", this.reportType);
return
params
.
toJSONString
();
return
params
.
toJSONString
();
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/MaterialDataAdaptor.java
View file @
f7c0113e
...
@@ -70,15 +70,10 @@ public class MaterialDataAdaptor {
...
@@ -70,15 +70,10 @@ public class MaterialDataAdaptor {
* @param reportType
* @param reportType
* @return
* @return
*/
*/
public
MaterialDataResult
queryClerkReportData
(
String
enterpriseId
,
String
clerkId
,
String
storeId
,
Integer
reportType
)
{
public
MaterialDataResult
queryClerkReportData
(
String
enterpriseId
,
String
clerkId
,
String
storeId
,
Integer
reportType
,
String
bizDate
)
{
int
bizDate
;
String
apolloKey
=
CLERK_WEEK_DATA
;
String
apolloKey
=
CLERK_WEEK_DATA
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
if
(
MaterialReportType
.
MONTH
.
getCode
().
equals
(
reportType
))
{
// 周报
bizDate
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
}
else
{
bizDate
=
DateUtil
.
month
(
DateUtil
.
lastMonth
());
apolloKey
=
CLERK_MONTH_DATA
;
apolloKey
=
CLERK_MONTH_DATA
;
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -123,15 +118,10 @@ public class MaterialDataAdaptor {
...
@@ -123,15 +118,10 @@ public class MaterialDataAdaptor {
* @param reportType
* @param reportType
* @return
* @return
*/
*/
public
MaterialDataResult
queryAreaReportData
(
String
enterpriseId
,
String
clerkId
,
List
<
String
>
storeIds
,
Integer
reportType
)
{
public
MaterialDataResult
queryAreaReportData
(
String
enterpriseId
,
String
clerkId
,
List
<
String
>
storeIds
,
Integer
reportType
,
String
bizDate
)
{
int
bizDate
=
0
;
String
apolloKey
=
AREA_WEEK_DATA
;
String
apolloKey
=
AREA_WEEK_DATA
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
if
(
MaterialReportType
.
MONTH
.
getCode
().
equals
(
reportType
))
{
// 周报
bizDate
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
}
else
{
bizDate
=
DateUtil
.
month
(
DateUtil
.
lastMonth
());
apolloKey
=
AREA_MONTH_DATA
;
apolloKey
=
AREA_MONTH_DATA
;
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/MaterialReportBuilder.java
View file @
f7c0113e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
adaptor
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
adaptor
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
...
@@ -69,6 +70,7 @@ public class MaterialReportBuilder {
...
@@ -69,6 +70,7 @@ public class MaterialReportBuilder {
/**
/**
* 填充该成员的主门店
* 填充该成员的主门店
*
* @param context
* @param context
*/
*/
public
void
fillMainStore
(
MaterialReportContext
context
)
{
public
void
fillMainStore
(
MaterialReportContext
context
)
{
...
@@ -92,7 +94,7 @@ public class MaterialReportBuilder {
...
@@ -92,7 +94,7 @@ public class MaterialReportBuilder {
.
stream
()
.
stream
()
.
filter
(
item
->
StringUtils
.
equals
(
item
.
getStoreId
(),
mainStoreInfo
.
getStoreId
()))
.
filter
(
item
->
StringUtils
.
equals
(
item
.
getStoreId
(),
mainStoreInfo
.
getStoreId
()))
.
findFirst
();
.
findFirst
();
if
(!
mainClerkInfo
.
isPresent
()){
if
(!
mainClerkInfo
.
isPresent
())
{
log
.
info
(
"成员{}与主门店{}不存在导购关联关系"
,
context
.
getStaffId
(),
context
.
getMainStoreId
());
log
.
info
(
"成员{}与主门店{}不存在导购关联关系"
,
context
.
getStaffId
(),
context
.
getMainStoreId
());
return
;
return
;
}
}
...
@@ -103,6 +105,7 @@ public class MaterialReportBuilder {
...
@@ -103,6 +105,7 @@ public class MaterialReportBuilder {
/**
/**
* 周报/月报 数据
* 周报/月报 数据
*
* @param context
* @param context
*/
*/
public
void
buildMaterialReportData
(
MaterialReportContext
context
)
{
public
void
buildMaterialReportData
(
MaterialReportContext
context
)
{
...
@@ -110,13 +113,16 @@ public class MaterialReportBuilder {
...
@@ -110,13 +113,16 @@ public class MaterialReportBuilder {
String
clerkId
=
context
.
getClerkId
();
String
clerkId
=
context
.
getClerkId
();
String
enterpriseId
=
context
.
getEnterpriseId
();
String
enterpriseId
=
context
.
getEnterpriseId
();
MaterialDataAdaptor
.
MaterialDataResult
materialDataResult
;
MaterialDataAdaptor
.
MaterialDataResult
materialDataResult
;
String
bizDate
=
this
.
calcBizDate
(
context
.
getReportType
());
context
.
setBizDate
(
bizDate
);
if
(
StringUtils
.
isBlank
(
context
.
getMainStoreId
()))
{
if
(
StringUtils
.
isBlank
(
context
.
getMainStoreId
()))
{
// 区经
// 区经
List
<
String
>
storeIds
=
this
.
queryClerkStoreIds
(
clerkId
,
context
.
getStaffInfo
().
getWxEnterpriseId
());
List
<
String
>
storeIds
=
this
.
queryClerkStoreIds
(
clerkId
,
context
.
getStaffInfo
().
getWxEnterpriseId
());
materialDataResult
=
materialDataAdaptor
.
queryAreaReportData
(
enterpriseId
,
clerkId
,
storeIds
,
context
.
getReportType
()
);
materialDataResult
=
materialDataAdaptor
.
queryAreaReportData
(
enterpriseId
,
clerkId
,
storeIds
,
context
.
getReportType
(),
bizDate
);
}
else
{
}
else
{
String
mainStoreId
=
context
.
getMainStoreId
();
String
mainStoreId
=
context
.
getMainStoreId
();
materialDataResult
=
materialDataAdaptor
.
queryClerkReportData
(
enterpriseId
,
clerkId
,
mainStoreId
,
context
.
getReportType
());
materialDataResult
=
materialDataAdaptor
.
queryClerkReportData
(
enterpriseId
,
clerkId
,
mainStoreId
,
context
.
getReportType
()
,
bizDate
);
}
}
log
.
info
(
"获取成员海报数据 clerkId:{}, data: {}"
,
clerkId
,
JSON
.
toJSONString
(
materialDataResult
));
log
.
info
(
"获取成员海报数据 clerkId:{}, data: {}"
,
clerkId
,
JSON
.
toJSONString
(
materialDataResult
));
if
(
materialDataResult
==
null
)
{
if
(
materialDataResult
==
null
)
{
...
@@ -124,15 +130,15 @@ public class MaterialReportBuilder {
...
@@ -124,15 +130,15 @@ public class MaterialReportBuilder {
}
}
DrawImageUtils
.
DrawBkgImg
templatePath
=
null
;
DrawImageUtils
.
DrawBkgImg
templatePath
=
null
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
context
.
getReportType
()))
{
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
context
.
getReportType
()))
{
if
(
StringUtils
.
is
Not
Blank
(
context
.
getMainStoreId
()))
{
if
(
StringUtils
.
isBlank
(
context
.
getMainStoreId
()))
{
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
AREA_WEEK_BKG
;
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
AREA_WEEK_BKG
;
}
else
{
}
else
{
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
CLERK_WEEK_BKG
;
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
CLERK_WEEK_BKG
;
}
}
}
else
{
}
else
{
if
(
StringUtils
.
is
Not
Blank
(
context
.
getMainStoreId
()))
{
if
(
StringUtils
.
isBlank
(
context
.
getMainStoreId
()))
{
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
AREA_MONTH_BKG
;
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
AREA_MONTH_BKG
;
}
else
{
}
else
{
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
CLERK_MONTH_BKG
;
templatePath
=
DrawImageUtils
.
DrawBkgImg
.
CLERK_MONTH_BKG
;
}
}
}
}
...
@@ -141,6 +147,26 @@ public class MaterialReportBuilder {
...
@@ -141,6 +147,26 @@ public class MaterialReportBuilder {
context
.
setMaterialReportUrl
(
url
);
context
.
setMaterialReportUrl
(
url
);
}
}
/**
* 计算素材周报的周期
* yyyy-biz
*
* @param reportType
* @return
*/
private
String
calcBizDate
(
Integer
reportType
)
{
String
bizDate
=
null
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
// 周报
bizDate
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
()).
toString
(
"yyyy-MM-dd"
);
}
else
{
// 月报
bizDate
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastMonth
()).
toString
(
"yyyy-MM-dd"
);
}
return
bizDate
;
}
/***
/***
* 构建企业微信消息
* 构建企业微信消息
*
*
...
...
haoban-manage3-service/src/test/java/MaterialReportServiceTest.java
View file @
f7c0113e
...
@@ -97,8 +97,9 @@ public class MaterialReportServiceTest {
...
@@ -97,8 +97,9 @@ public class MaterialReportServiceTest {
public
void
urlTest
(){
public
void
urlTest
(){
JSONObject
params
=
new
JSONObject
();
JSONObject
params
=
new
JSONObject
();
//params.put("clerkId", "300b60c7f8874ca2b9cc696ad6b6a480");
//params.put("clerkId", "300b60c7f8874ca2b9cc696ad6b6a480");
params
.
put
(
"s"
,
"ff8080816e216c04016e34294282004a"
);
params
.
put
(
"key"
,
"ff8080816e216c04016e34294282004a"
);
params
.
put
(
"t"
,
1
);
// params.put("t", 1);
// params.put("d", "04");
String
s
=
params
.
toJSONString
();
String
s
=
params
.
toJSONString
();
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
,
s
);
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
,
s
);
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
...
@@ -108,7 +109,7 @@ public class MaterialReportServiceTest {
...
@@ -108,7 +109,7 @@ public class MaterialReportServiceTest {
@Test
@Test
public
void
queryData
(){
public
void
queryData
(){
MaterialDataAdaptor
.
MaterialDataResult
materialDataResult
=
materialDataAdaptor
.
queryClerkReportData
(
eid
,
clerkId
,
storeId
,
MaterialReportType
.
MONTH
.
getCode
());
MaterialDataAdaptor
.
MaterialDataResult
materialDataResult
=
materialDataAdaptor
.
queryClerkReportData
(
eid
,
clerkId
,
storeId
,
MaterialReportType
.
MONTH
.
getCode
()
,
"2023-14"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
materialDataResult
));
System
.
out
.
println
(
JSON
.
toJSONString
(
materialDataResult
));
}
}
...
...
haoban-manage3-service/src/test/java/test.java
View file @
f7c0113e
...
@@ -8,13 +8,18 @@ import java.util.regex.Pattern;
...
@@ -8,13 +8,18 @@ import java.util.regex.Pattern;
import
cn.hutool.cache.CacheUtil
;
import
cn.hutool.cache.CacheUtil
;
import
cn.hutool.cache.impl.TimedCache
;
import
cn.hutool.cache.impl.TimedCache
;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.junit.Test
;
public
class
test
{
public
class
test
{
...
@@ -28,6 +33,44 @@ public class test {
...
@@ -28,6 +33,44 @@ public class test {
String
clerkId
=
StringUtils
.
substring
(
refUrl
,
indexOf
+
8
,
indexOf
+
40
);
String
clerkId
=
StringUtils
.
substring
(
refUrl
,
indexOf
+
8
,
indexOf
+
40
);
System
.
out
.
println
(
clerkId
);
System
.
out
.
println
(
clerkId
);
}
}
System
.
out
.
println
(
DateUtil
.
year
(
new
Date
())
+
"-"
+
DateUtil
.
month
(
DateUtil
.
lastMonth
()));
System
.
out
.
println
(
DateUtil
.
year
(
new
Date
())
+
""
+
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
()));
System
.
out
.
println
(
"-----"
);
int
weekOfYear
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
System
.
out
.
println
(
DateUtil
.
thisYear
()
+
"-"
+
StringUtils
.
leftPad
(
weekOfYear
+
""
,
2
,
"0"
));
// 月报
int
month
=
DateUtil
.
lastMonth
().
month
()
+
1
;
System
.
out
.
println
(
DateUtil
.
thisYear
()
+
"-"
+
StringUtils
.
leftPad
(
month
+
""
,
2
,
"0"
));
System
.
out
.
println
(
"---------------------"
);
DateTime
dateTime
=
DateUtil
.
parse
(
"2023-01-01"
,
"yyyy-MM-dd"
);
System
.
out
.
println
(
DateUtil
.
weekOfYear
(
dateTime
));
System
.
out
.
println
(
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
()).
toString
(
"yyyy-MM-dd"
));
System
.
out
.
println
(
DateUtil
.
offset
(
DateUtil
.
lastWeek
(),
DateField
.
DAY_OF_WEEK
,
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
())));
System
.
out
.
println
(
DateUtil
.
offsetWeek
(
new
Date
(),
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
())));
System
.
out
.
println
(
DateUtil
.
offsetWeek
(
new
Date
(),
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
())));
System
.
out
.
println
(
DateUtil
.
offsetWeek
(
new
Date
(),
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
())));
System
.
out
.
println
(
DateUtil
.
beginOfMonth
(
DateUtil
.
lastMonth
()).
toString
(
"yyyy-MM-dd"
));
}
@Test
public
void
urlTest
(){
JSONObject
params
=
new
JSONObject
();
//params.put("clerkId", "300b60c7f8874ca2b9cc696ad6b6a480");
String
bizDate
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
()).
toString
(
"yyyy-MM-dd"
);
params
.
put
(
"k"
,
"ff8080816e216c04016e34294282004a_1_"
+
bizDate
);
// params.put("t", 1);
// params.put("d", "04");
String
s
=
params
.
toJSONString
();
String
s1
=
NoticeMessageUtil
.
buildMiniAppUrl
(
NoticeMessageTypeEnum
.
MATERIAL_REPORT_NOTIFY
,
s
);
System
.
out
.
println
(
"/pages/route/index?pageType=hbapp_material_report&data="
.
length
());
System
.
out
.
println
(
s1
);
System
.
out
.
println
(
s1
.
length
());
}
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/MaterialDataStaticsController.java
View file @
f7c0113e
...
@@ -97,7 +97,7 @@ public class MaterialDataStaticsController {
...
@@ -97,7 +97,7 @@ public class MaterialDataStaticsController {
MaterialTodayDataBO
temp
=
materialDataAdaptor
.
queryMaterialTodayData
(
contentMaterialBaseQO
.
getEnterpriseId
(),
storeIds
);
MaterialTodayDataBO
temp
=
materialDataAdaptor
.
queryMaterialTodayData
(
contentMaterialBaseQO
.
getEnterpriseId
(),
storeIds
);
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
// 超管
// 超管
totalMa
terial
Num
=
clerkStoreAdaptor
.
countAdminManagerStore
(
contentMaterialBaseQO
.
getClerkId
(),
contentMaterialBaseQO
.
getWxEnterpriseId
());
totalMa
nagerStore
Num
=
clerkStoreAdaptor
.
countAdminManagerStore
(
contentMaterialBaseQO
.
getClerkId
(),
contentMaterialBaseQO
.
getWxEnterpriseId
());
}
}
MaterialIndexDataVO
indexDataVO
=
MaterialIndexDataVO
.
builder
()
MaterialIndexDataVO
indexDataVO
=
MaterialIndexDataVO
.
builder
()
.
newMaterialNum
(
totalMaterialNum
)
.
newMaterialNum
(
totalMaterialNum
)
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/adaptor/MaterialDataAdaptor.java
View file @
f7c0113e
...
@@ -239,17 +239,15 @@ public class MaterialDataAdaptor {
...
@@ -239,17 +239,15 @@ public class MaterialDataAdaptor {
// 获取当前时间周期
// 获取当前时间周期
DateTime
startTime
=
null
;
DateTime
startTime
=
null
;
DateTime
endTime
=
null
;
DateTime
endTime
=
null
;
int
bizDate
=
0
;
String
bizDate
=
this
.
calcBizDate
(
reportType
)
;
String
apolloKey
=
MATERIAL_CLERK_WEEK_DATA
;
String
apolloKey
=
MATERIAL_CLERK_WEEK_DATA
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
// 周报
// 周报
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
}
else
{
}
else
{
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
month
(
DateUtil
.
lastMonth
());
apolloKey
=
MATERIAL_CLERK_MONTH_DATA
;
apolloKey
=
MATERIAL_CLERK_MONTH_DATA
;
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -275,9 +273,8 @@ public class MaterialDataAdaptor {
...
@@ -275,9 +273,8 @@ public class MaterialDataAdaptor {
return
new
Page
<>();
return
new
Page
<>();
}
}
Page
<
MaterialPersonalUsedDataVO
>
pageResult
=
new
Page
<>();
Page
<
MaterialPersonalUsedDataVO
>
pageResult
=
new
Page
<>();
Object
total
=
result
.
get
(
"total"
);
List
<
MaterialPersonalUsedDataVO
>
materialPersonalUsedDataVos
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
result
.
get
(
"data"
)),
MaterialPersonalUsedDataVO
.
class
);
List
<
MaterialPersonalUsedDataVO
>
materialPersonalUsedDataVos
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
result
.
get
(
"data"
)),
MaterialPersonalUsedDataVO
.
class
);
if
(
CollectionUtils
.
is
Not
Empty
(
materialPersonalUsedDataVos
))
{
if
(
CollectionUtils
.
isEmpty
(
materialPersonalUsedDataVos
))
{
return
new
Page
<>();
return
new
Page
<>();
}
}
for
(
MaterialPersonalUsedDataVO
materialPersonalUsedDataVo
:
materialPersonalUsedDataVos
)
{
for
(
MaterialPersonalUsedDataVO
materialPersonalUsedDataVo
:
materialPersonalUsedDataVos
)
{
...
@@ -306,17 +303,15 @@ public class MaterialDataAdaptor {
...
@@ -306,17 +303,15 @@ public class MaterialDataAdaptor {
// 获取当前时间周期
// 获取当前时间周期
DateTime
startTime
=
null
;
DateTime
startTime
=
null
;
DateTime
endTime
=
null
;
DateTime
endTime
=
null
;
int
bizDate
=
0
;
String
bizDate
=
this
.
calcBizDate
(
reportType
)
;
String
apolloKey
=
MATERIAL_STORE_WEEK_DATA
;
String
apolloKey
=
MATERIAL_STORE_WEEK_DATA
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
// 周报
// 周报
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
}
else
{
}
else
{
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
month
(
DateUtil
.
lastMonth
());
apolloKey
=
MATERIAL_STORE_MONTH_DATA
;
apolloKey
=
MATERIAL_STORE_MONTH_DATA
;
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -344,7 +339,7 @@ public class MaterialDataAdaptor {
...
@@ -344,7 +339,7 @@ public class MaterialDataAdaptor {
}
}
Page
<
MaterialStoreUsedDataVO
>
pageResult
=
new
Page
<>();
Page
<
MaterialStoreUsedDataVO
>
pageResult
=
new
Page
<>();
List
<
MaterialStoreUsedDataVO
>
materialStoreUsedDataVOS
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
result
.
get
(
"data"
)),
MaterialStoreUsedDataVO
.
class
);
List
<
MaterialStoreUsedDataVO
>
materialStoreUsedDataVOS
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
result
.
get
(
"data"
)),
MaterialStoreUsedDataVO
.
class
);
if
(
CollectionUtils
.
is
Not
Empty
(
materialStoreUsedDataVOS
))
{
if
(
CollectionUtils
.
isEmpty
(
materialStoreUsedDataVOS
))
{
return
new
Page
<>();
return
new
Page
<>();
}
}
for
(
MaterialStoreUsedDataVO
materialStoreUsedDataVO
:
materialStoreUsedDataVOS
)
{
for
(
MaterialStoreUsedDataVO
materialStoreUsedDataVO
:
materialStoreUsedDataVOS
)
{
...
@@ -367,17 +362,15 @@ public class MaterialDataAdaptor {
...
@@ -367,17 +362,15 @@ public class MaterialDataAdaptor {
// 获取当前时间周期
// 获取当前时间周期
DateTime
startTime
=
null
;
DateTime
startTime
=
null
;
DateTime
endTime
=
null
;
DateTime
endTime
=
null
;
int
bizDate
=
0
;
String
bizDate
=
this
.
calcBizDate
(
reportType
)
;
String
apolloKey
=
MATERIAL_AREA_WEEK_DATA
;
String
apolloKey
=
MATERIAL_AREA_WEEK_DATA
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
// 周报
// 周报
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
startTime
=
DateUtil
.
beginOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfWeek
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
weekOfYear
(
DateUtil
.
lastWeek
());
}
else
{
}
else
{
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
startTime
=
DateUtil
.
beginOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
endTime
=
DateUtil
.
endOfMonth
(
DateUtil
.
lastWeek
());
bizDate
=
DateUtil
.
month
(
DateUtil
.
lastMonth
());
apolloKey
=
MATERIAL_AREA_MONTH_DATA
;
apolloKey
=
MATERIAL_AREA_MONTH_DATA
;
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -453,4 +446,18 @@ public class MaterialDataAdaptor {
...
@@ -453,4 +446,18 @@ public class MaterialDataAdaptor {
.
map
(
Integer:
:
new
).
orElse
(
0
),
(
v1
,
v2
)
->
v1
));
.
map
(
Integer:
:
new
).
orElse
(
0
),
(
v1
,
v2
)
->
v1
));
}
}
private
String
calcBizDate
(
Integer
reportType
){
String
bizDate
=
null
;
if
(
MaterialReportType
.
WEEK
.
getCode
().
equals
(
reportType
))
{
// 周报
bizDate
=
DateUtil
.
beginOfWeek
(
DateUtil
.
yesterday
()).
toString
(
"yyyy-MM-dd"
);
}
else
{
// 月报
bizDate
=
DateUtil
.
beginOfMonth
(
DateUtil
.
yesterday
()).
toString
(
"yyyy-MM-dd"
);
}
return
bizDate
;
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/content/statistics/MaterialReportQO.java
View file @
f7c0113e
...
@@ -33,4 +33,9 @@ public class MaterialReportQO extends MaterialStatisticsBaseQO {
...
@@ -33,4 +33,9 @@ public class MaterialReportQO extends MaterialStatisticsBaseQO {
* desc
* desc
*/
*/
private
String
order
;
private
String
order
;
/**
* 业务周期
*/
private
String
bizDate
;
}
}
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