|
|
@@ -12,6 +12,8 @@ import com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHis
|
|
12
|
12
|
import com.chinaitop.depot.intelligent.grainsituation.service.TWarningThresholdHistoryService;
|
|
13
|
13
|
import com.chinaitop.depot.intelligent.grainsituation.service.TemperatureRecordService;
|
|
14
|
14
|
import com.chinaitop.depot.intelligent.pushs.service.GrainPushsService;
|
|
|
15
|
+import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.model.MqMsg;
|
|
|
16
|
+import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.service.RocketMqService;
|
|
15
|
17
|
import com.chinaitop.depot.intelligent.utils.JsonToObjectUtils;
|
|
16
|
18
|
import com.chinaitop.depot.intelligent.utils.UuidUtils;
|
|
17
|
19
|
import com.chinaitop.depot.intelligent.utils.VerificationSourceUtils;
|
|
|
@@ -38,27 +40,22 @@ public class GrainPushsServiceImpl implements GrainPushsService {
|
|
38
|
40
|
|
|
39
|
41
|
@Resource
|
|
40
|
42
|
private TemperatureRecordService temperatureRecordService;
|
|
41
|
|
-
|
|
42
|
43
|
@Resource
|
|
43
|
44
|
private TTestdataLayerMapper tTestdataLayerMapper;
|
|
44
|
|
-
|
|
45
|
45
|
@Resource
|
|
46
|
46
|
private WarningThresholdService warningThresholdService;
|
|
47
|
|
-
|
|
48
|
47
|
@Resource
|
|
49
|
48
|
private TWarningThresholdHistoryMapper tWarningThresholdHistoryMapper;
|
|
50
|
|
-
|
|
51
|
49
|
@Resource
|
|
52
|
50
|
private UuidUtils uuidUtils;
|
|
53
|
|
-
|
|
54
|
51
|
@Resource
|
|
55
|
52
|
private WarningMessage warningMessage;
|
|
56
|
|
-
|
|
57
|
53
|
@Resource
|
|
58
|
54
|
private ResolutionToSendAlarmService resolutionToSendAlarmService;
|
|
59
|
|
-
|
|
60
|
55
|
@Resource
|
|
61
|
56
|
private TWarningThresholdHistoryService tWarningThresholdHistoryService;
|
|
|
57
|
+ @Resource
|
|
|
58
|
+ private RocketMqService rocketMqService;
|
|
62
|
59
|
|
|
63
|
60
|
@Transactional(rollbackFor = Exception.class)
|
|
64
|
61
|
@Override
|
|
|
@@ -282,18 +279,23 @@ public class GrainPushsServiceImpl implements GrainPushsService {
|
|
282
|
279
|
|
|
283
|
280
|
if (tTestdataList.size() > 0) {
|
|
284
|
281
|
temperatureRecordService.insertBatch(tTestdataList);
|
|
|
282
|
+ // 消息 CRUD 增加(Create)、* 不需要检索(Retrieve)、更新(Update)和删除(Delete) 小写区分增删改查
|
|
|
283
|
+ rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_testdata_c", null, tTestdataList));
|
|
285
|
284
|
}
|
|
286
|
285
|
if (tTestdataLayerArrayList.size() > 0) {
|
|
287
|
286
|
tTestdataLayerMapper.insertBatch(tTestdataLayerArrayList);
|
|
|
287
|
+ rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_testdata_layer_c", null, tTestdataLayerArrayList));
|
|
288
|
288
|
}
|
|
289
|
289
|
if (tWarningThresholdHistorieList.size() > 0) {
|
|
290
|
290
|
tWarningThresholdHistoryMapper.insertBatch(tWarningThresholdHistorieList);
|
|
|
291
|
+ rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_warning_threshold_history_c", null, tWarningThresholdHistorieList));
|
|
291
|
292
|
List<TWarningThresholdHistory> collect = tWarningThresholdHistorieList.stream().filter(TWarningThresholdHistory -> TWarningThresholdHistory.getwWarning().equals("0")).collect(Collectors.toList());
|
|
292
|
293
|
boolean alarmDetails = resolutionToSendAlarmService.getAlarmDetails(collect);
|
|
293
|
294
|
if (!alarmDetails) {
|
|
294
|
295
|
collect.forEach(obj -> {
|
|
295
|
296
|
obj.setIsSend("2");
|
|
296
|
297
|
tWarningThresholdHistoryService.updateById(obj);
|
|
|
298
|
+ rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_warning_threshold_history_u", null, tWarningThresholdHistorieList));
|
|
297
|
299
|
});
|
|
298
|
300
|
}
|
|
299
|
301
|
}
|