Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bill-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
bill-platform
Commits
cfe0acba
Commit
cfe0acba
authored
Jul 10, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加首页统计模块 统计近一周
parent
811e808f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
37 deletions
+52
-37
bill-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
+52
-37
No files found.
bill-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
View file @
cfe0acba
package
com.mortals.xhx.daemon.task
;
package
com.mortals.xhx.daemon.task
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -16,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -16,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -40,46 +42,55 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
...
@@ -40,46 +42,55 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
@Override
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
log
.
info
(
"站点评价统计任务"
);
log
.
info
(
"站点评价统计任务"
);
//统计最近一周
int
year
=
DateUtil
.
date
().
year
();
int
month
=
DateUtil
.
date
().
month
()
+
1
;
int
day
=
DateUtil
.
date
().
dayOfMonth
();
SitePdu
sitePdu
=
new
SitePdu
();
for
(
int
i
=
1
;
i
<
7
;
i
++)
{
sitePdu
.
setSize
(-
1
);
DateTime
beforeDate
=
DateUtil
.
offsetDay
(
new
Date
(),
-
i
);
Rest
<
RespData
<
List
<
SitePdu
>>>
resp
=
siteFeign
.
list
(
sitePdu
);
if
(
resp
.
getCode
()
==
1
)
{
int
year
=
beforeDate
.
year
();
List
<
SitePdu
>
sitePduList
=
resp
.
getData
().
getData
();
int
month
=
beforeDate
.
month
()
+
1
;
sitePduList
.
stream
().
forEach
(
site
->
{
int
day
=
beforeDate
.
dayOfMonth
();
PjEvaluateStatEntity
sitestatEntity
=
new
PjEvaluateStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
year
);
sitestatEntity
.
setMonth
(
month
);
sitestatEntity
.
setDay
(
day
);
//设置年月日
pjEvaluateStatService
.
updateSitePjStat
(
sitestatEntity
,
null
);
//设置排号
PhQueueStatEntity
phQueueStatEntity
=
new
PhQueueStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
year
);
sitestatEntity
.
setMonth
(
month
);
sitestatEntity
.
setDay
(
day
);
phQueueStatService
.
updateSitePhStat
(
phQueueStatEntity
,
null
);
});
}
/* int year = DateUtil.date().year();
int month = DateUtil.date().month() + 1;
int day = DateUtil.date().dayOfMonth();*/
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
SitePdu
>>>
resp
=
siteFeign
.
list
(
sitePdu
);
if
(
resp
.
getCode
()
==
1
)
{
List
<
SitePdu
>
sitePduList
=
resp
.
getData
().
getData
();
sitePduList
.
stream
().
forEach
(
site
->
{
PjEvaluateStatEntity
sitestatEntity
=
new
PjEvaluateStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
year
);
sitestatEntity
.
setMonth
(
month
);
sitestatEntity
.
setDay
(
day
);
//设置年月日
pjEvaluateStatService
.
updateSitePjStat
(
sitestatEntity
,
null
);
//设置排号
PhQueueStatEntity
phQueueStatEntity
=
new
PhQueueStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
year
);
sitestatEntity
.
setMonth
(
month
);
sitestatEntity
.
setDay
(
day
);
phQueueStatService
.
updateSitePhStat
(
phQueueStatEntity
,
null
);
});
}
}
}
}
...
@@ -95,7 +106,11 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
...
@@ -95,7 +106,11 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
int
month
=
DateUtil
.
date
().
month
()
+
1
;
int
month
=
DateUtil
.
date
().
month
()
+
1
;
int
day
=
DateUtil
.
date
().
dayOfMonth
();
int
day
=
DateUtil
.
date
().
dayOfMonth
();
System
.
out
.
println
(
year
+
"年"
+
month
+
"月"
+
day
+
"日"
);
// System.out.println(year + "年" + month + "月" + day + "日");
System
.
out
.
println
(
DateUtil
.
offsetDay
(
new
Date
(),
-
0
).
toString
(
"yyyy-MM-dd"
));
}
}
...
...
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