From 94690867571129f3d58d64be4de682c843901d80 Mon Sep 17 00:00:00 2001 From: pengwei Date: Thu, 23 Oct 2025 16:52:55 +0800 Subject: [PATCH] =?UTF-8?q?fit:=E5=A4=A7=E5=B1=8F=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datav/DataVSupervisionNotifyController.java | 11 +++++++++++ src/main/java/com/biutag/supervision/job/Job.java | 13 ++++++++++++- .../biutag/supervision/mapper/NegativeMapper.java | 9 +++++++++ .../biutag/supervision/mapper/RpcApplyMapper.java | 7 ++++++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java index a702b50..2081004 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java @@ -2,6 +2,7 @@ package com.biutag.supervision.controller.datav; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.concurrent.CompletableFuture; import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; @@ -79,7 +81,16 @@ public class DataVSupervisionNotifyController { DayTimeSuperviseVo fxsjRankOverview = negativeMapper.getSupervisionRank(beginTime, endTime, 3); DayTimeSuperviseVo jsdwRankOverview = negativeMapper.getSupervisionRank(beginTime, endTime, 4); + + + DayTimeSuperviseVo overview = new DayTimeSuperviseVo().addVO(fxsjRankOverview,jsdwRankOverview); + DayTimeSuperviseVo total = negativeMapper.getProTotalFun(beginTime, endTime); + if(ObjectUtil.isNotEmpty(total.getProTotal())){ + overview.setProTotal(total.getProTotal()); + } + + List fxsjChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 3); List jsdwChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 4); diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 6c50021..8b97f55 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -19,6 +19,7 @@ import org.springframework.stereotype.Component; import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.Month; import java.time.ZoneId; import java.util.ArrayList; import java.util.Date; @@ -64,9 +65,19 @@ public class Job { @Scheduled(cron = "0 0 4 * * ?") public void updateBaseData() { List happenTime = new ArrayList<>(); + + Date firstDayOfYear = Date.from( + LocalDate.now() // 当前日期 + .withDayOfYear(1) // 调整为当年第1天 + .atStartOfDay() // 转换为当天的00:00:00 + .atZone(ZoneId.systemDefault()) // 添加系统时区 + .toInstant() // 转为Instant + ); + 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(start); + + happenTime.add(firstDayOfYear); happenTime.add(end); businessDepartService.generate(happenTime); businessPoliceService.generate(happenTime); diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 0a32df5..64d4c84 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -146,6 +146,15 @@ public interface NegativeMapper extends BaseMapper { "AND sd.statistics_group_id=#{groupId} " + "AND crtTime BETWEEN #{beginTime} AND #{endTime};") DayTimeSuperviseVo getSupervisionRank(Date beginTime, Date endTime, Integer groupId); + + @Select("SELECT " + + "COUNT(DISTINCT ng.id) AS proTotal " + + "FROM negative ng " + + "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + + "WHERE problemSourcesCode IN (13) " + + "AND crtTime BETWEEN #{beginTime} AND #{endTime};") + DayTimeSuperviseVo getProTotalFun(Date beginTime, Date endTime); + //现场督察 @Select("SELECT " + "sd.short_name AS label, " + diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 32d830e..a91dd15 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -221,7 +221,12 @@ public interface RpcApplyMapper extends BaseMapper { @Select("select max(number_index) from rpc_apply where year = #{year}") Integer selectMaxNuberIndex(Integer year); - @Select("select d.short_name label, ROUND(sum(p.provide_relief) / 10000, 2) value from rpc_apply_person p left join rpc_apply r on p.rpc_id = r.rpc_id left join sup_depart d on r.second_depart_id = d.id where d.statistics_group_id = #{departGroupId} and r.crt_time between #{beginTime} and #{endTime} and r.type = 2 GROUP BY d.short_name order by value desc") + @Select("select d.short_name label, ROUND(sum(p.provide_relief) / 10000, 2) value " + + "from rpc_apply_person p left join rpc_apply r on p.rpc_id = r.rpc_id" + + " left join sup_depart d on r.second_depart_id = d.id " + + "where d.statistics_group_id = #{departGroupId} " + + "and r.crt_time between #{beginTime} and #{endTime} " + + "and r.type = 2 GROUP BY d.short_name order by value desc") List selectComfortMoneyBarList(Date beginTime, Date endTime, Integer departGroupId); @Select("select " +