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
ac20081f
Commit
ac20081f
authored
Jul 10, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加首页统计模块 统计近一周
parent
eeedb39b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
63 deletions
+88
-63
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
.../com/mortals/xhx/module/ph/web/PhQueueStatController.java
+43
-31
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
...m/mortals/xhx/module/pj/web/PjEvaluateStatController.java
+44
-31
bill-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+1
-1
No files found.
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
View file @
ac20081f
...
...
@@ -7,6 +7,7 @@ import com.mortals.framework.annotation.UnAuth;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
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.code.GroupListEnum
;
...
...
@@ -48,6 +49,8 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
@Autowired
private
ISiteFeign
siteFeign
;
@Autowired
private
PhQueueStatService
phQueueStatService
;
public
PhQueueStatController
()
{
super
.
setModuleDesc
(
"排队叫号汇总统计"
);
...
...
@@ -142,39 +145,48 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
=
1
;
try
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
phQueueQuery
.
getTaketimeStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
phQueueQuery
.
getTaketimeEnd
());
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
->
{
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
());
//设置年月日
this
.
service
.
updateSitePhStat
(
sitestatEntity
,
context
);
});
Runnable
runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
phQueueQuery
.
getTaketimeStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
phQueueQuery
.
getTaketimeEnd
());
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
->
{
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
();
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
)
{
...
...
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
ac20081f
...
...
@@ -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.exception.AppException
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
...
...
@@ -44,6 +45,8 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
@Autowired
private
ISiteFeign
siteFeign
;
@Autowired
private
PjEvaluateStatService
pjEvaluateStatService
;
public
PjEvaluateStatController
()
{
super
.
setModuleDesc
(
"评价汇总统计"
);
...
...
@@ -144,39 +147,49 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
=
1
;
try
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
pjEvaluateQuery
.
getPjTimeStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
pjEvaluateQuery
.
getPjTimeEnd
());
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
->
{
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
());
//设置年月日
this
.
service
.
updateSitePjStat
(
sitestatEntity
,
context
);
});
Runnable
runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
pjEvaluateQuery
.
getPjTimeStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
pjEvaluateQuery
.
getPjTimeEnd
());
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
->
{
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
();
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
)
{
...
...
bill-manager/src/test/java/com/mortals/httpclient/system.http
View file @
ac20081f
...
...
@@ -56,7 +56,7 @@ POST {{baseUrl}}/ph/queue/stat/stat
Content-Type: application/json
{
"taketimeStart": "202
3-01
-01",
"taketimeStart": "202
4-06
-01",
"taketimeEnd": "2024-07-10"
}
...
...
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