| | |
| | | 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 cn.huge.module.mediate.dto.WechatBindCaseDTO; |
| | | import cn.huge.module.sys.dto.FileIdTypeInfoBaseDTO; |
| | | import cn.huge.module.sys.dto.QueAddrBaseDTO; |
| | | import cn.huge.module.sys.dto.QueAreaDTO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | 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; |
| | |
| | | caseInfo.setDefendants(defendants.toString()); |
| | | caseInfo.setDagents(dagents.toString()); |
| | | caseInfo.setCaseRef(utilsClient.createCaseRef()); |
| | | caseInfo.setCanal(CaseBaseConstsEnum.CASE_CANAL_1.getIndex()); |
| | | caseInfo.setCanalName(CaseBaseConstsEnum.CASE_CANAL_1.getDes()); |
| | | caseInfo.setVisitWay(CaseBaseConstsEnum.VISIT_WAY_1.getIndex()); |
| | | caseInfo.setVisitWayName(CaseBaseConstsEnum.VISIT_WAY_1.getDes()); |
| | | //todo case_title生成、经纬度转换 |
| | |
| | | caseInfo.setInputUserId(loginUser.getId()); |
| | | caseInfo.setInputUserName(loginUser.getTrueName()); |
| | | caseInfo.setInputWay(CaseBaseConsts.INPUT_WAY_1); |
| | | if(ObjectUtils.isEmpty(registerSaveDTO.getPeopleNum())){ |
| | | caseInfo.setPeopleNum(0); |
| | | } |
| | | if(ObjectUtils.isEmpty(registerSaveDTO.getAmount())){ |
| | | caseInfo.setAmount(0.0); |
| | | } |
| | | //默认添加省市 |
| | | caseInfo.setQueProv("19"); |
| | | caseInfo.setQueProvName("广东省"); |
| | |
| | | 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.setCanalName("一级"); |
| | | break; |
| | | case 2: |
| | | casePageDTO.setCanalName("二级"); |
| | | break; |
| | | case 3: |
| | | casePageDTO.setCanalName("三级"); |
| | | break; |
| | | } |
| | | } |
| | | QueryWrapper<CasePerson> personWrapper1 = new QueryWrapper<>(); |
| | | personWrapper1.eq("case_id", casePageDTO.getId()); |
| | | List<CasePerson> casePersonList1 = personService.list(personWrapper1); |
| | |
| | | areaCodeList.add(caseStatisticsAreaDTO.getAreaCode()); |
| | | } |
| | | caseStatisticsAreaDTOS.add(allArea); |
| | | List<CaseAreaDTO> queArea = listAreaByType(terms.get("areaType"), terms.get("queArea")); |
| | | List<QueAreaDTO> queArea = listAreaByType(terms.get("queArea")); |
| | | log.info("listAreaByType {}", JSON.toJSONString(queArea)); |
| | | for (CaseAreaDTO caseAreaDTO : queArea) { |
| | | for (QueAreaDTO 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()); |
| | |
| | | } |
| | | |
| | | public List<CaseStatisticsAreaDTO> sortArea(List<CaseStatisticsAreaDTO> caseStatisticsAreaDTOS) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("越秀区","2"); |
| | | map.put("海珠区","3"); |
| | | map.put("荔湾区","4"); |
| | | map.put("天河区","5"); |
| | | map.put("白云区","6"); |
| | | map.put("黄埔区","7"); |
| | | map.put("花都区","8"); |
| | | map.put("番禺区","9"); |
| | | map.put("南沙区","10"); |
| | | map.put("从化区","11"); |
| | | map.put("增城区","12"); |
| | | for (CaseStatisticsAreaDTO caseStatisticsAreaDTO : caseStatisticsAreaDTOS) { |
| | | if(map.containsKey(caseStatisticsAreaDTO.getAreaName())){ |
| | | caseStatisticsAreaDTO.setAreaCode(map.get(caseStatisticsAreaDTO.getAreaName())); |
| | | } |
| | | } |
| | | caseStatisticsAreaDTOS.sort((o1, o2) -> { |
| | | log.info("xsd:{},{}",o1,o2); |
| | | Integer totalScore1 = Integer.valueOf(o1.getAreaCode()); |
| | | Integer totalScore2 = Integer.valueOf(o2.getAreaCode()); |
| | | if (totalScore1 > totalScore2) { |
| | |
| | | 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 { |
| | | log.info("listAreaByType {},{}", areaType, areaCode); |
| | | CaseAreaDTO area = getArea(); |
| | | if (ObjectUtils.isEmpty(areaType) || areaType.equals("") || areaType.equals("1")) { |
| | | return area.getChildren(); |
| | | public List<QueAreaDTO> listAreaByType(Object areaCode) { |
| | | log.info("listAreaByType {},{}", areaCode); |
| | | String parentId = "1601"; |
| | | if (ObjectUtils.isNotEmpty(areaCode)) { |
| | | parentId = String.valueOf(areaCode); |
| | | } |
| | | if (areaType.equals("2")) { |
| | | List<CaseAreaDTO> children = area.getChildren(); |
| | | for (CaseAreaDTO child : children) { |
| | | if (child.getAreaCode().equals(areaCode)) { |
| | | return child.getChildren(); |
| | | } |
| | | } |
| | | } |
| | | return new ArrayList<>(); |
| | | List<QueAreaDTO> queAreaDTOS = sysClient.listByParentId(parentId); |
| | | return queAreaDTOS; |
| | | } |
| | | } |