Browse Source

fit:大屏修复

master
pengwei 1 month ago
parent
commit
9469086757
  1. 11
      src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java
  2. 13
      src/main/java/com/biutag/supervision/job/Job.java
  3. 9
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  4. 7
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

11
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<RankVo> fxsjChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 3);
List<RankVo> jsdwChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 4);

13
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<Date> 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);

9
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -146,6 +146,15 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"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, " +

7
src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

@ -221,7 +221,12 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
@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<BarItem> selectComfortMoneyBarList(Date beginTime, Date endTime, Integer departGroupId);
@Select("select " +

Loading…
Cancel
Save