| | |
| | | |
| | | 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.dto.*; |
| | | |
| | | import cn.huge.module.cases.domain.dto.CaseAreaDTO; |
| | |
| | | // 临时加上一级纠纷类型 |
| | | 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)) { |
| | |
| | | } |
| | | twoSource.setCanalName(CaseBaseConstsEnum.CASE_CANAL_2.getDes()); |
| | | |
| | | Integer sourceTotalNum = dellNull(oneSource.getCaseNum()) + dellNull(oneSource.getCaseNum()); |
| | | terms.put("canal", CaseBaseConstsEnum.CASE_CANAL_3.getIndex()); |
| | | CaseStatisticsSourceDTO threeSource = mapper.statisticsSource(terms); |
| | | if(ObjectUtils.isEmpty(threeSource)){ |
| | | threeSource = new CaseStatisticsSourceDTO(); |
| | | } |
| | | |
| | | terms.put("canal", CaseBaseConstsEnum.CASE_CANAL_4.getIndex()); |
| | | CaseStatisticsSourceDTO fourSource = mapper.statisticsSource(terms); |
| | | if(ObjectUtils.isEmpty(fourSource)){ |
| | | fourSource = new CaseStatisticsSourceDTO(); |
| | | } |
| | | |
| | | Integer sourceTotalNum = dellNull(oneSource.getCaseNum()) + dellNull(twoSource.getCaseNum()) + dellNull(threeSource.getCaseNum()) + dellNull(fourSource.getCaseNum()); |
| | | oneSource.setCaseRate(BigDecimalUtil.integerDivideDelZero(oneSource.getCaseNum() * 100, sourceTotalNum, 1)); |
| | | oneSource.setResolveRate(BigDecimalUtil.integerDivideDelZero(oneSource.getResolveNum() * 100, oneSource.getCaseNum(), 1)); |
| | | twoSource.setCaseRate(BigDecimalUtil.integerDivideDelZero(twoSource.getCaseNum() * 100, sourceTotalNum, 1)); |
| | | twoSource.setResolveRate(BigDecimalUtil.integerDivideDelZero(twoSource.getResolveNum() * 100, twoSource.getCaseNum(), 1)); |
| | | |
| | | CaseStatisticsSourceDTO threeSource = new CaseStatisticsSourceDTO(); |
| | | threeSource.setCanalName("自行排查"); |
| | | threeSource.setResolveRate("0"); |
| | | threeSource.setCaseRate("0"); |
| | | CaseStatisticsSourceDTO fourSource = new CaseStatisticsSourceDTO(); |
| | | fourSource.setCanalName("协同推送"); |
| | | fourSource.setResolveRate("0"); |
| | | fourSource.setCaseRate("0"); |
| | | |
| | | threeSource.setCanalName(CaseBaseConstsEnum.CASE_CANAL_3.getDes()); |
| | | threeSource.setCaseRate(BigDecimalUtil.integerDivideDelZero(threeSource.getCaseNum() * 100, sourceTotalNum, 1)); |
| | | threeSource.setResolveRate(BigDecimalUtil.integerDivideDelZero(threeSource.getResolveNum() * 100, threeSource.getCaseNum(), 1)); |
| | | |
| | | fourSource.setCanalName(CaseBaseConstsEnum.CASE_CANAL_4.getDes()); |
| | | fourSource.setCaseRate(BigDecimalUtil.integerDivideDelZero(fourSource.getCaseNum() * 100, sourceTotalNum, 1)); |
| | | fourSource.setResolveRate(BigDecimalUtil.integerDivideDelZero(fourSource.getResolveNum() * 100, fourSource.getCaseNum(), 1)); |
| | | |
| | | caseStatisticsBaseDTO.setOneSource(oneSource); |
| | | caseStatisticsBaseDTO.setTwoSource(twoSource); |
| | | caseStatisticsBaseDTO.setThreeSource(threeSource); |