diff --git a/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java new file mode 100644 index 0000000..7dff98c --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java @@ -0,0 +1,79 @@ +package com.biutag.supervision.controller.datav; + +import cn.hutool.core.util.NumberUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.constants.enums.CaseVerifProblemNatureEnum; +import com.biutag.supervision.constants.enums.DepartGroupEnum; +import com.biutag.supervision.mapper.DataRightsComfortMapper; +import com.biutag.supervision.mapper.RpcApplyMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.CaseVerifDepart; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.pojo.entity.DataRightsComfort; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.service.DataRightsComfortService; +import com.biutag.supervision.service.RpcApplyService; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@RequestMapping("datav/rightsComfort") +@RequiredArgsConstructor +@RestController +public class DatavRightsComfortController { + + private final RpcApplyService rpcApplyService; + + private final RpcApplyMapper rpcApplyMapper; + + @GetMapping + public Result rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 抚慰人数 + long total = rpcApplyService.count(new LambdaQueryWrapper().between(RpcApply::getApplyDate, beginTime, endTime)); + long confirmed = 0; + JSONObject overview = new JSONObject() + // 抚慰人数 + .fluentPut("total", total); + /* // 维权案件总数 + .fluentPut("confirmed", 0) + // 受侵害人数 + .fluentPut("investigateAndPunish", 0) + // 打击处理人数 + .fluentPut("accountablePeopleNumber", 0) + // 抚慰金额(万元) + .fluentPut("accountableDepartNumber", 0) + // 查实率 + .fluentPut("confirmedRate", total == 0 ? 0 : BigDecimal.valueOf(NumberUtil.div(confirmed, total) * 100).intValue()); + // 分县市局排名 + List fxsjBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime); + // 局属单位排名 + List jsdwBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime); + // 执法办案 + List zfbaPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.ZFBA.getLaebl(), beginTime, endTime); + // 服务管理 + List fwglPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.FWGL.getLaebl(), beginTime, endTime); + // 警察纪警规 + List jjjgPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.JJJG.getLaebl(), beginTime, endTime); + // 案件来源占比 + List ajlyPieList = dataCaseVerifMapper.selectGroupByProblemSources(beginTime, endTime); + + JSONObject data = new JSONObject().fluentPut("overview", overview) + .fluentPut("fxsjBarList", fxsjBarList) + .fluentPut("jsdwBarList", jsdwBarList) + .fluentPut("zfbaPieList", zfbaPieList) + .fluentPut("fwglPieList", fwglPieList) + .fluentPut("jjjgPieList", jjjgPieList) + .fluentPut("ajlyPieList", ajlyPieList); + return Result.success(data);*/ + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java index 5f8d14b..c6d41f0 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java @@ -12,7 +12,6 @@ import java.time.LocalDateTime; @Getter public class RpcApply { - // @TableId(value = "rpc_id") private String rpcId; diff --git a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java index ff7217b..e4ebdd8 100644 --- a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java +++ b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java @@ -8,5 +8,13 @@ import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service -public class DataRightsComfortService extends ServiceImpl { +public class DataRightsComfortService { + + private final RpcApplyService rpcApplyService; + + private final RpcApplyPersonService rpcApplyPersonService; + + private final RpcInfringerResultService rpcInfringerResultService; + + } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyService.java b/src/main/java/com/biutag/supervision/service/RpcApplyService.java index f1ac779..9507279 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplyService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplyService.java @@ -3,8 +3,10 @@ package com.biutag.supervision.service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.pojo.entity.RpcApply; import com.biutag.supervision.mapper.RpcApplyMapper; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +@RequiredArgsConstructor @Service public class RpcApplyService extends ServiceImpl {