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
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<select id="getHealthScoreInfo" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfo" resultType="java.math.BigDecimal">
SELECT SELECT
round(avg( a.avgHealthIndex ), 2) AS healthIndex CEILING(avg( a.avgHealthIndex )) AS healthIndex
FROM FROM
( (
SELECT SELECT
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal">
SELECT SELECT
round(IFNULL( HEALTH_INDEX , 100 ), 2) AS healthIndex CEILING(IFNULL( HEALTH_INDEX , 100 )) AS healthIndex
FROM FROM
${tableName} ${tableName}
<where> <where>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<select id="getHealthListInfo" resultType="java.util.Map"> <select id="getHealthListInfo" resultType="java.util.Map">
SELECT SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex, CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
DATE_ADD( a.date, INTERVAL - 1 DAY ) as date DATE_ADD( a.date, INTERVAL - 1 DAY ) as date
FROM FROM
( (
...@@ -141,7 +141,8 @@ ...@@ -141,7 +141,8 @@
count(1) as num count(1) as num
FROM FROM
${tableName} a ${tableName} a
where a.DISPOSOTION_STATE == '未处置' where (a.DISPOSOTION_STATE = '未处置')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )
group by ARAE, group by ARAE,
WARNING_NAME WARNING_NAME
</select> </select>
...@@ -190,11 +191,16 @@ ...@@ -190,11 +191,16 @@
STATION AS station, STATION AS station,
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record wr WHERE wr.DISPOSOTION_STATE = '未处置' AND wr.STATION = STATION ) AS allNum ( SELECT count( 1 ) FROM idx_biz_fan_warning_record wr WHERE
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.STATION = STATION
) AS allNum
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
WHERE WHERE
DISPOSOTION_STATE = '未处置' ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
GROUP BY GROUP BY
STATION, STATION,
WARNING_NAME UNION ALL WARNING_NAME UNION ALL
...@@ -202,11 +208,16 @@ ...@@ -202,11 +208,16 @@
STATION AS station, STATION AS station,
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record wr WHERE wr.DISPOSOTION_STATE = '未处置' AND wr.STATION = STATION ) AS allNum ( SELECT count( 1 ) FROM idx_biz_pv_warning_record wr WHERE
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.STATION = STATION
) AS allNum
FROM FROM
idx_biz_pv_warning_record idx_biz_pv_warning_record
WHERE WHERE
DISPOSOTION_STATE = '未处置' ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
GROUP BY GROUP BY
STATION, STATION,
WARNING_NAME WARNING_NAME
...@@ -271,8 +282,10 @@ ...@@ -271,8 +282,10 @@
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
GATEWAY_ID = #{stationCode} and GATEWAY_ID = #{stationCode}
</if> </if>
</where> </where>
UNION ALL UNION ALL
...@@ -281,8 +294,10 @@ ...@@ -281,8 +294,10 @@
FROM FROM
idx_biz_pv_warning_record idx_biz_pv_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
GATEWAY_ID = #{stationCode} and GATEWAY_ID = #{stationCode}
</if> </if>
</where> </where>
) a ) a
...@@ -307,7 +322,8 @@ ...@@ -307,7 +322,8 @@
FROM FROM
${tableName} a ${tableName} a
<where> <where>
a.DISPOSOTION_STATE = '未处置' ((a.DISPOSOTION_STATE = '未处置')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and a.ARAE like concat('%', #{areaCode}, '%') and a.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -330,7 +346,9 @@ ...@@ -330,7 +346,9 @@
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record ( SELECT count( 1 ) FROM idx_biz_pv_warning_record
<where> <where>
DISPOSOTION_STATE = '未处置' AND wr.POINT_NAME = POINT_NAME ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%') and ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -340,7 +358,8 @@ ...@@ -340,7 +358,8 @@
FROM FROM
idx_biz_pv_warning_record wr idx_biz_pv_warning_record wr
<where> <where>
wr.DISPOSOTION_STATE = '未处置' ((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%') and wr.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -354,7 +373,9 @@ ...@@ -354,7 +373,9 @@
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record ( SELECT count( 1 ) FROM idx_biz_fan_warning_record
<where> <where>
DISPOSOTION_STATE = '未处置' AND wr.POINT_NAME = POINT_NAME ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%') and ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -364,7 +385,8 @@ ...@@ -364,7 +385,8 @@
FROM FROM
idx_biz_fan_warning_record wr idx_biz_fan_warning_record wr
<where> <where>
wr.DISPOSOTION_STATE = '未处置' ((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%') and wr.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -854,7 +876,7 @@ ...@@ -854,7 +876,7 @@
select index_address from wl_equipment_specific_index where gateway_id = '1668801435891929089' and data_type = 'analog' limit 100 select index_address from wl_equipment_specific_index where gateway_id = '1668801435891929089' and data_type = 'analog' limit 100
</select> </select>
<select id="queryForLeftTableList" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanHealthIndexDto"> <select id="queryForLeftTableList" resultType="map">
SELECT SELECT
b.*, b.*,
IFNULL( ibfhi.HEALTH_INDEX, 100 ) as HEALTH_INDEX , IFNULL( ibfhi.HEALTH_INDEX, 100 ) as HEALTH_INDEX ,
...@@ -887,9 +909,77 @@ ...@@ -887,9 +909,77 @@
<if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null"> <if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null">
AND HEALTH_LEVEL = #{HEALTHLEVEL} AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if> </if>
<if test="EQUIPMENTNAME != '' AND EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where> </where>
order by HEALTH_INDEX DESC
limit ${current},${size}
</select> </select>
<select id="queryForLeftTableListCount" resultType="int">
SELECT
count(1)
FROM
(
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
`idx_biz_fan_point_process_variable_classification`
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND DATE_FORMAT(ibfhi.REC_DATE,"%Y-%m-%d") = DATE_FORMAT(NOW(),"%Y-%m-%d")
<where>
<if test="STATION != '' AND STATION != null">
b.STATION = #{STATION}
</if>
<if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null">
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
<if test="EQUIPMENTNAME != '' AND EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
</select>
<select id="queryForLeftTableListNum" resultType="map">
SELECT
ibfhi.HEALTH_INDEX as value
FROM
(
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
`idx_biz_fan_point_process_variable_classification`
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND DATE_FORMAT(ibfhi.REC_DATE,"%Y-%m-%d") = DATE_FORMAT(NOW(),"%Y-%m-%d")
<where>
<if test="STATION != '' AND STATION != null">
b.STATION = #{STATION}
</if>
<if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null">
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
<if test="EQUIPMENTNAME != '' AND EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -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;
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import java.io.File;
import cn.hutool.core.date.DateUtil; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.Collator;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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;
...@@ -10,10 +47,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -10,10 +47,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.AlarmDesc; import com.yeejoin.amos.boot.module.jxiop.api.Enum.AlarmDesc;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.ElectricQuantity;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.KGName; import com.yeejoin.amos.boot.module.jxiop.api.Enum.KGName;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
...@@ -22,39 +58,37 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; ...@@ -22,39 +58,37 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper4.EquipmentSpecificIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments; import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans; import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.*; import com.yeejoin.amos.boot.module.jxiop.biz.dto.AlarmEventDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.*; import com.yeejoin.amos.boot.module.jxiop.biz.dto.ColModel;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*; import com.yeejoin.amos.boot.module.jxiop.biz.dto.DataGridMock;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.dto.ESEquipmentsDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SystemEnumDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.AlarmEvent;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipmentSpecificIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SystemEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TemporaryData;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.AlarmEventMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipAlarmEventMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SwitchPictureMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SystemEnumMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper;
//import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils; //import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IMonitorFanIndicator; import com.yeejoin.amos.boot.module.jxiop.biz.service.IMonitorFanIndicator;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.robot.BadRequest; import com.yeejoin.amos.component.robot.BadRequest;
import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.expression.DoubleValue;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.ws.rs.HEAD; import cn.hutool.core.bean.BeanUtil;
import java.io.File; import cn.hutool.core.date.DateUtil;
import java.io.IOException; import lombok.extern.slf4j.Slf4j;
import java.nio.charset.StandardCharsets;
import java.text.Collator;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
/** /**
...@@ -116,6 +150,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -116,6 +150,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private List<Map> list; private List<Map> list;
@Autowired
private EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private static Map<String, EquipmentSpecificIndex> map;
@Override @Override
public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) { public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) {
...@@ -215,8 +254,24 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -215,8 +254,24 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
likeMap.put("systemType", systemType); likeMap.put("systemType", systemType);
} }
List<ESEquipments> result = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap); List<ESEquipments> result = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap);
List<String> powerOther = Arrays.asList("月发电量", "年发电量", "总发电量");
if (!stationBasic.getStationType().equals("FDZ")) {
result.forEach(esEquipments -> {
if (esEquipments.getEquipmentIndexName().equals("日发电量")) {
esEquipments.setValueF(Float.valueOf(String.format(CommonConstans.Fourdecimalplaces, esEquipments.getValueF() * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)));
}
if (powerOther.contains(esEquipments.getEquipmentIndexName())) {
esEquipments.setValueF(Float.valueOf(String.format(CommonConstans.Fourdecimalplaces, esEquipments.getValueF() * CommonConstans.pvGenPoweActorCurrentData)));
}
});
}
result.stream().forEach(e -> { result.stream().forEach(e -> {
if(powerOther.contains(e.getEquipmentIndexName())||e.getEquipmentIndexName().equals("日发电量")){
e.setValue(String.format(CommonConstans.Fourdecimalplaces, e.getValueF()));
}else{
e.setValue(String.format(CommonConstans.Twodecimalplaces, e.getValueF())); e.setValue(String.format(CommonConstans.Twodecimalplaces, e.getValueF()));
}
}); });
Collator instance = Collator.getInstance(Locale.CHINA); Collator instance = Collator.getInstance(Locale.CHINA);
Integer traceIdCount = result.stream().filter(esEquipments -> !StringUtils.isEmpty(esEquipments.getTraceId())).collect(Collectors.toList()).size(); Integer traceIdCount = result.stream().filter(esEquipments -> !StringUtils.isEmpty(esEquipments.getTraceId())).collect(Collectors.toList()).size();
...@@ -232,17 +287,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -232,17 +287,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
.skip((long) (current - 1) * size) .skip((long) (current - 1) * size)
.limit(size) .limit(size)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<String> powerOther = Arrays.asList("月发电量", "年发电量", "总发电量");
if (!stationBasic.getStationType().equals("FDZ")) {
collect.forEach(esEquipments -> {
if (esEquipments.getEquipmentIndexName().equals("日发电量")) {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
}
if (powerOther.contains(esEquipments.getEquipmentIndexName())) {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActorCurrentData));
}
});
}
page.setTotal(result.size()); page.setTotal(result.size());
page.setRecords(collect); page.setRecords(collect);
return page; return page;
...@@ -296,15 +341,103 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -296,15 +341,103 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public List<ESEquipmentsDTO> getFanStatusList(String stationId) { public List<ESEquipmentsDTO> getFanStatusList(String stationId) {
StationBasic stationBasic = getOneByStationNumber(stationId); StationBasic stationBasic = getOneByStationNumber(stationId);
if(stationBasic.getStationName().contains("GFDZ"))
{
return new ArrayList<ESEquipmentsDTO>();
}
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("发电状态", "报警状态", "停机状态", "故障状态", "待机状态", "维护状态", "正常发电状态", "实时故障22")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName,
Arrays.asList("风机状态", "有功功率", "发电状态", "报警状态", "停机状态", "故障状态", "待机状态", "维护状态", "发电机转速", "正常发电状态"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
Map<String, List<String>> queryCondtion1 = new HashMap<>(); Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("报警状态")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("风机状态"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
List<ESEquipments> equipNumList = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class); List<ESEquipments> equipNumList = commonServiceImpl.getListDataByCondtions(queryCondtion1, null,
Map<String, String> collect = CollectionUtils.isEmpty(result) ? new HashMap<String, String>() : result.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getEquipmentIndexName, (item1, item2) -> item1)); ESEquipments.class);
Map<String, String> likeMap = new HashMap<String, String>();
queryCondtion.remove(CommonConstans.QueryStringEquipmentIndexName);
likeMap.put(CommonConstans.QueryStringEquipmentIndexName, "实时故障");
List<ESEquipments> resultWarn = commonServiceImpl.getListDataByCondtions(queryCondtion, null,
ESEquipments.class, likeMap);
result.addAll(resultWarn);
// list测点转风机map并且计算风机状态
Map<String, List<ESEquipments>> listMap = result.stream()
.collect(Collectors.groupingBy(po -> po.getEquipmentNumber()));
Map<String, String> equipMap = new HashMap<>();
for (Entry<String, List<ESEquipments>> entry : listMap.entrySet()) {
equipMap.put(entry.getKey(), "正常运行");
if (entry.getValue() == null) {
continue;
}
Map<String, String> objMap = entry.getValue().stream()
.collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, ESEquipments::getValue));
Map<String, Date> timeMap = entry.getValue().stream()
.collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, ESEquipments::getCreatedTime));
Map<String, String> warnMap = entry.getValue().stream()
.filter(i -> i.getEquipmentIndexName().contains("实时故障"))
.collect(Collectors.toMap(ESEquipments::getEquipmentSpecificName, ESEquipments::getValue));
String fanStatus = objMap.get("风机状态");
Double power = Double.valueOf(objMap.get("有功功率"));
String elecStatus = objMap.get("发电状态") != null ? objMap.get("发电状态") : objMap.get("正常发电状态");
String fault22 = objMap.get("实时故障22");
String warnStatus = objMap.get("报警状态");
String standbyStatus = objMap.get("待机状态");
String stopStatus = objMap.get("停机状态");
String faultStatus = objMap.get("故障状态");
String mainStatus = objMap.get("维护状态");
boolean isWarn = isWarn(warnMap);
Double fdjSpeed = Double.valueOf(objMap.get("发电机转速"));
Date fdjTime = timeMap.get("发电机转速");
Long min = null;
if(fdjTime!=null) {
long start = fdjTime.getTime();
//获取当前时间毫秒值
long current = System.currentTimeMillis();
min = (current - start)/ 1000 / 60;
}
//正常运行
//1.发电状态=true(遥信)
//2.风机状态=8(遥测)
//3.有功功率>0(遥测)
//4.实时故障:枚举值匹配不上,以及匹配为备留信号的为正常运行
if(Boolean.TRUE.toString().equalsIgnoreCase(elecStatus)&&"8.0".equals(fanStatus)&&power>0&&!isWarn)
{
equipMap.put(entry.getKey(), "正常运行");
}
else if("11.0".equals(fanStatus))
{
equipMap.put(entry.getKey(), "限功率");
}
else if(Boolean.TRUE.toString().equalsIgnoreCase(warnStatus))
{
equipMap.put(entry.getKey(), "报警运行");
}
else if(Boolean.TRUE.toString().equalsIgnoreCase(standbyStatus)&&"3.0".equals(fanStatus))
{
equipMap.put(entry.getKey(), "待机状态");
}
else if(Boolean.TRUE.toString().equalsIgnoreCase(stopStatus)&&"1.0".equals(fanStatus))
{
equipMap.put(entry.getKey(), "停机状态");
}
else if(Boolean.TRUE.toString().equalsIgnoreCase(stopStatus)&&Boolean.TRUE.toString().equalsIgnoreCase(faultStatus))
{
equipMap.put(entry.getKey(), "故障状态");
}
else if(Boolean.TRUE.toString().equalsIgnoreCase(mainStatus)&&"2.0".equals(fanStatus))
{
equipMap.put(entry.getKey(), "维护状态");
}
else if(fdjSpeed>0&&min!=null&&min>=10)
{
equipMap.put(entry.getKey(), "通讯中断");
}
}
HashMap<String, String> colorMap = new HashMap<>(); HashMap<String, String> colorMap = new HashMap<>();
colorMap.put("正常运行", "#00aa00"); colorMap.put("正常运行", "#00aa00");
...@@ -319,7 +452,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -319,7 +452,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<ESEquipmentsDTO> resultList = new ArrayList<>(); List<ESEquipmentsDTO> resultList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(equipNumList)) { if (CollectionUtils.isNotEmpty(equipNumList)) {
equipNumList.forEach(item -> { equipNumList.forEach(item -> {
String status = ObjectUtils.isEmpty(CommonConstans.fanStatus.get(collect.get(item.getEquipmentNumber()))) ? "通讯中断" : CommonConstans.fanStatus.get(collect.get(item.getEquipmentNumber())); String status =equipMap.get(item.getEquipmentNumber());
item.setAddress(status); item.setAddress(status);
ESEquipmentsDTO esEquipmentsDTO = new ESEquipmentsDTO(); ESEquipmentsDTO esEquipmentsDTO = new ESEquipmentsDTO();
BeanUtil.copyProperties(item, esEquipmentsDTO); BeanUtil.copyProperties(item, esEquipmentsDTO);
...@@ -334,6 +467,45 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -334,6 +467,45 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
@PostConstruct
public void init() {
QueryWrapper<EquipmentSpecificIndex> wrapper = new QueryWrapper<>();
wrapper.eq("is_alarm", 1);
List<EquipmentSpecificIndex> list = equipmentSpecificIndexMapper.selectList(wrapper);
map = list.stream().collect(Collectors.toMap(EquipmentSpecificIndex::getEquipmentSpecificName,
Function.identity(), (key1, key2) -> key2));
}
private boolean isWarn(Map<String, String> warnMap) {
boolean result = false;
for (Entry<String, String> entry : warnMap.entrySet()) {
EquipmentSpecificIndex equipmentSpecificIndex = map.get(entry.getKey());
if (equipmentSpecificIndex == null || entry.getValue() == null) {
continue;
}
String valueEnum = equipmentSpecificIndex.getValueEnum();
JSONArray arr = JSONObject.parseArray(valueEnum);
if(arr==null)
{
continue;
}
for (Object o : arr) {
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(o));
if (json.containsKey("key") && entry.getValue().equals(json.get("key"))) {
String warn = json.getString("label");
if (warn.indexOf("备留") == -1) {
result = true;
break;
}
}
}
if (result) {
break;
}
}
return result;
}
public List<IndexDto> getFanStatusStatistics(String stationId) { public List<IndexDto> getFanStatusStatistics(String stationId) {
List<ESEquipmentsDTO> equipNumList = getFanStatusList(stationId); List<ESEquipmentsDTO> equipNumList = getFanStatusList(stationId);
Map<String, Long> countMap = equipNumList.stream().collect(Collectors.groupingBy(ESEquipmentsDTO::getAddress, Collectors.counting())); Map<String, Long> countMap = equipNumList.stream().collect(Collectors.groupingBy(ESEquipmentsDTO::getAddress, Collectors.counting()));
...@@ -434,6 +606,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -434,6 +606,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
queryCondtion.put(CommonConstans.QueryStringEquipmentNumberKeyword, Arrays.asList(equipNum)); queryCondtion.put(CommonConstans.QueryStringEquipmentNumberKeyword, Arrays.asList(equipNum));
List<ESEquipments> equipNumList = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap); List<ESEquipments> equipNumList = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap);
if(ObjectUtils.isEmpty(frontModule)){
equipNumList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
}
if (CollectionUtils.isNotEmpty(equipNumList) && !ObjectUtils.isEmpty(equipNumList.get(0).getValueF())) { if (CollectionUtils.isNotEmpty(equipNumList) && !ObjectUtils.isEmpty(equipNumList.get(0).getValueF())) {
return equipNumList.get(0).getValueF().toString(); return equipNumList.get(0).getValueF().toString();
} else { } else {
...@@ -476,7 +651,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -476,7 +651,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
activePowerList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheActivePowerPoint, stationBasic.getBoosterGatewayId()); activePowerList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheActivePowerPoint, stationBasic.getBoosterGatewayId());
otherList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheIrradiationPonit, stationBasic.getBoosterGatewayId()); otherList = indicatorDataMapper.selectDataByequipmentIndexNameAndtime(CommonConstans.taiheIrradiationPonit, stationBasic.getBoosterGatewayId());
} }
for (int i = 0; i < activePowerList.size(); i++) { Integer size = activePowerList.size() > otherList.size() ? otherList.size() : activePowerList.size();
for (int i = 0; i < size; i++) {
IndicatorData indicatorData = activePowerList.get(i); IndicatorData indicatorData = activePowerList.get(i);
time.add(DateUtil.format(indicatorData.getCreatedTime(), "HH:mm")); time.add(DateUtil.format(indicatorData.getCreatedTime(), "HH:mm"));
if ("FDZ".equals(stationBasic.getStationType())) { if ("FDZ".equals(stationBasic.getStationType())) {
...@@ -926,14 +1102,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -926,14 +1102,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for (String s : collect.keySet()) { for (String s : collect.keySet()) {
Map<String, Object> statusMap = new HashMap<>(); Map<String, Object> statusMap = new HashMap<>();
if (frontModule.equals("前光")) { if (frontModule.equals("前光")) {
likeCodtion.remove(CommonConstans.QueryStringDisplayNameKeyword);
likeCodtion.remove(CommonConstans.QueryStringDisplayName + ".keyword"); likeCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, "模拟量");
likeCodtion.put(CommonConstans.QueryStringSystemType + ".keyword", "模拟量");
List<ESEquipments> value = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeCodtion); List<ESEquipments> value = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeCodtion);
for (ESEquipments indicatorsDto : value) { for (ESEquipments indicatorsDto : value) {
Double aDouble = Double.valueOf(indicatorsDto.getValue()); Double aDouble = Double.valueOf(indicatorsDto.getValue());
statusMap.put(indicatorsDto.getDisplayName() + "Value", String.format(CommonConstans.Twodecimalplaces, aDouble)); statusMap.put(indicatorsDto.getDisplayName().split("\\(")[0] + "Value", String.format(CommonConstans.Twodecimalplaces, aDouble));
} }
} }
List<ESEquipments> indicatorsDtos = collect.get(s); List<ESEquipments> indicatorsDtos = collect.get(s);
...@@ -1204,22 +1379,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1204,22 +1379,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Map<String, String> likeMap = new HashMap<>(); Map<String, String> likeMap = new HashMap<>();
queryCodtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCodtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量")); queryCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, map.get("boosterName")); likeMap.put(CommonConstans.QueryStringFrontMoudle, map.get("boosterName"));
if ("1主变高压侧".equals(map.get("boosterName")) || "1主变低压侧".equals(map.get("boosterName"))) { if ("1主变高压侧".equals(map.get("boosterName")) || "1主变低压侧".equals(map.get("boosterName"))) {
likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, map.get("压侧")); likeMap.put(CommonConstans.QueryStringFrontMoudle, "压侧");
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtionsAndLike(queryCodtion, null, ESEquipments.class, likeMap); List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCodtion, null, ESEquipments.class, likeMap);
// 主变高压侧 // 主变高压侧
Map<String, String> zbGYC = listData.stream().filter(t -> t.getFrontModule().contains("1主变高压侧")).collect(Collectors.toMap(ESEquipments::getDisplayName, ESEquipments::getValue)); Map<String, String> zbGYC = listData.stream().filter(t -> t.getFrontModule().contains("1主变高压侧")).collect(Collectors.toMap(ESEquipments::getDisplayName, ESEquipments::getValue));
List<Map<String, String>> zbList = new ArrayList<>(); List<Map<String, String>> zbList = new ArrayList<>();
listData.stream().filter(t -> t.getFrontModule().contains("1主变低压侧")).forEach(item -> { listData.stream().filter(t -> t.getFrontModule().contains("1主变低压侧")).forEach(item -> {
HashMap<String, String> zbMap = new HashMap<>(); HashMap<String, String> zbMap = new HashMap<>();
zbMap.put("traceId", item.getTraceId());
zbMap.put("title", item.getDisplayName()); zbMap.put("title", item.getDisplayName());
zbMap.put("grade1", keepTwoDecimalPlaces(item.getValue())); zbMap.put("grade1", keepTwoDecimalPlaces(item.getValue()));
zbMap.put("grade2", keepTwoDecimalPlaces(zbGYC.getOrDefault(item.getDisplayName(), "0.0"))); zbMap.put("grade2", keepTwoDecimalPlaces(zbGYC.getOrDefault(item.getDisplayName(), "0.0")));
if (StringUtils.isNotEmpty(item.getUnit())) {
zbMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
}
zbList.add(zbMap); zbList.add(zbMap);
}); });
IPage<Map<String, String>> zbResult = new Page<>(); IPage<Map<String, String>> zbResult = new Page<>();
...@@ -1228,21 +1400,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1228,21 +1400,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
zbResult.setTotal(zbList.size()); zbResult.setTotal(zbList.size());
try { try {
log.info("主变消息内容:{}", JSON.toJSONString(zbResult)); log.info("主变消息内容:{}", JSON.toJSONString(zbResult));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(zbResult).getBytes(), 2, false); emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(zbResult).getBytes(), 1, true);
} catch (MqttException e) { } catch (MqttException e) {
log.info("消息发送失败"); log.info("消息发送失败");
e.printStackTrace(); e.printStackTrace();
} }
} else { } else {
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtionsAndLike(queryCodtion, null, ESEquipments.class, likeMap); List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCodtion, null, ESEquipments.class, likeMap);
ArrayList<Map<String, String>> resultList = new ArrayList<>(); ArrayList<Map<String, String>> resultList = new ArrayList<>();
listData.forEach(item -> { listData.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("traceId", item.getTraceId());
stringStringHashMap.put("title", item.getDisplayName()); stringStringHashMap.put("title", item.getDisplayName());
stringStringHashMap.put("value", keepTwoDecimalPlaces(item.getValue())); stringStringHashMap.put("value", keepTwoDecimalPlaces(item.getValue()));
if (StringUtils.isNotEmpty(item.getUnit())) {
stringStringHashMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
}
resultList.add(stringStringHashMap); resultList.add(stringStringHashMap);
}); });
...@@ -1252,7 +1422,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1252,7 +1422,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
result.setTotal(resultList.size()); result.setTotal(resultList.size());
try { try {
log.info("消息内容:{}", JSON.toJSONString(result)); log.info("消息内容:{}", JSON.toJSONString(result));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(result).getBytes(), 2, false); emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(result).getBytes(), 1, true);
} catch (MqttException e) { } catch (MqttException e) {
log.info("消息发送失败"); log.info("消息发送失败");
e.printStackTrace(); e.printStackTrace();
......
...@@ -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