diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java index 7d89b77..74de20b 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java @@ -9,28 +9,24 @@ import com.biutag.supervision.mapper.CountyStreetDeptMapper; import com.biutag.supervision.mapper.RpcApplyMapper; import com.biutag.supervision.mapper.RpcInfringerResultMapper; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.dto.common.BarItem; -import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.CountyStreetDept; import com.biutag.supervision.pojo.entity.RpcApply; -import com.biutag.supervision.pojo.entity.SupDictData; -import com.biutag.supervision.pojo.vo.ComfortCountVO; +import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.vo.ComfortMapIconVo; -import com.biutag.supervision.pojo.vo.EchartsVo; -import com.biutag.supervision.service.DataRightsComfortService; import com.biutag.supervision.service.RpcApplyService; -import com.biutag.supervision.service.SupDictDataService; -import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; +import com.biutag.supervision.service.datav.DatavService; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; 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 org.springframework.web.bind.annotation.*; -import java.util.*; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; import java.util.stream.Collectors; /** @@ -46,102 +42,60 @@ import java.util.stream.Collectors; public class SubOneRightsController { - private final DataRightsComfortService dataRightsComfortService; private final RpcApplyMapper rpcApplyMapper; - private final SupDictDataService supDictDataService; private final CountyStreetDeptMapper countyStreetDeptMapper; private final RpcApplyService rpcApplyService; private final RpcInfringerResultMapper rpcInfringerResultMapper; - // 大屏中央总览数据 - @GetMapping("/getSubOneALlComfortCount") - public Result getALlComfortCount(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime = DateUtil.endOfDay(endTime); + private final DatavService datavService; + @Operation(summary = "维权案件情况") + @PostMapping("/getSubRightsBarList") + public Result getSubRightsBarList(@RequestBody SubDataVRequest request) { + return datavService.getSubRightsBarList(request); + } + @Operation(summary = "抚慰金额情况") + @PostMapping("/getSubComfortMoneyBarList") + public Result getSubComfortMoneyBarList(@RequestBody SubDataVRequest request) { + return datavService.getSubComfortMoneyBarList(request); + } - List list= rpcApplyMapper.selectList(new LambdaQueryWrapper() - .between(RpcApply::getCrtTime, beginTime, endTime) - .eq(RpcApply::getSecondDepartId,departId) - .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); - Long comfortTotal = rpcApplyMapper.countSubOneComfortPersonNumber(beginTime, endTime, departId); -// Integer comfortTotal = dataRightsComfortService.countComfortPersonNumber(beginTime, endTime); // 抚慰人数 - Double comfortMoney = rpcApplyMapper.countSubOneComfortMoney(beginTime, endTime, departId); -// Double comfortMoney = dataRightsComfortService.countComfortMoney(beginTime, endTime); // 抚慰金额 - Integer hitTotal = dataRightsComfortService.countSubOneHitPersonNumber(beginTime, endTime, departId); // 打击处理人数 - ComfortCountVO comfortOverview = new ComfortCountVO(); - //抚慰人数 - comfortOverview.setComfortTotal(comfortTotal); - //打击处理人数 - comfortOverview.setHitTotal(hitTotal); - //抚慰人数 - comfortOverview.setComfortMoney(comfortMoney); - //维权案件总数 - comfortOverview.setComfortCaseTotal(list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet()).size()); - //受侵害人数 - comfortOverview.setHurtTotal( rpcApplyMapper.selectVictimNumberByOrg(beginTime,endTime, String.valueOf(departId))); - // 维权案件情况 - 派出所 - List pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(beginTime, endTime, departId,10); - // 维权案件情况 - 大队 - List dbList = rpcApplyMapper.selectSubDdProtectRightsBarList(beginTime, endTime, departId,10); - //抚慰金额-派出所 - List fxsjComfortMoneyRank = rpcApplyMapper.selectSubProtectRightsBarList(beginTime, endTime, departId,10); - //抚慰金额-大队 - List jsdwComfortMoneyRank=rpcApplyMapper.selectSubComfortMoneyBarList(beginTime, endTime, departId,10); - JSONObject data = new JSONObject() - .fluentPut("comfortOverview", comfortOverview) - .fluentPut("fxsjRightsRankList",pcsList) - .fluentPut("jsdwRightsRankList",dbList) - .fluentPut("fxsjComfortMoneyRank",fxsjComfortMoneyRank) - .fluentPut("jsdwComfortMoneyRank",jsdwComfortMoneyRank); - - - return Result.success(data); + @Operation(summary = "案件类别占比") + @PostMapping("/getSubCaseType") + public Result getSubCaseType(@RequestBody SubDataVRequest request) { + return datavService.getSubCaseType(request); } + @Operation(summary = "大屏中央总览数据") + @PostMapping("/getSubOneALlComfortCount") + public Result getSubOneALlComfortCount(@RequestBody SubDataVRequest request) { + return datavService.getSubOneALlComfortCount(request); + } - // region 右边 - // 民辅警受伤人数情况和受伤类别 - @GetMapping("/getSubOnePoliceHurtSituationAndHurtType") - public Result getSubOnePoliceHurtSituationAndHurtType(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime =DateUtil.endOfDay(endTime); - List policeHurtSituationList = rpcApplyMapper.getSubOnePoliceHurtSituation(beginTime, endTime,departId); // 人数情况 - List policeHurtTypeList = rpcApplyMapper.getSubOnePoliceHurtType(beginTime, endTime,departId); // 受伤类别 - JSONObject data = new JSONObject() - .fluentPut("policeHurtSituationList", policeHurtSituationList) - .fluentPut("policeHurtTypeList", policeHurtTypeList); - return Result.success(data); + @Operation(summary = "打处情况") + @PostMapping("/getSubHitState") + public Result getSubHitState(@RequestBody SubDataVRequest request) { + return datavService.getSubHitState(request); } - // 发案情况占比 - @GetMapping("/getSubOneCaseAriseSituationRate") - public Result getSubOneCaseAriseSituationRate(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime =DateUtil.endOfDay(endTime); - // 发案环节 - List incidentLinkList = rpcApplyMapper.getSubOneIncidentLink(beginTime, endTime,departId); - // 发案警种 + @Operation(summary = "抚慰情况") + @PostMapping("/getSubComfortState") + public Result getSubComfortState(@RequestBody SubDataVRequest request) { + return datavService.getSubComfortState(request); + } - List incidentPoliceList = rpcApplyMapper.getSubOneIncidentPolice(beginTime, endTime,departId); - List supDictDataList = supDictDataService.list(new LambdaQueryWrapper().eq(SupDictData::getDictType,"personType")); - incidentPoliceList.forEach(s->{ - Optional supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst(); - supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel())); - }); + @Operation(summary = "民辅警受伤情况") + @PostMapping("/getSubPoliceHurtSituationAndHurtType") + public Result getSubPoliceHurtSituationAndHurtType(@RequestBody SubDataVRequest request) { + return datavService.getSubPoliceHurtSituationAndHurtType(request); + } - // 发案单位 - List incidentOrgList = rpcApplyMapper.getSubOneIncidentOrg(beginTime, endTime,departId); - JSONObject data = new JSONObject() - .fluentPut("incidentLinkList", incidentLinkList) - .fluentPut("incidentPoliceTypeList", incidentPoliceList) - .fluentPut("incidentOrgList", incidentOrgList); - return Result.success(data); + @Operation(summary = "发案情况占比") + @PostMapping("/getSubOneCaseAriseSituationRate") + public Result getSubOneCaseAriseSituationRate(@RequestBody SubDataVRequest request) { + return datavService.getSubOneCaseAriseSituationRate(request); } // endregion @@ -161,46 +115,29 @@ public class SubOneRightsController { res.add(iconVo); } for (ComfortMapIconVo re : res) { - String deptId = re.getDepartId(); - - List list = rpcApplyService.list(new LambdaQueryWrapper() - .between(RpcApply::getCrtTime, beginTime, finalEndTime) - .eq(RpcApply::getDepartId,deptId) - .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); - - Set caseNumbers = list.stream().filter(one->StrUtil.isNotBlank(one.getDepartId())).map(RpcApply::getCaseNumber).collect(Collectors.toSet()); - - // 维权案件总数 - re.setRightsNumber(caseNumbers.size()); - // 受侵害人数 - re.setVictimNumber(rpcApplyMapper.selectVictimNumberByOrg(beginTime,finalEndTime,deptId)); - // 打击处理人数 - List tortNames = rpcInfringerResultMapper.selectNamesByOrgTime(beginTime, finalEndTime,deptId); + String subDepart = re.getDepartId(); + Integer rightsNumber = rpcApplyMapper.selectMapRightsNumber(beginTime, finalEndTime, subDepart); + Integer victimNumber = rpcApplyMapper.selectMapVictimNumber(beginTime, finalEndTime, subDepart); + Long comfortPersonNumber = rpcApplyMapper.selectMapComfortPersonNumber(beginTime, finalEndTime, subDepart); + List tortNames = rpcApplyMapper.selectMaptHitPersonNumber(beginTime, finalEndTime, subDepart); + BigDecimal comfortMoney = rpcApplyMapper.selectMapComfortMoney(beginTime, finalEndTime, subDepart); + re.setRightsNumber(rightsNumber); + re.setVictimNumber(victimNumber); + re.setComfortPersonNumber(comfortPersonNumber); long initialListSize = tortNames.size(); long hitPersonNumber = tortNames.stream() .filter(s -> s.contains(",")).toList().size(); // 筛选出包含逗号的名称 long nums = tortNames.stream() .filter(s -> s.contains(",")) - .mapToLong(s -> s.split(",").length) - .sum();// 计算所有拆分后数组长度的总和 // 拆分每个名称并计算拆分后的数组长度 + .mapToLong(s -> s.split(",").length) // 拆分每个名称并计算拆分后的数组长度 + .sum();// 计算所有拆分后数组长度的总和 if(tortNames.stream().noneMatch(s -> s.contains(","))){ re.setHitPersonNumber(initialListSize ); }else{ re.setHitPersonNumber(initialListSize + nums - hitPersonNumber); } - //抚慰金额 - re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBar(beginTime, finalEndTime, deptId)); - // 抚慰人数 - re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), deptId)); -// CompletableFutureUtil.runSyncObject(() -> { -// -// re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, deptId)); -// }); -// CompletableFutureUtil.runSyncObject(() -> { -// // 抚慰人数 -// re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), deptId)); -// }); + re.setComfortMoney(comfortMoney); } @@ -213,55 +150,6 @@ public class SubOneRightsController { - // endregion - //打处情况 - @GetMapping("getPunishmentSituation") - public Result getPunishmentSituation(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ - endTime =DateUtil.endOfDay(endTime); - //获取相关案件 - List list= rpcApplyMapper.selectList(new LambdaQueryWrapper() - .between(RpcApply::getCrtTime, beginTime, endTime) - .eq(RpcApply::getSecondDepartId,departId) - .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); - //案件分组 - Map> collect = list.stream() - .filter(s-> StrUtil.isNotEmpty(s.getInfringerHandle()) ) - .collect(Collectors.groupingBy(RpcApply::getInfringerHandle)); - List pieItems = collect.keySet().stream().map(name -> { - return new PieItem(name, collect.get(name).size()); - }).toList(); - JSONObject data = new JSONObject().fluentPut("PunishmentSituation",pieItems); - return Result.success(data); - } - - - - // 抚慰情况 - @GetMapping("/getComfortSituation") - public Result getComfortSituation(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime = DateUtil.endOfDay(endTime); - List comfortSituationList = rpcApplyMapper.selectSubComfortSituation(beginTime, endTime,departId); - JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList); - return Result.success(data); - } - - //案件类别占比 - @GetMapping("getSubCaseType") - public Result getSubCaseType(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ - endTime = DateUtil.endOfDay(endTime); - //案件类别 - 刑事 - List crownCaseBar =rpcApplyMapper.selectSubCaseData(beginTime, endTime,"1",departId); - //案件类别 - 行政 - List administrativeCase = rpcApplyMapper.selectSubCaseData( beginTime, endTime,"2",departId); - JSONObject data = new JSONObject().fluentPut("crownCaseBar",crownCaseBar).fluentPut("administrativeCase",administrativeCase); - return Result.success(data); - } } diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 80be62d..33ab300 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -54,15 +54,18 @@ public interface RpcApplyMapper extends BaseMapper { /** * 二级 获取不同案件类型下的数据 * */ - @Select(" SELECT " + - " ra.case_category as name,COUNT(*) as value" + - " from rpc_apply as ra LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + - " WHERE ra.case_type = #{type} " + - " and ra.crt_time between #{beginTime} and #{endTime} " + - " and ra.second_depart_id = #{departId} "+ - " and ra.case_category is NOT NULL GROUP BY ra.case_category " - ) - List selectSubCaseData(Date beginTime, Date endTime,String type,Integer departId); + @Select(" SELECT " + + "ra.case_category AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply ra " + + "LEFT JOIN sup_depart sd on ra.depart_id = sd.id " + + "WHERE ra.case_type = #{caseType} " + + "AND ra.type=1 " + + "AND sd.pid = #{departId} " + + "AND ra.crt_time >=#{beginTime} AND ra.crt_time <= #{endTime} " + + "AND ra.case_category is not NULL " + + "GROUP BY ra.case_category; ") + List selectSubCaseData(Date beginTime, Date endTime,String caseType,Integer departId); /** * 获取受侵害人数 * */ @@ -439,5 +442,120 @@ public interface RpcApplyMapper extends BaseMapper { "AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})") BigDecimal selectMapComfortMoney(Date beginTime, Date finalEndTime, String departId); + + @Select("select " + + "sd.`short_name` AS label, " + + "ROUND( sum(p.provide_relief)/10000, 2) AS `value` " + + "from rpc_apply r " + + "LEFT JOIN rpc_apply_person p on r.rpc_id = p.rpc_id " + + "LEFT JOIN sup_depart sd ON r.depart_id = sd.id " + + "where r.type = 2 " + + "AND sd.statistics_group_id = #{groupId} " + + "and r.rpc_status = 'completed' " + + "AND r.apply_date >= #{beginTime} and r.apply_date<= #{endTime} " + + "AND sd.pid = #{departId} " + + "GROUP BY label " + + "ORDER BY `value` DESC") + List getSubPcComfortMoneyBarList(Date beginTime, Date endTime, String departId, int groupId); + @Select("select " + + "sd.`short_name` AS label, " + + "ROUND( sum(p.provide_relief)/10000, 2) AS `value` " + + "from rpc_apply r " + + "LEFT JOIN rpc_apply_person p on r.rpc_id = p.rpc_id " + + "LEFT JOIN sup_depart sd ON r.depart_id = sd.id " + + "where r.type = 2 " + + "AND sd.statistics_group_id != #{groupId} " + + "and r.rpc_status = 'completed' " + + "AND r.apply_date >= #{beginTime} and r.apply_date<= #{endTime} " + + "AND sd.pid = #{departId} " + + "GROUP BY label " + + "ORDER BY `value` DESC") + List getSubDdComfortMoneyBarList(Date beginTime, Date endTime, String departId, int groupId); + + @Select("SELECT " + + "b.person_type, " + + "IFNULL( sdd.dict_label,'未知') as name , " + + "count(*) as `value` " + + "FROM rpc_apply as a " + + "LEFT JOIN (SELECT emp_no, person_type, `name` FROM sup_police WHERE del =0) as b on a.applicant_emp_no = b.emp_no " + + "LEFT JOIN sup_dict_data sdd ON b.person_type = sdd.dict_value AND sdd.dict_type = 'personType' " + + "LEFT JOIN sup_depart sd on a.depart_id = sd.id " + + "WHERE a.apply_date >=#{beginTime} and a.apply_date<= #{endTime} " + + "AND a.type = 2 " + + "AND a.rpc_status = 'completed' " + + "AND sd.pid= #{departId} " + + "GROUP BY person_type") + List getSubComfortState(Date beginTime, Date endTime, String departId); + + @Select("SELECT " + + "p.injury_severity_name as name , " + + "count(r.rpc_id) as value " + + "FROM rpc_apply r " + + "LEFT JOIN rpc_apply_person p on r.rpc_id=p.rpc_id " + + "LEFT JOIN sup_depart sd on r.depart_id=sd.id " + + "WHERE r.apply_date >=#{beginTime} and r.apply_date <=#{endTime} " + + "AND r.type='2' " + + "and r.rpc_status = 'completed' " + + "AND sd.pid=#{departId} " + + "GROUP BY p.injury_severity_name") + List getSubPoliceHurtSituationAndHurtType(Date beginTime, Date endTime, String departId); + + @Select("SELECT Incident_link_name as name , count(*) as value " + + "FROM rpc_apply r " + + "LEFT JOIN sup_depart sd on r.depart_id=sd.id " + + "WHERE r.crt_time >= #{beginTime} and r.crt_time<= #{endTime} " + + "AND sd.pid = #{departId} " + + "and r.Incident_link_name is not NULL " + + "AND r.type= 1 " + + "AND r.verified = 0 " + + "GROUP BY name") + List getSubIncidentLinkList(Date beginTime, Date endTime, String departId); + + @Select("SELECT " + + "b.person_type, " + + "IFNULL( sdd.dict_label,'未知') as name , " + + "count(*) as `value` " + + "FROM rpc_apply ra " + + "LEFT JOIN rpc_apply_person rap ON ra.rpc_id = rap.rpc_id " + + "LEFT JOIN ( SELECT emp_no, person_type FROM sup_police WHERE del = 0 ) AS b ON rap.emp_no = b.emp_no " + + "LEFT JOIN sup_dict_data sdd ON b.person_type = sdd.dict_value AND sdd.dict_type = 'personType' " + + "LEFT JOIN sup_depart sd on ra.depart_id=sd.id " + + "WHERE " + + "ra.crt_time >= #{beginTime} AND ra.crt_time <= #{endTime} " + + "AND ra.type = 1 " + + "AND sd.pid=#{departId} " + + "GROUP BY b.person_type ") + List getSubIncidentPoliceList(Date beginTime, Date endTime, String departId); + + @Select("SELECT " + + "ra.depart_name as name," + + "count(*) as value " + + "FROM rpc_apply ra " + + "LEFT JOIN sup_depart sd on ra.depart_id = sd.id " + + "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + + "WHERE ra.rpc_id is not null " + + "AND ra.type =1 " + + "AND ra.verified = 0 " + + "AND ra.crt_time >= #{beginTime} AND ra.crt_time <= #{endTime} " + + "AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})" + + "group by name ") + List getSubIncidentOrgList(Date beginTime, Date endTime, String departId); + + @Select("select " + + "defend_handle_way_name as name, " + + "count(*) as value " + + "FROM rpc_infringer_result rir " + + "left join rpc_apply ra on rir.rpc_id = ra.rpc_id " + + "LEFT JOIN sup_depart sd on ra.depart_id = sd.id " + + "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + + "where ra.crt_time >= #{beginTime} AND ra.crt_time <= #{endTime} " + + "and ra.type=1 " + + "and ra.verified=0 " + + "AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})" + + "group by name ") + List getSubHitState(Date beginTime, Date endTime, String departId); + // } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java b/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java index 2abdec2..53b194f 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java @@ -2,6 +2,8 @@ package com.biutag.supervision.pojo.vo; import lombok.Data; +import java.math.BigDecimal; + /** * @Auther: sh * @Date: 2024/12/2 15:21 @@ -9,10 +11,10 @@ import lombok.Data; */ @Data public class ComfortCountVO { - private Integer comfortCaseTotal; // 维权案件总数 - private Integer hurtTotal; // 受侵害人数 + private Long comfortCaseTotal; // 维权案件总数 + private Long hurtTotal; // 受侵害人数 + private Long hitTotal; // 打击处理人数 private Long comfortTotal; // 抚慰人数 - private Integer hitTotal; // 打击处理人数 - private Double comfortMoney; // 抚慰金额 + private BigDecimal comfortMoney; // 抚慰金额 } 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 426253d..10b0a68 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavService.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavService.java @@ -3,6 +3,7 @@ package com.biutag.supervision.service.datav; import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.request.datav.DataVRequest; +import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.vo.AuditOverview; /** @@ -98,4 +99,55 @@ public interface DatavService { */ Result getPoliceHurtSituationAndHurtType(DataVRequest request); + /** + * 维权抚慰 二级大屏 维权案件情况 + * @param request + * @return + */ + Result getSubRightsBarList(SubDataVRequest request); + + Result getSubComfortMoneyBarList(SubDataVRequest request); + + /** + * 总览 + * @param request + * @return + */ + Result getSubOneALlComfortCount(SubDataVRequest request); + + /** + * 案件类别占比 + * @param request + * @return + */ + Result getSubCaseType(SubDataVRequest request); + + /** + * 二级 抚慰情况 + * @param request + * @return + */ + Result getSubComfortState(SubDataVRequest request); + + /** + * 二级 民辅警受伤情况 + * @param request + * @return + */ + Result getSubPoliceHurtSituationAndHurtType(SubDataVRequest request); + + /** + * 二级 发案情况占比 + * @param request + * @return + */ + Result getSubOneCaseAriseSituationRate(SubDataVRequest request); + + /** + * 二级 维权打处情况 + * @param request + * @return + */ + Result getSubHitState(SubDataVRequest 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 00d5f2e..2ec509c 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -22,6 +22,7 @@ import com.biutag.supervision.pojo.entity.report.ReportProject; import com.biutag.supervision.pojo.param.*; import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam; import com.biutag.supervision.pojo.request.datav.DataVRequest; +import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.repository.dataAudit.DataAuditResourceService; import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService; @@ -631,4 +632,105 @@ public class DatavServiceImpl implements DatavService { .fluentPut("comfortInjuryCategory", comfortInjuryCategory); return Result.success(data); } + + /** + * 维权抚慰 二级大屏 维权案件情况 + * @param request + * @return + */ + @Override + public Result getSubRightsBarList(SubDataVRequest request) { + // 维权案件情况 - 派出所 + List pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()),10); + // 维权案件情况 - 大队 + List dbList = rpcApplyMapper.selectSubDdProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()),10); + + JSONObject data = new JSONObject() + .fluentPut("fxsjRightsRankList",pcsList) + .fluentPut("jsdwRightsRankList",dbList); + return Result.success(data); + } + + + @Override + public Result getSubComfortMoneyBarList(SubDataVRequest request) { + List fxsjComfortMoneyRank = rpcApplyMapper.getSubPcComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10); + List jsdwComfortMoneyRank = rpcApplyMapper.getSubDdComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10); + JSONObject data = new JSONObject() + .fluentPut("fxsjComfortMoneyRank",fxsjComfortMoneyRank) + .fluentPut("jsdwComfortMoneyRank",jsdwComfortMoneyRank); + return Result.success(data); + } + + + @Override + public Result getSubCaseType(SubDataVRequest request) { + List crownCaseBar =rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(),"1",Integer.valueOf(request.getDepartId())); + //案件类别 - 行政 + List administrativeCase = rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(),"2",Integer.valueOf(request.getDepartId())); + JSONObject data = new JSONObject().fluentPut("crownCaseBar",crownCaseBar).fluentPut("administrativeCase",administrativeCase); + return Result.success(data); + } + + @Override + public Result getSubComfortState(SubDataVRequest request) { + List comfortSituationList = rpcApplyMapper.getSubComfortState(request.getBeginTime(), request.getEndTime(), request.getDepartId()); + JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList); + return Result.success(data); + } + + @Override + public Result getSubHitState(SubDataVRequest request) { + List pieItems = rpcApplyMapper.getSubHitState(request.getBeginTime(), request.getEndTime(), request.getDepartId()); + JSONObject data = new JSONObject().fluentPut("PunishmentSituation",pieItems); + return Result.success(data); + } + + @Override + public Result getSubPoliceHurtSituationAndHurtType(SubDataVRequest request) { + List policeHurtSituationList = rpcApplyMapper.getSubPoliceHurtSituationAndHurtType(request.getBeginTime(), request.getEndTime(), request.getDepartId()); // 人数情况 + JSONObject data = new JSONObject().fluentPut("policeHurtSituationList", policeHurtSituationList); + return Result.success(data); + } + + @Override + public Result getSubOneCaseAriseSituationRate(SubDataVRequest request) { + List incidentLinkList = rpcApplyMapper.getSubIncidentLinkList(request.getBeginTime(), request.getEndTime(), request.getDepartId()); + List incidentPoliceList = rpcApplyMapper.getSubIncidentPoliceList(request.getBeginTime(), request.getEndTime(), request.getDepartId()); + List incidentOrgList = rpcApplyMapper.getSubIncidentOrgList(request.getBeginTime(), request.getEndTime(), request.getDepartId()); + JSONObject data = new JSONObject() + .fluentPut("incidentLinkList", incidentLinkList) + .fluentPut("incidentPoliceTypeList", incidentPoliceList) + .fluentPut("incidentOrgList", incidentOrgList); + return Result.success(data); + } + + @Override + public Result getSubOneALlComfortCount(SubDataVRequest request) { + ComfortCountVO comfortOverview = new ComfortCountVO(); + Date beginTime = request.getBeginTime(); + Date endTime = request.getEndTime(); + String departId = request.getDepartId(); + comfortOverview.setComfortCaseTotal(Long.valueOf(rpcApplyMapper.selectMapRightsNumber(beginTime, endTime, departId))); + comfortOverview.setHurtTotal(Long.valueOf(rpcApplyMapper.selectMapVictimNumber(beginTime, endTime, departId))); + comfortOverview.setComfortTotal(rpcApplyMapper.selectMapComfortPersonNumber(beginTime, endTime, departId)); + List tortNames = rpcApplyMapper.selectMaptHitPersonNumber(beginTime, endTime, departId); + long initialListSize = tortNames.size(); + long hitPersonNumber = tortNames.stream() + .filter(s -> s.contains(",")).toList().size(); + // 筛选出包含逗号的名称 + long nums = tortNames.stream() + .filter(s -> s.contains(",")) + .mapToLong(s -> s.split(",").length) // 拆分每个名称并计算拆分后的数组长度 + .sum();// 计算所有拆分后数组长度的总和 + if(tortNames.stream().noneMatch(s -> s.contains(","))){ + comfortOverview.setHitTotal(initialListSize); + }else{ + comfortOverview.setHitTotal(initialListSize + nums - hitPersonNumber); + } + comfortOverview.setComfortMoney(rpcApplyMapper.selectMapComfortMoney(beginTime, endTime, departId)); + JSONObject data = new JSONObject().fluentPut("comfortOverview", comfortOverview); + return Result.success(data); + + } }