Compare commits

..

3 Commits

Author SHA1 Message Date
dwh fb2948ccf9 gen freak data of chaoxishikuang 2024-09-18 14:06:03 +08:00
dwh cb59862044 Merge remote-tracking branch 'origin/main' 2024-09-18 13:57:50 +08:00
dwh 7a1c7ef733 updatedate ge 2024-09-18 11:03:08 +08:00
2 changed files with 48 additions and 3 deletions

View File

@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
@ -81,7 +82,7 @@ public class BizPgChaoxiController extends BaseController<IBizPgChaoxiService, B
return build;
}).collect(Collectors.toList());
List<BizPgChaoxiShikuang> collect1 =
/* List<BizPgChaoxiShikuang> collect1 =
Stream.iterate(0, (i) -> ++i).limit(4000000).map(i -> {
BizPgChaoxiShikuang build = DataUtil.build(BizPgChaoxiShikuang.class);
build.setNodeId("1808764107360849926");
@ -91,7 +92,51 @@ public class BizPgChaoxiController extends BaseController<IBizPgChaoxiService, B
return build;
}).collect(Collectors.toList());
boolean b = iBizPgChaoxiShikuangService.saveBatch(collect);
boolean b1 = iBizPgChaoxiShikuangService.saveBatch(collect1);
boolean b1 = iBizPgChaoxiShikuangService.saveBatch(collect1);*/
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, 2024);
calendar.set(Calendar.MONTH, 0); // January
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<BizPgChaoxiShikuang>list = new ArrayList<>();
for (int i = 0; i < 366 * 24; i++) {
Date date = calendar.getTime();
System.out.println(sdf.format(date));
BizPgChaoxiShikuang build = DataUtil.build(BizPgChaoxiShikuang.class);
build.setNodeId("1806491040086233088");
build.setSid(null);
build.setDelflag(0);
build.setName("青岛港");
build.setCxTime(calendar.getTime());
list.add(build);
calendar.add(Calendar.HOUR_OF_DAY, 1);
}
iBizPgChaoxiShikuangService.saveBatch(list);
}
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, 2024);
calendar.set(Calendar.MONTH, 0); // January
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < 366 * 24; i++) {
Date date = calendar.getTime();
System.out.println(sdf.format(date));
calendar.add(Calendar.HOUR_OF_DAY, 1);
}
}
@GetMapping("/getAllArea")

View File

@ -31,7 +31,7 @@ spring:
password: ${bakdm.passwd}
PG:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:postgresql://localhost:5432/ai
url: jdbc:p6spy:postgresql://${bakdm.dataServerHost}:5432/ai
username: postgres
password: postgres