Browse Source

fix--抚慰大屏重构-step3

master
buaixuexideshitongxue 3 weeks ago
parent
commit
f80a19713a
  1. 230
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java
  2. 136
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java
  3. 10
      src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java
  4. 52
      src/main/java/com/biutag/supervision/service/datav/DatavService.java
  5. 102
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

230
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.RpcApplyMapper;
import com.biutag.supervision.mapper.RpcInfringerResultMapper; import com.biutag.supervision.mapper.RpcInfringerResultMapper;
import com.biutag.supervision.pojo.Result; 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.CountyStreetDept;
import com.biutag.supervision.pojo.entity.RpcApply; import com.biutag.supervision.pojo.entity.RpcApply;
import com.biutag.supervision.pojo.entity.SupDictData; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.ComfortCountVO;
import com.biutag.supervision.pojo.vo.ComfortMapIconVo; 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.RpcApplyService;
import com.biutag.supervision.service.SupDictDataService; import com.biutag.supervision.service.datav.DatavService;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
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; import java.util.stream.Collectors;
/** /**
@ -46,102 +42,60 @@ import java.util.stream.Collectors;
public class SubOneRightsController { public class SubOneRightsController {
private final DataRightsComfortService dataRightsComfortService;
private final RpcApplyMapper rpcApplyMapper; private final RpcApplyMapper rpcApplyMapper;
private final SupDictDataService supDictDataService;
private final CountyStreetDeptMapper countyStreetDeptMapper; private final CountyStreetDeptMapper countyStreetDeptMapper;
private final RpcApplyService rpcApplyService; private final RpcApplyService rpcApplyService;
private final RpcInfringerResultMapper rpcInfringerResultMapper; private final RpcInfringerResultMapper rpcInfringerResultMapper;
// 大屏中央总览数据 private final DatavService datavService;
@GetMapping("/getSubOneALlComfortCount")
public Result<JSONObject> getALlComfortCount(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
@Operation(summary = "维权案件情况")
@PostMapping("/getSubRightsBarList")
public Result<JSONObject> getSubRightsBarList(@RequestBody SubDataVRequest request) {
return datavService.getSubRightsBarList(request);
}
@Operation(summary = "抚慰金额情况")
@PostMapping("/getSubComfortMoneyBarList")
public Result<JSONObject> getSubComfortMoneyBarList(@RequestBody SubDataVRequest request) {
return datavService.getSubComfortMoneyBarList(request);
}
List<RpcApply> list= rpcApplyMapper.selectList(new LambdaQueryWrapper<RpcApply>() @Operation(summary = "案件类别占比")
.between(RpcApply::getCrtTime, beginTime, endTime) @PostMapping("/getSubCaseType")
.eq(RpcApply::getSecondDepartId,departId) public Result<JSONObject> getSubCaseType(@RequestBody SubDataVRequest request) {
.eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); return datavService.getSubCaseType(request);
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<BarItem> pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(beginTime, endTime, departId,10);
// 维权案件情况 - 大队
List<BarItem> dbList = rpcApplyMapper.selectSubDdProtectRightsBarList(beginTime, endTime, departId,10);
//抚慰金额-派出所
List<BarItem> fxsjComfortMoneyRank = rpcApplyMapper.selectSubProtectRightsBarList(beginTime, endTime, departId,10);
//抚慰金额-大队
List<BarItem> 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("/getSubOneALlComfortCount")
public Result<JSONObject> getSubOneALlComfortCount(@RequestBody SubDataVRequest request) {
return datavService.getSubOneALlComfortCount(request);
}
// region 右边 @Operation(summary = "打处情况")
// 民辅警受伤人数情况和受伤类别 @PostMapping("/getSubHitState")
@GetMapping("/getSubOnePoliceHurtSituationAndHurtType") public Result<JSONObject> getSubHitState(@RequestBody SubDataVRequest request) {
public Result<JSONObject> getSubOnePoliceHurtSituationAndHurtType(@RequestParam Integer departId, return datavService.getSubHitState(request);
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime =DateUtil.endOfDay(endTime);
List<EchartsVo> policeHurtSituationList = rpcApplyMapper.getSubOnePoliceHurtSituation(beginTime, endTime,departId); // 人数情况
List<EchartsVo> policeHurtTypeList = rpcApplyMapper.getSubOnePoliceHurtType(beginTime, endTime,departId); // 受伤类别
JSONObject data = new JSONObject()
.fluentPut("policeHurtSituationList", policeHurtSituationList)
.fluentPut("policeHurtTypeList", policeHurtTypeList);
return Result.success(data);
} }
// 发案情况占比 @Operation(summary = "抚慰情况")
@GetMapping("/getSubOneCaseAriseSituationRate") @PostMapping("/getSubComfortState")
public Result<JSONObject> getSubOneCaseAriseSituationRate(@RequestParam Integer departId, public Result<JSONObject> getSubComfortState(@RequestBody SubDataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, return datavService.getSubComfortState(request);
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { }
endTime =DateUtil.endOfDay(endTime);
// 发案环节
List<EchartsVo> incidentLinkList = rpcApplyMapper.getSubOneIncidentLink(beginTime, endTime,departId);
// 发案警种
List<EchartsVo> incidentPoliceList = rpcApplyMapper.getSubOneIncidentPolice(beginTime, endTime,departId);
List<SupDictData> supDictDataList = supDictDataService.list(new LambdaQueryWrapper<SupDictData>().eq(SupDictData::getDictType,"personType"));
incidentPoliceList.forEach(s->{
Optional<SupDictData> supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst();
supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel()));
});
@Operation(summary = "民辅警受伤情况")
@PostMapping("/getSubPoliceHurtSituationAndHurtType")
public Result<JSONObject> getSubPoliceHurtSituationAndHurtType(@RequestBody SubDataVRequest request) {
return datavService.getSubPoliceHurtSituationAndHurtType(request);
}
// 发案单位
List<EchartsVo> incidentOrgList = rpcApplyMapper.getSubOneIncidentOrg(beginTime, endTime,departId);
JSONObject data = new JSONObject() @Operation(summary = "发案情况占比")
.fluentPut("incidentLinkList", incidentLinkList) @PostMapping("/getSubOneCaseAriseSituationRate")
.fluentPut("incidentPoliceTypeList", incidentPoliceList) public Result<JSONObject> getSubOneCaseAriseSituationRate(@RequestBody SubDataVRequest request) {
.fluentPut("incidentOrgList", incidentOrgList); return datavService.getSubOneCaseAriseSituationRate(request);
return Result.success(data);
} }
// endregion // endregion
@ -161,46 +115,29 @@ public class SubOneRightsController {
res.add(iconVo); res.add(iconVo);
} }
for (ComfortMapIconVo re : res) { for (ComfortMapIconVo re : res) {
String deptId = re.getDepartId(); String subDepart = re.getDepartId();
Integer rightsNumber = rpcApplyMapper.selectMapRightsNumber(beginTime, finalEndTime, subDepart);
List<RpcApply> list = rpcApplyService.list(new LambdaQueryWrapper<RpcApply>() Integer victimNumber = rpcApplyMapper.selectMapVictimNumber(beginTime, finalEndTime, subDepart);
.between(RpcApply::getCrtTime, beginTime, finalEndTime) Long comfortPersonNumber = rpcApplyMapper.selectMapComfortPersonNumber(beginTime, finalEndTime, subDepart);
.eq(RpcApply::getDepartId,deptId) List<String> tortNames = rpcApplyMapper.selectMaptHitPersonNumber(beginTime, finalEndTime, subDepart);
.eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); BigDecimal comfortMoney = rpcApplyMapper.selectMapComfortMoney(beginTime, finalEndTime, subDepart);
re.setRightsNumber(rightsNumber);
Set<String> caseNumbers = list.stream().filter(one->StrUtil.isNotBlank(one.getDepartId())).map(RpcApply::getCaseNumber).collect(Collectors.toSet()); re.setVictimNumber(victimNumber);
re.setComfortPersonNumber(comfortPersonNumber);
// 维权案件总数
re.setRightsNumber(caseNumbers.size());
// 受侵害人数
re.setVictimNumber(rpcApplyMapper.selectVictimNumberByOrg(beginTime,finalEndTime,deptId));
// 打击处理人数
List<String> tortNames = rpcInfringerResultMapper.selectNamesByOrgTime(beginTime, finalEndTime,deptId);
long initialListSize = tortNames.size(); long initialListSize = tortNames.size();
long hitPersonNumber = tortNames.stream() long hitPersonNumber = tortNames.stream()
.filter(s -> s.contains(",")).toList().size(); .filter(s -> s.contains(",")).toList().size();
// 筛选出包含逗号的名称 // 筛选出包含逗号的名称
long nums = tortNames.stream() long nums = tortNames.stream()
.filter(s -> s.contains(",")) .filter(s -> s.contains(","))
.mapToLong(s -> s.split(",").length) .mapToLong(s -> s.split(",").length) // 拆分每个名称并计算拆分后的数组长度
.sum();// 计算所有拆分后数组长度的总和 // 拆分每个名称并计算拆分后的数组长度 .sum();// 计算所有拆分后数组长度的总和
if(tortNames.stream().noneMatch(s -> s.contains(","))){ if(tortNames.stream().noneMatch(s -> s.contains(","))){
re.setHitPersonNumber(initialListSize ); re.setHitPersonNumber(initialListSize );
}else{ }else{
re.setHitPersonNumber(initialListSize + nums - hitPersonNumber); re.setHitPersonNumber(initialListSize + nums - hitPersonNumber);
} }
//抚慰金额 re.setComfortMoney(comfortMoney);
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));
// });
} }
@ -213,55 +150,6 @@ public class SubOneRightsController {
// endregion
//打处情况
@GetMapping("getPunishmentSituation")
public Result<JSONObject> 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<RpcApply> list= rpcApplyMapper.selectList(new LambdaQueryWrapper<RpcApply>()
.between(RpcApply::getCrtTime, beginTime, endTime)
.eq(RpcApply::getSecondDepartId,departId)
.eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()));
//案件分组
Map<String, List<RpcApply>> collect = list.stream()
.filter(s-> StrUtil.isNotEmpty(s.getInfringerHandle()) )
.collect(Collectors.groupingBy(RpcApply::getInfringerHandle));
List<PieItem> 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<JSONObject> 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<PieItem> comfortSituationList = rpcApplyMapper.selectSubComfortSituation(beginTime, endTime,departId);
JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList);
return Result.success(data);
}
//案件类别占比
@GetMapping("getSubCaseType")
public Result<JSONObject> 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<EchartsVo> crownCaseBar =rpcApplyMapper.selectSubCaseData(beginTime, endTime,"1",departId);
//案件类别 - 行政
List<EchartsVo> administrativeCase = rpcApplyMapper.selectSubCaseData( beginTime, endTime,"2",departId);
JSONObject data = new JSONObject().fluentPut("crownCaseBar",crownCaseBar).fluentPut("administrativeCase",administrativeCase);
return Result.success(data);
}
} }

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

@ -54,15 +54,18 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
/** /**
* 二级 获取不同案件类型下的数据 * 二级 获取不同案件类型下的数据
* */ * */
@Select(" SELECT " + @Select(" SELECT " +
" ra.case_category as name,COUNT(*) as value" + "ra.case_category AS `name`, " +
" from rpc_apply as ra LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + "count(*) AS `value` " +
" WHERE ra.case_type = #{type} " + "FROM rpc_apply ra " +
" and ra.crt_time between #{beginTime} and #{endTime} " + "LEFT JOIN sup_depart sd on ra.depart_id = sd.id " +
" and ra.second_depart_id = #{departId} "+ "WHERE ra.case_type = #{caseType} " +
" and ra.case_category is NOT NULL GROUP BY ra.case_category " "AND ra.type=1 " +
) "AND sd.pid = #{departId} " +
List<EchartsVo> selectSubCaseData(Date beginTime, Date endTime,String type,Integer departId); "AND ra.crt_time >=#{beginTime} AND ra.crt_time <= #{endTime} " +
"AND ra.case_category is not NULL " +
"GROUP BY ra.case_category; ")
List<EchartsVo> selectSubCaseData(Date beginTime, Date endTime,String caseType,Integer departId);
/** /**
* 获取受侵害人数 * 获取受侵害人数
* */ * */
@ -439,5 +442,120 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
"AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})") "AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})")
BigDecimal selectMapComfortMoney(Date beginTime, Date finalEndTime, String 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<BarItem> 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<BarItem> 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<PieItem> 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<EchartsVo> 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<EchartsVo> 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<EchartsVo> 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<EchartsVo> 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<PieItem> getSubHitState(Date beginTime, Date endTime, String departId);
// //
} }

10
src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java

@ -2,6 +2,8 @@ package com.biutag.supervision.pojo.vo;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/12/2 15:21 * @Date: 2024/12/2 15:21
@ -9,10 +11,10 @@ import lombok.Data;
*/ */
@Data @Data
public class ComfortCountVO { public class ComfortCountVO {
private Integer comfortCaseTotal; // 维权案件总数 private Long comfortCaseTotal; // 维权案件总数
private Integer hurtTotal; // 受侵害人数 private Long hurtTotal; // 受侵害人数
private Long hitTotal; // 打击处理人数
private Long comfortTotal; // 抚慰人数 private Long comfortTotal; // 抚慰人数
private Integer hitTotal; // 打击处理人数 private BigDecimal comfortMoney; // 抚慰金额
private Double comfortMoney; // 抚慰金额
} }

52
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.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.AuditOverview; import com.biutag.supervision.pojo.vo.AuditOverview;
/** /**
@ -98,4 +99,55 @@ public interface DatavService {
*/ */
Result<JSONObject> getPoliceHurtSituationAndHurtType(DataVRequest request); Result<JSONObject> getPoliceHurtSituationAndHurtType(DataVRequest request);
/**
* 维权抚慰 二级大屏 维权案件情况
* @param request
* @return
*/
Result<JSONObject> getSubRightsBarList(SubDataVRequest request);
Result<JSONObject> getSubComfortMoneyBarList(SubDataVRequest request);
/**
* 总览
* @param request
* @return
*/
Result<JSONObject> getSubOneALlComfortCount(SubDataVRequest request);
/**
* 案件类别占比
* @param request
* @return
*/
Result<JSONObject> getSubCaseType(SubDataVRequest request);
/**
* 二级 抚慰情况
* @param request
* @return
*/
Result<JSONObject> getSubComfortState(SubDataVRequest request);
/**
* 二级 民辅警受伤情况
* @param request
* @return
*/
Result<JSONObject> getSubPoliceHurtSituationAndHurtType(SubDataVRequest request);
/**
* 二级 发案情况占比
* @param request
* @return
*/
Result<JSONObject> getSubOneCaseAriseSituationRate(SubDataVRequest request);
/**
* 二级 维权打处情况
* @param request
* @return
*/
Result<JSONObject> getSubHitState(SubDataVRequest request);
} }

102
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.*;
import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam; import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam;
import com.biutag.supervision.pojo.request.datav.DataVRequest; 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.pojo.vo.*;
import com.biutag.supervision.repository.dataAudit.DataAuditResourceService; import com.biutag.supervision.repository.dataAudit.DataAuditResourceService;
import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService; import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService;
@ -631,4 +632,105 @@ public class DatavServiceImpl implements DatavService {
.fluentPut("comfortInjuryCategory", comfortInjuryCategory); .fluentPut("comfortInjuryCategory", comfortInjuryCategory);
return Result.success(data); return Result.success(data);
} }
/**
* 维权抚慰 二级大屏 维权案件情况
* @param request
* @return
*/
@Override
public Result<JSONObject> getSubRightsBarList(SubDataVRequest request) {
// 维权案件情况 - 派出所
List<BarItem> pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()),10);
// 维权案件情况 - 大队
List<BarItem> 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<JSONObject> getSubComfortMoneyBarList(SubDataVRequest request) {
List<BarItem> fxsjComfortMoneyRank = rpcApplyMapper.getSubPcComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10);
List<BarItem> 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<JSONObject> getSubCaseType(SubDataVRequest request) {
List<EchartsVo> crownCaseBar =rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(),"1",Integer.valueOf(request.getDepartId()));
//案件类别 - 行政
List<EchartsVo> 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<JSONObject> getSubComfortState(SubDataVRequest request) {
List<PieItem> comfortSituationList = rpcApplyMapper.getSubComfortState(request.getBeginTime(), request.getEndTime(), request.getDepartId());
JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubHitState(SubDataVRequest request) {
List<PieItem> pieItems = rpcApplyMapper.getSubHitState(request.getBeginTime(), request.getEndTime(), request.getDepartId());
JSONObject data = new JSONObject().fluentPut("PunishmentSituation",pieItems);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubPoliceHurtSituationAndHurtType(SubDataVRequest request) {
List<EchartsVo> policeHurtSituationList = rpcApplyMapper.getSubPoliceHurtSituationAndHurtType(request.getBeginTime(), request.getEndTime(), request.getDepartId()); // 人数情况
JSONObject data = new JSONObject().fluentPut("policeHurtSituationList", policeHurtSituationList);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneCaseAriseSituationRate(SubDataVRequest request) {
List<EchartsVo> incidentLinkList = rpcApplyMapper.getSubIncidentLinkList(request.getBeginTime(), request.getEndTime(), request.getDepartId());
List<EchartsVo> incidentPoliceList = rpcApplyMapper.getSubIncidentPoliceList(request.getBeginTime(), request.getEndTime(), request.getDepartId());
List<EchartsVo> 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<JSONObject> 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<String> 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);
}
} }

Loading…
Cancel
Save