|
|
@@ -1,9 +1,18 @@
|
|
1
|
1
|
package com.sundot.airport.ledger.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import java.util.Collections;
|
|
|
4
|
+import java.util.Date;
|
|
4
|
5
|
import java.util.List;
|
|
|
6
|
+import java.util.Map;
|
|
|
7
|
+import java.util.Objects;
|
|
|
8
|
+import java.util.stream.Collectors;
|
|
|
9
|
+
|
|
|
10
|
+import cn.hutool.core.collection.CollUtil;
|
|
5
|
11
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
12
|
+import com.google.common.collect.Lists;
|
|
|
13
|
+import com.sundot.airport.common.core.domain.entity.SysDictData;
|
|
6
|
14
|
import com.sundot.airport.common.utils.DateUtils;
|
|
|
15
|
+import com.sundot.airport.common.utils.DictUtils;
|
|
7
|
16
|
import com.sundot.airport.ledger.domain.LedgerUnsafeEvent;
|
|
8
|
17
|
import com.sundot.airport.ledger.domain.vo.CountQueryReqVO;
|
|
9
|
18
|
import com.sundot.airport.ledger.domain.vo.UnsafeItemVO;
|
|
|
@@ -11,6 +20,7 @@ import com.sundot.airport.ledger.domain.vo.UnsafePositionVO;
|
|
11
|
20
|
import com.sundot.airport.ledger.domain.vo.UnsafeTypeVO;
|
|
12
|
21
|
import com.sundot.airport.ledger.mapper.LedgerUnsafeEventMapper;
|
|
13
|
22
|
import com.sundot.airport.ledger.service.ILedgerUnsafeEventService;
|
|
|
23
|
+import com.sundot.airport.system.service.ISysDictDataService;
|
|
14
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
15
|
25
|
import org.springframework.stereotype.Service;
|
|
16
|
26
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -19,11 +29,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|
19
|
29
|
* 不安全事件记录Service实现
|
|
20
|
30
|
*/
|
|
21
|
31
|
@Service
|
|
22
|
|
-public class LedgerUnsafeEventServiceImpl extends ServiceImpl<LedgerUnsafeEventMapper, LedgerUnsafeEvent>
|
|
23
|
|
- implements ILedgerUnsafeEventService {
|
|
|
32
|
+public class LedgerUnsafeEventServiceImpl extends ServiceImpl<LedgerUnsafeEventMapper, LedgerUnsafeEvent> implements ILedgerUnsafeEventService {
|
|
24
|
33
|
|
|
25
|
34
|
@Autowired
|
|
26
|
35
|
private LedgerUnsafeEventMapper mapper;
|
|
|
36
|
+ @Autowired
|
|
|
37
|
+ private ISysDictDataService dictDataService;
|
|
27
|
38
|
|
|
28
|
39
|
@Override
|
|
29
|
40
|
public List<LedgerUnsafeEvent> selectList(LedgerUnsafeEvent query) {
|
|
|
@@ -64,7 +75,25 @@ public class LedgerUnsafeEventServiceImpl extends ServiceImpl<LedgerUnsafeEventM
|
|
64
|
75
|
*/
|
|
65
|
76
|
@Override
|
|
66
|
77
|
public List<UnsafeTypeVO> countSeizureStatsType(CountQueryReqVO countQueryReq) {
|
|
67
|
|
- return this.baseMapper.countSeizureStatsType(countQueryReq);
|
|
|
78
|
+ List<UnsafeTypeVO> unsafeTypeList = this.baseMapper.countSeizureStatsType(countQueryReq);
|
|
|
79
|
+ if (CollUtil.isEmpty(unsafeTypeList)){
|
|
|
80
|
+ return Lists.newArrayList();
|
|
|
81
|
+ }
|
|
|
82
|
+
|
|
|
83
|
+ SysDictData dictData = new SysDictData();
|
|
|
84
|
+ dictData.setDictType("sys_unsafe_type");
|
|
|
85
|
+ dictData.setStatus("0");
|
|
|
86
|
+ List<SysDictData> sysDictData = dictDataService.selectDictDataList(dictData);
|
|
|
87
|
+ Map<String, SysDictData> trendDataMap = CollUtil.emptyIfNull(sysDictData).stream().collect(Collectors.toMap(SysDictData::getDictValue, dto -> dto));
|
|
|
88
|
+
|
|
|
89
|
+ unsafeTypeList.forEach(unsafeType -> {
|
|
|
90
|
+ SysDictData dict = trendDataMap.get(unsafeType.getEventType());
|
|
|
91
|
+ if (Objects.nonNull(dict)) {
|
|
|
92
|
+ unsafeType.setEventTypeName(dict.getDictLabel());
|
|
|
93
|
+ }
|
|
|
94
|
+ });
|
|
|
95
|
+
|
|
|
96
|
+ return unsafeTypeList;
|
|
68
|
97
|
}
|
|
69
|
98
|
|
|
70
|
99
|
/**
|