diff --git a/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java b/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java index a4b99ae..f8fbf23 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java @@ -84,11 +84,15 @@ public class DefaultHomePageAppController extends DefaultBaseController { AreaDTO parentDTO = mongoAreaService.get(areaParentId); String areaCodeLike = AreaCodeBuider.getAreaCodeBegin(parentDTO.getAreaCode()); params.put("areaCodeLike",areaCodeLike); - // 人口总数 - SuccessResultData count1 = basePopulationInfoService.countBasePopulationInfo(params); + // 户籍人口 + params.put("type","1"); + Integer count1 = basePopulationInfoService.countBasePopulationInfoNew(params); + // 户籍人口(外出) + params.put("type","2"); + Integer count11 = basePopulationInfoService.countBasePopulationInfoNew(params); // 境外人员 Integer count2 = overseasPersonnelService.countOverseasPersonnelNew(params); - // 流动人口 + // 非户籍人口 Integer count3 = floatingPopulationService.countFloatingPopulationNew(params); // 留守人员 Integer count4 = homePersonService.countNumberHomePersonNew(params); @@ -105,7 +109,7 @@ public class DefaultHomePageAppController extends DefaultBaseController { // 重点青少年 Integer count10 = keyTeenagersService.countKeyTeenagersNew(params); params.clear(); - params.put("count1", count1.getData()); + params.put("count1", count1); params.put("count2", count2); params.put("count3", count3); params.put("count4", count4); @@ -115,6 +119,7 @@ public class DefaultHomePageAppController extends DefaultBaseController { params.put("count8", count8); params.put("count9", count9); params.put("count10", count10); + params.put("count11", count11); return params; } diff --git a/src/main/java/cn/com/tenlion/commonpopulation/controller/app/floatingpopulation/FloatingPopulationAppController.java b/src/main/java/cn/com/tenlion/commonpopulation/controller/app/floatingpopulation/FloatingPopulationAppController.java index 92278cd..46ad540 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/controller/app/floatingpopulation/FloatingPopulationAppController.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/controller/app/floatingpopulation/FloatingPopulationAppController.java @@ -1,9 +1,11 @@ package cn.com.tenlion.commonpopulation.controller.app.floatingpopulation; +import cn.com.tenlion.commonpopulation.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.communitycorrection.CommunityCorrectionDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation.FloatingPopulationDTO; import cn.com.tenlion.commonpopulation.pojo.vos.floatingpopulation.FloatingPopulationVO; import cn.com.tenlion.commonpopulation.service.floatingpopulation.IFloatingPopulationService; +import cn.com.tenlion.commonpopulation.utils.IdCardVerifyUtil; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.exceptions.RemoveException; @@ -37,6 +39,20 @@ public class FloatingPopulationAppController extends DefaultBaseController { @Autowired private IFloatingPopulationService floatingPopulationService; + @ApiOperation(value = "身份证查询人员基础信息(检索条件查询一条)", notes = "身份证查询人员基础信息(检索条件查询一条)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "idCardNumber", value = "身份证号", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("/getByIdCardNumber/{idCardNumber}") + public FloatingPopulationDTO getBasePopulationInfo(@PathVariable String idCardNumber) throws SearchException { + Map params = requestParams(); + if(!IdCardVerifyUtil.isIDCard(idCardNumber)){ + throw new SearchException("请填写有效的身份证号"); + } + return floatingPopulationService.getFloatingPopulationByIdCardNumber(idCardNumber); + } + @ApiOperation(value = "人员信息基础表分页列表(区域下钻)", notes = "人员信息基础表分页列表接口(区域下钻)") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), diff --git a/src/main/java/cn/com/tenlion/commonpopulation/pojo/dtos/floatingpopulation/FloatingPopulationDTO.java b/src/main/java/cn/com/tenlion/commonpopulation/pojo/dtos/floatingpopulation/FloatingPopulationDTO.java index 8cc8401..66284d1 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/pojo/dtos/floatingpopulation/FloatingPopulationDTO.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/pojo/dtos/floatingpopulation/FloatingPopulationDTO.java @@ -1,10 +1,13 @@ package cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation; +import cn.com.tenlion.commonpopulation.pojo.dtos.basepopulationinfo.GridPersonDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; +import java.util.List; + /** * * @ClassName: FloatingPopulationDTO @@ -55,6 +58,28 @@ public class FloatingPopulationDTO { @ApiModelProperty(name = "gridName", value = "网格名称") private String gridName; + @ApiModelProperty(name = "gridPersonList", value = "网格内网格员集合") + List gridPersonList; + @ApiModelProperty(name = "nationDictionaryName", value = "民族字典名称") + private String nationDictionaryName; + @ApiModelProperty(name = "genderDictionaryName", value = "性别字典名称") + private String genderDictionaryName; + @ApiModelProperty(name = "nativePlaceDictionaryName", value = "户籍地址字典名称") + private String nativePlaceDictionaryName; + @ApiModelProperty(name = "politicalStatusDictionaryName", value = "政治面貌字典名称") + private String politicalStatusDictionaryName; + @ApiModelProperty(name = "maritalStatusDictionaryName", value = "婚姻情况字典名称") + private String maritalStatusDictionaryName; + @ApiModelProperty(name = "educationDictionaryName", value = "学历字典名称") + private String educationDictionaryName; + @ApiModelProperty(name = "religionDictionaryName", value = "宗教信仰字典名称") + private String religionDictionaryName; + @ApiModelProperty(name = "occupationCategoryDictionaryName", value = "职业类别字典名称") + private String occupationCategoryDictionaryName; + @ApiModelProperty(name = "registeredResidenceDictionaryName", value = "户籍地字典名称") + private String registeredResidenceDictionaryName; + @ApiModelProperty(name = "currentResidenceDictionaryName", value = "现住地字典名称") + private String currentResidenceDictionaryName; @ApiModelProperty(name = "nameUsedBefore", value = "曾用名(2023年6月19日新增)") private String nameUsedBefore; diff --git a/src/main/java/cn/com/tenlion/commonpopulation/service/basepopulationinfo/impl/BasePopulationInfoServiceImpl.java b/src/main/java/cn/com/tenlion/commonpopulation/service/basepopulationinfo/impl/BasePopulationInfoServiceImpl.java index f140776..3a3931a 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/service/basepopulationinfo/impl/BasePopulationInfoServiceImpl.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/service/basepopulationinfo/impl/BasePopulationInfoServiceImpl.java @@ -740,11 +740,9 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements AreaDTO areaDTO = mongoAreaService.get(areaParentId); String sendUrl = apiPathProperties.getUserCenter(); String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(); - int totalPeopleNum = 0; int huJiNum = 0; int changZhuNum = 0; int waiLaiNum = 0; - int liuDongNum = 0; int jingWaiNum = 0; int liuShouNum = 0; int xingManNum = 0; @@ -811,10 +809,6 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements params.clear(); params.put("areaCodeLike", areaCodeLike); params.put("gridId", item.getGridId()); - // 人口库数量 - Integer counts = countBasePopulationInfoNew(params); - temp.put("areaPeopleNum", counts); - totalPeopleNum += counts; // 户籍数量 params.put("type", "1"); Integer huJi = countBasePopulationInfoNew(params); @@ -825,19 +819,13 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements Integer changZhu = countBasePopulationInfoNew(params); temp.put("changZhu", changZhu); changZhuNum += changZhu; - // 外来数量 - params.put("type", "3"); - Integer waiLai = countBasePopulationInfoNew(params); - temp.put("waiLai", waiLai); - waiLaiNum += waiLai; - // 流动人口数量 + // 外来人口数量 params.clear(); params.put("areaCodeLike", areaCodeLike); params.put("gridId", item.getGridId()); - params.put("subtype", "11"); - Integer liuDong = countBasePopulationInfoNew(params); - temp.put("liuDong", liuDong); - liuDongNum += liuDong; + Integer waiLai = iFloatingPopulationService.countFloatingPopulationNew(params); + temp.put("waiLai", waiLai); + waiLaiNum += waiLai; // 境外人口数量 Integer jingWai = iOverseasPersonnelService.countOverseasPersonnelNew(params); temp.put("jingWai", jingWai); @@ -919,18 +907,17 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements Map map = CacheNumber.get(item.getAreaCode()); CacheNumber.print(); - totalPeopleNum += map.get("areaPeopleNum");// 总数 - huJiNum += map.get("huJi");// 户籍数量 - changZhuNum += map.get("changZhu");// 常住数量 - waiLaiNum += map.get("waiLai");// 外来数量 - jingWaiNum += map.get("jingWai");// 境外人口数量 - liuShouNum += map.get("liuShou");// 留守人员数量 - xingManNum += map.get("xingMan");// 刑满释放数量 - jiaoZhengNum += map.get("jiaoZheng");// 刑满释放数量 - jingShenNum += map.get("jingShen");// 精神障碍数量 - xiDuNum += map.get("xiDu");// 吸毒人员数量 - aiZiNum += map.get("aiZi");// 艾滋病人员数量 - zhongDianNum += map.get("zhongDian");// 艾滋病人员数量 + huJiNum += map.get("huJi") == null ? 0 : map.get("huJi");// 户籍数量 + changZhuNum += map.get("changZhu") == null ? 0 : map.get("changZhu");// 常住数量 + waiLaiNum += map.get("waiLai") == null ? 0 : map.get("waiLai");// 外来数量 + jingWaiNum += map.get("jingWai") == null ? 0 : map.get("jingWai");// 境外人口数量 + liuShouNum += map.get("liuShou") == null ? 0 : map.get("liuShou");// 留守人员数量 + xingManNum += map.get("xingMan") == null ? 0 : map.get("xingMan");// 刑满释放数量 + jiaoZhengNum += map.get("jiaoZheng") == null ? 0 : map.get("jiaoZheng");// 矫正数量 + jingShenNum += map.get("jingShen") == null ? 0 : map.get("jingShen");// 精神障碍数量 + xiDuNum += map.get("xiDu") == null ? 0 : map.get("xiDu");// 吸毒人员数量 + aiZiNum += map.get("aiZi") == null ? 0 : map.get("aiZi");// 艾滋病人员数量 + zhongDianNum += map.get("zhongDian") == null ? 0 : map.get("zhongDian");// 重点人员 temp.putAll(map); areaList.add(temp); } @@ -942,11 +929,9 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements totalMap.put("areaParentId", ""); totalMap.put("areaCode" , parentDTO.getAreaCode()); totalMap.put("areaName", "合计"); - totalMap.put("areaPeopleNum", totalPeopleNum); totalMap.put("huJi", huJiNum); totalMap.put("changZhu", changZhuNum); totalMap.put("waiLai", waiLaiNum); - totalMap.put("liuDong", liuDongNum); totalMap.put("jingWai", jingWaiNum); totalMap.put("liuShou", liuShouNum); totalMap.put("xingMan", xingManNum); @@ -1390,11 +1375,8 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements Integer type1Count = basePopulationInfoDao.countBasePopulationInfoNew(query); query.put("type", "2"); Integer type2Count = basePopulationInfoDao.countBasePopulationInfoNew(query); - query.put("type", "3"); - Integer type3Count = basePopulationInfoDao.countBasePopulationInfoNew(query); + Integer feiHuJi = iFloatingPopulationService.countFloatingPopulationNew(query); query.put("type", ""); - // 流动人口 - Integer floatCount = iFloatingPopulationService.countFloatingPopulationNew(query); // 境外人口数量 Integer jingWai = iOverseasPersonnelService.countOverseasPersonnelNew(query); // 留守人员数量 @@ -1421,10 +1403,9 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements // 返回数据 Map result = new HashMap(); result.put("huJi", type1Count); - result.put("feiHuJi", type2Count); - result.put("waiChuHuJi", type3Count); + result.put("feiHuJi", feiHuJi); + result.put("waiChuHuJi", type2Count); result.put("jingWai", jingWai); - result.put("liuDong", floatCount); result.put("liuShou", liuShou); result.put("xingMan", xingMan); result.put("jiaoZheng", jiaoZheng); @@ -1432,7 +1413,7 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements result.put("aiZi", aiZi); result.put("jingShen", jingShen); result.put("zhongDianQingShaoNian", zhongDian); - int totalPerson = type1Count + type2Count + type3Count; + int totalPerson = type1Count + feiHuJi + type2Count; NumberFormat numberFormat = NumberFormat.getInstance(); // 精确到小数点后2位 numberFormat.setMaximumFractionDigits(2); @@ -1510,7 +1491,7 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements areaParentId = areaDTO.getAreaId(); } } - List> areaList = new ArrayList<>(); + List> areaList = Collections.synchronizedList(new ArrayList<>()); AreaDTO parentDTO = mongoAreaService.get(areaParentId); // 查询社区下的网格 if (parentDTO.getAreaLevel().equals("4")) { diff --git a/src/main/java/cn/com/tenlion/commonpopulation/service/floatingpopulation/impl/FloatingPopulationServiceImpl.java b/src/main/java/cn/com/tenlion/commonpopulation/service/floatingpopulation/impl/FloatingPopulationServiceImpl.java index 2f5df2f..bbd1250 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/service/floatingpopulation/impl/FloatingPopulationServiceImpl.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/service/floatingpopulation/impl/FloatingPopulationServiceImpl.java @@ -5,6 +5,7 @@ import cn.com.tenlion.commonpopulation.dao.floatingpopulation.IFloatingPopulatio import cn.com.tenlion.commonpopulation.kafkaObject.FloatingPopulation; import cn.com.tenlion.commonpopulation.pojo.UserExpandBO; import cn.com.tenlion.commonpopulation.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO; +import cn.com.tenlion.commonpopulation.pojo.dtos.basepopulationinfo.GridPersonDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.communitycorrection.CommunityCorrectionDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation.FloatingPopulationDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.grid.GridDTO; @@ -114,6 +115,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements * @throws Exception */ private String saveFloatingPopulationInfoReturnId(String token, FloatingPopulationVO floatingPopulationVO) throws Exception { + String idCardNumber = floatingPopulationVO.getIdCardNumber(); // 校验身份证号 if(!IdCardVerifyUtil.isIDCard(floatingPopulationVO.getIdCardNumber())){ throw new SaveException("请填写有效的身份证号"); @@ -126,6 +128,18 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements } else { setSaveInfo(params); } + String birthDay = IdCardVerifyUtil.getIdCardBirthday(idCardNumber); + params.put("birthDate",birthDay); + String gender = IdCardVerifyUtil.getIdCardGender(idCardNumber); + switch (gender){ + case "1" : + params.put("gender", "46bec29f-2368-44f7-98d0-b33246e5e16d"); + break; + case "0" : + params.put("gender", "4a5f549a-d339-4403-8d26-9058e80499b1"); + break; + default : params.put("gender", "01fffb32-73ca-4872-9d2f-abb2158f0e07"); + } Map query1 = new HashMap<>(); query1.put("idCardNumber", floatingPopulationVO.getIdCardNumber()); floatingPopulationDao.saveFloatingPopulation(params); @@ -203,6 +217,19 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements } else { setUpdateInfo(params); } + String idCardNumber = floatingPopulationVO.getIdCardNumber(); + String birthDay = IdCardVerifyUtil.getIdCardBirthday(idCardNumber); + params.put("birthDate",birthDay); + String gender = IdCardVerifyUtil.getIdCardGender(idCardNumber); + switch (gender){ + case "1" : + params.put("gender", "46bec29f-2368-44f7-98d0-b33246e5e16d"); + break; + case "0" : + params.put("gender", "4a5f549a-d339-4403-8d26-9058e80499b1"); + break; + default : params.put("gender", "01fffb32-73ca-4872-9d2f-abb2158f0e07"); + } floatingPopulationDao.updateFloatingPopulation(params); updateKafkaFloatingPopulation(params,"update"); } @@ -212,7 +239,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements Map params = super.getHashMap(1); params.put("floatingPopulationId", floatingPopulationId); FloatingPopulationDTO floatingPopulation = floatingPopulationDao.getFloatingPopulation(params); - changeDtoInfoFromDict(floatingPopulation); + changeDTOFromDict(floatingPopulation); return floatingPopulation; } @@ -220,7 +247,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements public List listFloatingPopulation(Map params) throws SearchException { List list = floatingPopulationDao.listFloatingPopulation(params); for(FloatingPopulationDTO item : list){ - changeDtoInfoFromDict(item); + changeDTOFromDict(item); } return list; } @@ -304,7 +331,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements areaParentId = areaDTO.getAreaId(); } } - List> areaList = new ArrayList<>(); + List> areaList = Collections.synchronizedList(new ArrayList<>()); AreaDTO parentDTO = mongoAreaService.get(areaParentId); // 查询社区下的网格 if (parentDTO.getAreaLevel().equals("4")) { @@ -373,13 +400,13 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements areaList.add(totalMap); }else{ List areaDTOS = mongoAreaService.listByParentId(areaParentId); - int totalPeopleNum = 0; - //final AtomicInteger totalPeopleNum = new AtomicInteger(0); + //int totalPeopleNum = 0; + final AtomicInteger totalPeopleNum = new AtomicInteger(0); List areaDTOS1 = Collections.synchronizedList(areaDTOS); //初始时间 long startTime = System.currentTimeMillis(); - //areaDTOS1.parallelStream().forEach(item -> { - for (AreaDTO item : areaDTOS) { + areaDTOS1.parallelStream().forEach(item -> { + //for (AreaDTO item : areaDTOS) { Map temp = new HashMap<>(16); Map queryParam = new HashMap<>(16); // 查询是否存在子节点 @@ -405,24 +432,24 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements Integer counts = floatingPopulationDao.countFloatingPopulationNew(queryParam); temp.put("areaPeopleNum", counts); areaList.add(temp); - totalPeopleNum += counts; - //totalPeopleNum.addAndGet(counts); - }//); -// Collections.sort(areaList, new Comparator>() { -// @Override -// public int compare(Map o1, Map o2) { -// int i = Integer.valueOf(o1.get("orderBy").toString()) - Integer.valueOf(o2.get("orderBy").toString()) ; -// return i; -// } -// }); + //totalPeopleNum += counts; + totalPeopleNum.addAndGet(counts); + }); + Collections.sort(areaList, new Comparator>() { + @Override + public int compare(Map o1, Map o2) { + int i = Integer.valueOf(o1.get("orderBy").toString()) - Integer.valueOf(o2.get("orderBy").toString()) ; + return i; + } + }); Map totalMap = new HashMap<>(16); totalMap.put("hasSubArea","false"); totalMap.put("areaId", parentDTO.getAreaId()); totalMap.put("areaParentId", ""); totalMap.put("areaCode" , parentDTO.getAreaCode()); totalMap.put("areaName", "合计"); - totalMap.put("areaPeopleNum", totalPeopleNum); - // totalMap.put("areaPeopleNum", totalPeopleNum.get()); + // totalMap.put("areaPeopleNum", totalPeopleNum); + totalMap.put("areaPeopleNum", totalPeopleNum.get()); areaList.add(totalMap); /*测试程序部分*/ long endTime = System.currentTimeMillis(); @@ -741,11 +768,94 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements floatingPopulationDTO.setCurrentResidenceAddr(basePopulationInfoDTO.getCurrentResidenceAddr()); floatingPopulationDTO.setFullName(basePopulationInfoDTO.getFullName()); floatingPopulationDTO.setIdCardNumber(basePopulationInfoDTO.getIdCardNumber()); + floatingPopulationDTO.setAreaCode(basePopulationInfoDTO.getAreaCode()); + floatingPopulationDTO.setAreaId(basePopulationInfoDTO.getAreaId()); + floatingPopulationDTO.setAreaNames(basePopulationInfoDTO.getAreaNames()); + floatingPopulationDTO.setGridId(basePopulationInfoDTO.getGridId()); + floatingPopulationDTO.setGridName(basePopulationInfoDTO.getGridName()); } } + String grid = floatingPopulationDTO.getGridId(); + if(!StringUtils.isEmpty(grid)) { + String sendUrl = apiPathProperties.getUserCenter(); + String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(); + GridDTO gridDTO = gridRemoteService.getGrid(sendUrl, grid, accessToken); + List array = new ArrayList(); + array.add(gridDTO.getGridId()); + IDS ids = new IDS(); + ids.setIds(array); + List userDTOList = gridRemoteService.getGridUserListByGridIds(sendUrl, ids, accessToken); + List personDTOList = new ArrayList(); + if(userDTOList.size() > 0) { + for(GridUserDTO person : userDTOList) { + GridPersonDTO personDTO = new GridPersonDTO(); + personDTO.setGridUserId(person.getUserId()); + personDTO.setGridUserName(person.getUserName()); + personDTO.setGridUserPhone(person.getUserPhone()); + personDTOList.add(personDTO); + } + } + floatingPopulationDTO.setGridPersonList(personDTOList); + changeDTOFromDict(floatingPopulationDTO); + } return floatingPopulationDTO; } + + private void changeDTOFromDict(FloatingPopulationDTO dto){ + DataDTO dataDTO; + //性别 + if(dto.getGender() != null && dto.getGender().length() != 0){ + dataDTO = mongoDataService.get(dto.getGender()); + dto.setGenderDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //民族 + if(dto.getNation() != null && dto.getNation().length() != 0){ + dataDTO = mongoDataService.get(dto.getNation()); + dto.setNationDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //政治面貌 + if(dto.getPoliticalStatus() != null && dto.getPoliticalStatus().length() != 0){ + dataDTO = mongoDataService.get(dto.getPoliticalStatus()); + dto.setPoliticalStatusDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //婚姻状况 + if(dto.getMaritalStatus() != null && dto.getMaritalStatus().length() != 0){ + dataDTO = mongoDataService.get(dto.getMaritalStatus()); + dto.setMaritalStatusDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //学历 + if(dto.getEducation() != null && dto.getEducation().length() != 0){ + dataDTO = mongoDataService.get(dto.getEducation()); + dto.setEducationDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //宗教信仰 + if(dto.getReligion() != null && dto.getReligion().length() != 0){ + dataDTO = mongoDataService.get(dto.getReligion()); + dto.setReligionDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //职业类别 + if(dto.getOccupationCategory() != null && dto.getOccupationCategory().length() != 0){ + dataDTO = mongoDataService.get(dto.getOccupationCategory()); + dto.setOccupationCategoryDictionaryName(dataDTO == null ? "" : dataDTO.getDataName()); + } + //流入原因 + if(dto.getInflowReason() != null && dto.getInflowReason().length() != 0){ + dataDTO = mongoDataService.get(dto.getInflowReason()); + dto.setInflowReasonDict(dataDTO == null ? "" : dataDTO.getDataName()); + } + //住所类型 + if(dto.getResidenceType() != null && dto.getResidenceType().length() != 0){ + dataDTO = mongoDataService.get(dto.getResidenceType()); + dto.setResidenceTypeDict(dataDTO == null ? "" : dataDTO.getDataName()); + } + //办证类型 + if(dto.getRegistrationType() != null && dto.getRegistrationType().length() != 0){ + dataDTO = mongoDataService.get(dto.getRegistrationType()); + dto.setRegistrationTypeDict(dataDTO == null ? "" : dataDTO.getDataName()); + } + } + @Override public FloatingPopulationDTO getExists(Map data) { return floatingPopulationDao.getExists(data); diff --git a/src/main/java/cn/com/tenlion/commonpopulation/utils/CacheNumber.java b/src/main/java/cn/com/tenlion/commonpopulation/utils/CacheNumber.java index 7d50530..c5094a2 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/utils/CacheNumber.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/utils/CacheNumber.java @@ -5,6 +5,7 @@ import cn.com.tenlion.commonpopulation.pojo.dtos.grid.GridUserDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.grid.IDS; import cn.com.tenlion.commonpopulation.remote.grid.IGridRemoteService; import cn.com.tenlion.commonpopulation.service.basepopulationinfo.IBasePopulationInfoService; +import cn.com.tenlion.commonpopulation.service.floatingpopulation.IFloatingPopulationService; import cn.com.tenlion.commonpopulation.service.overseaspersonnel.IOverseasPersonnelService; import ink.wgink.module.dictionary.pojo.dtos.AreaDTO; import ink.wgink.module.oauth2.manager.OAuth2ClientTokenManager; @@ -39,11 +40,15 @@ public class CacheNumber { private IGridRemoteService gridRemoteService; @Autowired private ApiPathProperties apiPathProperties; + @Autowired + private IFloatingPopulationService iFloatingPopulationService; + private static IBasePopulationInfoService iBaseStaticPopulationInfoService; private static ApiPathProperties apiStaticPathProperties; private static IGridRemoteService gridStaticRemoteService; private static IOverseasPersonnelService iOverseasStaticPersonnelService; + private static IFloatingPopulationService iFloatingStaticPopulationService; private static IMongoAreaService iMongoStatisAreaService; @PostConstruct @@ -53,10 +58,12 @@ public class CacheNumber { apiStaticPathProperties = this.apiPathProperties; gridStaticRemoteService = this.gridRemoteService; iOverseasStaticPersonnelService = this.iOverseasPersonnelService; + iFloatingStaticPopulationService = this.iFloatingPopulationService; } public static Map get(String code) { - return numberMap.get(code); + Map map = numberMap.get(code); + return map == null ? new HashMap() : map; } public static void put(String code, Map map) { @@ -110,15 +117,12 @@ public class CacheNumber { Integer changZhu = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); temp.put("changZhu", changZhu); // 外来数量 - query.put("type", "3"); - Integer waiLai = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); + Integer waiLai = iFloatingStaticPopulationService.countFloatingPopulationNew(query); temp.put("waiLai", waiLai); - // 流动人口数量 query.clear(); + query.put("areaCodeLike", areaCodeLike); query.put("gridId", dto.getGridId()); query.put("subtype", "11"); - Integer liuDong = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); - temp.put("liuDong", liuDong); // 境外人口数量 Integer jingWai = iOverseasStaticPersonnelService.countOverseasPersonnelNew(query); temp.put("jingWai", jingWai); @@ -176,15 +180,11 @@ public class CacheNumber { Integer changZhu = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); temp.put("changZhu", changZhu); // 外来数量 - query.put("type", "3"); - Integer waiLai = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); + Integer waiLai = iFloatingStaticPopulationService.countFloatingPopulationNew(query); temp.put("waiLai", waiLai); - // 流动人口数量 query.clear(); query.put("areaCodeLike", areaCodeLike); query.put("subtype", "11"); - Integer liuDong = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); - temp.put("liuDong", liuDong); // 境外人口数量 Integer jingWai = iOverseasStaticPersonnelService.countOverseasPersonnelNew(query); temp.put("jingWai", jingWai); diff --git a/src/main/java/cn/com/tenlion/commonpopulation/utils/SpringCommonPopulationUtil.java b/src/main/java/cn/com/tenlion/commonpopulation/utils/SpringCommonPopulationUtil.java index d10d4f6..2478ce6 100644 --- a/src/main/java/cn/com/tenlion/commonpopulation/utils/SpringCommonPopulationUtil.java +++ b/src/main/java/cn/com/tenlion/commonpopulation/utils/SpringCommonPopulationUtil.java @@ -23,7 +23,14 @@ public class SpringCommonPopulationUtil implements ApplicationContextAware { System.out.println("---------------------------CommonPopulation--------------------------"); System.out.println("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+ SpringCommonPopulationUtil.applicationContext+"========"); System.out.println("---------------------------------------------------------------------"); - // CacheNumber.reload(); + Runnable runnable = new Runnable() { + @Override + public void run() { + CacheNumber.reload(); + } + }; + Thread thread = new Thread(runnable); + thread.start(); System.out.println("----------------------------缓存初始化完成-------------------------"); } diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 9abec08..b977d1c 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -66,10 +66,10 @@ spring: uri: mongodb://smartcity:smartcity@192.168.0.156:27017/smartcity redis: database: 6 -# host: 192.168.0.156 - host: 121.36.71.250 -# port: 6379 - port: 58021 + host: 192.168.0.156 +# host: 121.36.71.250 + port: 6379 + # port: 58021 password: 666 timeout: 3000 jedis: diff --git a/src/main/resources/mybatis/mapper/commonpopulation/basepopulationinfo/basepopulationinfo-mapper.xml b/src/main/resources/mybatis/mapper/commonpopulation/basepopulationinfo/basepopulationinfo-mapper.xml index bcbc055..155b6e8 100644 --- a/src/main/resources/mybatis/mapper/commonpopulation/basepopulationinfo/basepopulationinfo-mapper.xml +++ b/src/main/resources/mybatis/mapper/commonpopulation/basepopulationinfo/basepopulationinfo-mapper.xml @@ -304,8 +304,6 @@ t1.full_name LIKE CONCAT('%', #{keywords}, '%') OR t1.id_card_number LIKE CONCAT('%', #{keywords}, '%') - OR - t1.full_name LIKE CONCAT('%', #{keywords}, '%') ) diff --git a/src/main/resources/static/default.html b/src/main/resources/static/default.html index 1ceaa21..4968351 100644 --- a/src/main/resources/static/default.html +++ b/src/main/resources/static/default.html @@ -16,10 +16,10 @@
-
+
- 人口信息 + 户籍人口 @@ -29,7 +29,33 @@
-
+
+
+
+ 户籍人口(外出) + + + +
+
+

0

+
+
+
+
+
+
+ 非户籍人口 + + + +
+
+

0

+
+
+
+
境外人员 @@ -42,19 +68,6 @@
-
-
-
- 流动人口 - - - -
-
-

0

-
-
-
@@ -382,6 +395,7 @@ $('#count8').html(data.count8); $('#count9').html(data.count9); $('#count10').html(data.count10); + $('#count11').html(data.count11); }, function(code, data) { top.dialog.msg(data.msg); }); diff --git a/src/main/resources/static/route/basepopulationinfo/list-count.html b/src/main/resources/static/route/basepopulationinfo/list-count.html index 161e165..5c904d4 100644 --- a/src/main/resources/static/route/basepopulationinfo/list-count.html +++ b/src/main/resources/static/route/basepopulationinfo/list-count.html @@ -25,7 +25,6 @@ - @@ -37,16 +36,13 @@ - 行政区域 - 人口库数量 户籍人口 户籍人口(外出) 非户籍人口 - 流动人口 境外人口 留守人员 刑满释放 @@ -71,43 +67,37 @@ {{# } }} - {{item.areaPeopleNum}}{{i == d.length ? '人' : ''}} + {{item.huJi == null ? '查询中' : item.huJi }}{{i == d.length ? '人' : ''}} - {{item.huJi}}{{i == d.length ? '人' : ''}} + {{item.changZhu == null ? '查询中' : item.changZhu }}{{i == d.length ? '人' : ''}} - {{item.changZhu}}{{i == d.length ? '人' : ''}} + {{item.waiLai == null ? '查询中' : item.waiLai }}{{i == d.length ? '人' : ''}} - {{item.waiLai}}{{i == d.length ? '人' : ''}} + {{item.jingWai == null ? '查询中' : item.jingWai }}{{i == d.length ? '人' : ''}} - {{item.liuDong}}{{i == d.length ? '人' : ''}} + {{item.liuShou == null ? '查询中' : item.liuShou }}{{i == d.length ? '人' : ''}} - {{item.jingWai}}{{i == d.length ? '人' : ''}} + {{item.xingMan == null ? '查询中' : item.xingMan }}{{i == d.length ? '人' : ''}} - {{item.liuShou}}{{i == d.length ? '人' : ''}} + {{item.jiaoZheng == null ? '查询中' : item.jiaoZheng }}{{i == d.length ? '人' : ''}} - {{item.xingMan}}{{i == d.length ? '人' : ''}} + {{item.jingShen == null ? '查询中' : item.jingShen }}{{i == d.length ? '人' : ''}} - {{item.jiaoZheng}}{{i == d.length ? '人' : ''}} + {{item.xiDu == null ? '查询中' : item.xiDu }}{{i == d.length ? '人' : ''}} - {{item.jingShen}}{{i == d.length ? '人' : ''}} + {{item.aiZi == null ? '查询中' : item.aiZi }}{{i == d.length ? '人' : ''}} - {{item.xiDu}}{{i == d.length ? '人' : ''}} - - - {{item.aiZi}}{{i == d.length ? '人' : ''}} - - - {{item.zhongDian}}{{i == d.length ? '人' : ''}} + {{item.zhongDian == null ? '查询中' : item.zhongDian }}{{i == d.length ? '人' : ''}} {{# } }} diff --git a/src/main/resources/static/route/basepopulationinfo/list-show-basepopulationinfo.html b/src/main/resources/static/route/basepopulationinfo/list-show-basepopulationinfo.html index e6f88a3..75e83e6 100644 --- a/src/main/resources/static/route/basepopulationinfo/list-show-basepopulationinfo.html +++ b/src/main/resources/static/route/basepopulationinfo/list-show-basepopulationinfo.html @@ -27,10 +27,10 @@ - - 行政区域 - 人员数量 - + + 行政区域 + 人员数量 +
+ + + + diff --git a/src/main/resources/static/route/floatingpopulation/list-show-floatingpopulation.html b/src/main/resources/static/route/floatingpopulation/list-show-floatingpopulation.html index 7e713ae..f76aa40 100644 --- a/src/main/resources/static/route/floatingpopulation/list-show-floatingpopulation.html +++ b/src/main/resources/static/route/floatingpopulation/list-show-floatingpopulation.html @@ -67,7 +67,33 @@
- + +
+
+ +
+
+ +
+
+ +
+
+
@@ -109,7 +126,7 @@ base: 'assets/layuiadmin/' }).extend({ index: 'lib/index' - }).use(['index', 'table', 'laydate', 'common', 'laytpl'], function() { + }).use(['index', 'table', 'laydate', 'common', 'laytpl', 'form'], function() { var $ = layui.$; var $win = $(window); var table = layui.table; @@ -120,6 +137,7 @@ var idCardNumberSearchValue = ''; var areaParentId = ['']; var areaCode = ''; + var form = layui.form; $('#left-card-div').height($win.height() - 30); $('#left-card-div').css('overflow', 'auto'); @@ -127,9 +145,35 @@ function initData(){ initTable(); listAreaUserCounts(); + initPoliticalStatusSelect(); + initNationSelect(); } initData(); + // 初始化民族下拉选择 + function initNationSelect() { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('nationSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('nationSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'nationSelectTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始化政治面貌下拉选择 + function initPoliticalStatusSelect() { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/b2c96de0-3df8-41db-99b1-bc4e24ac6c24', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('politicalStatusSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('politicalStatusSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'politicalStatusSelectTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + function listAreaUserCounts(){ var loadIndex = layer.load(0,{shade : 0.3}); top.restAjax.get(top.restAjax.path('api/floatingpopulation/list-area-user-counts', []), @@ -147,13 +191,18 @@ $(document).on('click', '.change-area', function(){ areaParentId.push($(this).data().areaid); areaCode = ''; + listAreaUserCounts(); reloadTable(1); }); // 点击人员查看人员列表 $(document).on('click', '.people-event', function(){ areaCode = $(this).data().areacode; - reloadTable(1); + var gridId = ""; + if (areaCode == 'gridId') { + gridId = $(this).data().areaid; + } + reloadTable(1, gridId); }); // 返回上级 @@ -162,6 +211,7 @@ areaParentId.splice(areaParentId.length - 1, 1); } areaCode = ''; + listAreaUserCounts(); reloadTable(1); }); @@ -180,7 +230,7 @@ height: $win.height() - 90, limit: 20, limits: [20, 40, 60, 80, 100, 200], - toolbar: false, + toolbar: '#headerToolBar', request: { pageName: 'page', limitName: 'rows' @@ -288,13 +338,19 @@ } // 重载表格 - function reloadTable(currentPage) { + function reloadTable(currentPage, gridId) { table.reload('dataTable', { url: top.restAjax.path(tableUrl, []), where : { + keywords: $('#keywords').val(), + fullName: $('#fullName').val(), + idCardNumber: $('#idCardNumber').val(), + telephone: $('#telephone').val(), + politicalStatus: $("#politicalStatus").val(), + nation: $("#nation").val(), areaParentId : areaParentId[areaParentId.length -1], - areaCode : areaCode, - keywords: $('#keywords').val() + areaCode : areaCode == "gridId" ? "" : areaCode, + gridId: gridId ? gridId : "" }, page: { curr: currentPage @@ -304,6 +360,29 @@ listAreaUserCounts(); } + // 删除 + function removeData(ids) { + top.dialog.msg(top.dataMessage.delete, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function (index) { + top.dialog.close(index); + var layIndex; + top.restAjax.delete(top.restAjax.path('api/floatingpopulation/removefloatingpopulation/{ids}', [ids]), {}, null, function (code, data) { + top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); + reloadTable(); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + } + }); + } + // 事件 - 页面变化 $win.on('resize', function() { clearTimeout(resizeTimeout); @@ -319,6 +398,132 @@ reloadTable(1); }); + // 事件 - 增删改 + table.on('toolbar(dataTable)', function(obj) { + var layEvent = obj.event; + var checkStatus = table.checkStatus('dataTable'); + var checkDatas = checkStatus.data; + if(layEvent === 'saveEvent') { + popIdCardNumberSearchBox(); + } else if(layEvent === 'updateEvent') { + if(checkDatas.length === 0) { + top.dialog.msg(top.dataMessage.table.selectEdit); + } else if(checkDatas.length > 1) { + top.dialog.msg(top.dataMessage.table.selectOneEdit); + } else { + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['100%', '100%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/floatingpopulation/update-floatingpopulation.html?floatingPopulationId={floatingPopulationId}', [checkDatas[0].floatingPopulationId]), + end: function() { + reloadTable(); + } + }); + } + } else if(layEvent === 'excelEvent') { + top.layer.open({ + type: 2, + title: false, + closeBtn: 1, + area: ["1200px", "730px"], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/floatingpopulation/importexcel', []), + end: function () { + reloadTable(); + }, success: function () { + } + }); + } else if(layEvent === 'removeEvent') { + if(checkDatas.length === 0) { + top.dialog.msg(top.dataMessage.table.selectDelete); + } else { + var ids = ''; + for(var i = 0, item; item = checkDatas[i++];) { + if(i > 1) { + ids += '_'; + } + ids += item['floatingPopulationId']; + } + removeData(ids); + } + } + }); + + // 弹出身份证校验窗口 + function popIdCardNumberSearchBox(){ + var popIndex = layer.open({ + type: 1 + ,title: '请先输入身份证号进行查询' + ,closeBtn: 1 + ,area: '300px' + ,offset: '250px' + ,shade: 0.5 + ,id: 'popIdCardNumberSearchBox' //设定一个id,防止重复弹出 + ,btn: ['查询'] + ,btnAlign: 'c' + ,content: $('#popIdCardNumberSearchBox-template').html() + ,yes: function(){ + idCardNumberSearchValue = $('#idCardNumberSearchValue').val(); + if(idCardNumberSearchValue == ''){ + layer.msg("请输入身份证号进行查询!"); + return; + } + getIdCardNumberVerify(idCardNumberSearchValue, popIndex); + } + }); + } + + // 校验身份证号是否合法 合法后跳转到新增页面 + function getIdCardNumberVerify(idCardNumber, popIndex){ + top.restAjax.get(top.restAjax.path('api/basepopulationinfo/get-idCardNumber-verify/{arg}', [idCardNumber]), {}, null, function(code, data) { + if(typeof (data) == "boolean" && data){ + layer.close(popIndex); + checkHasInfo() + } else { + layer.msg("请填写有效的身份证号码"); + } + }, function(code, data) { + layer.msg("请填写有效的身份证号码"); + }); + /* top.restAjax.get(top.restAjax.path('api/basepopulationinfo/get-idCardNumber-verify/{arg}', [idCardNumber]), {}, null, function(code, data) { + if(typeof (data) == "boolean" && data){ + layer.close(popIndex); + checkHasInfo() + } else { + layer.msg("请填写有效的身份证号码"); + } + }, function(code, data) { + layer.msg("请填写有效的身份证号码"); + });*/ + } + + function checkHasInfo(){ + // 查询所输入身份证是否已有基本信息 + top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopuationbegin/{idCardNumber}', [idCardNumberSearchValue.trim()]), + {}, null, function(code, data) { + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['100%', '100%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/floatingpopulation/save-floatingpopulation.html?idCardNumber={arg1}', + [idCardNumberSearchValue.trim()]), + end: function() { + reloadTable(); + } + }); + }, function(code, data) { + layer.msg(data.msg); + } + ); + } }); diff --git a/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html b/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html index 5210c94..e5ed930 100644 --- a/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html +++ b/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html @@ -39,7 +39,7 @@
- +
@@ -414,23 +414,6 @@ }); } - // 初始化户籍地址下拉选择 - function initNativePlaceSelect(selectValue) { - top.restAjax.get(top.restAjax.path('api/mongo/area/list/parent-id/0', []), {}, null, function(code, data, args) { - laytpl(document.getElementById('nativePlaceSelectTemplate').innerHTML).render(data, function(html) { - document.getElementById('nativePlaceSelectTemplateBox').innerHTML = html; - }); - form.render('select', 'nativePlaceSelectTemplateBox'); - var selectObj = {}; - selectObj['nativePlace'] = selectValue; - form.val('dataForm', selectObj); - var parentId = $('#nativePlace').find("option:selected").attr("data-areaid"); - initNativePlace1Select(parentId,nativePlace1) - }, function(code, data) { - top.dialog.msg(data.msg); - }); - } - // 初始化内容 function initForm() { top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopuationbegin/{idCardNumber}', [idCardNumber]), {}, null, function(code, data) { diff --git a/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html b/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html index 9558f00..ed10f73 100644 --- a/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html +++ b/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html @@ -24,13 +24,13 @@
-
流动人口信息
+
非户籍人口
- +
@@ -38,7 +38,15 @@
- + +
+
+
+
+
+ +
+
@@ -69,6 +77,140 @@
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
@@ -180,6 +322,97 @@ } init(); + // 初始化民族下拉选择 + function initNationSelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('nationSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('nationSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'nationSelectTemplateBox'); + + var selectObj = {}; + selectObj['nation'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始化宗教信仰下拉选择 + function initReligionSelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/792e5742-d302-4943-b04c-161f406ea7ca', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('religionSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('religionSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'religionSelectTemplateBox'); + var selectObj = {}; + selectObj['religion'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始化学历下拉选择 + function initEducationSelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/d6b9f026-6ea9-456a-b48b-0c18d502523b', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('educationSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('educationSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'educationSelectTemplateBox'); + var selectObj = {}; + selectObj['education'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始化政治面貌下拉选择 + function initPoliticalStatusSelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/b2c96de0-3df8-41db-99b1-bc4e24ac6c24', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('politicalStatusSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('politicalStatusSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'politicalStatusSelectTemplateBox'); + var selectObj = {}; + selectObj['politicalStatus'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始化婚姻情况下拉选择 + function initMaritalStatusSelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/91bdd01b-e9d2-4a2b-98b5-45e25d3cd8ae', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('maritalStatusSelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('maritalStatusSelectTemplateBox').innerHTML = html; + }); + form.render('select', 'maritalStatusSelectTemplateBox'); + var selectObj = {}; + selectObj['maritalStatus'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始化职业类别下拉选择 + function initOccupationCategorySelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/5867642c-2b79-4bea-adc9-477a5b784159', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('occupationCategorySelectTemplate').innerHTML).render(data, function(html) { + document.getElementById('occupationCategorySelectTemplateBox').innerHTML = html; + }); + form.render('select', 'occupationCategorySelectTemplateBox'); + var selectObj = {}; + selectObj['occupationCategory'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + // 初始化内容 function initForm() { top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopulationbyid/{floatingPopulationId}', [floatingPopulationId]), {}, null, function(code, data) { @@ -187,6 +420,16 @@ for(var i in data) { dataFormData[i] = data[i] +''; } + initInflowReasonSelect(dataFormData['inflowReason']); + initRegistrationTypeSelect(dataFormData['registrationType']); + initResidenceTypeSelect(dataFormData['residenceType']); + initNationSelect(data['nation']); + initReligionSelect(data['religion']); + initEducationSelect(data['education']); + initPoliticalStatusSelect(data['politicalStatus']); + initMaritalStatusSelect(data['maritalStatus']); + initOccupationCategorySelect(data['occupationCategory']); + initInflowReasonSelect(dataFormData['inflowReason']); initRegistrationTypeSelect(dataFormData['registrationType']); initResidenceTypeSelect(dataFormData['residenceType']);