|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import com.jiayue.ipfcst.common.core.exception.BusinessException;
|
|
|
import com.jiayue.ipfcst.common.core.util.DateTimeUtil;
|
|
|
+import com.jiayue.ipfcst.common.data.constant.enums.PredictionModelEnum;
|
|
|
import com.jiayue.ipfcst.common.data.entity.*;
|
|
|
import com.jiayue.ipfcst.common.data.repository.*;
|
|
|
import com.jiayue.ipfcst.common.data.service.BaseService;
|
|
@@ -71,6 +72,8 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
|
|
|
public static String stationCodeStr = "J00307";
|
|
|
|
|
|
+ public static int shutDownNumber = 0;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 每天凌晨5点30执行 现场每日7点20开始执行文件生成定时任务
|
|
@@ -80,7 +83,7 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
//@Scheduled(fixedRate = 1000*60)
|
|
|
// 30 30 5 * * ? 0/1 * * * * ?
|
|
|
// 30 10,25,30 5,17 * * ?
|
|
|
- @Scheduled(cron = "30 10,25,30 5,17 * * ?")
|
|
|
+ @Scheduled(cron = "0/1 */1 * * * ?")
|
|
|
public void createDqFile() {
|
|
|
log.info("时间 【" + DateTimeUtil.dateToStrLong(new Date()) + "】 马头山短期文件生成开始");
|
|
|
//1.读取配置
|
|
@@ -90,7 +93,9 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
//3.查询nwp数据
|
|
|
List<Nwp> listTemperature = getNwpDatas();
|
|
|
//4.计算短期预测
|
|
|
- caculateDqs(listTemperature);
|
|
|
+ List<ForecastPowerShortTerm> forecastPowerShortTerms = caculateDqs(listTemperature);
|
|
|
+ forecastPowerShortTermRepository.saveAll(forecastPowerShortTerms);
|
|
|
+ yesOrNoStartIcingShutdown();
|
|
|
log.info("时间 【" + DateTimeUtil.dateToStrLong(new Date()) + "】 马头山短期文件生成完成");
|
|
|
}
|
|
|
/**
|
|
@@ -137,33 +142,29 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
* @param listTemperature
|
|
|
*/
|
|
|
private List<ForecastPowerShortTerm> caculateDqs(List<Nwp> listTemperature) {
|
|
|
- // 是否开启了结冰停机 1开启
|
|
|
- String yesorno_start_icing_shotdown = super.getSysParameter("YESORNO_START_ICING_SHOTDOWN", "0");
|
|
|
// 是否开启了解冻开机 1开启
|
|
|
- String yesorno_start_thaw_boot = super.getSysParameter("YESORNO_START_THAW_BOOT", "0");
|
|
|
+ String yesorno_start_thaw_boot = super.getSysParameter("YESORNO_START_THAW_BOOT", "1");
|
|
|
// 层高
|
|
|
String windHeight = super.getSysParameter("WIND_HEIGHT", "30");
|
|
|
List<ForecastPowerShortTerm> forecastPowerShortTermList = new ArrayList<>();
|
|
|
|
|
|
List<IcingShutdown> icingShutdowns = new ArrayList<>();
|
|
|
List<IcingShutdown> icingShutdownList = new ArrayList<>();
|
|
|
- // 是否开启了结冰停机
|
|
|
- if(yesorno_start_icing_shotdown.equals("1")){
|
|
|
- icingShutdowns = parkedWindTurbine();
|
|
|
- }
|
|
|
// 是否开启了解冻开机
|
|
|
if(yesorno_start_thaw_boot.equals("1")){
|
|
|
icingShutdownList = thawBoot();
|
|
|
}
|
|
|
- for (Nwp nwp: listTemperature) {
|
|
|
|
|
|
+ for (Nwp nwp: listTemperature) {
|
|
|
Float speed = Convert.toFloat(getHeightWs(nwp,windHeight).setScale(1, RoundingMode.HALF_UP));
|
|
|
|
|
|
//风速小于3米每秒不发电
|
|
|
if(speed<3f) {
|
|
|
ForecastPowerShortTerm forecastPowerShortTerm = new ForecastPowerShortTerm();
|
|
|
forecastPowerShortTerm.setForecastTime(nwp.getPreTime());
|
|
|
- forecastPowerShortTerm.setFpValue(BigDecimal.ZERO);
|
|
|
+ forecastPowerShortTerm.setFpValue(BigDecimal.ZERO.setScale(2,RoundingMode.HALF_UP));
|
|
|
+ forecastPowerShortTerm.setGenDate(new Date());
|
|
|
+ forecastPowerShortTerm.setPredictionModelEnum(PredictionModelEnum.E1);
|
|
|
forecastPowerShortTermList.add(forecastPowerShortTerm);
|
|
|
continue;
|
|
|
}
|
|
@@ -186,7 +187,7 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
//小于满发风速
|
|
|
if (speed < fanInfo.getFullWindSpeed()) {
|
|
|
//根据风机曲线点表获取功率值
|
|
|
- totalPower += windTurbinePowerCurveMaps.get(fanInfo.getId() + "").get(Convert.toFloat(fanKey.split("-")[1]));
|
|
|
+ totalPower += windTurbinePowerCurveMaps.get(fanInfo.getFanId() + "").get(Convert.toFloat(fanKey.split("-")[1]));
|
|
|
continue;
|
|
|
}
|
|
|
if (speed >= fanInfo.getCutOutSpeed()) {
|
|
@@ -218,25 +219,20 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
}
|
|
|
ForecastPowerShortTerm forecastPowerShortTerm = new ForecastPowerShortTerm();
|
|
|
forecastPowerShortTerm.setForecastTime(nwp.getPreTime());
|
|
|
- forecastPowerShortTerm.setFpValue(NumberUtil.round(totalPower/1000,2));
|
|
|
-
|
|
|
- // 结冰停机
|
|
|
- for(IcingShutdown icingShutdown:icingShutdowns){
|
|
|
- if(icingShutdown.getStartTime() < nwp.getPreTime() && nwp.getPreTime() < icingShutdown.getEndTime()){
|
|
|
- forecastPowerShortTerm.setFpValue(NumberUtil.round(totalPower/1000 - 2 * icingShutdown.getShutDownNumber(),2));
|
|
|
- }
|
|
|
- }
|
|
|
+ forecastPowerShortTerm.setFpValue(NumberUtil.round(totalPower/1000,2).setScale(2,RoundingMode.HALF_UP));
|
|
|
+ forecastPowerShortTerm.setGenDate(new Date());
|
|
|
+ forecastPowerShortTerm.setPredictionModelEnum(PredictionModelEnum.E1);
|
|
|
|
|
|
// 解冻开机
|
|
|
for(IcingShutdown icingShutdown:icingShutdownList){
|
|
|
if(icingShutdown.getStartTime() < nwp.getPreTime() && nwp.getPreTime() < icingShutdown.getEndTime()){
|
|
|
- forecastPowerShortTerm.setFpValue(NumberUtil.round(totalPower/1000 + 2 * icingShutdown.getShutDownNumber(),2));
|
|
|
+ forecastPowerShortTerm.setFpValue(NumberUtil.round(totalPower/1000 + 2 * icingShutdown.getShutDownNumber(),2).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 计算超装机容量设置为92.7
|
|
|
if(forecastPowerShortTerm.getFpValue().compareTo(new BigDecimal(93))> 0 ){
|
|
|
- forecastPowerShortTerm.setFpValue(BigDecimal.valueOf(random()));
|
|
|
+ forecastPowerShortTerm.setFpValue(BigDecimal.valueOf(random()).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
forecastPowerShortTermList.add(forecastPowerShortTerm);
|
|
|
}
|
|
@@ -433,11 +429,11 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
for(ForecastPowerShortTerm f: forecastPowerShortTermList){
|
|
|
// 修改短期数据
|
|
|
if(new Date(f.getForecastTime()).after(startTime) && new Date(f.getForecastTime()).before(endTime)){
|
|
|
- f.setFpValue(f.getFpValue().multiply(new BigDecimal(m.getModulus())));
|
|
|
+ f.setFpValue(f.getFpValue().multiply(new BigDecimal(m.getModulus())).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
// 计算超装机容量设置为92.7
|
|
|
if(f.getFpValue().compareTo(new BigDecimal(93)) > 0){
|
|
|
- f.setFpValue(new BigDecimal(random()));
|
|
|
+ f.setFpValue(new BigDecimal(random()).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -481,16 +477,16 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
}
|
|
|
// 九点的时候 小于2 设置为2
|
|
|
if (f.getForecastTime() > nDate.getTime() && f.getForecastTime() < nHDate.getTime() && f.getFpValue().compareTo(new BigDecimal(2)) > 0) {
|
|
|
- f.setFpValue(new BigDecimal(2));
|
|
|
+ f.setFpValue(new BigDecimal(2).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
if(dateFormat.format(f.getForecastTime()).equals(ntDate) && f.getFpValue().compareTo(new BigDecimal(3)) < 0) {
|
|
|
- f.setFpValue(new BigDecimal(3));
|
|
|
+ f.setFpValue(new BigDecimal(3).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
if(new Date(f.getForecastTime()).after(tDate) && new Date(f.getForecastTime()).before(nextFDate) && f.getFpValue().compareTo(new BigDecimal(3.8)) < 0) {
|
|
|
- f.setFpValue(new BigDecimal(3.8));
|
|
|
+ f.setFpValue(new BigDecimal(3.8).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
if(new Date(f.getForecastTime()).after(fDate) && new Date(f.getForecastTime()).before(sDate) && f.getFpValue().compareTo(new BigDecimal(2)) < 0) {
|
|
|
- f.setFpValue(new BigDecimal(2));
|
|
|
+ f.setFpValue(new BigDecimal(2).setScale(2,RoundingMode.HALF_UP));
|
|
|
}
|
|
|
}
|
|
|
log.info("执行根据时间段修改最小值结束" + dateFormat.format(new Date()));
|
|
@@ -507,6 +503,43 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 是否开启结冰停机功能
|
|
|
+ *
|
|
|
+ */
|
|
|
+ public void yesOrNoStartIcingShutdown(){
|
|
|
+ // 是否开启了结冰停机 1开启 0未开启
|
|
|
+ String yesorno_start_icing_shotdown = super.getSysParameter("YESORNO_START_ICING_SHOTDOWN", "0");
|
|
|
+ // 15天
|
|
|
+ long startTimes = getMillisecondsSubDay();
|
|
|
+ long endTimes = startTimes + dayNum * 24 * 60 * 60 * 1000 - 15 * 60 * 1000;
|
|
|
+
|
|
|
+ // 是否开启了结冰停机
|
|
|
+ if(yesorno_start_icing_shotdown.equals("1")){
|
|
|
+ // 停机数据
|
|
|
+ List<IcingShutdown> icingShutdowns = parkedWindTurbine();
|
|
|
+
|
|
|
+ // 短期数据
|
|
|
+ List<ForecastPowerShortTerm> byForecastTimeBetween = forecastPowerShortTermRepository.findByForecastTimeBetween(startTimes, endTimes);
|
|
|
+
|
|
|
+ for(IcingShutdown icingShutdown: icingShutdowns){
|
|
|
+
|
|
|
+ for(ForecastPowerShortTerm forecastPowerShortTerm: byForecastTimeBetween){
|
|
|
+ // 短期数据在停机数据时间内
|
|
|
+ if(icingShutdown.getStartTime() <= forecastPowerShortTerm.getForecastTime() && forecastPowerShortTerm.getForecastTime() < icingShutdown.getEndTime()){
|
|
|
+ forecastPowerShortTerm.setFpValue(forecastPowerShortTerm.getFpValue().subtract(new BigDecimal(2 * icingShutdown.getShutDownNumber())));
|
|
|
+ }
|
|
|
+ // 如果小于0 则等于0
|
|
|
+ if(forecastPowerShortTerm.getFpValue().compareTo(BigDecimal.ZERO) < 0){
|
|
|
+ forecastPowerShortTerm.setFpValue(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 保存修改后短期数据
|
|
|
+ forecastPowerShortTermRepository.saveAll(byForecastTimeBetween);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 结冰停机
|
|
|
*
|
|
|
* @return
|
|
@@ -521,24 +554,25 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
// 持续降雪多长时间开始结冰 将军山
|
|
|
String duration_of_snow_j = super.getSysParameter("DURATION_OF_SNOW_J", "18");
|
|
|
// 停机间隔时间 马头山
|
|
|
- String shut_down_number_time_interval_m = super.getSysParameter("SHUT_DOWN_NUMBER_TIME_INTERVAL_M", "18");
|
|
|
+ String shut_down_number_time_interval_m = super.getSysParameter("SHUT_DOWN_NUMBER_TIME_INTERVAL_M", "60");
|
|
|
// 停机间隔时间 将军山
|
|
|
- String shut_down_number_time_interval_j = super.getSysParameter("SHUT_DOWN_NUMBER_TIME_INTERVAL_J", "18");
|
|
|
+ String shut_down_number_time_interval_j = super.getSysParameter("SHUT_DOWN_NUMBER_TIME_INTERVAL_J", "60");
|
|
|
// 强北风出现次数
|
|
|
Integer snowHowLong = 0;
|
|
|
// 强北风中断次数
|
|
|
Integer snowHowLongCut = 0;
|
|
|
// 返回集合
|
|
|
List<IcingShutdown> icingShutdowns = new ArrayList<>();
|
|
|
- // 系统时间
|
|
|
- Date systemDate = new Date();
|
|
|
- // 明晚
|
|
|
- long tomrrow = DateUtil.endOfDay(DateUtil.offsetDay(systemDate,1)).getTime() + 1;
|
|
|
- // 获取两天nwp数据
|
|
|
- List<Nwp> nwpData = nwpService.getNwpData(DateUtil.beginOfDay(systemDate).getTime(), tomrrow);
|
|
|
+
|
|
|
+ // nwp数据
|
|
|
+ List<Nwp> nwpData = getNwpDatas();
|
|
|
+
|
|
|
+ // 停机数量
|
|
|
+ int iShutDownNumber = 0;
|
|
|
+
|
|
|
// 临时对象
|
|
|
- IcingShutdown icingShutdown = new IcingShutdown();
|
|
|
- IcingShutdown icingShutdownM = new IcingShutdown();
|
|
|
+ IcingShutdown tempIS = new IcingShutdown();
|
|
|
+ IcingShutdown tempISM = new IcingShutdown();
|
|
|
|
|
|
log.info("执行结冰停机方法开始,系统时间:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
for(Nwp nwp: nwpData){
|
|
@@ -551,52 +585,50 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
snowHowLong = 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ // 临时对象
|
|
|
+ IcingShutdown icingShutdown = new IcingShutdown();
|
|
|
+ IcingShutdown icingShutdownM = new IcingShutdown();
|
|
|
// 到达将军山停机时间
|
|
|
if(snowHowLong == Integer.parseInt(duration_of_snow_j) * 4){
|
|
|
+ iShutDownNumber += 1;
|
|
|
icingShutdown.setStartTime(nwp.getPreTime());
|
|
|
- icingShutdown.setEndTime(DateUtil.offsetHour(new Date(nwp.getPreTime()), Integer.parseInt(shut_down_number_time_interval_j)).getTime());
|
|
|
+ icingShutdown.setEndTime(DateUtil.offsetMinute(new Date(nwp.getPreTime()), Integer.parseInt(shut_down_number_time_interval_j)).getTime());
|
|
|
icingShutdown.setShutDownNumber(1);
|
|
|
icingShutdowns.add(icingShutdown);
|
|
|
}
|
|
|
|
|
|
if(snowHowLong > Integer.parseInt(duration_of_snow_j) * 4){
|
|
|
- icingShutdown.setStartTime(icingShutdown.getEndTime());
|
|
|
- icingShutdown.setEndTime(DateUtil.offsetHour(new Date(icingShutdown.getEndTime()), Integer.parseInt(shut_down_number_time_interval_j)).getTime());
|
|
|
- icingShutdown.setShutDownNumber(icingShutdown.getShutDownNumber() + 1);
|
|
|
+ iShutDownNumber += 1;
|
|
|
+ icingShutdown.setStartTime(tempIS.getEndTime());
|
|
|
+ icingShutdown.setEndTime(DateUtil.offsetMinute(new Date(tempIS.getEndTime()), Integer.parseInt(shut_down_number_time_interval_j)).getTime());
|
|
|
+ icingShutdown.setShutDownNumber(iShutDownNumber);
|
|
|
icingShutdowns.add(icingShutdown);
|
|
|
}
|
|
|
|
|
|
// 到达马头山停机时间
|
|
|
if(snowHowLong == Integer.parseInt(duration_of_snow_m) * 4){
|
|
|
+ iShutDownNumber += 1;
|
|
|
icingShutdownM.setStartTime(nwp.getPreTime());
|
|
|
- icingShutdownM.setEndTime(DateUtil.offsetHour(new Date(nwp.getPreTime()), Integer.parseInt(shut_down_number_time_interval_m)).getTime());
|
|
|
- icingShutdownM.setShutDownNumber(icingShutdown.getShutDownNumber() + 1);
|
|
|
+ icingShutdownM.setEndTime(DateUtil.offsetMinute(new Date(nwp.getPreTime()), Integer.parseInt(shut_down_number_time_interval_m)).getTime());
|
|
|
+ icingShutdownM.setShutDownNumber(iShutDownNumber);
|
|
|
icingShutdowns.add(icingShutdownM);
|
|
|
}
|
|
|
if(snowHowLong > Integer.parseInt(duration_of_snow_m) * 4){
|
|
|
+ iShutDownNumber += 1;
|
|
|
icingShutdownM.setStartTime(nwp.getPreTime());
|
|
|
- icingShutdownM.setEndTime(DateUtil.offsetHour(new Date(nwp.getPreTime()), Integer.parseInt(shut_down_number_time_interval_m)).getTime());
|
|
|
- icingShutdownM.setShutDownNumber(icingShutdown.getShutDownNumber() + 1);
|
|
|
+ icingShutdownM.setEndTime(DateUtil.offsetMinute(new Date(tempISM.getEndTime()), Integer.parseInt(shut_down_number_time_interval_m)).getTime());
|
|
|
+ icingShutdownM.setShutDownNumber(iShutDownNumber);
|
|
|
icingShutdowns.add(icingShutdownM);
|
|
|
}
|
|
|
+ tempIS = icingShutdown;
|
|
|
+ tempISM = icingShutdownM;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- try {
|
|
|
- SysParameter shut_down_number = sysParameterService.getParameterBySysKey("SHUT_DOWN_NUMBER");
|
|
|
- shut_down_number.setSysValue(String.valueOf(icingShutdowns.size()));
|
|
|
- sysParameterService.update(shut_down_number);
|
|
|
- } catch (BusinessException e) {
|
|
|
- log.info("获取参数错误:" + e);
|
|
|
- }
|
|
|
+ shutDownNumber = icingShutdowns.size();
|
|
|
log.info("执行结冰停机方法结束,系统时间:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
return icingShutdowns;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 解冻开机
|
|
|
*
|
|
@@ -604,9 +636,9 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
*/
|
|
|
public List<IcingShutdown> thawBoot(){
|
|
|
// 解冻间隔时间 马头山
|
|
|
- Integer thawing_interval_m = Integer.parseInt(super.getSysParameter("THAWING_INTERVAL_M", "1"));
|
|
|
+ Integer thawing_interval_m = Integer.parseInt(super.getSysParameter("THAWING_INTERVAL_M", "60"));
|
|
|
// 解冻间隔时间 将军山
|
|
|
- Integer thawing_interval_j = Integer.parseInt(super.getSysParameter("THAWING_INTERVAL_J", "1.2"));
|
|
|
+ Integer thawing_interval_j = Integer.parseInt(super.getSysParameter("THAWING_INTERVAL_J", "80"));
|
|
|
// 开机温度
|
|
|
String thawing_interval_temperature = super.getSysParameter("THAWING_INTERVAL_TEMPERATURE", "-1");
|
|
|
// 系统时间
|
|
@@ -617,50 +649,48 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
// 临时对象
|
|
|
IcingShutdown icingShutdown = new IcingShutdown();
|
|
|
IcingShutdown icingShutdownM = new IcingShutdown();
|
|
|
- // 停机数量
|
|
|
- String shut_down_number = super.getSysParameter("SHUT_DOWN_NUMBER", "0");
|
|
|
// 返回集合
|
|
|
List<IcingShutdown> icingShutdowns = new ArrayList<>();
|
|
|
|
|
|
Integer ifOfCount = 0;
|
|
|
Integer ifOfCountM = 0;
|
|
|
- Integer forM = 0;
|
|
|
- Integer forJ = 0;
|
|
|
+ Integer forM = 4;
|
|
|
+ Integer forJ = 4;
|
|
|
|
|
|
- if(thawing_interval_m > 0 && thawing_interval_m <= 1){
|
|
|
+ if(thawing_interval_m > 0 && thawing_interval_m <= 60){
|
|
|
forM = 4;
|
|
|
- }else if(thawing_interval_m > 1 && thawing_interval_m <= 1.2){
|
|
|
+ }else if(thawing_interval_m > 60 && thawing_interval_m <= 75){
|
|
|
forM = 5;
|
|
|
- }else if(thawing_interval_m > 1.2 && thawing_interval_m <= 1.4){
|
|
|
+ }else if(thawing_interval_m > 75 && thawing_interval_m <= 90){
|
|
|
forM = 6;
|
|
|
- }else if(thawing_interval_m > 1.4 && thawing_interval_m <= 1.6){
|
|
|
+ }else if(thawing_interval_m > 90 && thawing_interval_m <= 105){
|
|
|
forM = 7;
|
|
|
- }else if(thawing_interval_m > 1.6 && thawing_interval_m <= 2){
|
|
|
+ }else if(thawing_interval_m > 105 && thawing_interval_m <= 120){
|
|
|
forM = 8;
|
|
|
}
|
|
|
|
|
|
- if(thawing_interval_j > 0 && thawing_interval_j <= 1){
|
|
|
+ if(thawing_interval_j > 0 && thawing_interval_j <= 60){
|
|
|
forJ = 4;
|
|
|
- }else if(thawing_interval_j > 1 && thawing_interval_j <= 1.2){
|
|
|
+ }else if(thawing_interval_j > 60 && thawing_interval_j <= 75){
|
|
|
forJ = 5;
|
|
|
- }else if(thawing_interval_j > 1.2 && thawing_interval_j <= 1.4){
|
|
|
+ }else if(thawing_interval_j > 75 && thawing_interval_j <= 90){
|
|
|
forJ = 6;
|
|
|
- }else if(thawing_interval_j > 1.4 && thawing_interval_j <= 1.6){
|
|
|
+ }else if(thawing_interval_j > 90 && thawing_interval_j <= 105){
|
|
|
forJ = 7;
|
|
|
- }else if(thawing_interval_j > 1.6 && thawing_interval_j <= 2){
|
|
|
+ }else if(thawing_interval_j > 105 && thawing_interval_j <= 120){
|
|
|
forJ = 8;
|
|
|
}
|
|
|
log.info("执行解冻开机方法开始,系统时间:"+ DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
// 停机台数大于0
|
|
|
- if(Integer.parseInt(shut_down_number) > 0) {
|
|
|
+ if(shutDownNumber > 0) {
|
|
|
for (int i = 0; i < nwpData.size(); i++) {
|
|
|
- if (Integer.parseInt(shut_down_number) > 0) {
|
|
|
+ if (shutDownNumber > 0) {
|
|
|
// 当前点温度是否高于解冻温度 并判断下一小时内四个点的温度
|
|
|
for (int j = i; j <= forJ; j++){
|
|
|
if(nwpData.get(i).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0) {
|
|
|
ifOfCount = ifOfCount + 1;
|
|
|
Long preTime = nwpData.get(j).getPreTime();
|
|
|
- Long preTimeJ = DateUtil.offsetHour(new Date(preTime), thawing_interval_j).getTime();
|
|
|
+ Long preTimeJ =DateUtil.offsetMinute(new Date(preTime), thawing_interval_j).getTime();
|
|
|
icingShutdown.setStartTime(preTime);
|
|
|
icingShutdown.setEndTime(preTimeJ);
|
|
|
icingShutdown.setShutDownNumber(ifOfCount);
|
|
@@ -670,12 +700,13 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
if (nwpData.get(i).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0) {
|
|
|
ifOfCountM = ifOfCountM + 1;
|
|
|
Long preTime = nwpData.get(k).getPreTime();
|
|
|
- Long preTimeM = DateUtil.offsetHour(new Date(preTime), thawing_interval_m).getTime();
|
|
|
+ Long preTimeM = DateUtil.offsetMinute(new Date(preTime), thawing_interval_m).getTime();
|
|
|
icingShutdownM.setStartTime(preTime);
|
|
|
icingShutdownM.setEndTime(preTimeM);
|
|
|
icingShutdownM.setShutDownNumber(ifOfCountM);
|
|
|
}
|
|
|
}
|
|
|
+ shutDownNumber -= 2;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -684,40 +715,6 @@ public class UploadFileMatoushanJob extends BaseService {
|
|
|
return icingShutdowns;
|
|
|
}
|
|
|
|
|
|
-// if(nwpData.get(i).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0){
|
|
|
-// if(nwpData.get(i+1).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0){
|
|
|
-// if(nwpData.get(i+2).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0){
|
|
|
-// if(nwpData.get(i+3).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0){
|
|
|
-// if(nwpData.get(i+4).getT().compareTo(new BigDecimal(thawing_interval_temperature)) > 0){
|
|
|
-// ifOfCount = ifOfCount + 1;
|
|
|
-// Long preTime = nwpData.get(i).getPreTime();
|
|
|
-// Long preTimeJ = DateUtil.offsetHour(new Date(preTime),thawing_interval_j).getTime();
|
|
|
-// Long preTimeM = DateUtil.offsetHour(new Date(preTime),Integer.parseInt(thawing_interval_m)).getTime();
|
|
|
-// icingShutdown.setStartTime(preTime);
|
|
|
-// icingShutdown.setEndTime(preTimeJ);
|
|
|
-// icingShutdown.setShutDownNumber(ifOfCount);
|
|
|
-// ifOfCountM = ifOfCountM + 1;
|
|
|
-// icingShutdowns.add(icingShutdown);
|
|
|
-// icingShutdownM.setStartTime(preTime);
|
|
|
-// icingShutdownM.setEndTime(preTimeM);
|
|
|
-// icingShutdownM.setShutDownNumber(ifOfCountM);
|
|
|
-// i += 4;
|
|
|
-// }else{
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 判断风速是上升风还是下降风
|