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
323ccb21
Commit
323ccb21
authored
Jul 10, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加首页统计模块 统计近一周
parent
ac20081f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
37 deletions
+50
-37
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
.../com/mortals/xhx/module/ph/web/PhQueueStatController.java
+4
-3
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
...m/mortals/xhx/module/pj/web/PjEvaluateStatController.java
+3
-3
bill-manager/src/main/java/com/mortals/xhx/module/stat/web/StatController.java
.../java/com/mortals/xhx/module/stat/web/StatController.java
+43
-31
No files found.
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
View file @
323ccb21
...
...
@@ -155,13 +155,14 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
log
.
info
(
"计算天数区间:{}"
,
compare
);
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
SitePdu
>>>
resp
=
siteFeign
.
list
(
sitePdu
);
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
stopWatch
.
start
(
"执行本地方法"
);
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
->
{
...
...
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
323ccb21
...
...
@@ -157,13 +157,13 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
log
.
info
(
"计算天数区间:{}"
,
compare
);
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
SitePdu
>>>
resp
=
siteFeign
.
list
(
sitePdu
);
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
stopWatch
.
start
(
"执行本地方法"
);
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
->
{
...
...
bill-manager/src/main/java/com/mortals/xhx/module/stat/web/StatController.java
View file @
323ccb21
...
...
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.pdu.RespData
;
...
...
@@ -61,6 +62,8 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
@Autowired
private
ISiteFeign
siteFeign
;
@Autowired
private
StatService
statService
;
public
StatController
()
{
...
...
@@ -82,39 +85,48 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
=
1
;
try
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
query
.
getCreateTimeStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
query
.
getCreateTimeEnd
());
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
log
.
info
(
"计算天数区间:{}"
,
compare
);
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
stopWatch
.
start
(
"执行本地方法"
);
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
->
{
StatEntity
statEntity
=
new
StatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setSiteId
(
site
.
getId
());
statEntity
.
setSiteName
(
site
.
getSiteName
());
statEntity
.
setSiteCode
(
site
.
getSiteCode
());
statEntity
.
setYear
(
curDate
.
year
());
statEntity
.
setMonth
(
curDate
.
month
()
+
1
);
statEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
this
.
service
.
updateSiteStat
(
statEntity
,
context
);
});
Runnable
runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
query
.
getCreateTimeStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
query
.
getCreateTimeEnd
());
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
log
.
info
(
"计算天数区间:{}"
,
compare
);
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
SitePdu
>>>
resp
=
siteFeign
.
list
(
sitePdu
);
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
stopWatch
.
start
(
"执行本地方法"
);
if
(
resp
.
getCode
()
==
1
)
{
List
<
SitePdu
>
sitePduList
=
resp
.
getData
().
getData
();
sitePduList
.
stream
().
forEach
(
site
->
{
StatEntity
statEntity
=
new
StatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setSiteId
(
site
.
getId
());
statEntity
.
setSiteName
(
site
.
getSiteName
());
statEntity
.
setSiteCode
(
site
.
getSiteCode
());
statEntity
.
setYear
(
curDate
.
year
());
statEntity
.
setMonth
(
curDate
.
month
()
+
1
);
statEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
statService
.
updateSiteStat
(
statEntity
,
context
);
});
}
stopWatch
.
stop
();
log
.
info
(
"日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
}
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
stopWatch
.
stop
();
log
.
info
(
"日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
}
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
...
...
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