Commit 3c341878 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
parents f0b14a47 d8349475
package com.yeejoin.amos.boot.module.jxiop.biz.emqx; package com.yeejoin.amos.boot.module.jxiop.biz.emqx;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -7,9 +8,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; ...@@ -7,9 +8,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRecordServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -45,6 +48,18 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -45,6 +48,18 @@ public class WarningRecordStatusMessage extends EmqxListener {
@Autowired @Autowired
private IdxBizPvWarningRecordServiceImpl idxBizPvWarningRecordService; private IdxBizPvWarningRecordServiceImpl idxBizPvWarningRecordService;
@Autowired
private FanWaringRecordMapper fanWaringRecordMapper;
@Autowired
private PvWaringRecordMapper pvWaringRecordMapper;
@Autowired
FanWarningRecordServiceImpl fanWarningRecordService;
@Autowired
PvWarningRecordServiceImpl pvWarningRecordService;
@PostConstruct @PostConstruct
void init() throws Exception { void init() throws Exception {
new Thread(taskRunnable).start(); new Thread(taskRunnable).start();
...@@ -96,6 +111,13 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -96,6 +111,13 @@ public class WarningRecordStatusMessage extends EmqxListener {
lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds); lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds);
idxBizFanWarningRecordService.update(lambda); idxBizFanWarningRecordService.update(lambda);
LambdaUpdateWrapper<FanWarningRecord> lambdaTd = new LambdaUpdateWrapper<>();
lambdaTd.set(FanWarningRecord::getDisposotionState, "已处置");
lambdaTd.set(FanWarningRecord::getStatus, "1");
lambdaTd.set(FanWarningRecord::getDisposotionDate, DateUtil.now());
lambdaTd.in(FanWarningRecord::getTs, traceIds);
fanWarningRecordService.update(lambdaTd);
} }
public void jxIopUpdatePv(JSONArray analysisResult) { public void jxIopUpdatePv(JSONArray analysisResult) {
...@@ -108,5 +130,14 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -108,5 +130,14 @@ public class WarningRecordStatusMessage extends EmqxListener {
lambda.set(IdxBizPvWarningRecord::getDisposotionDate, new Date()); lambda.set(IdxBizPvWarningRecord::getDisposotionDate, new Date());
lambda.in(IdxBizPvWarningRecord::getSequenceNbr, traceIds); lambda.in(IdxBizPvWarningRecord::getSequenceNbr, traceIds);
idxBizPvWarningRecordService.update(lambda); idxBizPvWarningRecordService.update(lambda);
// td
LambdaUpdateWrapper<PvWarningRecord> lambdaTd = new LambdaUpdateWrapper<>();
lambdaTd.set(PvWarningRecord::getDisposotionState, "已处置");
lambdaTd.set(PvWarningRecord::getStatus, "1");
lambdaTd.set(PvWarningRecord::getDisposotionDate, DateUtil.now());
lambdaTd.in(PvWarningRecord::getTs, traceIds);
pvWarningRecordService.update(lambdaTd);
} }
} }
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class FanWarningRecordServiceImpl extends BaseService<FanWarningRecord, FanWarningRecord, FanWaringRecordMapper> {
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class PvWarningRecordServiceImpl extends BaseService<PvWarningRecord, PvWarningRecord, PvWaringRecordMapper> {
}
package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2; package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
...@@ -11,9 +15,14 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> { ...@@ -11,9 +15,14 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
public List<Map<String,Object>> selectFanWarningNum(String station); public List<Map<String,Object>> selectFanWarningNum(String station);
public List<FanWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBSYSTEM); public List<FanWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBSYSTEM);
public List<FanWarningRecord> selectWarningPoint(String STATION,String EQUIPMENTNAME); public List<FanWarningRecord> selectWarningPoint(String STATION,String EQUIPMENTNAME);
public List<Map<String,Object>> selectEquipWarningTotal(String STATION,String EQUIPMENTNAME); public List<Map<String,Object>> selectEquipWarningTotal(String STATION,String EQUIPMENTNAME);
int saveBatchWarningRecords(@Param("list") List<FanWarningRecord> list);
} }
...@@ -3,7 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2; ...@@ -3,7 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> { public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> {
int saveBatchWarningRecords(@Param("list") List<PvWarningRecord> list);
} }
...@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdengine; ...@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdengine;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
@Data @Data
@TableName(value = "", autoResultMap = true) @TableName(value = "fan_warning_record", autoResultMap = true)
public class FanWarningRecord { public class FanWarningRecord implements Serializable {
private Long ts; private Long ts;
private String recDate; private String recDate;
private String disposotionState; private String disposotionState;
...@@ -25,4 +27,5 @@ public class FanWarningRecord { ...@@ -25,4 +27,5 @@ public class FanWarningRecord {
private String disposotionDate; private String disposotionDate;
private String kks; private String kks;
private String warningPeriod; private String warningPeriod;
private String status;
} }
...@@ -4,14 +4,15 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,14 +4,15 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Data @Data
@TableName(value = "", autoResultMap = true) @TableName(value = "pv_warning_record", autoResultMap = true)
public class PvWarningRecord { public class PvWarningRecord implements Serializable {
private Long ts; private Long ts;
private String recDate; private String recDate;
private String disposotionState; private String disposotionState;
private String healthIndexSeq; private String healthIndex;
private String analysisPointId; private String analysisPointId;
private String warningName; private String warningName;
private String arae; private String arae;
...@@ -28,4 +29,5 @@ public class PvWarningRecord { ...@@ -28,4 +29,5 @@ public class PvWarningRecord {
private String disposotionDate; private String disposotionDate;
private String kks; private String kks;
private String warningPeriod; private String warningPeriod;
private String status;
} }
...@@ -2,6 +2,60 @@ ...@@ -2,6 +2,60 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper">
<insert id="saveBatchWarningRecords">
insert
into
fan_warning_record
<!-- (ts,-->
<!-- rec_date,-->
<!-- disposotion_state,-->
<!-- health_index_seq,-->
<!-- health_index,-->
<!-- analysis_point_id,-->
<!-- warning_name,-->
<!-- arae,-->
<!-- station,-->
<!-- subarray,-->
<!-- manufacturer,-->
<!-- device_type,-->
<!-- equipment_name,-->
<!-- gateway_id,-->
<!-- index_address,-->
<!-- content,-->
<!-- point_name,-->
<!-- health_level,-->
<!-- disposotion_date,-->
<!-- kks,-->
<!-- warning_period,-->
<!-- status)-->
values
<foreach collection="list" separator="," item="item" index="index">
(#{item.ts, jdbcType=TIMESTAMP},
#{item.recDate, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
<!-- #{item.healthIndexSeq, jdbcType=VARCHAR},-->
#{item.healthIndex, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
#{item.arae, jdbcType=VARCHAR},
#{item.station, jdbcType=VARCHAR},
#{item.subSystem, jdbcType=VARCHAR},
#{item.number, jdbcType=VARCHAR},
#{item.equipmentName, jdbcType=VARCHAR},
#{item.gatewayId, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.content, jdbcType=VARCHAR},
#{item.pointName, jdbcType=VARCHAR},
#{item.healthLevel, jdbcType=VARCHAR},
#{item.disposotionDate, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR},
#{item.warningPeriod, jdbcType=VARCHAR},
#{item.status, jdbcType=VARCHAR})
</foreach>
</insert>
<select id="selectFanWarningNum" resultType="map"> <select id="selectFanWarningNum" resultType="map">
SELECT `b`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`, SELECT `b`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper">
<insert id="saveBatchWarningRecords">
insert
into
pv_warning_record
<!-- (ts,-->
<!-- rec_date,-->
<!-- disposotion_state,-->
<!-- health_index_seq,-->
<!-- health_index,-->
<!-- analysis_point_id,-->
<!-- warning_name,-->
<!-- arae,-->
<!-- station,-->
<!-- subarray,-->
<!-- manufacturer,-->
<!-- device_type,-->
<!-- equipment_name,-->
<!-- gateway_id,-->
<!-- index_address,-->
<!-- content,-->
<!-- point_name,-->
<!-- health_level,-->
<!-- disposotion_date,-->
<!-- kks,-->
<!-- warning_period,-->
<!-- status)-->
values
<foreach collection="list" separator="," item="item" index="index">
(#{item.ts, jdbcType=TIMESTAMP},
#{item.recDate, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
#{item.healthIndex, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
#{item.arae, jdbcType=VARCHAR},
#{item.station, jdbcType=VARCHAR},
#{item.subarray, jdbcType=VARCHAR},
#{item.manufacturer, jdbcType=VARCHAR},
#{item.deviceType, jdbcType=VARCHAR},
#{item.equipmentName, jdbcType=VARCHAR},
#{item.gatewayId, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.content, jdbcType=VARCHAR},
#{item.pointName, jdbcType=VARCHAR},
#{item.healthLevel, jdbcType=VARCHAR},
#{item.disposotionDate, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR},
#{item.warningPeriod, jdbcType=VARCHAR},
#{item.status, jdbcType=VARCHAR})
</foreach>
</insert>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment