Browse Source

fit:大屏提速

master
pengwei 3 months ago
parent
commit
21854bd168
  1. 10
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  2. 23
      src/main/java/com/biutag/supervision/job/Job.java
  3. 6
      src/test/java/com/biutag/supervision/SupervisionApplicationTests.java

10
src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java

@ -193,15 +193,17 @@ public class SubOneSupervisionNotifyController {
.in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue())));
if(!negatives.isEmpty()){
List<String> negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList();
// 办结率
// superviseMapIconVo.setCompletedRate(superviseMapIconVo.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(superviseMapIconVo.getCompletedNumber(), superviseMapIconVo.getProblemNumber()), 100), 0).doubleValue());
//问责人数 、问责单位数
CompletableFuture.allOf(
CompletableFutureUtil.runSyncObject(()->{
superviseMapIconVo.setTotalPro(String.valueOf(negatives.size()));
//已办理
superviseMapIconVo.setCompletedNumber(negatives.stream().filter(item ->ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count());
//办理中
superviseMapIconVo.setProcessingNumber(negatives.size() - superviseMapIconVo.getCompletedNumber());
// 办结率
// superviseMapIconVo.setCompletedRate(superviseMapIconVo.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(superviseMapIconVo.getCompletedNumber(), superviseMapIconVo.getProblemNumber()), 100), 0).doubleValue());
//问责人数 、问责单位数
CompletableFuture.allOf(
}),
CompletableFutureUtil.runSyncObject(() -> {
//问责人数
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds)

23
src/main/java/com/biutag/supervision/job/Job.java

@ -64,20 +64,17 @@ public class Job {
// 每日04:00更新基础数据
@Scheduled(cron = "0 0 4 * * ?")
public void updateBaseData() {
List<Date> happenTime = new ArrayList<>();
Date firstDayOfYear = Date.from(
LocalDate.now() // 当前日期
.withDayOfYear(1) // 调整为当年第1天
.atStartOfDay() // 转换为当天的00:00:00
.atZone(ZoneId.systemDefault()) // 添加系统时区
.toInstant() // 转为Instant
);
// 0秒
Date start = Date.from(LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant());
Date end = Date.from(LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant());
happenTime.add(firstDayOfYear);
//LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()
//LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant()
LocalDateTime firstDay = LocalDate.now()
.withDayOfYear(1)
.atStartOfDay();
List<Date> happenTime = new ArrayList<>();
Date start = Date.from(firstDay.atZone(ZoneId.systemDefault()).toInstant());
Date end = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
happenTime.add(start);
happenTime.add(end);
businessDepartService.generate(happenTime);
businessPoliceService.generate(happenTime);

6
src/test/java/com/biutag/supervision/SupervisionApplicationTests.java

@ -55,6 +55,12 @@ class SupervisionApplicationTests {
void contextLoads() throws FileNotFoundException {
List<NegativeFile> files = negativeFileService.list(new LambdaQueryWrapper<NegativeFile>().eq(NegativeFile::getFileName, "123.jpg"));
System.out.println(files);
testFun();
}
void testFun(){
job.updateBaseData();
}
public String getPathTrace(SupDepart depart) {

Loading…
Cancel
Save