From 1312d0a191b8240f62c39c5528a97d9af451f82f Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Sun, 15 Aug 2021 17:14:14 +0800 Subject: [PATCH] . --- .../ReportCaseV2AppResoureController.java | 279 ++++++++++++++++++ .../dao/reportcase/v2/IReportCaseV2Dao.java | 17 ++ .../reportcase/v2/IReportCaseV2Service.java | 15 + .../v2/impl/ReportCaseV2ServiceImpl.java | 16 + .../reportcase/v2/reportcase-v2-mapper.xml | 75 +++++ 5 files changed, 402 insertions(+) create mode 100644 src/main/java/com/cm/systemcity/controller/app/resources/reportcasev2/ReportCaseV2AppResoureController.java diff --git a/src/main/java/com/cm/systemcity/controller/app/resources/reportcasev2/ReportCaseV2AppResoureController.java b/src/main/java/com/cm/systemcity/controller/app/resources/reportcasev2/ReportCaseV2AppResoureController.java new file mode 100644 index 0000000..d49580e --- /dev/null +++ b/src/main/java/com/cm/systemcity/controller/app/resources/reportcasev2/ReportCaseV2AppResoureController.java @@ -0,0 +1,279 @@ +package com.cm.systemcity.controller.app.resources.reportcasev2; + + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.pojo.bos.UserResourceBO; +import com.cm.common.pojo.ListPage; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResultList; +import com.cm.systemcity.pojo.dtos.reportcase.v2.ReportCaseV2DTO; +import com.cm.systemcity.service.reportcase.v2.IReportCaseV2Service; +import com.cm.systemcity.utils.BigDataResult; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * @ClassName: ReportCaseV2AppResoureController + * @Description: 环保案件统计 + * @Author: admin + * @Date: 2021-08-12 14:56:15 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保案件统计接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/reportcase/v2/"+ISystemConstant.APP_RELEASE_SUFFIX ) +public class ReportCaseV2AppResoureController extends AbstractController { + + @Autowired + private IReportCaseV2Service reportCaseV2Service; + + + + + @ApiOperation(value = "统计本月总上报案件数量", notes = "统计总上报案件数量接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count-month-now-total") + public BigDataResult countReportCaseTotal(){ + BigDataResult result = new BigDataResult(); + Map params = new HashMap<>(); + params.put("month","month"); + Integer count = reportCaseV2Service.countMonthNow(params); + params.clear(); + params.put("value",count); + result.setData(params); + return result; + } + + + + @ApiOperation(value = "统计案件-分状态", notes = "统计案件-分状态接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count-casestatus") + public BigDataResult countCaseStatus(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + //待受理 + Map params0 = new HashMap<>(); + params0.put("caseStatus","0"); + Integer count0 = reportCaseV2Service.countMonthNow(params0); + params0.clear(); + params0.put("name","待受理"); + params0.put("value",count0); + list.add(params0); + //受理 + Map params1 = new HashMap<>(); + params1.put("caseStatus","1"); + Integer count1 = reportCaseV2Service.countMonthNow(params1); + params1.clear(); + params1.put("name","受理"); + params1.put("value",count1); + list.add(params1); + //立案 + Map params2 = new HashMap<>(); + params2.put("caseStatus","2"); + Integer count2 = reportCaseV2Service.countMonthNow(params2); + params2.clear(); + params2.put("name","立案"); + params2.put("value",count2); + list.add(params2); + //下派 + Map params3 = new HashMap<>(); + params3.put("caseStatus","3"); + Integer count3 = reportCaseV2Service.countMonthNow(params3); + params3.clear(); + params3.put("name","下派"); + params3.put("value",count3); + list.add(params3); + //检查 + Map params4 = new HashMap<>(); + params4.put("caseStatus","4"); + Integer count4 = reportCaseV2Service.countMonthNow(params4); + params4.clear(); + params4.put("name","检查"); + params4.put("value",count4); + list.add(params4); + //结案 + Map params5 = new HashMap<>(); + params5.put("caseStatus","5"); + Integer count5 = reportCaseV2Service.countMonthNow(params5); + params5.clear(); + params5.put("name","结案"); + params5.put("value",count5); + list.add(params5); + //归档 + Map params6 = new HashMap<>(); + params6.put("caseStatus","6"); + Integer count6 = reportCaseV2Service.countMonthNow(params6); + params6.clear(); + params6.put("name","归档"); + params6.put("value",count6); + list.add(params6); + //异常 + Map paramsError = new HashMap<>(); + paramsError.put("caseStatus","-1"); + Integer countError = reportCaseV2Service.countMonthNow(paramsError); + paramsError.clear(); + paramsError.put("name","异常"); + paramsError.put("value",countError); + list.add(paramsError); + + result.setList(list); + return result; + } + + + + @ApiOperation(value = "案件列表", notes = "案件列表接口") + @GetMapping("reportcaselistpage") + public SuccessResultList> reportCaseListPage(ListPage page){ + Map params = requestParams(); + page.setParams(params); + SuccessResultList> listSuccessResultList = reportCaseV2Service.listBigData(page); + + for (ReportCaseV2DTO row : listSuccessResultList.getRows()) { + row.setCaseSource(setSource(row.getCaseSource())); + row.setCaseStatus(setStatus(row.getCaseStatus())); + } + + return listSuccessResultList; + } + + + public String setSource(String source){ + if(source.equals("1")){ + return "群众举报"; + } + if(source.equals("2")){ + return "巡检采集"; + } + if(source.equals("3")){ + return "专管员上报"; + } + return "未知"; + } + + public String setStatus(String Status){ + if(Status.equals("0")){ + return "待受理"; + } + if(Status.equals("1")){ + return "待立案"; + } + if(Status.equals("2")){ + return "待下派"; + } + if(Status.equals("3")){ + return "待处理"; + } + if(Status.equals("4")){ + return "待检查"; + } + if(Status.equals("5")){ + return "待结案"; + } + if(Status.equals("6")){ + return "已归档"; + } + return "异常"; + } + + @ApiOperation(value = "状态查询按钮组1", notes = "状态查询按钮组接口") + @GetMapping("countcasestatusbutton-one") + public BigDataResult countCaseStatusButtonOne(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + //待受理 + Map params0 = new HashMap<>(); + params0.put("caseStatus","0"); + Integer count0 = reportCaseV2Service.countMonthNow(params0); + params0.clear(); + params0.put("id","0"); + params0.put("name","待受理("+count0+")"); + list.add(params0); + //受理 + Map params1 = new HashMap<>(); + params1.put("caseStatus","1"); + Integer count1 = reportCaseV2Service.countMonthNow(params1); + params1.clear(); + params1.put("id","1"); + params1.put("name","受理("+count1+")"); + list.add(params1); + //立案 + Map params2 = new HashMap<>(); + params2.put("caseStatus","2"); + Integer count2 = reportCaseV2Service.countMonthNow(params2); + params2.clear(); + params2.put("id","2"); + params2.put("name","立案("+count2+")"); + list.add(params2); + //下派 + Map params3 = new HashMap<>(); + params3.put("caseStatus","3"); + Integer count3 = reportCaseV2Service.countMonthNow(params3); + params3.clear(); + params3.put("id","3"); + params3.put("name","下派("+count3+")"); + list.add(params3); + + result.setList(list); + return result; + + + } + + + @ApiOperation(value = "状态查询按钮组2", notes = "状态查询按钮组接口") + @GetMapping("countcasestatusbutton-two") + public BigDataResult countCaseStatusButtonTwo(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + //检查 + Map params4 = new HashMap<>(); + params4.put("caseStatus","4"); + Integer count4 = reportCaseV2Service.countMonthNow(params4); + params4.clear(); + params4.put("id","4"); + params4.put("name","检查("+count4+")"); + list.add(params4); + //结案 + Map params5 = new HashMap<>(); + params5.put("caseStatus","5"); + Integer count5 = reportCaseV2Service.countMonthNow(params5); + params5.clear(); + params5.put("id","5"); + params5.put("name","结案("+count5+")"); + list.add(params5); + //归档 + Map params6 = new HashMap<>(); + params6.put("caseStatus","6"); + Integer count6 = reportCaseV2Service.countMonthNow(params6); + params6.clear(); + params6.put("id","6"); + params6.put("name","归档("+count6+")"); + list.add(params6); + //异常 + Map paramsError = new HashMap<>(); + paramsError.put("caseStatus","-1"); + Integer countError = reportCaseV2Service.countMonthNow(paramsError); + paramsError.clear(); + paramsError.put("id","-1"); + paramsError.put("name","异常("+countError+")"); + list.add(paramsError); + + result.setList(list); + return result; + + + } + +} diff --git a/src/main/java/com/cm/systemcity/dao/reportcase/v2/IReportCaseV2Dao.java b/src/main/java/com/cm/systemcity/dao/reportcase/v2/IReportCaseV2Dao.java index cab71b4..a8c9075 100644 --- a/src/main/java/com/cm/systemcity/dao/reportcase/v2/IReportCaseV2Dao.java +++ b/src/main/java/com/cm/systemcity/dao/reportcase/v2/IReportCaseV2Dao.java @@ -309,4 +309,21 @@ public interface IReportCaseV2Dao { * @return */ List listCaseStatisticRatio(Map params); + + /** + * 本月案件数量 + * @param params + * @return + * @throws SearchException + */ + Integer countMonthNow(Map params) throws SearchException; + + /** + * 大数据案件列表 + * @param params + * @return + * @throws SearchException + */ + List listBigData(Map params) throws SearchException; + } diff --git a/src/main/java/com/cm/systemcity/service/reportcase/v2/IReportCaseV2Service.java b/src/main/java/com/cm/systemcity/service/reportcase/v2/IReportCaseV2Service.java index c4fc536..7c05bb7 100644 --- a/src/main/java/com/cm/systemcity/service/reportcase/v2/IReportCaseV2Service.java +++ b/src/main/java/com/cm/systemcity/service/reportcase/v2/IReportCaseV2Service.java @@ -47,6 +47,21 @@ public interface IReportCaseV2Service { */ int IS_SELF = 1; + + /** + * 大数据案件列表 + * @param page + * @return + * @throws SearchException + */ + SuccessResultList> listBigData(ListPage page) throws SearchException; + /** + * 统计本月案件数量 + * @param params + * @return + */ + Integer countMonthNow(Map params); + /** * 新增上报案件 * diff --git a/src/main/java/com/cm/systemcity/service/reportcase/v2/impl/ReportCaseV2ServiceImpl.java b/src/main/java/com/cm/systemcity/service/reportcase/v2/impl/ReportCaseV2ServiceImpl.java index d54a202..d42afae 100644 --- a/src/main/java/com/cm/systemcity/service/reportcase/v2/impl/ReportCaseV2ServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/reportcase/v2/impl/ReportCaseV2ServiceImpl.java @@ -65,6 +65,22 @@ public class ReportCaseV2ServiceImpl extends BaseService implements IReportCaseV @Autowired private IDocumentV2Service documentV2Service; + public Integer countMonthNow(Map params){ + return reportCaseV2Dao.countMonthNow(params); + } + + @Override + public SuccessResultList> listBigData(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List reportCaseDTOs = reportCaseV2Dao.listBigData(page.getParams()); + PageInfo pageInfo = new PageInfo<>(reportCaseDTOs); + return new SuccessResultList<>(reportCaseDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + + + + @Override public SuccessResult saveReportCase(Map params) throws SaveException { params.put("caseReporter", securityComponent.getCurrentUser().getUserName()); diff --git a/src/main/resources/mybatis/mapper/reportcase/v2/reportcase-v2-mapper.xml b/src/main/resources/mybatis/mapper/reportcase/v2/reportcase-v2-mapper.xml index c75d494..8bf2561 100644 --- a/src/main/resources/mybatis/mapper/reportcase/v2/reportcase-v2-mapper.xml +++ b/src/main/resources/mybatis/mapper/reportcase/v2/reportcase-v2-mapper.xml @@ -1428,4 +1428,79 @@ case_status 0 + + + + + + + + + \ No newline at end of file