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
6ed66f98
Commit
6ed66f98
authored
Jul 30, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加统计子站点
parent
5cb52c0d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
143 additions
and
18 deletions
+143
-18
bill-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
+38
-7
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
.../com/mortals/xhx/module/ph/web/PhQueueStatController.java
+26
-3
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
...m/mortals/xhx/module/pj/web/PjEvaluateStatController.java
+25
-1
bill-manager/src/main/java/com/mortals/xhx/module/stat/web/StatController.java
.../java/com/mortals/xhx/module/stat/web/StatController.java
+54
-7
No files found.
bill-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
View file @
6ed66f98
...
@@ -33,9 +33,11 @@ import org.springframework.stereotype.Service;
...
@@ -33,9 +33,11 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StopWatch
;
import
org.springframework.util.StopWatch
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
static
java
.
util
.
stream
.
Collectors
.
collectingAndThen
;
import
static
java
.
util
.
stream
.
Collectors
.
toCollection
;
/**
/**
* 站点评价统计任务
* 站点评价统计任务
...
@@ -82,8 +84,37 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
...
@@ -82,8 +84,37 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
int
total
=
0
;
int
total
=
0
;
List
<
SitePdu
>
sitePduList
=
new
ArrayList
<>();
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setId
(
accessEntity
.
getId
());
Rest
<
List
<
SitePdu
>>
sitesRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
if
(
YesNoEnum
.
YES
.
getValue
()==
sitesRest
.
getCode
()){
sitePduList
.
addAll
(
sitesRest
.
getData
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
sitePduList
)){
sitePduList
=
sitePduList
.
stream
().
collect
(
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
SitePdu:
:
getId
))),
ArrayList:
:
new
));
for
(
SitePdu
site
:
sitePduList
)
{
updatePjSectionCache
(
site
);
updatePjWindowCache
(
site
);
updatePjHallNameCache
(
site
);
updatePhQueueBusniessCache
(
site
);
updatePhQueueSectionNameCache
(
site
);
updatePhQueueWindowsCache
(
site
);
updatePhQueueHallNameCache
(
site
);
}
total
=
sitePduList
.
size
();
}
/* for (AccessEntity accessEntity : accessEntities) {
SitePdu sitePdu = new SitePdu();
SitePdu sitePdu = new SitePdu();
sitePdu.setId(accessEntity.getId());
sitePdu.setId(accessEntity.getId());
...
@@ -103,7 +134,7 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
...
@@ -103,7 +134,7 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
}
}
}
}
/* SitePdu site = new SitePdu();
*/
/* SitePdu site = new SitePdu();
site.setId(accessEntity.getSiteId());
site.setId(accessEntity.getSiteId());
site.setSiteName(accessEntity.getSiteName());
site.setSiteName(accessEntity.getSiteName());
site.setSiteCode(accessEntity.getSiteCode());
site.setSiteCode(accessEntity.getSiteCode());
...
@@ -116,8 +147,8 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
...
@@ -116,8 +147,8 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
updatePhQueueBusniessCache(site);
updatePhQueueBusniessCache(site);
updatePhQueueSectionNameCache(site);
updatePhQueueSectionNameCache(site);
updatePhQueueWindowsCache(site);
updatePhQueueWindowsCache(site);
updatePhQueueHallNameCache(site);*/
updatePhQueueHallNameCache(site);*/
/*
}
}
*/
cacheService
.
set
(
RedisKey
.
KEY_SITE_STAT_COUNT_CHCHE
,
total
);
cacheService
.
set
(
RedisKey
.
KEY_SITE_STAT_COUNT_CHCHE
,
total
);
...
...
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
View file @
6ed66f98
...
@@ -41,6 +41,9 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -41,6 +41,9 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
collectingAndThen
;
import
static
java
.
util
.
stream
.
Collectors
.
toCollection
;
/**
/**
* 排队叫号汇总统计
* 排队叫号汇总统计
*
*
...
@@ -191,7 +194,27 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
...
@@ -191,7 +194,27 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
SitePdu
>
sitePduList
=
new
ArrayList
<>();
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setId
(
accessEntity
.
getId
());
Rest
<
List
<
SitePdu
>>
sitesRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
if
(
YesNoEnum
.
YES
.
getValue
()==
sitesRest
.
getCode
()){
sitePduList
.
addAll
(
sitesRest
.
getData
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
sitePduList
)){
sitePduList
=
sitePduList
.
stream
().
collect
(
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
SitePdu:
:
getId
))),
ArrayList:
:
new
));
for
(
SitePdu
site
:
sitePduList
)
{
updateSitePhStat
(
attendStart
,
compare
,
stopWatch
,
site
,
context
);
}
}
/* for (AccessEntity accessEntity : accessEntities) {
//根据当前站点获取子站点
//根据当前站点获取子站点
SitePdu sitePdu = new SitePdu();
SitePdu sitePdu = new SitePdu();
sitePdu.setId(accessEntity.getId());
sitePdu.setId(accessEntity.getId());
...
@@ -202,14 +225,14 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
...
@@ -202,14 +225,14 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
updateSitePhStat(attendStart, compare, stopWatch, site, context);
updateSitePhStat(attendStart, compare, stopWatch, site, context);
}
}
}
}
/*
*/
/*
SitePdu site = new SitePdu();
SitePdu site = new SitePdu();
site.setId(accessEntity.getSiteId());
site.setId(accessEntity.getSiteId());
site.setSiteName(accessEntity.getSiteName());
site.setSiteName(accessEntity.getSiteName());
site.setSiteCode(accessEntity.getSiteCode());
site.setSiteCode(accessEntity.getSiteCode());
site.setAreaCode(accessEntity.getAreaCode());
site.setAreaCode(accessEntity.getAreaCode());
updateSitePhStat(attendStart, compare, stopWatch, site, context);*/
updateSitePhStat(attendStart, compare, stopWatch, site, context);*/
/*
}
}
*/
/* SitePdu sitePdu = new SitePdu();
/* SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1);
sitePdu.setSize(-1);
...
...
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
6ed66f98
...
@@ -38,6 +38,9 @@ import java.util.stream.Collectors;
...
@@ -38,6 +38,9 @@ import java.util.stream.Collectors;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.*
;
import
static
java
.
util
.
stream
.
Collectors
.
collectingAndThen
;
import
static
java
.
util
.
stream
.
Collectors
.
toCollection
;
/**
/**
* 评价汇总统计
* 评价汇总统计
*
*
...
@@ -191,6 +194,27 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
...
@@ -191,6 +194,27 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
SitePdu
>
sitePduList
=
new
ArrayList
<>();
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setId
(
accessEntity
.
getId
());
Rest
<
List
<
SitePdu
>>
sitesRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
if
(
YesNoEnum
.
YES
.
getValue
()==
sitesRest
.
getCode
()){
sitePduList
.
addAll
(
sitesRest
.
getData
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
sitePduList
)){
sitePduList
=
sitePduList
.
stream
().
collect
(
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
SitePdu:
:
getId
))),
ArrayList:
:
new
));
for
(
SitePdu
site
:
sitePduList
)
{
updateSitePjStat
(
attendStart
,
compare
,
stopWatch
,
site
,
context
);
}
}
/*
for (AccessEntity accessEntity : accessEntities) {
for (AccessEntity accessEntity : accessEntities) {
//根据当前站点获取子站点
//根据当前站点获取子站点
SitePdu sitePdu = new SitePdu();
SitePdu sitePdu = new SitePdu();
...
@@ -202,7 +226,7 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
...
@@ -202,7 +226,7 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
updateSitePjStat(attendStart, compare, stopWatch, site, context);
updateSitePjStat(attendStart, compare, stopWatch, site, context);
}
}
}
}
}
}
*/
/* for (AccessEntity accessEntity : accessEntities) {
/* for (AccessEntity accessEntity : accessEntities) {
SitePdu site = new SitePdu();
SitePdu site = new SitePdu();
...
...
bill-manager/src/main/java/com/mortals/xhx/module/stat/web/StatController.java
View file @
6ed66f98
...
@@ -12,11 +12,16 @@ import com.mortals.xhx.base.system.param.service.ParamService;
...
@@ -12,11 +12,16 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.module.access.model.AccessEntity
;
import
com.mortals.xhx.module.access.model.AccessQuery
;
import
com.mortals.xhx.module.access.service.AccessService
;
import
com.mortals.xhx.module.access.service.AccessStatLogService
;
import
com.mortals.xhx.module.pj.model.PjEvaluateQuery
;
import
com.mortals.xhx.module.pj.model.PjEvaluateQuery
;
import
com.mortals.xhx.module.pj.model.PjEvaluateStatEntity
;
import
com.mortals.xhx.module.pj.model.PjEvaluateStatEntity
;
import
com.mortals.xhx.module.stat.model.StatQuery
;
import
com.mortals.xhx.module.stat.model.StatQuery
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StopWatch
;
import
org.springframework.util.StopWatch
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -32,19 +37,17 @@ import com.mortals.xhx.module.stat.service.StatService;
...
@@ -32,19 +37,17 @@ import com.mortals.xhx.module.stat.service.StatService;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
import
static
java
.
util
.
stream
.
Collectors
.
collectingAndThen
;
import
static
java
.
util
.
stream
.
Collectors
.
toCollection
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.*
;
...
@@ -65,6 +68,11 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
...
@@ -65,6 +68,11 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
@Autowired
@Autowired
private
StatService
statService
;
private
StatService
statService
;
@Autowired
private
AccessService
accessService
;
@Autowired
private
AccessStatLogService
accessStatLogService
;
public
StatController
()
{
public
StatController
()
{
super
.
setModuleDesc
(
"汇总统计"
);
super
.
setModuleDesc
(
"汇总统计"
);
...
@@ -95,6 +103,46 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
...
@@ -95,6 +103,46 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch"
);
log
.
info
(
"计算天数区间:{}"
,
compare
);
log
.
info
(
"计算天数区间:{}"
,
compare
);
AccessQuery
accessQuery
=
new
AccessQuery
();
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
SitePdu
>
sitePduList
=
new
ArrayList
<>();
for
(
AccessEntity
accessEntity
:
accessEntities
)
{
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setId
(
accessEntity
.
getId
());
Rest
<
List
<
SitePdu
>>
sitesRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
if
(
YesNoEnum
.
YES
.
getValue
()
==
sitesRest
.
getCode
())
{
sitePduList
.
addAll
(
sitesRest
.
getData
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
sitePduList
))
{
sitePduList
=
sitePduList
.
stream
().
collect
(
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
SitePdu:
:
getId
))),
ArrayList:
:
new
));
for
(
SitePdu
site
:
sitePduList
)
{
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
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
);
}
}
}
/*
SitePdu sitePdu = new SitePdu();
SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1);
sitePdu.setSize(-1);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
...
@@ -121,12 +169,11 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
...
@@ -121,12 +169,11 @@ public class StatController extends BaseCRUDJsonBodyMappingController<StatServic
stopWatch.stop();
stopWatch.stop();
log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
log.info("日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}
}
*/
}
}
};
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
ThreadPool
.
getInstance
().
execute
(
runnable
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
}
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