Browse Source

新增维权抚慰大屏展示模块2

main
xyx 1 year ago
parent
commit
7efd07273b
  1. 79
      src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java
  2. 1
      src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java
  3. 10
      src/main/java/com/biutag/supervision/service/DataRightsComfortService.java
  4. 2
      src/main/java/com/biutag/supervision/service/RpcApplyService.java

79
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<JSONObject> rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 抚慰人数
long total = rpcApplyService.count(new LambdaQueryWrapper<RpcApply>().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<CaseVerifDepart> fxsjBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime);
// 局属单位排名
List<CaseVerifDepart> jsdwBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime);
// 执法办案
List<PieItem> zfbaPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.ZFBA.getLaebl(), beginTime, endTime);
// 服务管理
List<PieItem> fwglPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.FWGL.getLaebl(), beginTime, endTime);
// 警察纪警规
List<PieItem> jjjgPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.JJJG.getLaebl(), beginTime, endTime);
// 案件来源占比
List<PieItem> 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;
}
}

1
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;

10
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<DataRightsComfortMapper, DataRightsComfort> {
public class DataRightsComfortService {
private final RpcApplyService rpcApplyService;
private final RpcApplyPersonService rpcApplyPersonService;
private final RpcInfringerResultService rpcInfringerResultService;
}

2
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<RpcApplyMapper, RpcApply> {

Loading…
Cancel
Save