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
Show 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,13 +185,54 @@ 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) {
updateSitePhStat(attendStart, compare, stopWatch, site, context);
}
//log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}*/
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
model
.
put
(
"message_info"
,
e
.
getMessage
());
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
private
void
updateSitePhStat
(
DateTime
attendStart
,
Long
compare
,
StopWatch
stopWatch
,
SitePdu
site
,
Context
context
)
{
log
.
info
(
"统计站点:{}"
,
site
.
getSiteName
());
stopWatch
.
start
(
"站点排号统计开始"
);
AccessStatLogEntity
statLogEntity
=
new
AccessStatLogEntity
();
...
...
@@ -232,27 +273,6 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
accessStatLogService
.
save
(
statLogEntity
,
context
);
}
//log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
model
.
put
(
"message_info"
,
e
.
getMessage
());
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
...
...
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
b25b3c5a
...
...
@@ -186,13 +186,50 @@ 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) {
updateSitePjStat(attendStart, compare, stopWatch, site, context);
}
//log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}*/
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
model
.
put
(
"message_info"
,
e
.
getMessage
());
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
private
void
updateSitePjStat
(
DateTime
attendStart
,
Long
compare
,
StopWatch
stopWatch
,
SitePdu
site
,
Context
context
)
{
stopWatch
.
start
(
"站点评价统计开始"
);
AccessStatLogEntity
statLogEntity
=
new
AccessStatLogEntity
();
statLogEntity
.
initAttrValue
();
...
...
@@ -232,25 +269,6 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
accessStatLogService
.
save
(
statLogEntity
,
context
);
}
//log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
model
.
put
(
"message_info"
,
e
.
getMessage
());
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
\ 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