From b7190049ece6c5ffe096fe6d5fb27c5af2903a88 Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Mon, 6 Mar 2023 18:13:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E5=88=97=E8=A1=A8/=E6=A1=88?= =?UTF-8?q?=E4=BB=B6=E7=BB=9F=E8=AE=A1=20=E5=A2=9E=E5=8A=A0=20=E4=B8=93?= =?UTF-8?q?=E7=AE=A1=E5=91=98=E5=8C=BA=E5=9F=9F=20=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../systemcity/consts/ISystemCityConsts.java | 34 +++ .../apis/reportcase/ReportCaseController.java | 2 +- .../dao/reportcase/IReportCaseDao.java | 5 +- .../dtos/reportcase/HandleDepartmentDTO.java | 12 + .../reportcase/HandleUserDepartmentDTO.java | 41 +++ .../pojo/dtos/reportcase/ReportCaseDTO.java | 3 + .../dtos/reportcase/ReportCaseHandleDTO.java | 27 +- .../impl/ReportCaseServiceImpl.java | 239 +++++++++++++----- src/main/resources/application-btgxq.yml | 8 +- .../mapper/reportcase/reportcase-mapper.xml | 201 +++++++++++++++ .../route/reportcase/list_placeonfile.html | 4 +- 11 files changed, 491 insertions(+), 85 deletions(-) create mode 100644 src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java create mode 100644 src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleDepartmentDTO.java create mode 100644 src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleUserDepartmentDTO.java diff --git a/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java b/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java new file mode 100644 index 0000000..6d78005 --- /dev/null +++ b/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java @@ -0,0 +1,34 @@ +package com.cm.systemcity.consts; + +public interface ISystemCityConsts { + + /** + * 专管员区域ID + */ + String N_PERSON_AREA_ID = "e64a0a05-45ca-4452-a869-a4dcbff74593"; + /** + * 稀土路区域ID + */ + String XTL_AREA_ID = "7ed23f06-566d-43b7-acd9-4f0b5db08974"; + /** + * 稀土路部门ID + */ + String XTL_DEPARTMENT_ID = "1a9b5a0c-d842-46ff-b0c5-36a29b9055df"; + /** + * 民馨路区域ID + */ + String MXL_AREA_ID = "6e922367-f21f-4daf-b38c-c55a67d9a35b"; + /** + * 民馨路部门ID + */ + String MXL_DEPARTMENT_ID = "f0bf2d8a-e736-4895-a9c8-80f530068c3a"; + /** + * 万水泉区域ID + */ + String WSQ_AREA_ID = "8d62a0cc-2c15-4355-906c-6720f8f3617e"; + /** + * 万水泉部门ID + */ + String WSQ_DEPARTMENT_ID = "52fecef4-f0f5-4077-999c-39db09872718"; + +} diff --git a/src/main/java/com/cm/systemcity/controller/apis/reportcase/ReportCaseController.java b/src/main/java/com/cm/systemcity/controller/apis/reportcase/ReportCaseController.java index c91b5d8..962fdd9 100755 --- a/src/main/java/com/cm/systemcity/controller/apis/reportcase/ReportCaseController.java +++ b/src/main/java/com/cm/systemcity/controller/apis/reportcase/ReportCaseController.java @@ -447,7 +447,7 @@ public class ReportCaseController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpagereportcaseexception") public SuccessResultList> listPageReportCaseException(ListPage page) throws SearchException { - Map params = getParams(); + Map params = requestParams(); page.setParams(params); return reportCaseService.listReportCaseException(page); } diff --git a/src/main/java/com/cm/systemcity/dao/reportcase/IReportCaseDao.java b/src/main/java/com/cm/systemcity/dao/reportcase/IReportCaseDao.java index 1e47ee0..ccf85b3 100755 --- a/src/main/java/com/cm/systemcity/dao/reportcase/IReportCaseDao.java +++ b/src/main/java/com/cm/systemcity/dao/reportcase/IReportCaseDao.java @@ -5,7 +5,6 @@ import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; import com.cm.systemcity.pojo.dtos.reportcase.*; -import io.swagger.models.auth.In; import org.springframework.stereotype.Repository; import java.util.List; @@ -376,4 +375,8 @@ public interface IReportCaseDao { List listPageReportDelete(Map params); ReportCaseDTO getReportCaseForDel(Map params); + + List listReportCaseHandleDTO(Map params); + + List listDept(Map params); } diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleDepartmentDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleDepartmentDTO.java new file mode 100644 index 0000000..e0560ca --- /dev/null +++ b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleDepartmentDTO.java @@ -0,0 +1,12 @@ +package com.cm.systemcity.pojo.dtos.reportcase; + +import lombok.Data; + +@Data +public class HandleDepartmentDTO { + + private String departmentId; + private String departmentName; + private Integer caseCount; + +} diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleUserDepartmentDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleUserDepartmentDTO.java new file mode 100644 index 0000000..dd71541 --- /dev/null +++ b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/HandleUserDepartmentDTO.java @@ -0,0 +1,41 @@ +package com.cm.systemcity.pojo.dtos.reportcase; + +public class HandleUserDepartmentDTO { + + private String userId; + private String userUsername; + private String departmentId; + private String departmentName; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserUsername() { + return userUsername; + } + + public void setUserUsername(String userUsername) { + this.userUsername = userUsername; + } + + public String getDepartmentId() { + return departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } +} diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseDTO.java index 24df2d4..d06af33 100755 --- a/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseDTO.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseDTO.java @@ -76,5 +76,8 @@ public class ReportCaseDTO { private String handlePhotos; @ApiModelProperty(name = "gmtModified", value = "最后修改时间") private String gmtModified; + private String handleUserDepartmentName; + private String handleUserCommunityName; + private String handleUserUsername; } \ No newline at end of file diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseHandleDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseHandleDTO.java index 0634f26..e3ca9a1 100755 --- a/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseHandleDTO.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/reportcase/ReportCaseHandleDTO.java @@ -13,6 +13,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel public class ReportCaseHandleDTO extends ReportCaseDTO { + @ApiModelProperty(name = "caseId", value = "案件ID") + private String caseId; @ApiModelProperty(name = "handleUserId", value = "案件处理人ID") private String handleUserId; @ApiModelProperty(name = "handleUserName", value = "案件处理人名称") @@ -24,6 +26,15 @@ public class ReportCaseHandleDTO extends ReportCaseDTO { @ApiModelProperty(name = "overDays", value = "超时天数") private Integer overDays; + + public String getCaseId() { + return caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + public String getHandleUserId() { return handleUserId == null ? "" : handleUserId.trim(); } @@ -65,20 +76,4 @@ public class ReportCaseHandleDTO extends ReportCaseDTO { this.overDays = overDays; } - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"handleUserId\":") - .append("\"").append(handleUserId).append("\""); - sb.append(",\"handleUserName\":") - .append("\"").append(handleUserName).append("\""); - sb.append(",\"handleTime\":") - .append(handleTime); - sb.append(",\"assignDate\":") - .append("\"").append(assignDate).append("\""); - sb.append(",\"overDays\":") - .append(overDays); - sb.append('}'); - return sb.toString(); - } } \ No newline at end of file diff --git a/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java b/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java index 0ac51f9..4cf84be 100755 --- a/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java @@ -3,6 +3,7 @@ package com.cm.systemcity.service.reportcase.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cm.common.component.SecurityComponent; +import com.cm.common.constants.ISystemConstant; import com.cm.common.exception.RemoveException; import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; @@ -20,15 +21,14 @@ import com.cm.common.utils.DateUtil; import com.cm.common.utils.UUIDUtil; import com.cm.common.utils.point.Point; import com.cm.common.utils.point.PointUtil; +import com.cm.systemcity.consts.ISystemCityConsts; import com.cm.systemcity.dao.reportcase.IReportCaseDao; import com.cm.systemcity.pojo.dtos.AreaPointsDTO; import com.cm.systemcity.pojo.dtos.areapoints.GridAndPointsDTO; import com.cm.systemcity.pojo.dtos.bindingdepartment.BindingDepartmentDTO; -import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO; import com.cm.systemcity.pojo.dtos.dict.DictDTO; import com.cm.systemcity.pojo.dtos.readstate.ReadStateDTO; import com.cm.systemcity.pojo.dtos.reportcase.*; -import com.cm.systemcity.pojo.pos.communityboss.CommunityBossPO; import com.cm.systemcity.service.BaseService; import com.cm.systemcity.service.bindingdepartment.IBindingDepartmentService; import com.cm.systemcity.service.community.ICommunityService; @@ -52,6 +52,7 @@ import java.text.NumberFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * @ClassName: ReportCaseServiceImpl @@ -124,6 +125,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportDelete(ListPage page) { + setNPersonAreaParams(page.getParams()); PageHelper.startPage(page.getPage(), page.getRows()); List deleteList = reportCaseDao.listPageReportDelete(page.getParams()); PageInfo pageInfo = new PageInfo<>(deleteList); @@ -284,18 +286,57 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer AppTokenUser appTokenUser = appToken.getAppTokenUser(); page.getParams().put("userId", appTokenUser.getId()); } + setNPersonAreaParams(page.getParams()); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseDTOs = reportCaseDao.listReportCase(page.getParams()); - for(ReportCaseDTO item : reportCaseDTOs){ + for (ReportCaseDTO item : reportCaseDTOs) { page.getParams().clear(); page.getParams().put("dictId", item.getCaseTypeId()); DictDTO dict = dictService.getDict(page.getParams()); item.setCaseTypeName(dict == null ? "" : dict.getDictName()); } + // 查询处理人 + List reportCaseIds = reportCaseDTOs.stream().map(ReportCaseDTO::getReportCaseId).collect(Collectors.toList()); + Map params = getHashMap(2); + params.put("caseIds", reportCaseIds); + List reportCaseHandleDTOS = reportCaseDao.listReportCaseHandleDTO(params); + reportCaseDTOs.parallelStream().forEach(reportCaseDTO -> { + for (ReportCaseHandleDTO reportCaseHandleDTO : reportCaseHandleDTOS) { + if (!StringUtils.equals(reportCaseDTO.getReportCaseId(), reportCaseHandleDTO.getCaseId())) { + continue; + } + reportCaseDTO.setHandleUserName(reportCaseHandleDTO.getHandleUserName()); + reportCaseDTO.setHandleUserDepartmentName(reportCaseHandleDTO.getHandleUserDepartmentName()); + reportCaseDTO.setHandleUserCommunityName(reportCaseHandleDTO.getHandleUserCommunityName()); + reportCaseDTO.setHandleUserUsername(reportCaseHandleDTO.getHandleUserUsername()); + break; + } + }); PageInfo pageInfo = new PageInfo<>(reportCaseDTOs); return new SuccessResultList<>(reportCaseDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } + /** + * 设置专管员区域参数 + * + * @param areaId + */ + private void setNPersonAreaParams(Map params) { + Object areaIdObj = params.get("areaId"); + if (areaIdObj == null) { + return; + } + String areaId = areaIdObj.toString(); + if (StringUtils.isBlank(areaId)) { + return; + } + if (!StringUtils.equals(ISystemCityConsts.N_PERSON_AREA_ID, areaId)) { + return; + } + params.remove("areaId"); + params.put("isNPersonArea", ISystemConstant.IS_TRUE); + } + /** * 2020-12-22 王帅 * 镇街案件分页列表 @@ -626,6 +667,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportCaseAssign(ListPage page) throws SearchException { + setNPersonAreaParams(page.getParams()); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseAssignDTOs = reportCaseDao.listPageReportCaseAssign(page.getParams()); LOG.debug("计算案件超时"); @@ -639,6 +681,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportCaseHandle(ListPage page) throws SearchException { + setNPersonAreaParams(page.getParams()); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseHandleDTOs = reportCaseDao.listPageReportCaseHandle(page.getParams()); PageInfo pageInfo = new PageInfo<>(reportCaseHandleDTOs); @@ -659,13 +702,13 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResult saveReportCaseHandle(String token, Map params) throws SaveException, UpdateException, SearchException, RemoveException { - if(params.get("handleStatus") == null - || params.get("handleStatus").toString().length() == 0){ + if (params.get("handleStatus") == null + || params.get("handleStatus").toString().length() == 0) { throw new SaveException("错误:处理状态丢失"); } // 判断处理状态 1处理 0 不处理 int handleStatus = Integer.parseInt(params.get("handleStatus").toString()); - if(1 == handleStatus){ + if (1 == handleStatus) { Map query = new HashMap<>(8); query.put("caseId", params.get("caseId").toString()); ReportCaseHandleDTO handleInfo = reportCaseDao.getReportCaseHandle(query); @@ -714,7 +757,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer addReportCaseLog(token, logParam); return new SuccessResult(); } - if(0 == handleStatus){ + if (0 == handleStatus) { // 2022年10月25日 案件如果不处理需要管理员确认后才可退回 修改原来直接退回的逻辑 @@ -743,6 +786,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportCaseInspect(ListPage page) throws SearchException { + setNPersonAreaParams(page.getParams()); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseInspectDTOs = reportCaseDao.listPageReportCaseInspect(page.getParams()); PageInfo pageInfo = new PageInfo<>(reportCaseInspectDTOs); @@ -778,7 +822,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer addReportCaseLog(token, caseLogParams); return new SuccessResult(); } - if(1 == isPass){ + if (1 == isPass) { // 将处理表中状态修改为已检查 reportCaseParams.clear(); reportCaseParams.put("caseId", params.get("caseId").toString()); @@ -823,6 +867,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportCaseClose(ListPage page) throws SearchException { + setNPersonAreaParams(page.getParams()); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseCloseDTOs = reportCaseDao.listPageReportCaseClose(page.getParams()); PageInfo pageInfo = new PageInfo<>(reportCaseCloseDTOs); @@ -930,13 +975,13 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer // 2021-11-18 案件类别添加下级案件ID List parentCaseTypeList = (List) params.get("caseTypeIds"); List caseTypeIdsList = new ArrayList<>(); - for(String parentId : parentCaseTypeList){ + for (String parentId : parentCaseTypeList) { caseTypeIdsList.add(parentId); params.clear(); - params.put("dictParentId",parentId); + params.put("dictParentId", parentId); List dictDTOS = dictService.listDict(params); - if(dictDTOS != null && dictDTOS.size() > 0){ - for(DictDTO item : dictDTOS){ + if (dictDTOS != null && dictDTOS.size() > 0) { + for (DictDTO item : dictDTOS) { caseTypeIdsList.add(item.getDictId()); } } @@ -951,13 +996,13 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer // 2021-11-18 案件类别添加下级案件ID List parentCaseTypeList = Arrays.asList(params.get("ids").toString().split(",")); List caseTypeIdsList = new ArrayList<>(); - for(String parentId : parentCaseTypeList){ + for (String parentId : parentCaseTypeList) { caseTypeIdsList.add(parentId); params.clear(); - params.put("dictParentId",parentId); + params.put("dictParentId", parentId); List dictDTOS = dictService.listDict(params); - if(dictDTOS != null && dictDTOS.size() > 0){ - for(DictDTO item : dictDTOS){ + if (dictDTOS != null && dictDTOS.size() > 0) { + for (DictDTO item : dictDTOS) { caseTypeIdsList.add(item.getDictId()); } } @@ -1059,42 +1104,114 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listCaseStatisticRatio(Map params) { - List caseStatisticDTOS = reportCaseDao.listCaseStatisticRatio(params); - for (CaseStatisticDTO item : caseStatisticDTOS) { - params.put("caseStatus", ""); - params.put("exception", ""); - Integer caseTotalCount = Integer.parseInt(item.getCaseTotalCount()); - params.put("areaId", item.getAreaId()); - params.put("communityId", item.getCommunityId()); - //下派数/下派率 - params.put("caseStatus", "3"); - Integer assignCount = reportCaseDao.countReportCase(params); - item.setAssignCount(assignCount + ""); - double assignRatio; - assignRatio = assignCount.doubleValue() / caseTotalCount.doubleValue(); - item.setAssignRatio(assignRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", assignRatio * 100)); - //检查数/检查率 - params.put("caseStatus", "4"); - Integer inspectCount = reportCaseDao.countReportCase(params); - item.setInspectCount(inspectCount + ""); - double inspectRatio; - inspectRatio = inspectCount.doubleValue() / caseTotalCount.doubleValue(); - item.setInspectRatio(inspectRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", inspectRatio * 100)); - //结案数/结案率 - params.put("caseStatus", "5"); - Integer closeCount = reportCaseDao.countReportCase(params); - item.setCloseCount(closeCount + ""); - double closeRatio; - closeRatio = closeCount.doubleValue() / caseTotalCount.doubleValue(); - item.setCloseRatio(closeRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", closeRatio * 100)); - //归档数/归档率 - params.put("caseStatus", "6"); - Integer fileCount = reportCaseDao.countReportCase(params); - item.setFileCount(fileCount + ""); - double fileRatio; - fileRatio = fileCount.doubleValue() / caseTotalCount.doubleValue(); - item.setFileRatio(fileRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", fileRatio * 100)); + Object areaIdObj = params.get("areaId"); + List caseStatisticDTOS = null; + if (areaIdObj == null || StringUtils.isBlank(areaIdObj.toString()) || + StringUtils.equals(ISystemCityConsts.XTL_AREA_ID, areaIdObj.toString()) || + StringUtils.equals(ISystemCityConsts.MXL_AREA_ID, areaIdObj.toString()) || + StringUtils.equals(ISystemCityConsts.WSQ_AREA_ID, areaIdObj.toString())) { + caseStatisticDTOS = reportCaseDao.listCaseStatisticRatio(params); + for (CaseStatisticDTO item : caseStatisticDTOS) { + params.put("caseStatus", ""); + params.put("exception", ""); + Integer caseTotalCount = Integer.parseInt(item.getCaseTotalCount()); + params.put("areaId", item.getAreaId()); + params.put("communityId", item.getCommunityId()); + //下派数/下派率 + params.put("caseStatus", "3"); + Integer assignCount = reportCaseDao.countReportCase(params); + item.setAssignCount(assignCount + ""); + double assignRatio; + assignRatio = assignCount.doubleValue() / caseTotalCount.doubleValue(); + item.setAssignRatio(assignRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", assignRatio * 100)); + //检查数/检查率 + params.put("caseStatus", "4"); + Integer inspectCount = reportCaseDao.countReportCase(params); + item.setInspectCount(inspectCount + ""); + double inspectRatio; + inspectRatio = inspectCount.doubleValue() / caseTotalCount.doubleValue(); + item.setInspectRatio(inspectRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", inspectRatio * 100)); + //结案数/结案率 + params.put("caseStatus", "5"); + Integer closeCount = reportCaseDao.countReportCase(params); + item.setCloseCount(closeCount + ""); + double closeRatio; + closeRatio = closeCount.doubleValue() / caseTotalCount.doubleValue(); + item.setCloseRatio(closeRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", closeRatio * 100)); + //归档数/归档率 + params.put("caseStatus", "6"); + Integer fileCount = reportCaseDao.countReportCase(params); + item.setFileCount(fileCount + ""); + double fileRatio; + fileRatio = fileCount.doubleValue() / caseTotalCount.doubleValue(); + item.setFileRatio(fileRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", fileRatio * 100)); + } } + if (areaIdObj == null || StringUtils.isBlank(areaIdObj.toString()) || + StringUtils.equals(ISystemCityConsts.N_PERSON_AREA_ID, areaIdObj.toString())) { + // 列出所有的专管机构 + + params.put("departmentParentId", "0"); + List handleDepartmentDTOS = reportCaseDao.listDept(params); + for (int i = 0; i < handleDepartmentDTOS.size(); i++) { + HandleDepartmentDTO handleDepartmentDTO = handleDepartmentDTOS.get(i); + handleDepartmentDTO.setCaseCount(0); + } + params.remove("departmentParentId"); + params.remove("areaId"); + params.remove("communityId"); + List departmentCaseStatisticDTOS = new ArrayList<>(); + handleDepartmentDTOS.parallelStream().forEach(handleDepartmentDTO -> { + CaseStatisticDTO caseStatisticDTO = new CaseStatisticDTO(); + caseStatisticDTO.setAreaName("专管员区域"); + departmentCaseStatisticDTOS.add(caseStatisticDTO); + + caseStatisticDTO.setCommunityName(handleDepartmentDTO.getDepartmentName()); + // 查询需要专管员的案件 + Map caseParams = getHashMap(2); + caseParams.put("caseTypeId", params.get("caseTypeId")); + caseParams.put("startTime", params.get("startTime")); + caseParams.put("endTime", params.get("endTime")); + caseParams.put("handleDepartmentId", handleDepartmentDTO.getDepartmentId()); + Integer caseTotalCount = reportCaseDao.countReportCase(caseParams); + caseStatisticDTO.setCaseTotalCount(caseTotalCount.toString()); + + //下派数/下派率 + caseParams.put("caseStatus", "3"); + Integer assignCount = reportCaseDao.countReportCase(caseParams); + caseStatisticDTO.setAssignCount(assignCount + ""); + double assignRatio; + assignRatio = caseTotalCount > 0 ? assignCount.doubleValue() / caseTotalCount.doubleValue() : 0; + caseStatisticDTO.setAssignRatio(assignRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", assignRatio * 100)); + //检查数/检查率 + caseParams.put("caseStatus", "4"); + Integer inspectCount = reportCaseDao.countReportCase(caseParams); + caseStatisticDTO.setInspectCount(inspectCount + ""); + double inspectRatio; + inspectRatio = caseTotalCount > 0 ? inspectCount.doubleValue() / caseTotalCount.doubleValue() : 0; + caseStatisticDTO.setInspectRatio(inspectRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", inspectRatio * 100)); + //结案数/结案率 + caseParams.put("caseStatus", "5"); + Integer closeCount = reportCaseDao.countReportCase(caseParams); + caseStatisticDTO.setCloseCount(closeCount + ""); + double closeRatio; + closeRatio = caseTotalCount > 0 ? closeCount.doubleValue() / caseTotalCount.doubleValue() : 0; + caseStatisticDTO.setCloseRatio(closeRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", closeRatio * 100)); + //归档数/归档率 + caseParams.put("caseStatus", "6"); + Integer fileCount = reportCaseDao.countReportCase(caseParams); + caseStatisticDTO.setFileCount(fileCount + ""); + double fileRatio; + fileRatio = caseTotalCount > 0 ? fileCount.doubleValue() / caseTotalCount.doubleValue() : 0; + caseStatisticDTO.setFileRatio(fileRatio >= 1 ? String.format("%.0f", 1.0 * 100) : String.format("%.2f", fileRatio * 100)); + }); + if(caseStatisticDTOS == null) { + caseStatisticDTOS = departmentCaseStatisticDTOS; + } else { + caseStatisticDTOS.addAll(departmentCaseStatisticDTOS); + } + } + // 查询每个转关机构处理的案件量 return new SuccessResultList<>(caseStatisticDTOS, 1, 0L); } @@ -1538,7 +1655,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer reportCaseDao.updateReportCase(reportCaseParams); // 删除受理、立案、下派、处理表的历史记录 Map removeMap = new HashMap<>(); - removeMap.put("caseId",caseId); + removeMap.put("caseId", caseId); reportCaseDao.removeReportCaseAccept(removeMap); reportCaseDao.removeReportCaseRegister(removeMap); reportCaseDao.removeReportCaseAssign(removeMap); @@ -1565,31 +1682,31 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResult saveReportCaseAutoAccept(Map params) { - params.put("reportCaseId",params.get("caseId").toString()); + params.put("reportCaseId", params.get("caseId").toString()); ReportCaseDTO reportCase = reportCaseDao.getReportCase(params); Map query = new HashMap<>(8); query.put("caseType", reportCase.getCaseTypeId()); query.put("areaId", reportCase.getAreaId()); List bindingList = bindingDepartmentService.listBindingDepartmentByCaseType(query); - if(bindingList == null || bindingList.size() == 0){ + if (bindingList == null || bindingList.size() == 0) { throw new SaveException("未匹配到专管部门与专管员,请手动转派"); } // 查询部门下所有专管员 List> deptUsers = new ArrayList<>(); - for(BindingDepartmentDTO deptItem : bindingList){ + for (BindingDepartmentDTO deptItem : bindingList) { List> userList = bindingDepartmentService.listDepartmentUser(deptItem.getDepartmentId()); - if(userList != null && userList.size() > 0){ + if (userList != null && userList.size() > 0) { deptUsers.addAll(userList); } } - if(deptUsers == null || deptUsers.size() == 0){ + if (deptUsers == null || deptUsers.size() == 0) { throw new SaveException("未匹配到专管部门与专管员,请手动转派"); } // 查询所有专管员片区信息 query.clear(); List handleUserIds = new ArrayList<>(); List handleUserNames = new ArrayList<>(); - for(Map item : deptUsers ){ + for (Map item : deptUsers) { query.put("userId", item.get("userId").toString()); List gridList = userPointsService.listUserGrid(query); if (gridList.isEmpty()) { @@ -1606,7 +1723,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer } } } - if(handleUserIds.size() == 0){ + if (handleUserIds.size() == 0) { return new SuccessResult(); } // 修改案件状态为待处理 @@ -1632,7 +1749,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer params.put("assignUserName", userInfoBO.getUserName()); params.put("handleUserType", 0); params.put("handleTime", 3); - params.put("handleUserId", StringUtils.join(handleUserIds,",")); + params.put("handleUserId", StringUtils.join(handleUserIds, ",")); params.put("handleUserName", StringUtils.join(handleUserNames, ",")); params.put("assignOpinion", "[案件自动转派]" + params.get("assignOpinion").toString()); setSaveInfo(params); @@ -1642,7 +1759,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer caseLogParams.put("caseId", reportCase.getReportCaseId()); caseLogParams.put("optionType", "案件自动转派"); caseLogParams.put("userOpinion", params.get("assignOpinion").toString()); - caseLogParams.put("handleUserId", StringUtils.join(handleUserIds,",")); + caseLogParams.put("handleUserId", StringUtils.join(handleUserIds, ",")); caseLogParams.put("handleUserName", StringUtils.join(handleUserNames, ",")); caseLogParams.put("handleUserPhone", StringUtils.join(handleUserNames, ",")); caseLogParams.put("handleTime", params.get("handleTime") == null ? "3" : params.get("handleTime")); diff --git a/src/main/resources/application-btgxq.yml b/src/main/resources/application-btgxq.yml index 6c3721e..924a875 100644 --- a/src/main/resources/application-btgxq.yml +++ b/src/main/resources/application-btgxq.yml @@ -1,6 +1,6 @@ server: port: 7022 - url: http://192.168.0.103:7022/servicecity + url: http://192.168.0.15:7022/servicecity title: 生态环保网格化监督平台 servlet: context-path: /servicecity @@ -24,7 +24,7 @@ spring: max-request-size: 1GB datasource: druid: - url: jdbc:mysql://192.168.0.103:3306/db_btgxq_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false + url: jdbc:mysql://192.168.0.151:3306/db_btgxq_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false db-type: mysql driver-class-name: com.mysql.jdbc.Driver username: root @@ -55,7 +55,7 @@ spring: config: classpath:ehcache.xml data: mongodb: - uri: mongodb://city:city@192.168.0.103:27017/systemcity + uri: mongodb://city:city@192.168.0.156:27017/systemcity # 数据库 mybatis: @@ -81,7 +81,7 @@ file: # 安全 security: oauth2: - oauth-server: http://192.168.0.103:7021/usercenter + oauth-server: http://192.168.0.15:7021/usercenter oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} client: client-id: c024a89b35b04d4d8b5b4ea4d66a8acb diff --git a/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml b/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml index 6100eec..54496de 100755 --- a/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml +++ b/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml @@ -29,6 +29,9 @@ + + + @@ -44,6 +47,7 @@ + @@ -100,6 +104,11 @@ + + + + + @@ -399,6 +421,39 @@ FIND_IN_SET( #{userId}, t2.handle_user_id) ) + + + AND + t1.creator IN ( + SELECT + user_id + FROM + sys_role_user + WHERE + + role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' + ) + + + AND + t1.report_case_id IN ( + SELECT + st1.case_id + FROM + city_report_case_assign st1 + WHERE + st1.is_delete = 0 + AND + st1.handle_user_id IN ( + SELECT + sst1.user_id + FROM + sys_department_user sst1 + WHERE + sst1.department_id = #{handleDepartmentId} + ) + ) + ORDER BY t1.gmt_create DESC @@ -736,6 +791,19 @@ #{reportCaseIds[${index}]} + + + AND + t1.creator IN ( + SELECT + user_id + FROM + sys_role_user + WHERE + + role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' + ) + ORDER BY t1.gmt_modified DESC @@ -816,6 +884,19 @@ #{reportCaseIds[${index}]} + + + AND + t1.creator IN ( + SELECT + user_id + FROM + sys_role_user + WHERE + + role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' + ) + ORDER BY t1.gmt_modified DESC @@ -968,6 +1049,19 @@ #{reportCaseIds[${index}]} + + + AND + t1.creator IN ( + SELECT + user_id + FROM + sys_role_user + WHERE + + role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' + ) + ORDER BY t1.gmt_modified DESC @@ -1161,6 +1255,19 @@ #{reportCaseIds[${index}]} + + + AND + t1.creator IN ( + SELECT + user_id + FROM + sys_role_user + WHERE + + role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' + ) + ORDER BY t1.gmt_create DESC @@ -1427,6 +1534,26 @@ AND gmt_create #{endTime} + + AND + report_case_id IN ( + SELECT + st1.case_id + FROM + city_report_case_assign st1 + WHERE + st1.is_delete = 0 + AND + st1.handle_user_id IN ( + SELECT + sst1.user_id + FROM + sys_department_user sst1 + WHERE + sst1.department_id = #{handleDepartmentId} + ) + ) + @@ -1489,6 +1616,13 @@ AND LEFT(t1.gmt_create, 10) #{endTime} + + AND + t1.case_id IN + + #{item} + + @@ -1709,4 +1843,71 @@ ORDER BY t1.gmt_create DESC limit 0, #{limitNumber} + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/reportcase/list_placeonfile.html b/src/main/resources/static/route/reportcase/list_placeonfile.html index dc78e23..5fdbb41 100755 --- a/src/main/resources/static/route/reportcase/list_placeonfile.html +++ b/src/main/resources/static/route/reportcase/list_placeonfile.html @@ -178,14 +178,14 @@ return value; } }, - {width: 250, title: '案件状态', align: 'center', + {width: 300, title: '案件状态', align: 'center', templet: function (row) { var value = '
'+ '
上报时间'+ row.reportDate +'
'+ '
上报人员'+ row.caseReporter +'
'+ '
案件状态'+ caseStatusFormatter(row.caseStatus) +'
'+ '
'+ ((row.overDays != null && row.overDays >= 1) ? '【超过'+ row.overDays +'天未处理】' : '') +'
'+ - '
'+ + '
处理人【'+ (row.handleUserCommunityName ? row.handleUserCommunityName : row.handleUserDepartmentName) + '】' + row.handleUserName +'
'+ '
'; return value; }