Commit 6bf1f04f authored by tangwei's avatar tangwei

解决冲突

parents 9ccfa0a0 7f66e72f
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
......@@ -13,10 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.feign.RiskWarningFeign;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthLevel;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper;
......@@ -31,10 +29,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......
......@@ -252,6 +252,23 @@ public class IdxBizFanHealthIndexController extends BaseController {
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/selectPointByANALYSISTYPE")
public ResponseModel<Map<String,Object>> selectPointByANALYSISTYPE(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME,@RequestParam(required = false)String startTime,@RequestParam(required = false) String endTime) {
List<Map<String, Object>> maps = idxBizFanHealthIndexServiceImpl.selectPointByANALYSISTYPE(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME,startTime,endTime);
Map<String,Object> result = new HashMap<>();
List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>();
for (Map<String, Object> map : maps) {
seriesData.add(map.get("value"));
axisData.add(map.get("REC_DATE"));
}
result.put("seriesData",seriesData);
result.put("axisData",axisData);
return ResponseHelper.buildResponse(result);
}
}
......@@ -25,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -261,4 +262,69 @@ public class IdxBizFanWarningRecordController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/stringToMap")
@ApiOperation(httpMethod = "get", value = "字符串转为对象格式", notes = "字符串转为对象格式")
public ResponseModel<Map<String, Object>> list(@RequestParam("analysisPointIds") String ids) {
Map<String, Object> data = new HashMap<>();
data.put("analysisPointIds", ids);
return ResponseHelper.buildResponse(data);
}
/**
* 根据pointId修改信息
*
* @param analysisInfo 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/updateByPointInfoBatchPv")
@ApiOperation(httpMethod = "POST", value = "根据pointId修改信息", notes = "根据pointId修改信息")
public ResponseModel<Boolean> updateByPointInfoBatchPv(@RequestBody JSONObject analysisInfo) {
LambdaQueryWrapper<IdxBizPvWarningRuleSet> query = new LambdaQueryWrapper<>();
List<String> analysisPointIds = Arrays.asList(analysisInfo.get("analysisPointIds").toString().split(","));
query.in(IdxBizPvWarningRuleSet::getAnalysisPointId, analysisPointIds);
List<IdxBizPvWarningRuleSet> idxBizFanWarningRecordList = idxBizPvWarningRuleSetService.getBaseMapper().selectList(query);
for (IdxBizPvWarningRuleSet idxBizPvWarningRuleSet : idxBizFanWarningRecordList) {
BeanUtil.copyProperties(analysisInfo, idxBizPvWarningRuleSet, "analysisPointIds");
if (idxBizPvWarningRuleSet.getWarningName().equals("警告")) {
//警告周期
idxBizPvWarningRuleSet.setWarningCycle(analysisInfo.get("jgWarningCycle").toString());
} else if (idxBizPvWarningRuleSet.getWarningName().equals("危险")) {
//警告周期
idxBizPvWarningRuleSet.setWarningCycle(analysisInfo.get("wxWarningCycle").toString());
}
}
boolean b = idxBizPvWarningRuleSetService.updateBatchById(idxBizFanWarningRecordList);
return ResponseHelper.buildResponse(b);
}
/**
* 根据pointId修改信息
*
* @param analysisInfo 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/updateByPointInfoBatchFan")
@ApiOperation(httpMethod = "POST", value = "根据pointId修改信息", notes = "根据pointId修改信息")
public ResponseModel<Boolean> updateByPointInfoBatchFan(@RequestBody JSONObject analysisInfo) {
LambdaQueryWrapper<IdxBizFanWarningRuleSet> query = new LambdaQueryWrapper<>();
List<String> analysisPointIds = Arrays.asList(analysisInfo.get("analysisPointIds").toString().split(","));
query.in(IdxBizFanWarningRuleSet::getAnalysisPointId, analysisPointIds);
List<IdxBizFanWarningRuleSet> idxBizFanWarningRecordList = idxBizFanWarningRuleSetService.getBaseMapper().selectList(query);
for (IdxBizFanWarningRuleSet idxBizFanWarningRuleSet : idxBizFanWarningRecordList) {
BeanUtil.copyProperties(analysisInfo, idxBizFanWarningRuleSet, "analysisPointIds");
if (idxBizFanWarningRuleSet.getWarningName().equals("警告")) {
//警告周期
idxBizFanWarningRuleSet.setWarningCycle(analysisInfo.get("jgWarningCycle").toString());
} else if (idxBizFanWarningRuleSet.getWarningName().equals("危险")) {
//警告周期
idxBizFanWarningRuleSet.setWarningCycle(analysisInfo.get("wxWarningCycle").toString());
}
}
boolean b = idxBizFanWarningRuleSetService.updateBatchById(idxBizFanWarningRecordList);
return ResponseHelper.buildResponse(b);
}
}
......@@ -111,12 +111,12 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size);
List<Map<String,Object>> selectPointByANALYSISTYPE(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME,String startTime,String endTime);
int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME);
Map<String,Object> queryForLeftTableListByPointNum(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME);
List<IdxBizFanWarningRecord> warningData(String STATION, String SUBARRAY, String EQUIPMENTNAME);
Integer pointNum(String STATION, String SUBARRAY, String EQUIPMENTNAME);
......
......@@ -95,7 +95,8 @@ public class CommonServiceImpl {
@Value("${jkzsjs.url:a9a404d4-6ead-440e-9fcb-b95d5a239b10}")
String jkzsgfurl;
@Value("${openHealth:true}")
Boolean openHealth;
// {"tableName": "idx_biz_fan_point_process_variable_classification"} 风机工况变量划分
// {"tableName": "idx_biz_pv_point_process_variable_classification"} 光伏工况变量画分
// {"tableName": "idx_biz_fan_point_var_correlation"} 风机相关性
......@@ -1462,6 +1463,9 @@ public class CommonServiceImpl {
@Scheduled(cron = "0 0/10 * * * ?")
@Async("async")
public void healthWarningMinuteByFan() {
if (!openHealth){
return;
}
Date time = new Date();
Calendar calendar = Calendar.getInstance();
List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData();
......@@ -1623,6 +1627,9 @@ public class CommonServiceImpl {
@Scheduled(cron = "0 0/10 * * * ?")
@Async("async")
public void healthWarningMinuteByPv() {
if (!openHealth){
return;
}
Calendar calendar = Calendar.getInstance();
Date time = new Date();
List<IdxBizPvPointProcessVariableClassificationDto> data = idxBizPvPointProcessVariableClassificationMapper.getInfluxDBData();
......
......@@ -84,7 +84,8 @@ public class HealthStatusIndicatorServiceImpl {
@Autowired
EmqKeeper emqKeeper;
@Value("${openHealth:true}")
boolean openHealth;
/**
* 夏造风电分析index_key
*/
......@@ -115,6 +116,9 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 */1 * * ?")
@Async("async")
public void healthWarningMinuteGF(Calendar calendar,Date time ) {
if (!openHealth){
return;
}
// Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-1);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
......@@ -256,6 +260,9 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled(cron = "0 0 0/1 * * ?")
@Async("async")
public void healthWarningHourGF() {
if (!openHealth){
return;
}
Date time = new Date();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
......@@ -399,6 +406,9 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async")
public void healthWarningDayGF() {
if (!openHealth){
return;
}
Calendar calendar = Calendar.getInstance();
Date time = new Date();
calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
......@@ -533,6 +543,9 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 */1 * * ?")
@Async("async")
public void healthWarningMinute(Calendar calendar ,Date time) {
if (!openHealth){
return;
}
// Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-1);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
......@@ -679,6 +692,9 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled(cron = "0 0 0/1 * * ?")
@Async("async")
public void healthWarningHour() {
if (!openHealth){
return;
}
Date time = new Date();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
......@@ -818,6 +834,9 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async")
public void healthWarningDay() {
if (!openHealth){
return;
}
Date time = new Date();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
......
......@@ -181,6 +181,12 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
return this.getBaseMapper().queryForLeftTableListByPoint(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,current,size);
}
public List<Map<String,Object>> selectPointByANALYSISTYPE(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME,String startTime,String endTime){
return this.getBaseMapper().selectPointByANALYSISTYPE(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,startTime,endTime);
};
public int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME){
return this.getBaseMapper().queryForLeftTableListByPointCount(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME);
}
......
......@@ -87,4 +87,7 @@ healthValue_Notice=79
healthValue_DayCount=3
healthValue_HourCount=6
healthValue_MinCount=5
\ No newline at end of file
healthValue_MinCount=5
##是否打开健康计算计算 true 打开 false 关闭
openHealth = false
\ No newline at end of file
......@@ -1754,6 +1754,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public HashMap<String, Object> getEquipInfoByEquipNum(String gatewayId, String equipmentNumber) {
HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
......@@ -1771,11 +1772,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
type = "汇流箱系统";
queryEquipNum = equipNames[0] + equipNames[1] + Integer.parseInt(equipNames[2]);
} else {
HashMap<String,String> nbpStatus = getPvNBQStationBy(gatewayId);
type = "光伏逆变器系统";
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("待机", "故障停机", "告警运行", "限额运行", "停机", "通讯故障", "降额运行", "运行"));
queryCondtion.put(CommonConstans.QueryStringValueKeyword, Arrays.asList("true"));
List<ESEquipments> list1 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
resultMap.put("status", AlarmDesc.getCode(list1.get(0).getEquipmentIndexName()));
resultMap.put("status", nbpStatus.get(equipmentNumber));
// queryEquipNum = "#" + Integer.parseInt(equipNames[0]);
queryEquipNum = equipNames[0] + equipNames[1] + 1;
}
......
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