| | |
| | | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.*; |
| | | import cn.huge.module.cases.domain.bo.CaseAgentBO; |
| | | import cn.huge.module.cases.domain.bo.CasePersonBO; |
| | | import cn.huge.module.cases.domain.bo.CasePersonCountBO; |
| | | import cn.huge.module.cases.domain.dto.*; |
| | | |
| | | import cn.huge.module.cases.domain.dto.CaseAreaDTO; |
| | |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.cases.dao.mapper.CaseInfoMapper; |
| | | import cn.huge.module.constant.BaseConsts; |
| | | import cn.huge.module.cust.dto.CtUnitDTO; |
| | | import cn.huge.module.cust.dto.PaUserDTO; |
| | | import cn.huge.module.mediate.constant.*; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | |
| | | //复制填装案件表 |
| | | CaseInfo caseInfo = new CaseInfo(); |
| | | BeanUtils.copyProperties(registerSaveDTO, caseInfo); |
| | | // 是否自行受理 |
| | | if (1 == registerSaveDTO.getIsSelfAccept()) { |
| | | // 是 |
| | | caseInfo.setZxslStatus(CaseBaseConsts.ZXSL_STATUS_1); |
| | | }else { |
| | | // 否 |
| | | caseInfo.setZxslStatus(CaseBaseConsts.ZXSL_STATUS_0); |
| | | } |
| | | caseInfo.setUpdateTime(nowDate); |
| | | |
| | | // 常规登记-保存当事人 |
| | |
| | | caseInfo.setDefendants(defendants.toString()); |
| | | caseInfo.setDagents(dagents.toString()); |
| | | caseInfo.setCaseRef(utilsClient.createCaseRef()); |
| | | caseInfo.setVisitWay(CaseBaseConstsEnum.VISIT_WAY_1.getIndex()); |
| | | caseInfo.setVisitWayName(CaseBaseConstsEnum.VISIT_WAY_1.getDes()); |
| | | caseInfo.setVisitWay(CaseBaseConstsEnum.getVisitWayByCanal(caseInfo.getCanal()).getIndex()); |
| | | caseInfo.setVisitWayName(CaseBaseConstsEnum.getVisitWayByCanal(caseInfo.getCanal()).getDes()); |
| | | //默认小程序可见 |
| | | if(ObjectUtils.isNotEmpty(caseInfo.getCanal())){ |
| | | if(CaseBaseConstsEnum.CASE_CANAL_1.getIndex().equals(caseInfo.getCanal())){ |
| | | caseInfo.setPartyShow(1); |
| | | } |
| | | } |
| | | |
| | | //todo case_title生成、经纬度转换 |
| | | if (0 == registerSaveDTO.getOperateType()) { |
| | | caseInfo.setInputUnitId(loginUser.getUnitId()); |
| | |
| | | caseInfo.setInputUserId(loginUser.getId()); |
| | | caseInfo.setInputUserName(loginUser.getTrueName()); |
| | | caseInfo.setInputWay(CaseBaseConsts.INPUT_WAY_1); |
| | | caseInfo.setPartyShow(1); |
| | | if(ObjectUtils.isEmpty(registerSaveDTO.getPeopleNum())){ |
| | | caseInfo.setPeopleNum(0); |
| | | } |
| | |
| | | // 临时加上一级纠纷类型 |
| | | caseInfo.setCaseTypeFirst("24_01-2"); |
| | | caseInfo.setCaseTypeFirstName("劳动社保"); |
| | | //小程序是否查看 |
| | | caseInfo.setPartyShow(1); |
| | | |
| | | this.saveOrUpdate(caseInfo); |
| | | |
| | | caseInfoUnfoldService.saveOrUpdate(caseInfoUnfold); |
| | |
| | | int peopleNum = 0; |
| | | // 保存申请人 |
| | | List<CasePerson> personList = registerSaveDTO.getPersonList(); |
| | | Map<String,String> personIdMap = new HashMap<>(); |
| | | if (CollectionUtils.isNotEmpty(personList)) { |
| | | for (CasePerson casePerson : personList) { |
| | | casePerson.setId(utilsClient.getNewTimeCaseId()); |
| | | String newTimeCaseId = utilsClient.getNewTimeCaseId(); |
| | | personIdMap.put(casePerson.getAgentCode(), newTimeCaseId); |
| | | casePerson.setId(newTimeCaseId); |
| | | casePerson.setCaseId(registerSaveDTO.getId()); |
| | | casePerson.setPartyUserId(loginUser.getId()); |
| | | casePerson.setCustId(registerSaveDTO.getCustId()); |
| | |
| | | if (CollectionUtils.isNotEmpty(agentList)) { |
| | | for (CaseAgent caseAgent : agentList) { |
| | | caseAgent.setId(utilsClient.getNewTimeCaseId()); |
| | | caseAgent.setPersonId(personIdMap.get(caseAgent.getAgentCode())); |
| | | caseAgent.setPartyUserId(loginUser.getId()); |
| | | caseAgent.setCaseId(registerSaveDTO.getId()); |
| | | caseAgent.setAgentTypeName(CaseBaseConstsEnum.getDes(caseAgent.getAgentType())); |
| | |
| | | QueryWrapper<CasePerson> casePersonQueryWrapper = new QueryWrapper<>(); |
| | | casePersonQueryWrapper.eq("case_id", registerSaveDTO.getId()); |
| | | List<CasePerson> personList = personService.list(casePersonQueryWrapper); |
| | | Map<String,String> personNameMap = new HashMap<>(); |
| | | if(ObjectUtils.isNotEmpty(personList)){ |
| | | for (CasePerson casePerson : personList) { |
| | | personNameMap.put(casePerson.getId(),casePerson.getTrueName()); |
| | | } |
| | | } |
| | | registerSaveDTO.setPersonList(personList); |
| | | |
| | | QueryWrapper<CaseAgent> caseAgentQueryWrapper = new QueryWrapper<>(); |
| | | caseAgentQueryWrapper.eq("case_id", registerSaveDTO.getId()); |
| | | List<CaseAgent> agentList = agentService.list(caseAgentQueryWrapper); |
| | | if(ObjectUtils.isNotEmpty(agentList)){ |
| | | for (CaseAgent caseAgent : agentList) { |
| | | caseAgent.setAgentPersonName(personNameMap.get(caseAgent.getPersonId())); |
| | | } |
| | | } |
| | | registerSaveDTO.setAgentList(agentList); |
| | | |
| | | return registerSaveDTO; |
| | |
| | | } |
| | | List<String> ids = casePersonList.stream().map(CasePerson::getCaseId).collect(Collectors.toList()); |
| | | terms.put("ids", ids); |
| | | terms.put("partyShow",1); |
| | | long total = mapper.countTerms(terms); |
| | | List<CaseInfo> content = mapper.pageTerms(page, terms); |
| | | if (ObjectUtils.isNotEmpty(content)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | QueryWrapper<CasePerson> personWrapper1 = new QueryWrapper<>(); |
| | | personWrapper1.eq("case_id", casePageDTO.getId()); |
| | | List<CasePerson> casePersonList1 = personService.list(personWrapper1); |
| | | //申请人集合 |
| | | List<CasePersonWeDTO> plaintiffList = new ArrayList<>(); |
| | | //被申请人集合 |
| | | List<CasePersonWeDTO> defendantList = new ArrayList<>(); |
| | | for (CasePerson casePerson : casePersonList1) { |
| | | CasePersonWeDTO casePersonWechatDTO = new CasePersonWeDTO(); |
| | | BeanUtils.copyProperties(casePerson, casePersonWechatDTO); |
| | | if (CaseBaseConstsEnum.PERSON_TYPE_1.getIndex().equals(casePerson.getPerType())) { |
| | | plaintiffList.add(casePersonWechatDTO); |
| | | } else if (CaseBaseConstsEnum.PERSON_TYPE_2.getIndex().equals(casePerson.getPerType())) { |
| | | defendantList.add(casePersonWechatDTO); |
| | | //如果是导出调用,不查询extend信息 |
| | | if(ObjectUtils.isEmpty(terms.get("report"))){ |
| | | QueryWrapper<CasePerson> personWrapper1 = new QueryWrapper<>(); |
| | | personWrapper1.eq("case_id", casePageDTO.getId()); |
| | | List<CasePerson> casePersonList1 = personService.list(personWrapper1); |
| | | for (CasePerson casePerson : casePersonList1) { |
| | | CasePersonWeDTO casePersonWechatDTO = new CasePersonWeDTO(); |
| | | BeanUtils.copyProperties(casePerson, casePersonWechatDTO); |
| | | if (CaseBaseConstsEnum.PERSON_TYPE_1.getIndex().equals(casePerson.getPerType())) { |
| | | plaintiffList.add(casePersonWechatDTO); |
| | | } else if (CaseBaseConstsEnum.PERSON_TYPE_2.getIndex().equals(casePerson.getPerType())) { |
| | | defendantList.add(casePersonWechatDTO); |
| | | } |
| | | } |
| | | } |
| | | casePageDTO.setDefendantList(defendantList); |
| | |
| | | return new PageImpl<CasePageDTO>(content, page, total); |
| | | } |
| | | |
| | | public CaseStatisticsBaseDTO statistics(Map<String, Object> terms) throws IOException { |
| | | /** |
| | | * 纠纷态势 |
| | | * 筛选范围:如果已经有承办部门,就按承办部门的区域筛选。如果没有承办部门按问题归属区域筛选 |
| | | * */ |
| | | public CaseStatisticsBaseDTO statistics(Map<String, Object> terms,String userId) throws IOException { |
| | | Object canal = null; |
| | | if(ObjectUtils.isNotEmpty(terms.get("canal"))){ |
| | | canal = terms.get("canal"); |
| | | } |
| | | terms.put("statistics", "1"); |
| | | //根据用户筛选区域范围 |
| | | CtUnitDTO ctUnitDTO = custClient.getUnitByUserId(userId); |
| | | String areaCode = null; |
| | | //目前没有村居数据,所以单位等级是4的也归集到3里面 |
| | | List<Integer> unitGrades = new ArrayList<>(); |
| | | |
| | | if(ctUnitDTO.getUnitGrade().equals(1)){ |
| | | terms.put("queCity", ctUnitDTO.getCity()); |
| | | areaCode = ctUnitDTO.getCity(); |
| | | unitGrades.add(ctUnitDTO.getUnitGrade()); |
| | | }else if(ctUnitDTO.getUnitGrade().equals(2)){ |
| | | terms.put("queArea", ctUnitDTO.getArea()); |
| | | areaCode = ctUnitDTO.getArea(); |
| | | unitGrades.add(ctUnitDTO.getUnitGrade()); |
| | | }else if(ctUnitDTO.getUnitGrade().equals(3) || ctUnitDTO.getUnitGrade().equals(4)){ |
| | | terms.put("queRoad", ctUnitDTO.getRoad()); |
| | | areaCode = ctUnitDTO.getRoad(); |
| | | unitGrades.add(3); |
| | | unitGrades.add(4); |
| | | } |
| | | //目前没有村居,所以区和街道进来都是按街道展示 |
| | | String areaType = null;//兼容白云数据 |
| | | if(ObjectUtils.isNotEmpty(terms.get("queRoad")) || ObjectUtils.isNotEmpty(terms.get("queArea"))){ |
| | | terms.put("areaType","2"); |
| | | areaType = "2"; |
| | | }else{ |
| | | areaType = "1"; |
| | | } |
| | | //基础数据统计 |
| | | CaseStatisticsBaseDTO caseStatisticsBaseDTO = mapper.statisticsBase(terms); |
| | |
| | | caseStatisticsBaseDTO.setTwoLevelRate(BigDecimalUtil.integerDivideDelZero(caseStatisticsBaseDTO.getTwoLevelNum() * 100, levelTotalNum, 1)); |
| | | caseStatisticsBaseDTO.setThreeLevelRate(BigDecimalUtil.integerDivideDelZero(caseStatisticsBaseDTO.getThreeLevelNum() * 100, levelTotalNum, 1)); |
| | | //区域数据统计 |
| | | terms.put("isArea", "1"); |
| | | List<CaseStatisticsAreaDTO> caseStatisticsAreaDTOS = mapper.statisticsArea(terms); |
| | | if (ObjectUtils.isEmpty(caseStatisticsAreaDTOS)) { |
| | | caseStatisticsAreaDTOS = new ArrayList<>(); |
| | |
| | | allArea.setAreaName("本级"); |
| | | allArea.setAreaCode("1"); |
| | | List<String> areaCodeList = new ArrayList<>(); |
| | | List<CaseStatisticsAreaDTO> areaList = new ArrayList<>(); |
| | | List<String> areaNames = new ArrayList<>();//为兼容白云区数据 |
| | | for (CaseStatisticsAreaDTO caseStatisticsAreaDTO : caseStatisticsAreaDTOS) { |
| | | allArea.setCaseNum(dellNull(caseStatisticsAreaDTO.getCaseNum()) + dellNull(allArea.getCaseNum())); |
| | | allArea.setResolveNum(dellNull(caseStatisticsAreaDTO.getResolveNum()) + dellNull(allArea.getResolveNum())); |
| | | allArea.setUnResolveNum(dellNull(caseStatisticsAreaDTO.getUnResolveNum()) + dellNull(allArea.getUnResolveNum())); |
| | | allArea.setResolveingNum(dellNull(caseStatisticsAreaDTO.getResolveingNum()) + dellNull(allArea.getResolveingNum())); |
| | | areaCodeList.add(caseStatisticsAreaDTO.getAreaCode()); |
| | | areaNames.add(caseStatisticsAreaDTO.getAreaName()); |
| | | //本及:承办单位是本及和没有承办单位并且没有下级区域编码 |
| | | if(ObjectUtils.isEmpty(caseStatisticsAreaDTO.getAreaCode()) || unitGrades.contains(caseStatisticsAreaDTO.getUnitGrade())){ |
| | | allArea.setCaseNum(dellNull(caseStatisticsAreaDTO.getCaseNum()) + dellNull(allArea.getCaseNum())); |
| | | allArea.setResolveNum(dellNull(caseStatisticsAreaDTO.getResolveNum()) + dellNull(allArea.getResolveNum())); |
| | | allArea.setUnResolveNum(dellNull(caseStatisticsAreaDTO.getUnResolveNum()) + dellNull(allArea.getUnResolveNum())); |
| | | allArea.setResolveingNum(dellNull(caseStatisticsAreaDTO.getResolveingNum()) + dellNull(allArea.getResolveingNum())); |
| | | }else{ |
| | | areaList.add(caseStatisticsAreaDTO); |
| | | areaCodeList.add(caseStatisticsAreaDTO.getAreaCode()); |
| | | } |
| | | } |
| | | caseStatisticsAreaDTOS.add(allArea); |
| | | List<QueAreaDTO> queArea = listAreaByType(terms.get("queArea")); |
| | | areaList.add(allArea); |
| | | if("1".equals(areaType)){ |
| | | Map<String, String> area = getArea(); |
| | | for (String areaName : area.keySet()) { |
| | | if(!areaNames.contains(areaName)){ |
| | | CaseStatisticsAreaDTO areaChild = new CaseStatisticsAreaDTO(); |
| | | areaChild.setAreaCode(area.get(areaName)); |
| | | areaChild.setAreaName(areaName); |
| | | areaList.add(areaChild); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<QueAreaDTO> queArea = listAreaByType(areaCode); |
| | | log.info("listAreaByType {}", JSON.toJSONString(queArea)); |
| | | for (QueAreaDTO caseAreaDTO : queArea) { |
| | | if (!areaCodeList.contains(caseAreaDTO.getAreaCode())) { |
| | |
| | | areaChild.setResolveNum(0); |
| | | areaChild.setUnResolveNum(0); |
| | | areaChild.setResolveingNum(0); |
| | | caseStatisticsAreaDTOS.add(areaChild); |
| | | areaList.add(areaChild); |
| | | } |
| | | } |
| | | |
| | | if (ObjectUtils.isNotEmpty(caseStatisticsAreaDTOS)) { |
| | | sortArea(caseStatisticsAreaDTOS); |
| | | if (ObjectUtils.isNotEmpty(areaList)) { |
| | | sortArea(areaList); |
| | | } |
| | | caseStatisticsBaseDTO.setAreaList(caseStatisticsAreaDTOS); |
| | | terms.remove("isArea"); |
| | | caseStatisticsBaseDTO.setAreaList(areaList); |
| | | //纠纷类型统计 |
| | | List<CaseStatisticsTypeDTO> caseStatisticsTypeDTOS = mapper.statisticsType(terms); |
| | | List<CaseStatisticsTypeDTO> caseStatisticsTypeDTOS = mapper.statisticsTypeFirst(terms); |
| | | if (ObjectUtils.isNotEmpty(caseStatisticsTypeDTOS)) { |
| | | sortType(caseStatisticsTypeDTOS); |
| | | } |
| | |
| | | terms.put("canal", canal); |
| | | } |
| | | Sort sort = Sort.by(Sort.Direction.DESC, "a.create_time"); |
| | | PageRequest pageRequest = PageRequest.of(0, 5, sort); |
| | | PageRequest pageRequest = PageRequest.of(0, 30, sort); |
| | | terms.remove("statistics"); |
| | | Page<CasePageDTO> casePageDTOS = pageQueryAll(pageRequest, terms); |
| | | if (ObjectUtils.isNotEmpty(casePageDTOS.getContent())) { |
| | | caseStatisticsBaseDTO.setCaseList(casePageDTOS.getContent()); |
| | |
| | | return caseStatisticsTypeDTOS; |
| | | } |
| | | |
| | | public List<CaseStatisticsAreaDTO> sortArea(List<CaseStatisticsAreaDTO> caseStatisticsAreaDTOS) { |
| | | public Map<String, String> getArea(){ |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("越秀区","2"); |
| | | map.put("海珠区","3"); |
| | |
| | | map.put("南沙区","10"); |
| | | map.put("从化区","11"); |
| | | map.put("增城区","12"); |
| | | return map; |
| | | } |
| | | |
| | | public List<CaseStatisticsAreaDTO> sortArea(List<CaseStatisticsAreaDTO> caseStatisticsAreaDTOS) { |
| | | Map<String, String> map = getArea(); |
| | | for (CaseStatisticsAreaDTO caseStatisticsAreaDTO : caseStatisticsAreaDTOS) { |
| | | caseStatisticsAreaDTO.setAreaCode(caseStatisticsAreaDTO.getAreaCode().replace("-","")); |
| | | if(map.containsKey(caseStatisticsAreaDTO.getAreaName())){ |
| | | caseStatisticsAreaDTO.setAreaCode(map.get(caseStatisticsAreaDTO.getAreaName())); |
| | | } |
| | | } |
| | | caseStatisticsAreaDTOS.sort((o1, o2) -> { |
| | | Integer totalScore1 = Integer.valueOf(o1.getAreaCode()); |
| | | Integer totalScore2 = Integer.valueOf(o2.getAreaCode()); |
| | | Long totalScore1 = Long.valueOf(o1.getAreaCode()); |
| | | Long totalScore2 = Long.valueOf(o2.getAreaCode()); |
| | | if (totalScore1 > totalScore2) { |
| | | return 1; |
| | | } else if (totalScore1.equals(totalScore2)) { |
| | |
| | | List<QueAreaDTO> queAreaDTOS = sysClient.listByParentId(parentId); |
| | | return queAreaDTOS; |
| | | } |
| | | |
| | | public Page<CasePageDTO> pagePerson(PageRequest page, Map<String, Object> terms,String certiNo) { |
| | | QueryWrapper<CasePerson> personWrapper = new QueryWrapper<>(); |
| | | personWrapper.select("case_id,certi_no"); |
| | | personWrapper.eq("certi_no", certiNo); |
| | | List<CasePerson> personList = personService.list(personWrapper); |
| | | List<String> ids = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(personList)){ |
| | | for (CasePerson casePerson : personList) { |
| | | ids.add(casePerson.getCaseId()); |
| | | } |
| | | } |
| | | QueryWrapper<CaseAgent> agentWrapper = new QueryWrapper<>(); |
| | | agentWrapper.select("case_id,certi_no"); |
| | | agentWrapper.in("certi_no", certiNo); |
| | | List<CaseAgent> agentList = agentService.list(agentWrapper); |
| | | if(ObjectUtils.isNotEmpty(agentList)){ |
| | | for (CaseAgent caseAgent : agentList) { |
| | | ids.add(caseAgent.getCaseId()); |
| | | } |
| | | } |
| | | if(ObjectUtils.isEmpty(ids)){ |
| | | return new PageImpl<CasePageDTO>(new ArrayList<>(), page, 0); |
| | | } |
| | | terms.put("ids", ids); |
| | | long total = mapper.countTermsAll(terms); |
| | | List<CasePageDTO> content = mapper.pageTermsAll(page, terms); |
| | | if (ObjectUtils.isNotEmpty(content)) { |
| | | for (CasePageDTO casePageDTO : content) { |
| | | if(ObjectUtils.isNotEmpty(casePageDTO.getQueRoadName())){ |
| | | casePageDTO.setAreaName(casePageDTO.getQueRoadName()); |
| | | }else if(ObjectUtils.isNotEmpty(casePageDTO.getAreaName())){ |
| | | casePageDTO.setAreaName(casePageDTO.getAreaName()); |
| | | }else if(ObjectUtils.isNotEmpty(casePageDTO.getQueCityName())){ |
| | | casePageDTO.setAreaName(casePageDTO.getQueCityName()); |
| | | } |
| | | if(ObjectUtils.isNotEmpty(casePageDTO.getCaseLevel())){ |
| | | switch (casePageDTO.getCaseLevel()){ |
| | | case "1": |
| | | casePageDTO.setCaseLevel("一级"); |
| | | break; |
| | | case "2": |
| | | casePageDTO.setCaseLevel("二级"); |
| | | break; |
| | | case "3": |
| | | casePageDTO.setCaseLevel("三级"); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return new PageImpl<CasePageDTO>(content, page, total); |
| | | } |
| | | |
| | | public CasePersonCountBO countPerson(String certiNo){ |
| | | CasePersonCountBO casePersonCountBO = new CasePersonCountBO(); |
| | | |
| | | Integer plaintiffNum = 0;//申请方当事人数 |
| | | Integer defendantNum = 0;//被申请方当事人数 |
| | | Integer pagentsNum = 0;//申请方代理人数 |
| | | Integer dagentsNum = 0;//被申请方代理人数 |
| | | |
| | | List<CasePerson> personList = personService.listByCertiNo(certiNo); |
| | | List<String> ids = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(personList)){ |
| | | for (CasePerson casePerson : personList) { |
| | | ids.add(casePerson.getCaseId()); |
| | | if(CaseBaseConstsEnum.PERSON_TYPE_1.getIndex().equals(casePerson.getPerType())){ |
| | | plaintiffNum++; |
| | | } |
| | | if(CaseBaseConstsEnum.PERSON_TYPE_2.getIndex().equals(casePerson.getPerType())){ |
| | | defendantNum++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<CaseAgent> agentList = agentService.listByCertiNo(certiNo); |
| | | if(ObjectUtils.isNotEmpty(agentList)){ |
| | | for (CaseAgent caseAgent : agentList) { |
| | | ids.add(caseAgent.getCaseId()); |
| | | if(CaseBaseConstsEnum.PERSON_TYPE_3.getIndex().equals(caseAgent.getPerType())){ |
| | | pagentsNum++; |
| | | } |
| | | if(CaseBaseConstsEnum.PERSON_TYPE_4.getIndex().equals(caseAgent.getPerType())){ |
| | | dagentsNum++; |
| | | } |
| | | } |
| | | } |
| | | casePersonCountBO.setDagentsNum(dagentsNum); |
| | | casePersonCountBO.setPagentsNum(pagentsNum); |
| | | casePersonCountBO.setDefendantNum(defendantNum); |
| | | casePersonCountBO.setPlaintiffNum(plaintiffNum); |
| | | casePersonCountBO.setTotalNum(ids.size()); |
| | | casePersonCountBO.setZzzxNum(ids.size()); |
| | | return casePersonCountBO; |
| | | } |
| | | |
| | | public List<CaseStatisticsTypeDTO> statisticsCaseType(Map<String, Object> terms,String userId){ |
| | | //根据用户筛选区域范围 |
| | | CtUnitDTO ctUnitDTO = custClient.getUnitByUserId(userId); |
| | | if(ctUnitDTO.getUnitGrade().equals(2)){ |
| | | terms.put("queArea", ctUnitDTO.getArea()); |
| | | }else if(ctUnitDTO.getUnitGrade().equals(3) || ctUnitDTO.getUnitGrade().equals(4)){ |
| | | terms.put("queRoad", ctUnitDTO.getRoad()); |
| | | } |
| | | if(ObjectUtils.isEmpty(terms.get("caseTypeFirst"))){ |
| | | //筛选一级为其他的纠纷类型 |
| | | List<CaseStatisticsTypeDTO> caseStatisticsTypeDTOS = mapper.statisticsTypeFirst(terms); |
| | | if (ObjectUtils.isNotEmpty(caseStatisticsTypeDTOS)) { |
| | | sortType(caseStatisticsTypeDTOS); |
| | | } |
| | | int i = 1; |
| | | List<String> caseTypeList = new ArrayList<>(); |
| | | for (CaseStatisticsTypeDTO caseStatisticsTypeDTO : caseStatisticsTypeDTOS) { |
| | | if (i > 5) { |
| | | caseTypeList.add(caseStatisticsTypeDTO.getCaseType()); |
| | | } |
| | | i++; |
| | | } |
| | | if(ObjectUtils.isEmpty(caseTypeList)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | terms.put("caseTypeFirstList", caseTypeList); |
| | | } |
| | | List<CaseStatisticsTypeDTO> caseStatisticsTypeDTOS = mapper.statisticsType(terms); |
| | | if (ObjectUtils.isNotEmpty(caseStatisticsTypeDTOS)) { |
| | | sortType(caseStatisticsTypeDTOS); |
| | | } |
| | | Integer typeTotalNum = 0; |
| | | for (CaseStatisticsTypeDTO caseStatisticsTypeDTO : caseStatisticsTypeDTOS) { |
| | | typeTotalNum = typeTotalNum + dellNull(caseStatisticsTypeDTO.getCaseNum()); |
| | | } |
| | | for (CaseStatisticsTypeDTO caseStatisticsTypeDTO : caseStatisticsTypeDTOS) { |
| | | caseStatisticsTypeDTO.setCaseRate(BigDecimalUtil.integerDivideDelZero(caseStatisticsTypeDTO.getCaseNum() * 100, typeTotalNum, 1)); |
| | | } |
| | | return caseStatisticsTypeDTOS; |
| | | } |
| | | } |