修改使用表r_stat_limit_rate_d
This commit is contained in:
@@ -32,7 +32,6 @@ import com.njcn.process.enums.*;
|
||||
import com.njcn.process.mapper.*;
|
||||
import com.njcn.process.pojo.param.FileParam;
|
||||
import com.njcn.process.pojo.po.FlowableAss;
|
||||
import com.njcn.process.pojo.po.LimitRate;
|
||||
import com.njcn.process.pojo.po.ThsAlarmFormwork;
|
||||
import com.njcn.process.pojo.vo.flowable.FlowTaskVo;
|
||||
import com.njcn.process.service.ThsSuperviseService;
|
||||
@@ -50,7 +49,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -615,93 +613,93 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
* @param limitRate
|
||||
* @param steady
|
||||
*/
|
||||
private Map<String, Object> verifyLimit(LimitRate limitRate, SourceSteadyIndicator steady) {
|
||||
if (limitRate != null) {
|
||||
List<String> steadyIndicator = steady.getSteadyIndicator();
|
||||
Map<String, Object> limitBoolMap = new HashedMap();
|
||||
List<String> descriptionList = new ArrayList<>();
|
||||
steadyIndicator.forEach(id -> {
|
||||
HttpResult<DictData> dicDataById = dicDataFeignClient.getDicDataById(id);
|
||||
if (CommonResponseEnum.SUCCESS.getCode().equals(dicDataById.getCode()) && dicDataById.getData() != null) {
|
||||
SteadyIndicatorEnum steadyIndicatorEnum = SteadyIndicatorEnum.getSteadyIndicatorEnumByCode(dicDataById.getData().getCode());
|
||||
if (null != steadyIndicatorEnum) {
|
||||
switch (steadyIndicatorEnum) {
|
||||
case Negative_Voltage://负序电压不平衡度
|
||||
if (limitRate.getUbalanceOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Negative_Voltage.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Negative_Voltage.getMessage().concat(limitRate.getUbalanceOvertime() + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Negative_Voltage.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Interhar_Voltage://间谐波电压
|
||||
Integer interharVoltageOvertime = this.maxOverTime(limitRate, InterharVoltage.class);
|
||||
if (interharVoltageOvertime > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Interhar_Voltage.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Interhar_Voltage.getMessage().concat(interharVoltageOvertime + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Interhar_Voltage.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Neg_Current://负序电流
|
||||
if (limitRate.getINegOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Neg_Current.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Neg_Current.getMessage().concat(limitRate.getINegOvertime() + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Neg_Current.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Fre_Deviation://频率偏差
|
||||
if (limitRate.getFreqDevOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Fre_Deviation.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Fre_Deviation.getMessage().concat(limitRate.getFreqDevOvertime() + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Fre_Deviation.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Voltage_Dev://电压偏差
|
||||
if (limitRate.getVoltageDevOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Dev.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Voltage_Dev.getMessage().concat(limitRate.getVoltageDevOvertime() + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Dev.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Har_Current://谐波电流
|
||||
Integer harCurrentOvertime = this.maxOverTime(limitRate, HarCurrent.class);
|
||||
if (harCurrentOvertime > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Current.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Har_Current.getMessage().concat(harCurrentOvertime + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Current.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Voltage_Fluc://电压波动与闪变
|
||||
if (limitRate.getFlickerOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Fluc.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Voltage_Fluc.getMessage().concat(limitRate.getFlickerOvertime() + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Fluc.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Har_Voltage://谐波电压
|
||||
Integer harVoltageOvertime = this.maxOverTime(limitRate, HarVoltage.class);
|
||||
if (harVoltageOvertime > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Voltage.getCode(), true);
|
||||
descriptionList.add(SteadyIndicatorEnum.Har_Voltage.getMessage().concat(harVoltageOvertime + "次"));
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Voltage.getCode(), false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
limitBoolMap.put(DESCRIPTION, descriptionList);
|
||||
return limitBoolMap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// private Map<String, Object> verifyLimit(LimitRate limitRate, SourceSteadyIndicator steady) {
|
||||
// if (limitRate != null) {
|
||||
// List<String> steadyIndicator = steady.getSteadyIndicator();
|
||||
// Map<String, Object> limitBoolMap = new HashedMap();
|
||||
// List<String> descriptionList = new ArrayList<>();
|
||||
// steadyIndicator.forEach(id -> {
|
||||
// HttpResult<DictData> dicDataById = dicDataFeignClient.getDicDataById(id);
|
||||
// if (CommonResponseEnum.SUCCESS.getCode().equals(dicDataById.getCode()) && dicDataById.getData() != null) {
|
||||
// SteadyIndicatorEnum steadyIndicatorEnum = SteadyIndicatorEnum.getSteadyIndicatorEnumByCode(dicDataById.getData().getCode());
|
||||
// if (null != steadyIndicatorEnum) {
|
||||
// switch (steadyIndicatorEnum) {
|
||||
// case Negative_Voltage://负序电压不平衡度
|
||||
// if (limitRate.getUbalanceOvertime() > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Negative_Voltage.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Negative_Voltage.getMessage().concat(limitRate.getUbalanceOvertime() + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Negative_Voltage.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Interhar_Voltage://间谐波电压
|
||||
// Integer interharVoltageOvertime = this.maxOverTime(limitRate, InterharVoltage.class);
|
||||
// if (interharVoltageOvertime > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Interhar_Voltage.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Interhar_Voltage.getMessage().concat(interharVoltageOvertime + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Interhar_Voltage.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Neg_Current://负序电流
|
||||
// if (limitRate.getINegOvertime() > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Neg_Current.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Neg_Current.getMessage().concat(limitRate.getINegOvertime() + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Neg_Current.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Fre_Deviation://频率偏差
|
||||
// if (limitRate.getFreqDevOvertime() > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Fre_Deviation.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Fre_Deviation.getMessage().concat(limitRate.getFreqDevOvertime() + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Fre_Deviation.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Voltage_Dev://电压偏差
|
||||
// if (limitRate.getVoltageDevOvertime() > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Voltage_Dev.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Voltage_Dev.getMessage().concat(limitRate.getVoltageDevOvertime() + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Voltage_Dev.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Har_Current://谐波电流
|
||||
// Integer harCurrentOvertime = this.maxOverTime(limitRate, HarCurrent.class);
|
||||
// if (harCurrentOvertime > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Har_Current.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Har_Current.getMessage().concat(harCurrentOvertime + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Har_Current.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Voltage_Fluc://电压波动与闪变
|
||||
// if (limitRate.getFlickerOvertime() > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Voltage_Fluc.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Voltage_Fluc.getMessage().concat(limitRate.getFlickerOvertime() + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Voltage_Fluc.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// case Har_Voltage://谐波电压
|
||||
// Integer harVoltageOvertime = this.maxOverTime(limitRate, HarVoltage.class);
|
||||
// if (harVoltageOvertime > 0) {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Har_Voltage.getCode(), true);
|
||||
// descriptionList.add(SteadyIndicatorEnum.Har_Voltage.getMessage().concat(harVoltageOvertime + "次"));
|
||||
// } else {
|
||||
// limitBoolMap.put(SteadyIndicatorEnum.Har_Voltage.getCode(), false);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// limitBoolMap.put(DESCRIPTION, descriptionList);
|
||||
// return limitBoolMap;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
/***
|
||||
* 获取越限最大值
|
||||
|
||||
Reference in New Issue
Block a user