| | |
| | | import cn.huge.module.cases.domain.dto.*; |
| | | |
| | | import cn.huge.module.cases.domain.dto.CaseAreaDTO; |
| | | import cn.huge.module.cases.domain.po.CaseAgent; |
| | | import cn.huge.module.cases.domain.po.CaseInfoUnfold; |
| | | import cn.huge.module.cases.domain.po.CasePerson; |
| | | import cn.huge.module.cases.domain.po.*; |
| | | import cn.huge.module.client.api.impl.CustClientImpl; |
| | | import cn.huge.module.client.api.impl.SysClientImpl; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.cases.dao.mapper.CaseInfoMapper; |
| | | import cn.huge.module.cases.domain.po.CaseInfo; |
| | | import cn.huge.module.constant.BaseConsts; |
| | | import cn.huge.module.cust.dto.PaUserDTO; |
| | | import cn.huge.module.mediate.constant.*; |
| | |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.net.URL; |
| | | import java.nio.file.Files; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Autowired |
| | | private CaseEvaluateService caseEvaluateService; |
| | | |
| | | @Autowired |
| | | private CaseAreaService caseAreaService; |
| | | |
| | | |
| | | /** |
| | |
| | | areaCodeList.add(caseStatisticsAreaDTO.getAreaCode()); |
| | | } |
| | | caseStatisticsAreaDTOS.add(allArea); |
| | | List<CaseAreaDTO> queArea = listAreaByType(terms.get("areaType"), terms.get("queArea")); |
| | | List<CaseArea> queArea = listAreaByType(terms.get("areaType"), terms.get("queArea")); |
| | | log.info("listAreaByType {}", JSON.toJSONString(queArea)); |
| | | for (CaseAreaDTO caseAreaDTO : queArea) { |
| | | for (CaseArea caseAreaDTO : queArea) { |
| | | if (!areaCodeList.contains(caseAreaDTO.getAreaCode())) { |
| | | CaseStatisticsAreaDTO areaChild = new CaseStatisticsAreaDTO(); |
| | | areaChild.setAreaCode(caseAreaDTO.getAreaCode()); |
| | |
| | | //事项来源 |
| | | terms.put("canal", CaseBaseConstsEnum.CASE_CANAL_1.getIndex()); |
| | | CaseStatisticsSourceDTO oneSource = mapper.statisticsSource(terms); |
| | | if(ObjectUtils.isEmpty(oneSource)){ |
| | | oneSource = new CaseStatisticsSourceDTO(); |
| | | } |
| | | oneSource.setCanalName(CaseBaseConstsEnum.CASE_CANAL_1.getDes()); |
| | | terms.put("canal", CaseBaseConstsEnum.CASE_CANAL_2.getIndex()); |
| | | CaseStatisticsSourceDTO twoSource = mapper.statisticsSource(terms); |
| | | if(ObjectUtils.isEmpty(twoSource)){ |
| | | twoSource = new CaseStatisticsSourceDTO(); |
| | | } |
| | | twoSource.setCanalName(CaseBaseConstsEnum.CASE_CANAL_2.getDes()); |
| | | |
| | | Integer sourceTotalNum = dellNull(oneSource.getCaseNum()) + dellNull(oneSource.getCaseNum()); |
| | |
| | | return number; |
| | | } |
| | | |
| | | /** |
| | | * 根据json文件获取区域信息 |
| | | */ |
| | | public CaseAreaDTO getArea() throws IOException { |
| | | Class<?> clazz = CaseAreaDTO.class; |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | |
| | | File file = new File("area/Area.json"); |
| | | CaseAreaDTO obj = mapper.readValue(file, CaseAreaDTO.class); |
| | | return obj; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据不同的等级获取不同区域子集合 |
| | | * |
| | | * @param areaType 1-市级 2-区 |
| | | */ |
| | | public List<CaseAreaDTO> listAreaByType(Object areaType, Object areaCode) throws IOException { |
| | | public List<CaseArea> listAreaByType(Object areaType, Object areaCode) throws IOException { |
| | | log.info("listAreaByType {},{}", areaType, areaCode); |
| | | CaseAreaDTO area = getArea(); |
| | | if (ObjectUtils.isEmpty(areaType) || areaType.equals("") || areaType.equals("1")) { |
| | | return area.getChildren(); |
| | | QueryWrapper<CaseArea> caseAreaWrapper = new QueryWrapper<>(); |
| | | caseAreaWrapper.eq("parent_code","1601"); |
| | | List<CaseArea> list = caseAreaService.list(caseAreaWrapper); |
| | | return list; |
| | | } |
| | | if (areaType.equals("2")) { |
| | | List<CaseAreaDTO> children = area.getChildren(); |
| | | for (CaseAreaDTO child : children) { |
| | | if (child.getAreaCode().equals(areaCode)) { |
| | | return child.getChildren(); |
| | | } |
| | | } |
| | | |
| | | QueryWrapper<CaseArea> caseAreaWrapper = new QueryWrapper<>(); |
| | | caseAreaWrapper.eq("parent_code",areaCode); |
| | | List<CaseArea> list = caseAreaService.list(caseAreaWrapper); |
| | | return list; |
| | | } |
| | | return new ArrayList<>(); |
| | | } |