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
b25b3c5a
Commit
b25b3c5a
authored
Jul 27, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改同步统计只统计开通的站点
parent
9a883119
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
85 deletions
+147
-85
bill-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
+26
-2
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
.../com/mortals/xhx/module/ph/web/PhQueueStatController.java
+61
-41
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
...m/mortals/xhx/module/pj/web/PjEvaluateStatController.java
+58
-40
bill-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+2
-2
No files found.
bill-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
View file @
b25b3c5a
...
...
@@ -75,7 +75,31 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
}
private
void
updateSiteCache
()
{
SitePdu
sitePdu
=
new
SitePdu
();
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
site
=
new
SitePdu
();
site
.
setId
(
accessEntity
.
getSiteId
());
site
.
setSiteName
(
accessEntity
.
getSiteName
());
site
.
setSiteCode
(
accessEntity
.
getSiteCode
());
site
.
setAreaCode
(
accessEntity
.
getAreaCode
());
updatePjSectionCache
(
site
);
updatePjWindowCache
(
site
);
updatePjHallNameCache
(
site
);
updatePhQueueBusniessCache
(
site
);
updatePhQueueSectionNameCache
(
site
);
updatePhQueueWindowsCache
(
site
);
updatePhQueueHallNameCache
(
site
);
}
/* SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
if (resp.getCode() == 1) {
...
...
@@ -90,7 +114,7 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
updatePhQueueWindowsCache(site);
updatePhQueueHallNameCache(site);
}
}
}
*/
}
private
void
updatePhQueueBusniessCache
(
SitePdu
site
)
{
...
...
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
View file @
b25b3c5a
...
...
@@ -185,55 +185,33 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
();
log
.
info
(
"计算天数区间:{}"
,
compare
);
SitePdu
sitePdu
=
new
SitePdu
();
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
site
=
new
SitePdu
();
site
.
setId
(
accessEntity
.
getSiteId
());
site
.
setSiteName
(
accessEntity
.
getSiteName
());
site
.
setSiteCode
(
accessEntity
.
getSiteCode
());
site
.
setAreaCode
(
accessEntity
.
getAreaCode
());
updateSitePhStat
(
attendStart
,
compare
,
stopWatch
,
site
,
context
);
}
/* SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
log.info("site resp:{}", JSON.toJSONString(resp));
if (resp.getCode() == 1) {
List<SitePdu> sitePduList = resp.getData().getData();
for (SitePdu site : sitePduList) {
log
.
info
(
"统计站点:{}"
,
site
.
getSiteName
());
stopWatch
.
start
(
"站点排号统计开始"
);
AccessStatLogEntity
statLogEntity
=
new
AccessStatLogEntity
();
statLogEntity
.
initAttrValue
();
statLogEntity
.
setStatStartTime
(
new
Date
());
statLogEntity
.
setType
(
AccessTypeEnum
.
排队机
.
getValue
());
statLogEntity
.
setCreateUserId
(
1L
);
statLogEntity
.
setCreateTime
(
new
Date
());
statLogEntity
.
setSiteId
(
site
.
getId
());
statLogEntity
.
setSiteCode
(
site
.
getSiteCode
());
statLogEntity
.
setSiteName
(
site
.
getSiteName
());
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setSiteId
(
site
.
getId
()
==
null
?
0L
:
site
.
getId
());
AccessEntity
accessEntity
=
accessService
.
selectOne
(
accessQuery
);
if
(!
ObjectUtils
.
isEmpty
(
accessEntity
))
{
statLogEntity
.
setAccessId
(
accessEntity
.
getId
());
}
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
PhQueueStatEntity
sitestatEntity
=
new
PhQueueStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
curDate
.
year
());
sitestatEntity
.
setMonth
(
curDate
.
month
()
+
1
);
sitestatEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
phQueueStatService
.
updateSitePhStat
(
sitestatEntity
,
context
);
}
stopWatch
.
stop
();
statLogEntity
.
setStatEndTime
(
new
Date
());
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
accessStatLogService
.
save
(
statLogEntity
,
context
);
updateSitePhStat(attendStart, compare, stopWatch, site, context);
}
//log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}
}
*/
}
};
...
...
@@ -254,6 +232,48 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
}
private
void
updateSitePhStat
(
DateTime
attendStart
,
Long
compare
,
StopWatch
stopWatch
,
SitePdu
site
,
Context
context
)
{
log
.
info
(
"统计站点:{}"
,
site
.
getSiteName
());
stopWatch
.
start
(
"站点排号统计开始"
);
AccessStatLogEntity
statLogEntity
=
new
AccessStatLogEntity
();
statLogEntity
.
initAttrValue
();
statLogEntity
.
setStatStartTime
(
new
Date
());
statLogEntity
.
setType
(
AccessTypeEnum
.
排队机
.
getValue
());
statLogEntity
.
setCreateUserId
(
1L
);
statLogEntity
.
setCreateTime
(
new
Date
());
statLogEntity
.
setSiteId
(
site
.
getId
());
statLogEntity
.
setSiteCode
(
site
.
getSiteCode
());
statLogEntity
.
setSiteName
(
site
.
getSiteName
());
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setSiteId
(
site
.
getId
()
==
null
?
0L
:
site
.
getId
());
AccessEntity
accessEntity
=
accessService
.
selectOne
(
accessQuery
);
if
(!
ObjectUtils
.
isEmpty
(
accessEntity
))
{
statLogEntity
.
setAccessId
(
accessEntity
.
getId
());
}
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
PhQueueStatEntity
sitestatEntity
=
new
PhQueueStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
curDate
.
year
());
sitestatEntity
.
setMonth
(
curDate
.
month
()
+
1
);
sitestatEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
phQueueStatService
.
updateSitePhStat
(
sitestatEntity
,
context
);
}
stopWatch
.
stop
();
statLogEntity
.
setStatEndTime
(
new
Date
());
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
accessStatLogService
.
save
(
statLogEntity
,
context
);
}
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
...
...
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
b25b3c5a
...
...
@@ -186,54 +186,31 @@ 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
();
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
site
=
new
SitePdu
();
site
.
setId
(
accessEntity
.
getSiteId
());
site
.
setSiteName
(
accessEntity
.
getSiteName
());
site
.
setSiteCode
(
accessEntity
.
getSiteCode
());
site
.
setAreaCode
(
accessEntity
.
getAreaCode
());
updateSitePjStat
(
attendStart
,
compare
,
stopWatch
,
site
,
context
);
}
/* SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
List<SitePdu> sitePduList = resp.getData().getData();
log.info("site resp:{}", JSON.toJSONString(resp));
if (resp.getCode() == 1) {
for (SitePdu site : sitePduList) {
stopWatch
.
start
(
"站点评价统计开始"
);
AccessStatLogEntity
statLogEntity
=
new
AccessStatLogEntity
();
statLogEntity
.
initAttrValue
();
statLogEntity
.
setStatStartTime
(
new
Date
());
statLogEntity
.
setType
(
AccessTypeEnum
.
排队机
.
getValue
());
statLogEntity
.
setCreateUserId
(
1L
);
statLogEntity
.
setCreateTime
(
new
Date
());
statLogEntity
.
setSiteId
(
site
.
getId
());
statLogEntity
.
setSiteCode
(
site
.
getSiteCode
());
statLogEntity
.
setSiteName
(
site
.
getSiteName
());
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setSiteId
(
site
.
getId
()
==
null
?
0L
:
site
.
getId
());
AccessEntity
accessEntity
=
accessService
.
selectOne
(
accessQuery
);
if
(!
ObjectUtils
.
isEmpty
(
accessEntity
))
{
statLogEntity
.
setAccessId
(
accessEntity
.
getId
());
}
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
PjEvaluateStatEntity
sitestatEntity
=
new
PjEvaluateStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
curDate
.
year
());
sitestatEntity
.
setMonth
(
curDate
.
month
()
+
1
);
sitestatEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
pjEvaluateStatService
.
updateSitePjStat
(
sitestatEntity
,
context
);
}
stopWatch
.
stop
();
statLogEntity
.
setStatEndTime
(
new
Date
());
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
accessStatLogService
.
save
(
statLogEntity
,
context
);
updateSitePjStat(attendStart, compare, stopWatch, site, context);
}
//log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}
}
*/
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
...
...
@@ -252,5 +229,46 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
}
private
void
updateSitePjStat
(
DateTime
attendStart
,
Long
compare
,
StopWatch
stopWatch
,
SitePdu
site
,
Context
context
)
{
stopWatch
.
start
(
"站点评价统计开始"
);
AccessStatLogEntity
statLogEntity
=
new
AccessStatLogEntity
();
statLogEntity
.
initAttrValue
();
statLogEntity
.
setStatStartTime
(
new
Date
());
statLogEntity
.
setType
(
AccessTypeEnum
.
排队机
.
getValue
());
statLogEntity
.
setCreateUserId
(
1L
);
statLogEntity
.
setCreateTime
(
new
Date
());
statLogEntity
.
setSiteId
(
site
.
getId
());
statLogEntity
.
setSiteCode
(
site
.
getSiteCode
());
statLogEntity
.
setSiteName
(
site
.
getSiteName
());
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setSiteId
(
site
.
getId
()
==
null
?
0L
:
site
.
getId
());
AccessEntity
accessEntity
=
accessService
.
selectOne
(
accessQuery
);
if
(!
ObjectUtils
.
isEmpty
(
accessEntity
))
{
statLogEntity
.
setAccessId
(
accessEntity
.
getId
());
}
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
PjEvaluateStatEntity
sitestatEntity
=
new
PjEvaluateStatEntity
();
sitestatEntity
.
initAttrValue
();
sitestatEntity
.
setSiteId
(
site
.
getId
());
sitestatEntity
.
setSiteName
(
site
.
getSiteName
());
sitestatEntity
.
setSiteCode
(
site
.
getSiteCode
());
sitestatEntity
.
setYear
(
curDate
.
year
());
sitestatEntity
.
setMonth
(
curDate
.
month
()
+
1
);
sitestatEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
pjEvaluateStatService
.
updateSitePjStat
(
sitestatEntity
,
context
);
}
stopWatch
.
stop
();
statLogEntity
.
setStatEndTime
(
new
Date
());
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
accessStatLogService
.
save
(
statLogEntity
,
context
);
}
}
\ No newline at end of file
bill-manager/src/test/java/com/mortals/httpclient/system.http
View file @
b25b3c5a
...
...
@@ -47,7 +47,7 @@ POST {{baseUrl}}/pj/evaluate/stat/stat
Content-Type: application/json
{
"pjTimeStart": "202
4-06
-01",
"pjTimeStart": "202
3-01
-01",
"pjTimeEnd": "2024-07-26"
}
...
...
@@ -56,7 +56,7 @@ POST {{baseUrl}}/ph/queue/stat/stat
Content-Type: application/json
{
"taketimeStart": "202
4-06
-01",
"taketimeStart": "202
3-01
-01",
"taketimeEnd": "2024-07-26"
}
...
...
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