diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java index e803353..91cb55b 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java @@ -63,17 +63,17 @@ public enum ProblemSourcesEnum { // ================== 问题来源分组(集合) ================== /** - * 13 + * 现场督察 */ public static final List GROUP_13 = List.of("13"); /** - * 14, 15, 16 + * 数字督察 */ public static final List GROUP_14_15_16 = List.of("14", "15", "16"); /** - * 17, 18, 19, 20 + * 案件核查 */ public static final List GROUP_17_18_19_20 = List.of("17", "18", "19", "20"); diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java index db5576a..02c95c6 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java @@ -140,6 +140,18 @@ public class DataVGlobalController { return Result.success(data); } + /** + * 获取首页大屏中央数据 + * + * @param request 时间 + * @return Result + */ + @Operation(summary = "大屏中央数据") + @PostMapping("/getAllGlobalCount") + public Result getAllGlobalCount(@RequestBody DataVRequest request) { + return datavService.getAllGlobalCount(request); + } + /** * 地图数据 * diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java index cd10269..cc2b53a 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.param; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; import org.springframework.format.annotation.DateTimeFormat; @@ -34,4 +35,9 @@ public class DataCaseVerifQueryParam extends BasePage { // 问题发现时间 @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private List discoveryTime = new ArrayList<>(); + + + @Schema(description = "创建时间") + private List createTime = new ArrayList<>(); + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/GlobalOverViewVo.java b/src/main/java/com/biutag/supervision/pojo/vo/GlobalOverViewVo.java index a864350..3d7181b 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/GlobalOverViewVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/GlobalOverViewVo.java @@ -3,6 +3,9 @@ package com.biutag.supervision.pojo.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.util.Objects; +import java.util.stream.Stream; + /** * @Auther: sh * @Date: 2024/12/18 18:20 @@ -49,5 +52,19 @@ public class GlobalOverViewVo { return vo; } + public void calcTotal() { + this.totalPro = Stream.of( + supervisionPro, + numSupervisionPro, + caseVerificationPro, + complaintPro, + talkPro, + auditPro, + mailboxNumber + ).filter(Objects::nonNull) + .mapToLong(Long::longValue) + .sum(); + } + } diff --git a/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java b/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java new file mode 100644 index 0000000..6e61e90 --- /dev/null +++ b/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.repository.dataCaseVerif; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.mapper.DataCaseVerifMapper; +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +/** + * @ClassName DataCaseVerifResourceService + * @Description 案件核查资源层 + * @Author shihao + * @Date 2025/12/19 15:06 + */ +@Service +public class DataCaseVerifResourceService { + + + @Resource + private DataCaseVerifMapper dataCaseVerifMapper; + + + + + public long count(DataCaseVerifQueryParam param) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.between(CollectionUtil.isNotEmpty(param.getCreateTime()), DataCaseVerif::getCreateTime, param.getCreateTime().get(0), param.getCreateTime().get(1)); + if (wrapper.getExpression() == null || wrapper.getExpression().getSqlSegment().isEmpty()) { + return 0L; + } + return dataCaseVerifMapper.selectCount(wrapper); + } + + + + + + + +} diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavService.java b/src/main/java/com/biutag/supervision/service/datav/DatavService.java index ad99faf..3dadf2d 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavService.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavService.java @@ -33,4 +33,11 @@ public interface DatavService { * @return */ Result getOrganizationRank(DataVRequest request); + + /** + * 获取一级首页中间总览数据 + * @param request + * @return + */ + Result getAllGlobalCount(DataVRequest request); } diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java index 1066be0..8f2778e 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -16,7 +16,9 @@ import com.biutag.supervision.pojo.param.*; import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.vo.AuditSuperviseMapIconVo; import com.biutag.supervision.pojo.vo.GlobalMapIconVo; +import com.biutag.supervision.pojo.vo.GlobalOverViewVo; import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; +import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService; import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; import com.biutag.supervision.repository.mail.MailResourceService; import com.biutag.supervision.repository.negative.NegativeResourceService; @@ -62,6 +64,9 @@ public class DatavServiceImpl implements DatavService { @Resource private SupExternalDepartResourceService supExternalDepartResourceService; + @Resource + private DataCaseVerifResourceService dataCaseVerifResourceService; + @Override public Result getAuditMap(DataVRequest request) { List auditSuperviseMapIconVoList = new ArrayList<>(); @@ -118,6 +123,11 @@ public class DatavServiceImpl implements DatavService { return Result.success(data); } + /** + * 获取一级首页的地图数据 + * @param request + * @return + */ @Override public Result getGlobalMap(DataVRequest request) { List globalMapIconVoList = new ArrayList<>(); @@ -207,6 +217,11 @@ public class DatavServiceImpl implements DatavService { return Result.success(data); } + /** + * 获取一级首页的机构问题排名 + * @param request + * @return + */ @Override public Result getOrganizationRank(DataVRequest request) { Map fxsjDepartAndSubDepartData = getDepartAndSubDepartData(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); @@ -257,6 +272,67 @@ public class DatavServiceImpl implements DatavService { return Result.success(res); } + /** + * 获取一级首页中间总览数据 + * @param request + * @return + */ + @Override + public Result getAllGlobalCount(DataVRequest request) { + + GlobalOverViewVo overview = GlobalOverViewVo.of(); + List dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); + // 现场督查 + NegativeQueryParam xcdcQueryParam = new NegativeQueryParam(); + xcdcQueryParam.setCrtTime(dates); + xcdcQueryParam.setProblemSourcesCode(ProblemSourcesEnum.GROUP_13); + long xcdcCount = negativeResourceService.count(xcdcQueryParam); + // 数字督察 + NegativeQueryParam szdcQueryParam = new NegativeQueryParam(); + szdcQueryParam.setCrtTime(dates); + szdcQueryParam.setProblemSourcesCode(ProblemSourcesEnum.GROUP_14_15_16); + long szdcCount = negativeResourceService.count(szdcQueryParam); + // 案件核查 + DataCaseVerifQueryParam ajhcQueryParam = new DataCaseVerifQueryParam(); + ajhcQueryParam.setCreateTime(dates); + long ajhcCount = dataCaseVerifResourceService.count(ajhcQueryParam); + // 局长信箱 + MailQueryParam mailQueryParam = new MailQueryParam(); + mailQueryParam.setCreateTime(dates); + long jzxxCount = mailResourceService.count(mailQueryParam); + + // 12337 + NegativeQueryParam xf12337Param = new NegativeQueryParam(); + xf12337Param.setCrtTime(dates); + xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue())); + long xf12337Count = negativeResourceService.count(xf12337Param); + // 国家信访 + DataPetitionComplaintQueryParam countryParam = new DataPetitionComplaintQueryParam(); + countryParam.setCreateTime(dates); + countryParam.setProblemSourcesCode(ProblemSourcesEnum.GJXFPT.getValue()); + long gjxfCount = dataPetitionComplaintResourceService.count(countryParam); + // 公安部门信访 + DataPetitionComplaintQueryParam policeParam = new DataPetitionComplaintQueryParam(); + policeParam.setCreateTime(dates); + policeParam.setProblemSourcesCode(ProblemSourcesEnum.GABXF.getValue()); + long gabxfCount = dataPetitionComplaintResourceService.count(policeParam); + + // 审计项目数 + ReportProjectQueryParam reportProjectQueryParam = new ReportProjectQueryParam(); + reportProjectQueryParam.setArchivingStart(request.getBeginTime()); + reportProjectQueryParam.setArchivingEnd(request.getEndTime()); + long sjxmCount = reportProjectResourceService.count(reportProjectQueryParam); + + overview.setSupervisionPro(xcdcCount); + overview.setNumSupervisionPro(szdcCount); + overview.setCaseVerificationPro(ajhcCount); + overview.setMailboxNumber(jzxxCount); + overview.setComplaintPro(xf12337Count+gjxfCount+gabxfCount); + overview.setAuditPro(sjxmCount); + overview.calcTotal(); + JSONObject data = new JSONObject().fluentPut("overview", overview); + return Result.success(data); + } /** * @return 部门和子部门映射数据