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
ebca163f
Commit
ebca163f
authored
Jul 30, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加统计子站点
parent
2d32c02b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
57 deletions
+111
-57
bill-manager/src/main/java/com/mortals/xhx/module/ph/service/PhQueueStatService.java
...com/mortals/xhx/module/ph/service/PhQueueStatService.java
+12
-10
bill-manager/src/main/java/com/mortals/xhx/module/ph/service/impl/PhQueueStatServiceImpl.java
...ls/xhx/module/ph/service/impl/PhQueueStatServiceImpl.java
+4
-4
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
.../com/mortals/xhx/module/ph/web/PhQueueStatController.java
+18
-5
bill-manager/src/main/java/com/mortals/xhx/module/pj/service/PjEvaluateStatService.java
.../mortals/xhx/module/pj/service/PjEvaluateStatService.java
+2
-2
bill-manager/src/main/java/com/mortals/xhx/module/pj/service/impl/PjEvaluateStatServiceImpl.java
...xhx/module/pj/service/impl/PjEvaluateStatServiceImpl.java
+62
-35
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
...m/mortals/xhx/module/pj/web/PjEvaluateStatController.java
+13
-1
No files found.
bill-manager/src/main/java/com/mortals/xhx/module/ph/service/PhQueueStatService.java
View file @
ebca163f
package
com.mortals.xhx.module.ph.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
...
...
@@ -11,21 +12,22 @@ import com.mortals.xhx.module.pj.model.PjEvaluateStatEntity;
import
java.util.List
;
/**
* PhQueueStatService
*
* 排队叫号汇总统计 service接口
*
* @author zxfei
* @date 2024-06-24
*/
public
interface
PhQueueStatService
extends
ICRUDService
<
PhQueueStatEntity
,
Long
>
{
* PhQueueStatService
* <p>
* 排队叫号汇总统计 service接口
*
* @author zxfei
* @date 2024-06-24
*/
public
interface
PhQueueStatService
extends
ICRUDService
<
PhQueueStatEntity
,
Long
>
{
PhQueueStatDao
getDao
();
Rest
<
Void
>
updateSitePhStat
(
PhQueueStatEntity
entity
,
Context
context
);
Rest
<
List
<
PhQueueStatEntity
>
>
updateSitePhStat
(
PhQueueStatEntity
entity
,
Context
context
);
List
<
PhQueueStatEntity
>
getBillInfos
(
PhQueueStatQuery
query
,
PageInfo
pageInfo
,
Context
context
);
List
<
PhQueueStatEntity
>
getBillInfos
(
PhQueueStatQuery
query
,
PageInfo
pageInfo
,
Context
context
);
void
saveUpdatePhStatList
(
List
<
PhQueueStatEntity
>
saveAndUpdatelist
);
}
\ No newline at end of file
bill-manager/src/main/java/com/mortals/xhx/module/ph/service/impl/PhQueueStatServiceImpl.java
View file @
ebca163f
...
...
@@ -42,7 +42,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
@Override
public
Rest
<
Void
>
updateSitePhStat
(
PhQueueStatEntity
entity
,
Context
context
)
{
public
Rest
<
List
<
PhQueueStatEntity
>
>
updateSitePhStat
(
PhQueueStatEntity
entity
,
Context
context
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
entity
.
getYear
(),
entity
.
getMonth
()
-
1
,
entity
.
getDay
());
...
...
@@ -81,8 +81,8 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
saveOrUpdateList
.
addAll
(
phQueueStatEntities3
);
saveOrUpdateList
.
addAll
(
phQueueStatEntities4
);
saveUpdatePhStatList
(
saveOrUpdateList
);
return
Rest
.
ok
();
//
saveUpdatePhStatList(saveOrUpdateList);
return
Rest
.
ok
(
saveOrUpdateList
);
}
...
...
@@ -364,7 +364,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
}
p
rivate
void
saveUpdatePhStatList
(
List
<
PhQueueStatEntity
>
saveAndUpdatelist
)
{
p
ublic
void
saveUpdatePhStatList
(
List
<
PhQueueStatEntity
>
saveAndUpdatelist
)
{
if
(!
ObjectUtils
.
isEmpty
(
saveAndUpdatelist
))
{
Map
<
Boolean
,
List
<
PhQueueStatEntity
>>
saveUpdateCollect
=
saveAndUpdatelist
.
parallelStream
().
collect
(
Collectors
.
partitioningBy
(
i
->
i
.
newEntity
()));
...
...
bill-manager/src/main/java/com/mortals/xhx/module/ph/web/PhQueueStatController.java
View file @
ebca163f
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -40,6 +41,8 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
import
java.util.stream.LongStream
;
import
static
java
.
util
.
stream
.
Collectors
.
collectingAndThen
;
import
static
java
.
util
.
stream
.
Collectors
.
toCollection
;
...
...
@@ -194,18 +197,18 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
accessQuery
.
setTagNotList
(
Arrays
.
asList
(
""
));
List
<
AccessEntity
>
accessEntities
=
accessService
.
find
(
accessQuery
);
List
<
SitePdu
>
sitePduList
=
new
ArrayList
<>();
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
())
{
if
(
YesNoEnum
.
YES
.
getValue
()
==
sitesRest
.
getCode
())
{
sitePduList
.
addAll
(
sitesRest
.
getData
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
sitePduList
))
{
sitePduList
=
sitePduList
.
stream
().
collect
(
if
(!
ObjectUtils
.
isEmpty
(
sitePduList
))
{
sitePduList
=
sitePduList
.
stream
().
collect
(
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
SitePdu:
:
getId
))),
ArrayList:
:
new
));
for
(
SitePdu
site
:
sitePduList
)
{
...
...
@@ -285,6 +288,8 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
statLogEntity
.
setAccessId
(
accessEntity
.
getId
());
}
List
<
PhQueueStatEntity
>
saveOrUpdateList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
...
...
@@ -299,8 +304,16 @@ public class PhQueueStatController extends BaseCRUDJsonBodyMappingController<PhQ
sitestatEntity
.
setMonth
(
curDate
.
month
()
+
1
);
sitestatEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
phQueueStatService
.
updateSitePhStat
(
sitestatEntity
,
context
);
Rest
<
List
<
PhQueueStatEntity
>>
listRest
=
phQueueStatService
.
updateSitePhStat
(
sitestatEntity
,
context
);
saveOrUpdateList
.
addAll
(
listRest
.
getData
());
}
List
<
List
<
PhQueueStatEntity
>>
partition
=
Lists
.
partition
(
saveOrUpdateList
,
1000
);
for
(
List
<
PhQueueStatEntity
>
phQueueStatEntities
:
partition
)
{
this
.
service
.
saveUpdatePhStatList
(
phQueueStatEntities
);
}
stopWatch
.
stop
();
statLogEntity
.
setStatEndTime
(
new
Date
());
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
...
...
bill-manager/src/main/java/com/mortals/xhx/module/pj/service/PjEvaluateStatService.java
View file @
ebca163f
...
...
@@ -27,10 +27,10 @@ public interface PjEvaluateStatService extends ICRUDService<PjEvaluateStatEntity
* @param context
* @return
*/
Rest
<
Void
>
updateSitePjStat
(
PjEvaluateStatEntity
entity
,
Context
context
);
Rest
<
List
<
PjEvaluateStatEntity
>
>
updateSitePjStat
(
PjEvaluateStatEntity
entity
,
Context
context
);
List
<
PjEvaluateStatEntity
>
getBillInfos
(
PjEvaluateStatQuery
query
,
PageInfo
pageInfo
,
Context
context
);
void
saveUpdatePjEvaluateStatList
(
List
<
PjEvaluateStatEntity
>
saveAndUpdatelist
);
}
\ No newline at end of file
bill-manager/src/main/java/com/mortals/xhx/module/pj/service/impl/PjEvaluateStatServiceImpl.java
View file @
ebca163f
This diff is collapsed.
Click to expand it.
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
ebca163f
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -285,6 +286,8 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
statLogEntity
.
setAccessId
(
accessEntity
.
getId
());
}
List
<
PjEvaluateStatEntity
>
saveAndUpdatelist
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"记录日期:{}"
,
curDate
.
toDateStr
());
...
...
@@ -297,8 +300,17 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
sitestatEntity
.
setMonth
(
curDate
.
month
()
+
1
);
sitestatEntity
.
setDay
(
curDate
.
dayOfMonth
());
//设置年月日
pjEvaluateStatService
.
updateSitePjStat
(
sitestatEntity
,
context
);
Rest
<
List
<
PjEvaluateStatEntity
>>
rest
=
pjEvaluateStatService
.
updateSitePjStat
(
sitestatEntity
,
context
);
saveAndUpdatelist
.
addAll
(
rest
.
getData
());
}
List
<
List
<
PjEvaluateStatEntity
>>
partition
=
Lists
.
partition
(
saveAndUpdatelist
,
1000
);
for
(
List
<
PjEvaluateStatEntity
>
pjEvaluateStatEntities
:
partition
)
{
this
.
service
.
saveUpdatePjEvaluateStatList
(
pjEvaluateStatEntities
);
}
stopWatch
.
stop
();
statLogEntity
.
setStatEndTime
(
new
Date
());
statLogEntity
.
setDuration
(
stopWatch
.
getLastTaskTimeMillis
());
...
...
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