Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
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
shenjunjie
brandkbs2
Commits
b41c0373
Commit
b41c0373
authored
Mar 03, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!232
parents
d0a006b7
369eb3d4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
src/main/java/com/zhiwei/brandkbs2/pojo/Report.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
+9
-9
src/test/java/com/zhiwei/brandkbs2/ReportServiceTest.java
+1
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/pojo/Report.java
View file @
b41c0373
...
@@ -93,7 +93,7 @@ public class Report extends AbstractBaseMongo {
...
@@ -93,7 +93,7 @@ public class Report extends AbstractBaseMongo {
case
MONTH:
case
MONTH:
report
.
setTitle
(
project
.
getBrandName
()
+
Constant
.
DAY_FORMAT
.
format
(
now
)
+
reportSettings
.
getType
());
report
.
setTitle
(
project
.
getBrandName
()
+
Constant
.
DAY_FORMAT
.
format
(
now
)
+
reportSettings
.
getType
());
now
=
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
);
now
=
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
);
report
.
setStartTime
(
DateUtils
.
addMonths
(
now
,
1
).
getTime
());
report
.
setStartTime
(
DateUtils
.
addMonths
(
now
,
-
1
).
getTime
());
report
.
setEndTime
(
now
.
getTime
());
report
.
setEndTime
(
now
.
getTime
());
break
;
break
;
case
CUSTOM:
case
CUSTOM:
...
...
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
View file @
b41c0373
...
@@ -29,7 +29,7 @@ public interface ReportService {
...
@@ -29,7 +29,7 @@ public interface ReportService {
*/
*/
Map
<
String
,
ReportSettingsDTO
>
getReportSettings
();
Map
<
String
,
ReportSettingsDTO
>
getReportSettings
();
List
<
Report
>
get
Custom
ReportByStatus
(
String
projectId
,
boolean
status
);
List
<
Report
>
getReportByStatus
(
String
projectId
,
boolean
status
);
/**
/**
* 保存报告配置
* 保存报告配置
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
View file @
b41c0373
...
@@ -118,8 +118,8 @@ public class ReportServiceImpl implements ReportService {
...
@@ -118,8 +118,8 @@ public class ReportServiceImpl implements ReportService {
}
}
@Override
@Override
public
List
<
Report
>
get
Custom
ReportByStatus
(
String
projectId
,
boolean
status
)
{
public
List
<
Report
>
getReportByStatus
(
String
projectId
,
boolean
status
)
{
Criteria
criteria
=
Criteria
.
where
(
"projectId"
).
is
(
projectId
).
and
(
"status"
).
is
(
status
)
.
and
(
"type"
).
is
(
ReportTypeEnum
.
CUSTOM
.
getState
())
;
Criteria
criteria
=
Criteria
.
where
(
"projectId"
).
is
(
projectId
).
and
(
"status"
).
is
(
status
);
return
reportDao
.
findList
(
Query
.
query
(
criteria
));
return
reportDao
.
findList
(
Query
.
query
(
criteria
));
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
View file @
b41c0373
...
@@ -315,23 +315,23 @@ public class TaskServiceImpl implements TaskService {
...
@@ -315,23 +315,23 @@ public class TaskServiceImpl implements TaskService {
private
boolean
reportSendByProject
(
Project
project
)
{
private
boolean
reportSendByProject
(
Project
project
)
{
boolean
flag
=
false
;
boolean
flag
=
false
;
// 扫描setting信息
// 扫描setting信息
并生成对应报告
for
(
ReportSettings
reportSettings
:
reportSettingsDao
.
getReportSettingByProjectWithUsed
(
project
.
getId
()))
{
for
(
ReportSettings
reportSettings
:
reportSettingsDao
.
getReportSettingByProjectWithUsed
(
project
.
getId
()))
{
ReportTypeEnum
reportType
=
ReportTypeEnum
.
getInstanceByState
(
reportSettings
.
getType
());
ReportTypeEnum
reportType
=
ReportTypeEnum
.
getInstanceByState
(
reportSettings
.
getType
());
if
(
ReportTypeEnum
.
canPublishNow
(
reportType
))
{
if
(
ReportTypeEnum
.
canPublishNow
(
reportType
))
{
Pair
<
Boolean
,
Report
>
booleanReportPair
=
reportService
.
generateReportBySettings
(
reportSettings
,
project
);
Pair
<
Boolean
,
Report
>
booleanReportPair
=
reportService
.
generateReportBySettings
(
reportSettings
,
project
);
// 生成新的简报之后的处理
// 生成新的简报之后的处理
if
(
booleanReportPair
.
getLeft
())
{
//
if (booleanReportPair.getLeft()) {
Report
report
=
booleanReportPair
.
getRight
();
//
Report report = booleanReportPair.getRight();
// 用作生成缓存
//
// 用作生成缓存
reportService
.
getPcReportAnalyze
(
report
.
getId
(),
false
);
//
reportService.getPcReportAnalyze(report.getId(), false);
reportService
.
switchReportStatus
(
report
.
getId
(),
true
);
//
reportService.switchReportStatus(report.getId(), true);
}
//
}
flag
=
true
;
flag
=
true
;
}
}
}
}
//
自定义简报不通过setting生效
//
生成对应报告
for
(
Report
report
:
reportService
.
get
Custom
ReportByStatus
(
project
.
getId
(),
false
))
{
for
(
Report
report
:
reportService
.
getReportByStatus
(
project
.
getId
(),
false
))
{
// 用作生成缓存
// 用作生成缓存
reportService
.
getPcReportAnalyze
(
report
.
getId
(),
false
);
reportService
.
getPcReportAnalyze
(
report
.
getId
(),
false
);
reportService
.
switchReportStatus
(
report
.
getId
(),
true
);
reportService
.
switchReportStatus
(
report
.
getId
(),
true
);
...
...
src/test/java/com/zhiwei/brandkbs2/ReportServiceTest.java
View file @
b41c0373
...
@@ -32,7 +32,7 @@ public class ReportServiceTest {
...
@@ -32,7 +32,7 @@ public class ReportServiceTest {
@Test
@Test
public
void
getCustomReportByStatusTest
(){
public
void
getCustomReportByStatusTest
(){
List
<
Report
>
customReportByStatus
=
reportService
.
get
Custom
ReportByStatus
(
UserThreadLocal
.
getProjectId
(),
false
);
List
<
Report
>
customReportByStatus
=
reportService
.
getReportByStatus
(
UserThreadLocal
.
getProjectId
(),
false
);
for
(
Report
reportByStatus
:
customReportByStatus
)
{
for
(
Report
reportByStatus
:
customReportByStatus
)
{
System
.
out
.
println
(
reportByStatus
);
System
.
out
.
println
(
reportByStatus
);
}
}
...
...
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