This commit is contained in:
ly19960718 2021-08-15 17:14:14 +08:00
parent 1089110ad3
commit 1312d0a191
5 changed files with 402 additions and 0 deletions

View File

@ -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<String,Object> 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<Map<String,Object>> list = new ArrayList<>();
//待受理
Map<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<List<ReportCaseV2DTO>> reportCaseListPage(ListPage page){
Map<String, Object> params = requestParams();
page.setParams(params);
SuccessResultList<List<ReportCaseV2DTO>> 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<Map<String,Object>> list = new ArrayList<>();
//待受理
Map<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<Map<String,Object>> list = new ArrayList<>();
//检查
Map<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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;
}
}

View File

@ -309,4 +309,21 @@ public interface IReportCaseV2Dao {
* @return
*/
List<CaseStatisticV2DTO> listCaseStatisticRatio(Map<String, Object> params);
/**
* 本月案件数量
* @param params
* @return
* @throws SearchException
*/
Integer countMonthNow(Map<String,Object> params) throws SearchException;
/**
* 大数据案件列表
* @param params
* @return
* @throws SearchException
*/
List<ReportCaseV2DTO> listBigData(Map<String,Object> params) throws SearchException;
}

View File

@ -47,6 +47,21 @@ public interface IReportCaseV2Service {
*/
int IS_SELF = 1;
/**
* 大数据案件列表
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<ReportCaseV2DTO>> listBigData(ListPage page) throws SearchException;
/**
* 统计本月案件数量
* @param params
* @return
*/
Integer countMonthNow(Map<String,Object> params);
/**
* 新增上报案件
*

View File

@ -65,6 +65,22 @@ public class ReportCaseV2ServiceImpl extends BaseService implements IReportCaseV
@Autowired
private IDocumentV2Service documentV2Service;
public Integer countMonthNow(Map<String,Object> params){
return reportCaseV2Dao.countMonthNow(params);
}
@Override
public SuccessResultList<List<ReportCaseV2DTO>> listBigData(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<ReportCaseV2DTO> reportCaseDTOs = reportCaseV2Dao.listBigData(page.getParams());
PageInfo<ReportCaseV2DTO> pageInfo = new PageInfo<>(reportCaseDTOs);
return new SuccessResultList<>(reportCaseDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public SuccessResult saveReportCase(Map<String, Object> params) throws SaveException {
params.put("caseReporter", securityComponent.getCurrentUser().getUserName());

View File

@ -1428,4 +1428,79 @@
case_status <![CDATA[ < ]]> 0
</select>
<!-- 本月案件数量-->
<select id="countMonthNow" parameterType="map" resultType="Integer">
SELECT
COUNT(*)
FROM
city_report_case_v2
WHERE
is_delete = 0
AND
<if test="month != null and month != ''">
DATE_FORMAT( gmt_create, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="caseStatus != null and caseStatus != ''">
case_status = #{caseStatus}
</if>
</select>
<!--大数据案件列表-->
<select id="listBigData" parameterType="map" resultMap="reportCaseDTO">
SELECT
t1.report_case_id,
t1.case_number,
t1.area_name,
t1.community_name,
t1.case_source,
t1.case_type_name,
t1.case_position,
t1.is_accept,
t1.is_deny,
t1.is_self,
t1.grade,
t1.case_reporter,
t1.gmt_create,
t1.case_status
FROM
city_report_case_v2 t1
WHERE
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.case_number LIKE CONCAT('%', #{keywords}, '%')
OR
t1.area_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.community_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.case_reporter LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="caseStatus != null and caseStatus != ''">
AND
t1.case_status = #{caseStatus}
</if>
<if test="isAccept != null and isAccept != ''">
AND
t1.is_accept = #{isAccept}
</if>
<if test="caseSource != null and caseSource != ''">
AND
t1.case_source = #{caseSource}
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY t1.gmt_create DESC
</select>
</mapper>