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
aaaed4e7
"...src/main/resources/git@gitlab.scsmile.cn:zxf/appbuild.git" did not exist on "c8bfd8dd112d923e6de11030e4a7f34497e00a8c"
Commit
aaaed4e7
authored
10 months ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改排队统计更新与组合查询
parent
26834802
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
bill-manager/src/main/java/com/mortals/xhx/module/ph/service/impl/PhQueueStatServiceImpl.java
...ls/xhx/module/ph/service/impl/PhQueueStatServiceImpl.java
+25
-14
No files found.
bill-manager/src/main/java/com/mortals/xhx/module/ph/service/impl/PhQueueStatServiceImpl.java
View file @
aaaed4e7
package
com.mortals.xhx.module.ph.service.impl
;
package
com.mortals.xhx.module.ph.service.impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.OrderCol
;
...
@@ -62,7 +63,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -62,7 +63,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
List
<
PhQueueEntity
>
phQueueEntities
=
phQueueService
.
find
(
phQueueQuery
);
List
<
PhQueueEntity
>
phQueueEntities
=
phQueueService
.
find
(
phQueueQuery
);
// log.info("更新站点排队统计数据,站点ID:{},站点名称:{},日期:{},排队数量:{}", entity.getSiteId(), entity.getSiteName(), currentDate, phQueueEntities.size());
// log.info("更新站点排队统计数据,站点ID:{},站点名称:{},日期:{},排队数量:{}", entity.getSiteId(), entity.getSiteName(), currentDate, phQueueEntities.size());
/*
updateSitePhCount(entity, phQueueEntities);
updateSitePhCount
(
entity
,
phQueueEntities
);
//部门
//部门
updateSiteSectionNamePhCount
(
currentDate
,
entity
,
phQueueEntities
);
updateSiteSectionNamePhCount
(
currentDate
,
entity
,
phQueueEntities
);
...
@@ -71,7 +72,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -71,7 +72,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
//业务
//业务
updateSiteBussinessPhCount
(
currentDate
,
entity
,
phQueueEntities
);
updateSiteBussinessPhCount
(
currentDate
,
entity
,
phQueueEntities
);
//窗口
//窗口
updateSiteWindowPhCount(currentDate, entity, phQueueEntities);
*/
updateSiteWindowPhCount
(
currentDate
,
entity
,
phQueueEntities
);
//组合条件更新
//组合条件更新
updateSiteConditionPhCount
(
entity
,
phQueueEntities
);
updateSiteConditionPhCount
(
entity
,
phQueueEntities
);
return
Rest
.
ok
();
return
Rest
.
ok
();
...
@@ -217,8 +218,9 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -217,8 +218,9 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getBusiness
()
+
"&"
+
x
.
getSectionName
()));
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getBusiness
()
+
"&"
+
x
.
getSectionName
()));
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
String
vals
=
item
.
getKey
();
String
vals
=
item
.
getKey
();
String
[]
split
=
vals
.
split
(
"&"
);
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
]))
return
null
;
String
[]
split
=
StrUtil
.
splitToArray
(
vals
,
"&"
);
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
]))
return
null
;
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
PhQueueStatQuery
phQueueStatQuery
=
getPhQueueStatQuery
(
entity
);
PhQueueStatQuery
phQueueStatQuery
=
getPhQueueStatQuery
(
entity
);
...
@@ -238,7 +240,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -238,7 +240,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getBusiness
()
+
"&"
+
x
.
getWindowFromnum
()));
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getBusiness
()
+
"&"
+
x
.
getWindowFromnum
()));
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
String
vals
=
item
.
getKey
();
String
vals
=
item
.
getKey
();
String
[]
split
=
vals
.
split
(
"&"
);
String
[]
split
=
StrUtil
.
splitToArray
(
vals
,
"&"
);
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
]))
return
null
;
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
]))
return
null
;
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
...
@@ -259,7 +261,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -259,7 +261,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getSectionName
()
+
"&"
+
x
.
getWindowFromnum
()));
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getSectionName
()
+
"&"
+
x
.
getWindowFromnum
()));
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
String
vals
=
item
.
getKey
();
String
vals
=
item
.
getKey
();
String
[]
split
=
vals
.
split
(
"&"
);
String
[]
split
=
StrUtil
.
splitToArray
(
vals
,
"&"
);
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
]))
return
null
;
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
]))
return
null
;
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
...
@@ -279,7 +281,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -279,7 +281,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getBusiness
()
+
"&"
+
x
.
getSectionName
()
+
"&"
+
x
.
getWindowFromnum
()));
.
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getBusiness
()
+
"&"
+
x
.
getSectionName
()
+
"&"
+
x
.
getWindowFromnum
()));
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
List
<
PhQueueStatEntity
>
saveAndUpdatelist
=
businessAndSectionCollect
.
entrySet
().
parallelStream
().
map
(
item
->
{
String
vals
=
item
.
getKey
();
String
vals
=
item
.
getKey
();
String
[]
split
=
vals
.
split
(
"&"
);
String
[]
split
=
StrUtil
.
splitToArray
(
vals
,
"&"
);
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
])
||
ObjectUtils
.
isEmpty
(
split
[
2
]))
if
(
ObjectUtils
.
isEmpty
(
split
[
0
])
||
ObjectUtils
.
isEmpty
(
split
[
1
])
||
ObjectUtils
.
isEmpty
(
split
[
2
]))
return
null
;
return
null
;
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
Double
intAvg
=
item
.
getValue
().
parallelStream
().
mapToInt
(
e
->
e
.
getWaitTime
()).
average
().
orElse
(
0
D
);
...
@@ -335,10 +337,6 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -335,10 +337,6 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
private
void
saveUpdatePhqueueStatList
(
List
<
PhQueueStatEntity
>
saveAndUpdatelist
)
{
private
void
saveUpdatePhqueueStatList
(
List
<
PhQueueStatEntity
>
saveAndUpdatelist
)
{
try
{
if
(!
ObjectUtils
.
isEmpty
(
saveAndUpdatelist
))
{
if
(!
ObjectUtils
.
isEmpty
(
saveAndUpdatelist
))
{
Map
<
Boolean
,
List
<
PhQueueStatEntity
>>
saveUpdateCollect
=
saveAndUpdatelist
.
parallelStream
().
collect
(
Collectors
.
partitioningBy
(
i
->
i
.
newEntity
()));
Map
<
Boolean
,
List
<
PhQueueStatEntity
>>
saveUpdateCollect
=
saveAndUpdatelist
.
parallelStream
().
collect
(
Collectors
.
partitioningBy
(
i
->
i
.
newEntity
()));
...
@@ -355,9 +353,22 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
...
@@ -355,9 +353,22 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
}
}
}
}
}
catch
(
Exception
e
)
{
}
log
.
error
(
"异常,e"
);
}
public
static
void
main
(
String
[]
args
)
{
String
str
=
"adbc&&"
;
List
<
String
>
split
=
StrUtil
.
split
(
str
,
"&"
);
String
[]
strings
=
StrUtil
.
splitToArray
(
str
,
"&"
);
System
.
out
.
println
(
split
.
get
(
0
));
System
.
out
.
println
(
split
.
get
(
1
));
System
.
out
.
println
(
strings
[
0
]);
System
.
out
.
println
(
strings
[
1
]);
System
.
out
.
println
(
strings
[
2
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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