|
@@ -4,26 +4,26 @@ import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateRange;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.text.StrBuilder;
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.ruoyi.ucp.entity.*;
|
|
|
-import com.ruoyi.ucp.feign.AdapterApi;
|
|
|
-import com.ruoyi.ucp.service.*;
|
|
|
-import com.ruoyi.ucp.util.CalcCache;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.LambdaUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.support.LambdaMeta;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
|
|
+import com.ruoyi.ucp.entity.StationInfoMin;
|
|
|
+import com.ruoyi.ucp.entity.TurbineInfoDay;
|
|
|
+import com.ruoyi.ucp.service.IStationInfoMinService;
|
|
|
import com.ruoyi.web.controller.JavaFunctionJobHandler;
|
|
|
+import org.apache.ibatis.reflection.property.PropertyNamer;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
-import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.net.URI;
|
|
|
-import java.util.*;
|
|
|
-import java.util.concurrent.ConcurrentHashMap;
|
|
|
-import java.util.function.Function;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@SpringBootTest//classes = RuoYiApp.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
|
|
@@ -139,10 +139,6 @@ public class NewTests {
|
|
|
// writeReportPool(date);
|
|
|
|
|
|
// task.calcStationSspjfs();
|
|
|
- /*while (true) {
|
|
|
- task.calcRealtimeTurbineZt();
|
|
|
- ThreadUtil.sleep(1000);
|
|
|
- }*/
|
|
|
// task.calcRealtimeTurbineZt();
|
|
|
}
|
|
|
|
|
@@ -186,6 +182,19 @@ public class NewTests {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
+ QueryWrapper<TurbineInfoDay> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().select(TurbineInfoDay::getRecordDate);
|
|
|
+ System.out.println();
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void aadd(SFunction<TurbineInfoDay,String> a) {
|
|
|
+ LambdaMeta meta = LambdaUtils.extract(a);
|
|
|
+ String fieldName = PropertyNamer.methodToProperty(meta.getImplMethodName());
|
|
|
+ String string = a.toString();
|
|
|
+ System.out.println(a);
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void test4() {
|
|
|
// while (true){
|
|
@@ -204,7 +213,7 @@ public class NewTests {
|
|
|
stIds.add("GJNY_SXGS_LJS_FDC_STA");
|
|
|
for (DateTime date : range) {
|
|
|
// task.calcTurbineStateMin(date);
|
|
|
- task.predictExaminBc(stIds,date);
|
|
|
+ task.predictExaminBc(stIds, date);
|
|
|
}
|
|
|
// task.calcGlqxnhSurplus(start, end);
|
|
|
|
|
@@ -223,28 +232,16 @@ public class NewTests {
|
|
|
task.calcTurbineStateMin(date);
|
|
|
task.writeReportPool5SPjfsLlfdlZtsj(date);
|
|
|
//风机日切入
|
|
|
- task.cutInWindSpeed();
|
|
|
+ task.cutInWindSpeed(date);
|
|
|
//风机日额定风速
|
|
|
- task.calcGlqxnh_edfs();
|
|
|
+ task.calcGlqxnh_edfs(date);
|
|
|
task.calcPredictExamin2(date);
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- long value1 = 10L;
|
|
|
- long value2 = 3L;
|
|
|
-
|
|
|
- double result = (double) value1 / value2;
|
|
|
- System.out.println();
|
|
|
- }
|
|
|
-
|
|
|
@Test
|
|
|
public void test6() {
|
|
|
- DateTime begin = DateUtil.parse("2024-12-04 00:00:00");
|
|
|
- DateTime end = DateUtil.parse("2024-12-05 00:00:00");
|
|
|
-// DateTime date = DateUtil.date();
|
|
|
-// DateTime begin = DateUtil.beginOfDay(date);
|
|
|
-// begin = DateUtil.offsetMinute(begin, 15);
|
|
|
-// DateTime end = date;
|
|
|
+ DateTime begin = DateUtil.parse("2024-09-20 19:00:00");
|
|
|
+ DateTime end = DateUtil.parse("2024-12-25 09:00:00");
|
|
|
DateTime minEnd = begin;
|
|
|
while (minEnd.isBefore(end)) {
|
|
|
minEnd = DateUtil.offsetMinute(begin, 15);
|
|
@@ -254,6 +251,7 @@ public class NewTests {
|
|
|
begin = minEnd;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Test
|
|
|
public void test7() {
|
|
|
DateTime begin = DateUtil.parse("2024-01-01");
|
|
@@ -267,8 +265,8 @@ public class NewTests {
|
|
|
stIds.add("GJNY_SXGS_ZZ_FDC_STA");
|
|
|
stIds.add("GJNY_SXGS_XZ_FDC_STA");
|
|
|
stIds.add("GJNY_SXGS_LJS_FDC_STA");
|
|
|
- QueryWrapper<StationInfoMin> wrapper=new QueryWrapper<>();
|
|
|
- wrapper.lambda().between(StationInfoMin::getRecordDate,begin,end);
|
|
|
+ QueryWrapper<StationInfoMin> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.lambda().between(StationInfoMin::getRecordDate, begin, end);
|
|
|
List<StationInfoMin> list = stationInfoMinService.list(wrapper);
|
|
|
Map<String, List<StationInfoMin>> collect = list.stream().collect(Collectors.groupingBy(m -> DateUtil.date(m.getRecordDate()).toString()));
|
|
|
while (minEnd.isBefore(end)) {
|
|
@@ -279,6 +277,7 @@ public class NewTests {
|
|
|
minBegin = minEnd;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Test
|
|
|
public void test8() {
|
|
|
DateTime begin = DateUtil.parse("2024-11-05 14:30:00");
|
|
@@ -292,8 +291,8 @@ public class NewTests {
|
|
|
stIds.add("GJNY_SXGS_ZZ_FDC_STA");
|
|
|
stIds.add("GJNY_SXGS_XZ_FDC_STA");
|
|
|
stIds.add("GJNY_SXGS_LJS_FDC_STA");
|
|
|
- QueryWrapper<StationInfoMin> wrapper=new QueryWrapper<>();
|
|
|
- wrapper.lambda().between(StationInfoMin::getRecordDate,begin,end);
|
|
|
+ QueryWrapper<StationInfoMin> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.lambda().between(StationInfoMin::getRecordDate, begin, end);
|
|
|
List<StationInfoMin> list = stationInfoMinService.list(wrapper);
|
|
|
Map<String, List<StationInfoMin>> collect = list.stream().collect(Collectors.groupingBy(m -> DateUtil.date(m.getRecordDate()).toString()));
|
|
|
while (minEnd.isBefore(end)) {
|
|
@@ -304,4 +303,51 @@ public class NewTests {
|
|
|
minBegin = minEnd;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void test9() {
|
|
|
+ DateTime date = DateUtil.date();
|
|
|
+ task.calcLineRfdlSameDay();
|
|
|
+ task.calcStationSwGwCyDlSameDay();
|
|
|
+ task.calcStationZhcyRfDlSameDay();
|
|
|
+ task.calcLineSwGWCyDlSameDay();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void test10() {
|
|
|
+// DateTime date = DateUtil.date();
|
|
|
+ // 创建日期范围生成器
|
|
|
+ DateTime start = DateUtil.parse("2024-12-12");
|
|
|
+ DateTime end = DateUtil.parse("2024-12-25");
|
|
|
+ DateRange range = DateUtil.range(start, end, DateField.DAY_OF_YEAR);
|
|
|
+ for (DateTime date : range) {
|
|
|
+ System.out.println(DateUtil.date() + ":" + date);
|
|
|
+ task.calcTurbineRFDL_ha(date);
|
|
|
+ task.calcLineRfdl_ha(date);
|
|
|
+ //上网购网厂用电量
|
|
|
+ task.calcStationSwGwCyRdl_ha(date);
|
|
|
+ //计算综合厂用电量
|
|
|
+ task.calcStationZhcyRfDl(date);
|
|
|
+ //风机日环境温度
|
|
|
+ task.ambientTemperature();
|
|
|
+ //计算日发电量--风机汇总方式
|
|
|
+ task.calcStationRfdlFj(date);
|
|
|
+ task.calcLineSwGWCyDl(date);
|
|
|
+ task.calcTurbine5s2(date);
|
|
|
+ //风机状态时间
|
|
|
+ task.calcTurbineStateMin(date);
|
|
|
+ //风机日切入
|
|
|
+ task.cutInWindSpeed(date);
|
|
|
+ //风机日额定风速
|
|
|
+ task.calcGlqxnh_edfs(date);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void test11() {
|
|
|
+ while (true) {
|
|
|
+ task.calcRealtimeTurbineZt();
|
|
|
+ ThreadUtil.sleep(1000);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|