Commit 988aaede authored by tangwei's avatar tangwei

解决冲突解决冲突

parents f28f7bdc 7fda4163
...@@ -15,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -15,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
...@@ -116,8 +117,21 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -116,8 +117,21 @@ public class IdxBizFanHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测风机层左侧列表", notes = "预警监测风机层左侧列表") @ApiOperation(httpMethod = "GET",value = "预警监测风机层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftList") @GetMapping(value = "/tableLeftList")
public ResponseModel<List<IdxBizFanHealthIndexDto>> queryForLeftTableList(String STATION,String HEALTHLEVEL) { public ResponseModel<Page<Map<String,Object>>> queryForLeftTableList(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,Integer current,Integer size) {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION,HEALTHLEVEL)); Page<Map<String,Object>> page = new Page<Map<String,Object>>();
page.setCurrent(current);
page.setSize(size);
int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListCount(STATION, HEALTHLEVEL, EQUIPMENTNAME);
page.setTotal(Long.valueOf(total));
page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION,HEALTHLEVEL,EQUIPMENTNAME,(current-1)*size,size));
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测风机层仪表盘", notes = "预警监测风机层仪表盘")
@GetMapping(value = "/queryForLeftTableListNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListNum(@RequestParam(required = false)String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false)String EQUIPMENTNAME) {
return ResponseHelper.buildResponse( idxBizFanHealthIndexServiceImpl.queryForLeftTableListNum(STATION, HEALTHLEVEL, EQUIPMENTNAME));
} }
......
...@@ -14,6 +14,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -14,6 +14,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -141,4 +143,44 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -141,4 +143,44 @@ public class IdxBizPvHealthIndexController extends BaseController {
page.setRecords(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION,SUBARRAY,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,(current-1)*size,size)); page.setRecords(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION,SUBARRAY,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,(current-1)*size,size));
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级仪表盘", notes = "预警监测设备级仪表盘")
@GetMapping(value = "/queryForLeftTableListByEquipNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListByEquipNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME) {
;
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquipNum(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点级仪表盘", notes = "预警监测设备级仪表盘")
@GetMapping(value = "/queryForLeftTableListByPointNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false) String POINTNAME) {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPointNum(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计", notes = "预警监测设备级统计")
@GetMapping(value = "/queryForPointNum")
public ResponseModel<List<Map<String,Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) {
List<Map<String, Object>> maps = idxBizPvHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME);
int total = idxBizPvHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME);
Map<String,Object> warningNum =new HashMap<>();
warningNum.put("name","异常");
warningNum.put("value",maps.size());
Map<String,Object> pointNum =new HashMap<>();
pointNum.put("name","正常");
pointNum.put("value",total - maps.size());
List<Map<String,Object>> list = new ArrayList<>();
list.add(pointNum);
list.add(warningNum);
return ResponseHelper.buildResponse(list);
}
} }
...@@ -46,10 +46,10 @@ public class IdxBizFanWarningRecordDto{ ...@@ -46,10 +46,10 @@ public class IdxBizFanWarningRecordDto{
private String disposotionState; private String disposotionState;
@TableField("HEALTH_INDEX_SEQ") @TableField("HEALTH_INDEX_SEQ")
private Integer healthIndexSeq; private String healthIndexSeq;
@TableField("ANALYSIS_POINT_ID") @TableField("ANALYSIS_POINT_ID")
private Integer analysisPointId; private String analysisPointId;
@ApiModelProperty(value = "预警等级") @ApiModelProperty(value = "预警等级")
@TableField("WARNING_NAME") @TableField("WARNING_NAME")
...@@ -73,7 +73,7 @@ public class IdxBizFanWarningRecordDto{ ...@@ -73,7 +73,7 @@ public class IdxBizFanWarningRecordDto{
@ApiModelProperty(value = "网关ID") @ApiModelProperty(value = "网关ID")
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Integer gatewayId; private String gatewayId;
@ApiModelProperty(value = "点表地址") @ApiModelProperty(value = "点表地址")
@TableField("INDEX_ADDRESS") @TableField("INDEX_ADDRESS")
......
...@@ -99,5 +99,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -99,5 +99,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<String> getAddressInfo(); List<String> getAddressInfo();
List<IdxBizFanHealthIndexDto> queryForLeftTableList(String STATION,String HEALTHLEVEL); List<Map<String,Object>> queryForLeftTableList(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,Integer current,Integer size);
int queryForLeftTableListCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME);
Map<String,Object> queryForLeftTableListNum(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME);
} }
...@@ -16,9 +16,19 @@ import java.util.Map; ...@@ -16,9 +16,19 @@ import java.util.Map;
public interface IdxBizPvHealthIndexMapper extends BaseMapper<IdxBizPvHealthIndex> { public interface IdxBizPvHealthIndexMapper extends BaseMapper<IdxBizPvHealthIndex> {
List<Map<String,Object>> queryForLeftTableListByEquip(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME, Integer current, Integer size); List<Map<String,Object>> queryForLeftTableListByEquip(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME, Integer current, Integer size);
Map<String,Object> queryForLeftTableListByEquipNum(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME);
Map<String,Object> queryForLeftTableListByPointNum(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME);
int queryForLeftTableListByEquipCount(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME); int queryForLeftTableListByEquipCount(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME);
List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size); List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size);
int queryForLeftTableListByPointCount(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME); int queryForLeftTableListByPointCount(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME);
List<Map<String,Object>> warningData(String STATION, String SUBARRAY, String EQUIPMENTNAME);
Integer pointNum(String STATION, String SUBARRAY, String EQUIPMENTNAME);
} }
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...@@ -965,6 +966,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -965,6 +966,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo.setSourceAttribution(stationMap.get(idxBizPvWarningRecord.getGatewayId()).getProjectOrgCode()); riskBizInfoVo.setSourceAttribution(stationMap.get(idxBizPvWarningRecord.getGatewayId()).getProjectOrgCode());
riskBizInfoVo.setSourceAttributionDesc(idxBizPvWarningRecord.getStation()); riskBizInfoVo.setSourceAttributionDesc(idxBizPvWarningRecord.getStation());
riskBizInfoVo.setWarningObjectType("equip"); riskBizInfoVo.setWarningObjectType("equip");
riskBizInfoVo.setWarningTime(DateUtil.now());
List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>(); List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>();
RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo(); RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo();
dynamicDetailsVo.setTabName("预警详情"); dynamicDetailsVo.setTabName("预警详情");
...@@ -1000,6 +1002,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1000,6 +1002,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo.setSourceAttribution(stationMap.get(idxBizFanWarningRecord.getGatewayId()).getProjectOrgCode()); riskBizInfoVo.setSourceAttribution(stationMap.get(idxBizFanWarningRecord.getGatewayId()).getProjectOrgCode());
riskBizInfoVo.setSourceAttributionDesc(idxBizFanWarningRecord.getStation()); riskBizInfoVo.setSourceAttributionDesc(idxBizFanWarningRecord.getStation());
riskBizInfoVo.setWarningObjectType("equip"); riskBizInfoVo.setWarningObjectType("equip");
riskBizInfoVo.setWarningTime(DateUtil.now());
List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>(); List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>();
RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo(); RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo();
dynamicDetailsVo.setTabName("预警详情"); dynamicDetailsVo.setTabName("预警详情");
......
...@@ -15,10 +15,11 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; ...@@ -15,10 +15,11 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/** /**
* 服务实现类 * 服务实现类
* *
...@@ -47,8 +48,16 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -47,8 +48,16 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
return this.queryForList("" , false); return this.queryForList("" , false);
} }
public List<IdxBizFanHealthIndexDto> queryForLeftTableList(String STATION,String HEALTHLEVEL){ public List<Map<String,Object>> queryForLeftTableList(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME, Integer current, Integer size){
return this.getBaseMapper().queryForLeftTableList(STATION,HEALTHLEVEL); return this.getBaseMapper().queryForLeftTableList(STATION,HEALTHLEVEL,EQUIPMENTNAME,current,size);
}
public int queryForLeftTableListCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME){
return this.getBaseMapper().queryForLeftTableListCount(STATION,HEALTHLEVEL,EQUIPMENTNAME);
}
public Map<String,Object> queryForLeftTableListNum(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME){
return this.getBaseMapper().queryForLeftTableListNum(STATION,HEALTHLEVEL,EQUIPMENTNAME);
} }
......
...@@ -37,6 +37,13 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn ...@@ -37,6 +37,13 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn
public List<Map<String,Object>> queryForLeftTableListByEquip(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME, Integer current, Integer size) { public List<Map<String,Object>> queryForLeftTableListByEquip(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME, Integer current, Integer size) {
return this.getBaseMapper().queryForLeftTableListByEquip(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME,current,size); return this.getBaseMapper().queryForLeftTableListByEquip(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME,current,size);
} }
public Map<String,Object>queryForLeftTableListByEquipNum(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME) {
return this.getBaseMapper().queryForLeftTableListByEquipNum(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME);
}
public Map<String,Object>queryForLeftTableListByPointNum(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME) {
return this.getBaseMapper().queryForLeftTableListByPointNum(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME);
}
public List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size) { public List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size) {
return this.getBaseMapper().queryForLeftTableListByPoint(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME,current,size); return this.getBaseMapper().queryForLeftTableListByPoint(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME,current,size);
...@@ -50,4 +57,13 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn ...@@ -50,4 +57,13 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn
return this.getBaseMapper().queryForLeftTableListByEquipCount(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME); return this.getBaseMapper().queryForLeftTableListByEquipCount(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME);
} }
public int pointNum(String STATION, String SUBARRAY,String EQUIPMENTNAME) {
return this.getBaseMapper().pointNum(STATION, SUBARRAY,EQUIPMENTNAME);
}
public List<Map<String,Object>> warningData(String STATION, String SUBARRAY , String EQUIPMENTNAME) {
return this.getBaseMapper().warningData(STATION, SUBARRAY, EQUIPMENTNAME);
}
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND DATE_FORMAT( a.disposotionState, '%Y-%m-%d' ) = CURRENT_DATE)) ((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND DATE_FORMAT( a.disposotionDate, '%Y-%m-%d' ) = CURRENT_DATE)) ((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
b.HEALTH_INDEX as value, b.HEALTH_INDEX as value,
b.HEALTH_LEVEL, b.HEALTH_LEVEL,
CONCAT( '子阵 ', b.SUBARRAY ) AS 子阵, CONCAT( '子阵 ', b.SUBARRAY ) AS 子阵,
( CASE b.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS STATUS, ( CASE b.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
b.REC_DATE, b.REC_DATE,
b.SUBARRAY b.SUBARRAY
FROM FROM
...@@ -23,20 +23,43 @@ ...@@ -23,20 +23,43 @@
b.ANALYSIS_TYPE = '按天' b.ANALYSIS_TYPE = '按天'
<if test="SUBARRAY != '' and SUBARRAY != null"> <if test="SUBARRAY != '' and SUBARRAY != null">
AND b.SUBARRAY = #{SUBARRAY} AND b.SUBARRAY = #{SUBARRAY}
</if> </if>
<if test="STATION != '' and STATION != null"> <if test="STATION != '' and STATION != null">
AND b.STATION = #{STATION} AND b.STATION = #{STATION}
</if> </if>
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null"> <if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENT_NAME} AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if> </if>
<if test="HEALTHLEVEL != '' and HEALTHLEVEL != null"> <if test="HEALTHLEVEL != '' and HEALTHLEVEL != null">
AND b.HEALTH_LEVEL = #{HEALTHLEVEL} AND b.HEALTH_LEVEL = #{HEALTHLEVEL}
</if> </if>
order by b.HEALTH_INDEX DESC
limit ${current},${size} limit ${current},${size}
</select> </select>
<select id="queryForLeftTableListByEquipNum"
resultType="map">
SELECT
b.HEALTH_INDEX as value
FROM
`idx_biz_pv_health_index` b
WHERE
DATE_FORMAT(b.REC_DATE,"%Y-%m-%d") = DATE_FORMAT(NOW(),"%Y-%m-%d") AND b.ANALYSIS_OBJ_TYPE = '设备' AND
b.ANALYSIS_TYPE = '按天'
<if test="SUBARRAY != '' and SUBARRAY != null">
AND b.SUBARRAY = #{SUBARRAY}
</if>
<if test="STATION != '' and STATION != null">
AND b.STATION = #{STATION}
</if>
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if test="HEALTHLEVEL != '' and HEALTHLEVEL != null">
AND b.HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
</select>
<select id="queryForLeftTableListByEquipCount" <select id="queryForLeftTableListByEquipCount"
resultType="int"> resultType="int">
SELECT SELECT
...@@ -58,7 +81,7 @@ ...@@ -58,7 +81,7 @@
AND b.HEALTH_LEVEL = #{HEALTHLEVEL} AND b.HEALTH_LEVEL = #{HEALTHLEVEL}
</if> </if>
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null"> <if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENT_NAME} AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if> </if>
</select> </select>
...@@ -76,6 +99,7 @@ ...@@ -76,6 +99,7 @@
HEALTH_INDEX, HEALTH_INDEX,
HEALTH_INDEX as value, HEALTH_INDEX as value,
HEALTH_LEVEL, HEALTH_LEVEL,
( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
SUBARRAY, SUBARRAY,
REC_DATE, REC_DATE,
EQUIPMENT_NAME, EQUIPMENT_NAME,
...@@ -110,13 +134,15 @@ ...@@ -110,13 +134,15 @@
AND b.POINT_NAME = #{POINTNAME} AND b.POINT_NAME = #{POINTNAME}
</if> </if>
</where> </where>
order by b.HEALTH_INDEX DESC
limit ${current},${size} limit ${current},${size}
</select> </select>
<select id="queryForLeftTableListByPointCount" <select id="queryForLeftTableListByPointCount"
resultType="int"> resultType="int">
SELECT SELECT
COUNT(b.*) as value COUNT(1) as value
FROM FROM
( (
SELECT SELECT
...@@ -161,4 +187,99 @@ ...@@ -161,4 +187,99 @@
</where> </where>
</select> </select>
<select id="queryForLeftTableListByPointNum"
resultType="map">
SELECT
HEALTH_INDEX as value
FROM
(
SELECT
POINT_NAME ,
STATION,
HEALTH_INDEX,
HEALTH_INDEX as value,
HEALTH_LEVEL,
SUBARRAY,
REC_DATE,
EQUIPMENT_NAME,
INDEX_ADDRESS,
ANALYSIS_OBJ_SEQ,
ANALYSIS_TYPE
FROM
`idx_biz_pv_health_index`
WHERE
ANALYSIS_OBJ_TYPE = '测点'
AND ( ANALYSIS_TYPE = '按小时' AND REC_DATE >= DATE_SUB( NOW( ), INTERVAL 1 HOUR ) )
OR ( REC_DATE >= CURRENT_DATE ( ) AND ANALYSIS_TYPE = '按天' )
OR ( ANALYSIS_TYPE = '按时刻' AND REC_DATE >= DATE_SUB( NOW( ), INTERVAL 10 MINUTE ) )
) b
INNER JOIN idx_biz_pv_warning_rule_set rule ON rule.ANALYSIS_POINT_ID = b.ANALYSIS_OBJ_SEQ
AND rule.WARNING_NAME = '注意'
AND rule.ANALYSIS_TYPE = b.ANALYSIS_TYPE
<where>
<if test="STATION != null and STATION != '' ">
b.STATION = #{STATION}
</if>
<if test="EQUIPMENTNAME != null and EQUIPMENTNAME != '' ">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if test="SUBARRAY != null and SUBARRAY != '' ">
AND b.SUBARRAY = #{SUBARRAY}
</if>
<if test="HEALTHLEVEL != null and HEALTHLEVEL != '' ">
AND b.HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
<if test="POINTNAME != null and POINTNAME != '' ">
AND b.INDEX_ADDRESS = #{POINTNAME}
</if>
</where>
</select>
<select id="warningData" resultType="map">
SELECT * FROM (SELECT
cl. STATION,
cl. SUBARRAY,
cl.EQUIPMENT_NAME
FROM
idx_biz_pv_point_process_variable_classification cl
INNER JOIN idx_biz_pv_warning_record re ON re.EQUIPMENT_NAME = cl.EQUIPMENT_NAME AND re.STATION = cl.STATION AND re.SUBARRAY = cl.SUBARRAY
AND re.`STATUS` = 0
WHERE
cl.TAG_CODE = '分析变量'
GROUP BY cl.EQUIPMENT_NAME) a
<where>
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND a.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if test="SUBARRAY != null and SUBARRAY != '' ">
AND a.SUBARRAY = #{SUBARRAY}
</if>
<if test="STATION != null and STATION != '' ">
AND a.STATION = #{STATION}
</if>
</where>
</select>
<select id="pointNum" resultType="int">
SELECT
count(1)
FROM
idx_biz_pv_point_process_variable_classification cl
WHERE
cl.TAG_CODE = '分析变量'
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND cl.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if test="SUBARRAY != null and SUBARRAY != '' ">
AND cl.SUBARRAY = #{SUBARRAY}
</if>
<if test="STATION != null and STATION != '' ">
AND cl.STATION = #{STATION}
</if>
</select>
</mapper> </mapper>
...@@ -72,16 +72,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio ...@@ -72,16 +72,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
} }
/**
* 列表查询 示例
*/
public List<StationBasicDto> queryForStationBasicList() {
return this.queryForList("", false);
}
private CompanyModel addCompanyModel(CompanyModel companyModel) { private CompanyModel addCompanyModel(CompanyModel companyModel) {
FeignClientResult<CompanyModel> Model = Privilege.companyClient.create(companyModel); FeignClientResult<CompanyModel> Model = Privilege.companyClient.create(companyModel);
CompanyModel user = new CompanyModel(); CompanyModel user = new CompanyModel();
......
package com.yeejoin.amos.boot.module.jxiop.biz.tasks;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationDataTaskImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @description: 定时获取场站最新数据
* @author: tw
* @createDate: 2023/7/3
*/
@Component
@EnableScheduling
public class StationDataTask {
@Autowired
StationDataTaskImpl stationDataTask;
//定时获取场站指标最新数据
// @Scheduled(cron = "${station.task.cron}")
// public void getStationDataTask(){
// //获取所有场站信息
// List<StationTaksDto> list=stationDataTask.getListStationBasic();
// for (StationTaksDto stationTaksDto : list) {
// //获取分机
// List<DeviceDto> listDeviceDto= stationDataTask.getListDevice(stationTaksDto);
// if(listDeviceDto!=null&&listDeviceDto.size()>0){
// for (DeviceDto deviceDto : listDeviceDto) {
// List<IndexDto> listIndexDto = stationDataTask.getIndexDto(deviceDto);
// }
// }
// }
// }
}
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
IFNULL(SCCJ, '') as source, IFNULL(SCCJ, '') as source,
'' as stationName, '' as stationName,
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor, IFNULL(QRCODE_COLOR, 'green') as qrCodeColor,
IFNULL(UPDATE_TIME, '') AS recDate IFNULL(UPDATE_STAMP, '') AS recDate
FROM FROM
sjgl_zsj_zsbtz sjgl_zsj_zsbtz
where SBBM = #{objectId} where SBBM = #{objectId}
......
package com.yeejoin.amos.boot.module.jxiop.api.mapper4;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipmentSpecificIndex;
public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecificIndex>{
}
package com.yeejoin.amos.boot.module.jxiop.biz.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.github.pagehelper.PageInterceptor;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Properties;
@Configuration
@MapperScan(basePackages = "com.yeejoin.amos.boot.module.jxiop.api.mapper4", sqlSessionFactoryRef = "forthSqlSessionFactory")
public class ForthDbConfig {
private Logger logger = LoggerFactory.getLogger(ForthDbConfig.class);
// 精确到 master 目录,以便跟其他数据源隔离
private static final String MAPPER_LOCATION = "classpath*:mapper/forth/*.xml";
@Value("${spring.db4.datasource.url}")
private String dbUrl;
@Value("${spring.db4.datasource.username}")
private String username;
@Value("${spring.db4.datasource.password}")
private String password;
@Value("${spring.db4.datasource.driver-class-name}")
private String driverClassName;
@Bean(name="forthDataSource") //声明其为Bean实例
public DataSource masterDataSource() {
DruidDataSource datasource = new DruidDataSource();
datasource.setUrl(this.dbUrl);
datasource.setUsername(username);
datasource.setPassword(password);
datasource.setDriverClassName(driverClassName);
return datasource;
}
@Bean(name = "forthTransactionManager")
public DataSourceTransactionManager masterTransactionManager() {
return new DataSourceTransactionManager(masterDataSource());
}
@Bean(name = "forthSqlSessionFactory")
public SqlSessionFactory masterSqlSessionFactory(@Qualifier("forthDataSource") DataSource masterDataSource)
throws Exception {
final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
sessionFactory.setDataSource(masterDataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(ForthDbConfig.MAPPER_LOCATION));
sessionFactory.setTypeAliasesPackage("com.yeejoin.amos.boot.module.jxiop.api.entity");
//mybatis 数据库字段与实体类属性驼峰映射配置
sessionFactory.getObject().getConfiguration().setMapUnderscoreToCamelCase(true);
//分页插件
Interceptor interceptor = new PageInterceptor();
Properties properties = new Properties();
properties.setProperty("helperDialect", "mysql");
properties.setProperty("offsetAsPageNum", "true");
properties.setProperty("rowBoundsWithCount", "true");
properties.setProperty("reasonable", "true");
properties.setProperty("supportMethodsArguments","true");
properties.setProperty("params","pageNum=pageNum;pageSize=pageSize" +
"" +
";");
interceptor.setProperties(properties);
sessionFactory.setPlugins(new Interceptor[] {interceptor});
return sessionFactory.getObject();
}
}
...@@ -222,24 +222,24 @@ public class DemoController extends BaseController { ...@@ -222,24 +222,24 @@ public class DemoController extends BaseController {
equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> { equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> {
ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get(); ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get();
esEquipments.setEquipmentIndexName(equipmentsJxiopDocMysql.getEquipmentIndexName()); esEquipments.setEquipmentIndexName(equipmentsJxiopDocMysql.getEquipmentIndexName());
esEquipments.setEquipmentNumber(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getEquipmentNumber())?"":equipmentsJxiopDocMysql.getEquipmentNumber()); esEquipments.setEquipmentNumber(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getEquipmentNumber()) ? "" : equipmentsJxiopDocMysql.getEquipmentNumber());
esEquipments.setIsAlarm(equipmentsJxiopDocMysql.getIsAlarm()); esEquipments.setIsAlarm(equipmentsJxiopDocMysql.getIsAlarm());
esEquipments.setDataType(equipmentsJxiopDocMysql.getDataType()); esEquipments.setDataType(equipmentsJxiopDocMysql.getDataType());
esEquipments.setGatewayId(equipmentsJxiopDocMysql.getGatewayId()); esEquipments.setGatewayId(equipmentsJxiopDocMysql.getGatewayId());
esEquipments.setAddress(equipmentsJxiopDocMysql.getAddress()); esEquipments.setAddress(equipmentsJxiopDocMysql.getAddress());
esEquipments.setEquipmentSpecificName(equipmentsJxiopDocMysql.getEquipmentSpecificName()); esEquipments.setEquipmentSpecificName(equipmentsJxiopDocMysql.getEquipmentSpecificName());
//更新显示名称 //更新显示名称
esEquipments.setDisplayName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getDisplayName())?"":equipmentsJxiopDocMysql.getDisplayName()); esEquipments.setDisplayName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getDisplayName()) ? "" : equipmentsJxiopDocMysql.getDisplayName());
//更新排序号 //更新排序号
esEquipments.setTraceId(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getTraceId())?"":equipmentsJxiopDocMysql.getTraceId()); esEquipments.setTraceId(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getTraceId()) ? "" : equipmentsJxiopDocMysql.getTraceId());
//更新单位 //更新单位
esEquipments.setUnit(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getUnit())?"":equipmentsJxiopDocMysql.getUnit()); esEquipments.setUnit(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getUnit()) ? "" : equipmentsJxiopDocMysql.getUnit());
//更新frontModule //更新frontModule
esEquipments.setFrontModule(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getFrontModule())?"":equipmentsJxiopDocMysql.getFrontModule()); esEquipments.setFrontModule(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getFrontModule()) ? "" : equipmentsJxiopDocMysql.getFrontModule());
//更新systemType //更新systemType
esEquipments.setSystemType(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getSystemType())?"":equipmentsJxiopDocMysql.getSystemType()); esEquipments.setSystemType(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getSystemType()) ? "" : equipmentsJxiopDocMysql.getSystemType());
//更新图片名称 //更新图片名称
esEquipments.setPictureName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getPictureName())?"":equipmentsJxiopDocMysql.getPictureName()); esEquipments.setPictureName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getPictureName()) ? "" : equipmentsJxiopDocMysql.getPictureName());
equipmentsRepository.save(esEquipments); equipmentsRepository.save(esEquipments);
}); });
...@@ -254,16 +254,20 @@ public class DemoController extends BaseController { ...@@ -254,16 +254,20 @@ public class DemoController extends BaseController {
List<Object> pointImportDtoList = EasyExcel.read(inputStream).head(PointImportDto.class).sheet(0).headRowNumber(1).doReadSync(); List<Object> pointImportDtoList = EasyExcel.read(inputStream).head(PointImportDto.class).sheet(0).headRowNumber(1).doReadSync();
pointImportDtoList.forEach(o -> { pointImportDtoList.forEach(o -> {
PointImportDto pointImportDto = (PointImportDto) o; PointImportDto pointImportDto = (PointImportDto) o;
List<EquipmentsJxiopDocMysql> equipmentsJxiopDocMysqlList = equipmentsJxiopDocMysqlMapper.selectList(new QueryWrapper<EquipmentsJxiopDocMysql>().eq("gateway_id", pointImportDto.getGatewayId()).eq("equipment_index_name",pointImportDto.getEquipmentIndexName())); List<EquipmentsJxiopDocMysql> equipmentsJxiopDocMysqlList = equipmentsJxiopDocMysqlMapper.selectList(new QueryWrapper<EquipmentsJxiopDocMysql>().eq("gateway_id", pointImportDto.getGatewayId()).eq("equipment_index_name", pointImportDto.getEquipmentIndexName()));
if(!ObjectUtils.isEmpty(equipmentsJxiopDocMysqlList)){ if (!ObjectUtils.isEmpty(equipmentsJxiopDocMysqlList)) {
equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> { equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> {
ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get(); ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get();
//更新模块 //更新模块
equipmentsJxiopDocMysql.setFrontModule(pointImportDto.getFrontModule()); if (equipmentsJxiopDocMysql.getFrontModule().contains(pointImportDto.getFrontModule())) {
esEquipments.setFrontModule(pointImportDto.getFrontModule()); equipmentsJxiopDocMysql.setFrontModule(equipmentsJxiopDocMysql.getFrontModule() + "," + pointImportDto.getFrontModule());
esEquipments.setFrontModule(equipmentsJxiopDocMysql.getFrontModule() + "," + pointImportDto.getFrontModule());
}
//更新类型 //更新类型
equipmentsJxiopDocMysql.setSystemType(pointImportDto.getSystemType()); if (equipmentsJxiopDocMysql.getSystemType().contains(pointImportDto.getSystemType())) {
esEquipments.setSystemType(pointImportDto.getSystemType()); equipmentsJxiopDocMysql.setSystemType(equipmentsJxiopDocMysql.getSystemType()+","+pointImportDto.getSystemType());
esEquipments.setSystemType(equipmentsJxiopDocMysql.getSystemType()+","+pointImportDto.getSystemType());
}
//更新排序号 //更新排序号
equipmentsJxiopDocMysql.setTraceId(pointImportDto.getTraceId()); equipmentsJxiopDocMysql.setTraceId(pointImportDto.getTraceId());
esEquipments.setTraceId(pointImportDto.getTraceId()); esEquipments.setTraceId(pointImportDto.getTraceId());
...@@ -271,7 +275,7 @@ public class DemoController extends BaseController { ...@@ -271,7 +275,7 @@ public class DemoController extends BaseController {
equipmentsJxiopDocMysql.setDisplayName(pointImportDto.getDisplayName()); equipmentsJxiopDocMysql.setDisplayName(pointImportDto.getDisplayName());
esEquipments.setDisplayName(pointImportDto.getDisplayName()); esEquipments.setDisplayName(pointImportDto.getDisplayName());
//更新单位 如果单位为空或者单位超过周期性数据存储长度则丢弃单位更新操作 //更新单位 如果单位为空或者单位超过周期性数据存储长度则丢弃单位更新操作
if(!ObjectUtils.isEmpty(pointImportDto.getUnit())&&(pointImportDto.getUnit().toCharArray().length<24)){ if (!ObjectUtils.isEmpty(pointImportDto.getUnit()) && (pointImportDto.getUnit().toCharArray().length < 24)) {
equipmentsJxiopDocMysql.setUnit(pointImportDto.getUnit()); equipmentsJxiopDocMysql.setUnit(pointImportDto.getUnit());
esEquipments.setUnit(pointImportDto.getUnit()); esEquipments.setUnit(pointImportDto.getUnit());
} }
......
...@@ -403,7 +403,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -403,7 +403,7 @@ public class MonitorFanIdxController extends BaseController {
result.setCurrent(1); result.setCurrent(1);
result.setTotal(statusMonitoring.size()); result.setTotal(statusMonitoring.size());
try { try {
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, frontModule, stringStringEntry.getKey()), JSON.toJSONString(result).getBytes(), 0, false); emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, frontModule, stringStringEntry.getKey()), JSON.toJSONString(result).getBytes(), 1, true);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
@TableName("wl_equipment_specific_index")
public class EquipmentSpecificIndex {
@TableField("id")
private Long id;
@TableField("equipment_specific_id")
private Long address;
@TableField("value")
private String value;
@TableField("create_date")
private Date createDate;
@TableField("equipment_index_id")
private Long equipmentIndexId;
@TableField("update_date")
private Date updateDate;
@TableField("equipment_specific_name")
private String equipmentSpecificName;
@TableField("equipment_index_name")
private String equipmentIndexName;
@TableField("equipment_index_key")
private String equipmentIndexKey;
@TableField("value_label")
private String valueLabel;
@TableField("value_enum")
private String valueEnum;
@TableField("emergency_level_color")
private String emergencyLevelColor;
@TableField("is_alarm")
private boolean isAlarm;
@TableField("emergency_level")
private String emergencyLevel;
@TableField("emergency_level_describe")
private String emergencyLevelDescribe;
@TableField("trace_id")
private String traceId;
@TableField("index_address")
private String indexAddress;
@TableField("station")
private String station;
@TableField("quality")
private boolean quality;
@TableField("data_type")
private String dataType;
@TableField("time_stamp")
private String timeStamp;
@TableField("gateway_id")
private String gatewayId;
@TableField("unit")
private String unit;
}
...@@ -12,6 +12,13 @@ spring.db2.datasource.username=root ...@@ -12,6 +12,13 @@ spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin@2020 spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
## db4-equip
spring.db4.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db4.datasource.url=jdbc:mysql://139.9.173.44:3306/equipment?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db4.datasource.username=root
spring.db4.datasource.password=Yeejoin@2020
spring.db4.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
## db3-td-engine ## db3-td-engine
#spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource #spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.url=jdbc:TAOS-RS://139.9.170.47:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true spring.db3.datasource.url=jdbc:TAOS-RS://139.9.170.47:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
......
<?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">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipmentSpecificIndexMapper">
</mapper>
...@@ -110,6 +110,10 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent ...@@ -110,6 +110,10 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
} }
String valueEnum = equipmentSpecificIndex.getValueEnum(); String valueEnum = equipmentSpecificIndex.getValueEnum();
JSONArray arr = JSONObject.parseArray(valueEnum); JSONArray arr = JSONObject.parseArray(valueEnum);
if(arr==null)
{
continue;
}
for (Object o : arr) { for (Object o : arr) {
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(o)); JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(o));
if (json.containsKey("key") && value.equals(json.get("key"))) { if (json.containsKey("key") && value.equals(json.get("key"))) {
......
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