Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
a64427a9
Commit
a64427a9
authored
Dec 31, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
a90ab0b5
b7a284c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
7 deletions
+58
-7
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+58
-7
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
a64427a9
...
...
@@ -9,9 +9,11 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyShift
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.runtime.directive.Break
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -111,6 +113,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Autowired
private
EmqKeeper
emqKeeper
;
@Autowired
DutyPersonShiftMapper
dutyPersonShiftMapper
;
@Value
(
"${mqtt.topic.command.power.deployment}"
)
private
String
topic
;
...
...
@@ -299,8 +304,50 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
if
(
fireCarDto
.
getId
()
!=
null
)
{
try
{
int
num
;
List
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
String
dutyDay
=
DateUtils
.
getDateNowShortStr
();
Map
<
String
,
Object
>
instanceMap
=
dutyPersonShiftMapper
.
getInstanceIdForSpecifyDateAndEquipment
(
dutyDay
,
"dutyCar"
,
fireCarDto
.
getId
());
if
(
instanceMap
!=
null
){
String
instanceId
=
instanceMap
.
get
(
"instanceIds"
).
toString
();
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
String
[]
instanceIds
=
instanceId
.
split
(
","
);
List
<
Map
<
String
,
Object
>>
dutyList
=
dutyPersonShiftMapper
.
getDutyForSpecifyDate
(
dutyDay
);
if
(
dutyList
!=
null
&&
dutyList
.
size
()>
0
)
{
for
(
Map
<
String
,
Object
>
dutyDetail
:
dutyList
)
{
if
(!
dutyDetail
.
containsKey
(
"name"
))
{
continue
;
}
// 获取当前装备ID下的排版数据
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
"dutyCar"
,
instanceIds
,
dutyDetail
.
get
(
"name"
).
toString
());
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)==
null
)
{
continue
;
}
LinkedHashMap
<
String
,
String
>
infoMap_1
=
new
LinkedHashMap
<
String
,
String
>();
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
//
if
(
specify
.
containsKey
(
"userName"
)&&
specify
.
get
(
"userName"
)!=
null
)
{
if
(
specify
.
get
(
"userName"
).
toString
().
contains
(
","
)){
String
[]
userNames
=
specify
.
get
(
"userName"
).
toString
().
split
(
","
);
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
userNames
.
length
+
""
);
}
else
{
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
"1"
);
}
resultList
.
add
(
infoMap_1
);
}
}
}
}
}
}
int
num
=
0
;
String
todayTime
=
DateUtils
.
getDateNowShortStr
();
String
beginDate
=
todayTime
;
beginDate
=
beginDate
+
" 00:00:00"
;
...
...
@@ -341,15 +388,19 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if
(
DateUtils
.
belongCalendar
(
DateUtils
.
getDateNow
(),
startDate
,
dateEnd
))
{
dutyShiftName
[
0
]
=
dutyShiftName
[
0
].
replace
(
" "
,
e
.
getName
());
}
});
List
<
Map
<
String
,
Object
>>
list
=
iDutyCarService
.
list
(
null
,
beginDate
,
endDate
);
num
=
(
int
)
list
.
stream
().
filter
(
e
->
e
.
get
(
"carId"
).
equals
(
fireCarDto
.
getId
())
&&
((
List
<
DutyPersonShiftDto
>)
e
.
get
(
"dutyShift"
)).
get
(
0
).
getShiftName
().
equals
(
dutyShiftName
[
0
])).
count
();
if
(
resultList
!=
null
){
resultList
.
forEach
(
e
->{
if
(
e
.
containsKey
(
dutyShiftName
[
0
]))
{
String
personNum
=
e
.
get
(
dutyShiftName
[
0
]);
fireCarDto
.
setPersonCount
(
Integer
.
valueOf
(
personNum
));
}
});
}
else
{
fireCarDto
.
setPersonCount
(
num
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
fireCarDtoList
.
add
(
fireCarDto
);
});
...
...
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