将流动人口改为了非户籍人口

This commit is contained in:
java_cuibaocheng@163.com 2023-06-21 15:27:12 +08:00
parent aa4c538d8a
commit 75981df063
15 changed files with 904 additions and 175 deletions

View File

@ -84,11 +84,15 @@ public class DefaultHomePageAppController extends DefaultBaseController {
AreaDTO parentDTO = mongoAreaService.get(areaParentId); AreaDTO parentDTO = mongoAreaService.get(areaParentId);
String areaCodeLike = AreaCodeBuider.getAreaCodeBegin(parentDTO.getAreaCode()); String areaCodeLike = AreaCodeBuider.getAreaCodeBegin(parentDTO.getAreaCode());
params.put("areaCodeLike",areaCodeLike); params.put("areaCodeLike",areaCodeLike);
// 人口总数 // 户籍人口
SuccessResultData<Integer> 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 count2 = overseasPersonnelService.countOverseasPersonnelNew(params);
// 流动人口 // 非户籍人口
Integer count3 = floatingPopulationService.countFloatingPopulationNew(params); Integer count3 = floatingPopulationService.countFloatingPopulationNew(params);
// 留守人员 // 留守人员
Integer count4 = homePersonService.countNumberHomePersonNew(params); Integer count4 = homePersonService.countNumberHomePersonNew(params);
@ -105,7 +109,7 @@ public class DefaultHomePageAppController extends DefaultBaseController {
// 重点青少年 // 重点青少年
Integer count10 = keyTeenagersService.countKeyTeenagersNew(params); Integer count10 = keyTeenagersService.countKeyTeenagersNew(params);
params.clear(); params.clear();
params.put("count1", count1.getData()); params.put("count1", count1);
params.put("count2", count2); params.put("count2", count2);
params.put("count3", count3); params.put("count3", count3);
params.put("count4", count4); params.put("count4", count4);
@ -115,6 +119,7 @@ public class DefaultHomePageAppController extends DefaultBaseController {
params.put("count8", count8); params.put("count8", count8);
params.put("count9", count9); params.put("count9", count9);
params.put("count10", count10); params.put("count10", count10);
params.put("count11", count11);
return params; return params;
} }

View File

@ -1,9 +1,11 @@
package cn.com.tenlion.commonpopulation.controller.app.floatingpopulation; 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.communitycorrection.CommunityCorrectionDTO;
import cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation.FloatingPopulationDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation.FloatingPopulationDTO;
import cn.com.tenlion.commonpopulation.pojo.vos.floatingpopulation.FloatingPopulationVO; import cn.com.tenlion.commonpopulation.pojo.vos.floatingpopulation.FloatingPopulationVO;
import cn.com.tenlion.commonpopulation.service.floatingpopulation.IFloatingPopulationService; import cn.com.tenlion.commonpopulation.service.floatingpopulation.IFloatingPopulationService;
import cn.com.tenlion.commonpopulation.utils.IdCardVerifyUtil;
import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.exceptions.RemoveException; import ink.wgink.exceptions.RemoveException;
@ -37,6 +39,20 @@ public class FloatingPopulationAppController extends DefaultBaseController {
@Autowired @Autowired
private IFloatingPopulationService floatingPopulationService; 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<String, Object> params = requestParams();
if(!IdCardVerifyUtil.isIDCard(idCardNumber)){
throw new SearchException("请填写有效的身份证号");
}
return floatingPopulationService.getFloatingPopulationByIdCardNumber(idCardNumber);
}
@ApiOperation(value = "人员信息基础表分页列表(区域下钻)", notes = "人员信息基础表分页列表接口(区域下钻)") @ApiOperation(value = "人员信息基础表分页列表(区域下钻)", notes = "人员信息基础表分页列表接口(区域下钻)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "token", value = "token", paramType = "header"),

View File

@ -1,10 +1,13 @@
package cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import java.util.List;
/** /**
* *
* @ClassName: FloatingPopulationDTO * @ClassName: FloatingPopulationDTO
@ -55,6 +58,28 @@ public class FloatingPopulationDTO {
@ApiModelProperty(name = "gridName", value = "网格名称") @ApiModelProperty(name = "gridName", value = "网格名称")
private String gridName; private String gridName;
@ApiModelProperty(name = "gridPersonList", value = "网格内网格员集合")
List<GridPersonDTO> 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日新增)") @ApiModelProperty(name = "nameUsedBefore", value = "曾用名(2023年6月19日新增)")
private String nameUsedBefore; private String nameUsedBefore;

View File

@ -740,11 +740,9 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
AreaDTO areaDTO = mongoAreaService.get(areaParentId); AreaDTO areaDTO = mongoAreaService.get(areaParentId);
String sendUrl = apiPathProperties.getUserCenter(); String sendUrl = apiPathProperties.getUserCenter();
String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(); String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken();
int totalPeopleNum = 0;
int huJiNum = 0; int huJiNum = 0;
int changZhuNum = 0; int changZhuNum = 0;
int waiLaiNum = 0; int waiLaiNum = 0;
int liuDongNum = 0;
int jingWaiNum = 0; int jingWaiNum = 0;
int liuShouNum = 0; int liuShouNum = 0;
int xingManNum = 0; int xingManNum = 0;
@ -811,10 +809,6 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
params.clear(); params.clear();
params.put("areaCodeLike", areaCodeLike); params.put("areaCodeLike", areaCodeLike);
params.put("gridId", item.getGridId()); params.put("gridId", item.getGridId());
// 人口库数量
Integer counts = countBasePopulationInfoNew(params);
temp.put("areaPeopleNum", counts);
totalPeopleNum += counts;
// 户籍数量 // 户籍数量
params.put("type", "1"); params.put("type", "1");
Integer huJi = countBasePopulationInfoNew(params); Integer huJi = countBasePopulationInfoNew(params);
@ -825,19 +819,13 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
Integer changZhu = countBasePopulationInfoNew(params); Integer changZhu = countBasePopulationInfoNew(params);
temp.put("changZhu", changZhu); temp.put("changZhu", changZhu);
changZhuNum += changZhu; changZhuNum += changZhu;
// 外来数量 // 外来人口数量
params.put("type", "3");
Integer waiLai = countBasePopulationInfoNew(params);
temp.put("waiLai", waiLai);
waiLaiNum += waiLai;
// 流动人口数量
params.clear(); params.clear();
params.put("areaCodeLike", areaCodeLike); params.put("areaCodeLike", areaCodeLike);
params.put("gridId", item.getGridId()); params.put("gridId", item.getGridId());
params.put("subtype", "11"); Integer waiLai = iFloatingPopulationService.countFloatingPopulationNew(params);
Integer liuDong = countBasePopulationInfoNew(params); temp.put("waiLai", waiLai);
temp.put("liuDong", liuDong); waiLaiNum += waiLai;
liuDongNum += liuDong;
// 境外人口数量 // 境外人口数量
Integer jingWai = iOverseasPersonnelService.countOverseasPersonnelNew(params); Integer jingWai = iOverseasPersonnelService.countOverseasPersonnelNew(params);
temp.put("jingWai", jingWai); temp.put("jingWai", jingWai);
@ -919,18 +907,17 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
Map<String, Integer> map = CacheNumber.get(item.getAreaCode()); Map<String, Integer> map = CacheNumber.get(item.getAreaCode());
CacheNumber.print(); CacheNumber.print();
totalPeopleNum += map.get("areaPeopleNum");// 总数 huJiNum += map.get("huJi") == null ? 0 : map.get("huJi");// 户籍数量
huJiNum += map.get("huJi");// 户籍数量 changZhuNum += map.get("changZhu") == null ? 0 : map.get("changZhu");// 常住数量
changZhuNum += map.get("changZhu");// 常住数量 waiLaiNum += map.get("waiLai") == null ? 0 : map.get("waiLai");// 外来数量
waiLaiNum += map.get("waiLai");// 外来数量 jingWaiNum += map.get("jingWai") == null ? 0 : map.get("jingWai");// 境外人口数量
jingWaiNum += map.get("jingWai");// 境外人口数量 liuShouNum += map.get("liuShou") == null ? 0 : map.get("liuShou");// 留守人员数量
liuShouNum += map.get("liuShou");// 留守人员数量 xingManNum += map.get("xingMan") == null ? 0 : map.get("xingMan");// 刑满释放数量
xingManNum += map.get("xingMan");// 刑满释放数量 jiaoZhengNum += map.get("jiaoZheng") == null ? 0 : map.get("jiaoZheng");// 矫正数量
jiaoZhengNum += map.get("jiaoZheng");// 刑满释放数量 jingShenNum += map.get("jingShen") == null ? 0 : map.get("jingShen");// 精神障碍数量
jingShenNum += map.get("jingShen");// 精神障碍数量 xiDuNum += map.get("xiDu") == null ? 0 : map.get("xiDu");// 吸毒人员数量
xiDuNum += map.get("xiDu");// 吸毒人员数量 aiZiNum += map.get("aiZi") == null ? 0 : map.get("aiZi");// 艾滋病人员数量
aiZiNum += map.get("aiZi");// 艾滋病人员数量 zhongDianNum += map.get("zhongDian") == null ? 0 : map.get("zhongDian");// 重点人员
zhongDianNum += map.get("zhongDian");// 艾滋病人员数量
temp.putAll(map); temp.putAll(map);
areaList.add(temp); areaList.add(temp);
} }
@ -942,11 +929,9 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
totalMap.put("areaParentId", ""); totalMap.put("areaParentId", "");
totalMap.put("areaCode" , parentDTO.getAreaCode()); totalMap.put("areaCode" , parentDTO.getAreaCode());
totalMap.put("areaName", "合计"); totalMap.put("areaName", "合计");
totalMap.put("areaPeopleNum", totalPeopleNum);
totalMap.put("huJi", huJiNum); totalMap.put("huJi", huJiNum);
totalMap.put("changZhu", changZhuNum); totalMap.put("changZhu", changZhuNum);
totalMap.put("waiLai", waiLaiNum); totalMap.put("waiLai", waiLaiNum);
totalMap.put("liuDong", liuDongNum);
totalMap.put("jingWai", jingWaiNum); totalMap.put("jingWai", jingWaiNum);
totalMap.put("liuShou", liuShouNum); totalMap.put("liuShou", liuShouNum);
totalMap.put("xingMan", xingManNum); totalMap.put("xingMan", xingManNum);
@ -1390,11 +1375,8 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
Integer type1Count = basePopulationInfoDao.countBasePopulationInfoNew(query); Integer type1Count = basePopulationInfoDao.countBasePopulationInfoNew(query);
query.put("type", "2"); query.put("type", "2");
Integer type2Count = basePopulationInfoDao.countBasePopulationInfoNew(query); Integer type2Count = basePopulationInfoDao.countBasePopulationInfoNew(query);
query.put("type", "3"); Integer feiHuJi = iFloatingPopulationService.countFloatingPopulationNew(query);
Integer type3Count = basePopulationInfoDao.countBasePopulationInfoNew(query);
query.put("type", ""); query.put("type", "");
// 流动人口
Integer floatCount = iFloatingPopulationService.countFloatingPopulationNew(query);
// 境外人口数量 // 境外人口数量
Integer jingWai = iOverseasPersonnelService.countOverseasPersonnelNew(query); Integer jingWai = iOverseasPersonnelService.countOverseasPersonnelNew(query);
// 留守人员数量 // 留守人员数量
@ -1421,10 +1403,9 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
// 返回数据 // 返回数据
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<String, Object>();
result.put("huJi", type1Count); result.put("huJi", type1Count);
result.put("feiHuJi", type2Count); result.put("feiHuJi", feiHuJi);
result.put("waiChuHuJi", type3Count); result.put("waiChuHuJi", type2Count);
result.put("jingWai", jingWai); result.put("jingWai", jingWai);
result.put("liuDong", floatCount);
result.put("liuShou", liuShou); result.put("liuShou", liuShou);
result.put("xingMan", xingMan); result.put("xingMan", xingMan);
result.put("jiaoZheng", jiaoZheng); result.put("jiaoZheng", jiaoZheng);
@ -1432,7 +1413,7 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
result.put("aiZi", aiZi); result.put("aiZi", aiZi);
result.put("jingShen", jingShen); result.put("jingShen", jingShen);
result.put("zhongDianQingShaoNian", zhongDian); result.put("zhongDianQingShaoNian", zhongDian);
int totalPerson = type1Count + type2Count + type3Count; int totalPerson = type1Count + feiHuJi + type2Count;
NumberFormat numberFormat = NumberFormat.getInstance(); NumberFormat numberFormat = NumberFormat.getInstance();
// 精确到小数点后2位 // 精确到小数点后2位
numberFormat.setMaximumFractionDigits(2); numberFormat.setMaximumFractionDigits(2);
@ -1510,7 +1491,7 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
areaParentId = areaDTO.getAreaId(); areaParentId = areaDTO.getAreaId();
} }
} }
List<Map<String, Object>> areaList = new ArrayList<>(); List<Map<String, Object>> areaList = Collections.synchronizedList(new ArrayList<>());
AreaDTO parentDTO = mongoAreaService.get(areaParentId); AreaDTO parentDTO = mongoAreaService.get(areaParentId);
// 查询社区下的网格 // 查询社区下的网格
if (parentDTO.getAreaLevel().equals("4")) { if (parentDTO.getAreaLevel().equals("4")) {

View File

@ -5,6 +5,7 @@ import cn.com.tenlion.commonpopulation.dao.floatingpopulation.IFloatingPopulatio
import cn.com.tenlion.commonpopulation.kafkaObject.FloatingPopulation; import cn.com.tenlion.commonpopulation.kafkaObject.FloatingPopulation;
import cn.com.tenlion.commonpopulation.pojo.UserExpandBO; import cn.com.tenlion.commonpopulation.pojo.UserExpandBO;
import cn.com.tenlion.commonpopulation.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO; 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.communitycorrection.CommunityCorrectionDTO;
import cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation.FloatingPopulationDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.floatingpopulation.FloatingPopulationDTO;
import cn.com.tenlion.commonpopulation.pojo.dtos.grid.GridDTO; import cn.com.tenlion.commonpopulation.pojo.dtos.grid.GridDTO;
@ -114,6 +115,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
* @throws Exception * @throws Exception
*/ */
private String saveFloatingPopulationInfoReturnId(String token, FloatingPopulationVO floatingPopulationVO) throws Exception { private String saveFloatingPopulationInfoReturnId(String token, FloatingPopulationVO floatingPopulationVO) throws Exception {
String idCardNumber = floatingPopulationVO.getIdCardNumber();
// 校验身份证号 // 校验身份证号
if(!IdCardVerifyUtil.isIDCard(floatingPopulationVO.getIdCardNumber())){ if(!IdCardVerifyUtil.isIDCard(floatingPopulationVO.getIdCardNumber())){
throw new SaveException("请填写有效的身份证号"); throw new SaveException("请填写有效的身份证号");
@ -126,6 +128,18 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
} else { } else {
setSaveInfo(params); 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<String, Object> query1 = new HashMap<>(); Map<String, Object> query1 = new HashMap<>();
query1.put("idCardNumber", floatingPopulationVO.getIdCardNumber()); query1.put("idCardNumber", floatingPopulationVO.getIdCardNumber());
floatingPopulationDao.saveFloatingPopulation(params); floatingPopulationDao.saveFloatingPopulation(params);
@ -203,6 +217,19 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
} else { } else {
setUpdateInfo(params); 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); floatingPopulationDao.updateFloatingPopulation(params);
updateKafkaFloatingPopulation(params,"update"); updateKafkaFloatingPopulation(params,"update");
} }
@ -212,7 +239,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
Map<String, Object> params = super.getHashMap(1); Map<String, Object> params = super.getHashMap(1);
params.put("floatingPopulationId", floatingPopulationId); params.put("floatingPopulationId", floatingPopulationId);
FloatingPopulationDTO floatingPopulation = floatingPopulationDao.getFloatingPopulation(params); FloatingPopulationDTO floatingPopulation = floatingPopulationDao.getFloatingPopulation(params);
changeDtoInfoFromDict(floatingPopulation); changeDTOFromDict(floatingPopulation);
return floatingPopulation; return floatingPopulation;
} }
@ -220,7 +247,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
public List<FloatingPopulationDTO> listFloatingPopulation(Map<String, Object> params) throws SearchException { public List<FloatingPopulationDTO> listFloatingPopulation(Map<String, Object> params) throws SearchException {
List<FloatingPopulationDTO> list = floatingPopulationDao.listFloatingPopulation(params); List<FloatingPopulationDTO> list = floatingPopulationDao.listFloatingPopulation(params);
for(FloatingPopulationDTO item : list){ for(FloatingPopulationDTO item : list){
changeDtoInfoFromDict(item); changeDTOFromDict(item);
} }
return list; return list;
} }
@ -304,7 +331,7 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
areaParentId = areaDTO.getAreaId(); areaParentId = areaDTO.getAreaId();
} }
} }
List<Map<String, Object>> areaList = new ArrayList<>(); List<Map<String, Object>> areaList = Collections.synchronizedList(new ArrayList<>());
AreaDTO parentDTO = mongoAreaService.get(areaParentId); AreaDTO parentDTO = mongoAreaService.get(areaParentId);
// 查询社区下的网格 // 查询社区下的网格
if (parentDTO.getAreaLevel().equals("4")) { if (parentDTO.getAreaLevel().equals("4")) {
@ -373,13 +400,13 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
areaList.add(totalMap); areaList.add(totalMap);
}else{ }else{
List<AreaDTO> areaDTOS = mongoAreaService.listByParentId(areaParentId); List<AreaDTO> areaDTOS = mongoAreaService.listByParentId(areaParentId);
int totalPeopleNum = 0; //int totalPeopleNum = 0;
//final AtomicInteger totalPeopleNum = new AtomicInteger(0); final AtomicInteger totalPeopleNum = new AtomicInteger(0);
List<AreaDTO> areaDTOS1 = Collections.synchronizedList(areaDTOS); List<AreaDTO> areaDTOS1 = Collections.synchronizedList(areaDTOS);
//初始时间 //初始时间
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
//areaDTOS1.parallelStream().forEach(item -> { areaDTOS1.parallelStream().forEach(item -> {
for (AreaDTO item : areaDTOS) { //for (AreaDTO item : areaDTOS) {
Map<String, Object> temp = new HashMap<>(16); Map<String, Object> temp = new HashMap<>(16);
Map<String, Object> queryParam = new HashMap<>(16); Map<String, Object> queryParam = new HashMap<>(16);
// 查询是否存在子节点 // 查询是否存在子节点
@ -405,24 +432,24 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
Integer counts = floatingPopulationDao.countFloatingPopulationNew(queryParam); Integer counts = floatingPopulationDao.countFloatingPopulationNew(queryParam);
temp.put("areaPeopleNum", counts); temp.put("areaPeopleNum", counts);
areaList.add(temp); areaList.add(temp);
totalPeopleNum += counts; //totalPeopleNum += counts;
//totalPeopleNum.addAndGet(counts); totalPeopleNum.addAndGet(counts);
}//); });
// Collections.sort(areaList, new Comparator<Map<String, Object>>() { Collections.sort(areaList, new Comparator<Map<String, Object>>() {
// @Override @Override
// public int compare(Map<String, Object> o1, Map<String, Object> o2) { public int compare(Map<String, Object> o1, Map<String, Object> o2) {
// int i = Integer.valueOf(o1.get("orderBy").toString()) - Integer.valueOf(o2.get("orderBy").toString()) ; int i = Integer.valueOf(o1.get("orderBy").toString()) - Integer.valueOf(o2.get("orderBy").toString()) ;
// return i; return i;
// } }
// }); });
Map<String, Object> totalMap = new HashMap<>(16); Map<String, Object> totalMap = new HashMap<>(16);
totalMap.put("hasSubArea","false"); totalMap.put("hasSubArea","false");
totalMap.put("areaId", parentDTO.getAreaId()); totalMap.put("areaId", parentDTO.getAreaId());
totalMap.put("areaParentId", ""); totalMap.put("areaParentId", "");
totalMap.put("areaCode" , parentDTO.getAreaCode()); totalMap.put("areaCode" , parentDTO.getAreaCode());
totalMap.put("areaName", "合计"); totalMap.put("areaName", "合计");
totalMap.put("areaPeopleNum", totalPeopleNum); // totalMap.put("areaPeopleNum", totalPeopleNum);
// totalMap.put("areaPeopleNum", totalPeopleNum.get()); totalMap.put("areaPeopleNum", totalPeopleNum.get());
areaList.add(totalMap); areaList.add(totalMap);
/*测试程序部分*/ /*测试程序部分*/
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
@ -741,11 +768,94 @@ public class FloatingPopulationServiceImpl extends DefaultBaseService implements
floatingPopulationDTO.setCurrentResidenceAddr(basePopulationInfoDTO.getCurrentResidenceAddr()); floatingPopulationDTO.setCurrentResidenceAddr(basePopulationInfoDTO.getCurrentResidenceAddr());
floatingPopulationDTO.setFullName(basePopulationInfoDTO.getFullName()); floatingPopulationDTO.setFullName(basePopulationInfoDTO.getFullName());
floatingPopulationDTO.setIdCardNumber(basePopulationInfoDTO.getIdCardNumber()); 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<String> array = new ArrayList<String>();
array.add(gridDTO.getGridId());
IDS ids = new IDS();
ids.setIds(array);
List<GridUserDTO> userDTOList = gridRemoteService.getGridUserListByGridIds(sendUrl, ids, accessToken);
List<GridPersonDTO> personDTOList = new ArrayList<GridPersonDTO>();
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; 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 @Override
public FloatingPopulationDTO getExists(Map<String, Object> data) { public FloatingPopulationDTO getExists(Map<String, Object> data) {
return floatingPopulationDao.getExists(data); return floatingPopulationDao.getExists(data);

View File

@ -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.pojo.dtos.grid.IDS;
import cn.com.tenlion.commonpopulation.remote.grid.IGridRemoteService; import cn.com.tenlion.commonpopulation.remote.grid.IGridRemoteService;
import cn.com.tenlion.commonpopulation.service.basepopulationinfo.IBasePopulationInfoService; 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 cn.com.tenlion.commonpopulation.service.overseaspersonnel.IOverseasPersonnelService;
import ink.wgink.module.dictionary.pojo.dtos.AreaDTO; import ink.wgink.module.dictionary.pojo.dtos.AreaDTO;
import ink.wgink.module.oauth2.manager.OAuth2ClientTokenManager; import ink.wgink.module.oauth2.manager.OAuth2ClientTokenManager;
@ -39,11 +40,15 @@ public class CacheNumber {
private IGridRemoteService gridRemoteService; private IGridRemoteService gridRemoteService;
@Autowired @Autowired
private ApiPathProperties apiPathProperties; private ApiPathProperties apiPathProperties;
@Autowired
private IFloatingPopulationService iFloatingPopulationService;
private static IBasePopulationInfoService iBaseStaticPopulationInfoService; private static IBasePopulationInfoService iBaseStaticPopulationInfoService;
private static ApiPathProperties apiStaticPathProperties; private static ApiPathProperties apiStaticPathProperties;
private static IGridRemoteService gridStaticRemoteService; private static IGridRemoteService gridStaticRemoteService;
private static IOverseasPersonnelService iOverseasStaticPersonnelService; private static IOverseasPersonnelService iOverseasStaticPersonnelService;
private static IFloatingPopulationService iFloatingStaticPopulationService;
private static IMongoAreaService iMongoStatisAreaService; private static IMongoAreaService iMongoStatisAreaService;
@PostConstruct @PostConstruct
@ -53,10 +58,12 @@ public class CacheNumber {
apiStaticPathProperties = this.apiPathProperties; apiStaticPathProperties = this.apiPathProperties;
gridStaticRemoteService = this.gridRemoteService; gridStaticRemoteService = this.gridRemoteService;
iOverseasStaticPersonnelService = this.iOverseasPersonnelService; iOverseasStaticPersonnelService = this.iOverseasPersonnelService;
iFloatingStaticPopulationService = this.iFloatingPopulationService;
} }
public static Map<String, Integer> get(String code) { public static Map<String, Integer> get(String code) {
return numberMap.get(code); Map<String, Integer> map = numberMap.get(code);
return map == null ? new HashMap<String, Integer>() : map;
} }
public static void put(String code, Map<String, Integer> map) { public static void put(String code, Map<String, Integer> map) {
@ -110,15 +117,12 @@ public class CacheNumber {
Integer changZhu = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); Integer changZhu = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query);
temp.put("changZhu", changZhu); temp.put("changZhu", changZhu);
// 外来数量 // 外来数量
query.put("type", "3"); Integer waiLai = iFloatingStaticPopulationService.countFloatingPopulationNew(query);
Integer waiLai = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query);
temp.put("waiLai", waiLai); temp.put("waiLai", waiLai);
// 流动人口数量
query.clear(); query.clear();
query.put("areaCodeLike", areaCodeLike);
query.put("gridId", dto.getGridId()); query.put("gridId", dto.getGridId());
query.put("subtype", "11"); query.put("subtype", "11");
Integer liuDong = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query);
temp.put("liuDong", liuDong);
// 境外人口数量 // 境外人口数量
Integer jingWai = iOverseasStaticPersonnelService.countOverseasPersonnelNew(query); Integer jingWai = iOverseasStaticPersonnelService.countOverseasPersonnelNew(query);
temp.put("jingWai", jingWai); temp.put("jingWai", jingWai);
@ -176,15 +180,11 @@ public class CacheNumber {
Integer changZhu = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query); Integer changZhu = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query);
temp.put("changZhu", changZhu); temp.put("changZhu", changZhu);
// 外来数量 // 外来数量
query.put("type", "3"); Integer waiLai = iFloatingStaticPopulationService.countFloatingPopulationNew(query);
Integer waiLai = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query);
temp.put("waiLai", waiLai); temp.put("waiLai", waiLai);
// 流动人口数量
query.clear(); query.clear();
query.put("areaCodeLike", areaCodeLike); query.put("areaCodeLike", areaCodeLike);
query.put("subtype", "11"); query.put("subtype", "11");
Integer liuDong = iBaseStaticPopulationInfoService.countBasePopulationInfoNew(query);
temp.put("liuDong", liuDong);
// 境外人口数量 // 境外人口数量
Integer jingWai = iOverseasStaticPersonnelService.countOverseasPersonnelNew(query); Integer jingWai = iOverseasStaticPersonnelService.countOverseasPersonnelNew(query);
temp.put("jingWai", jingWai); temp.put("jingWai", jingWai);

View File

@ -23,7 +23,14 @@ public class SpringCommonPopulationUtil implements ApplicationContextAware {
System.out.println("---------------------------CommonPopulation--------------------------"); System.out.println("---------------------------CommonPopulation--------------------------");
System.out.println("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+ SpringCommonPopulationUtil.applicationContext+"========"); System.out.println("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+ SpringCommonPopulationUtil.applicationContext+"========");
System.out.println("---------------------------------------------------------------------"); 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("----------------------------缓存初始化完成-------------------------"); System.out.println("----------------------------缓存初始化完成-------------------------");
} }

View File

@ -66,10 +66,10 @@ spring:
uri: mongodb://smartcity:smartcity@192.168.0.156:27017/smartcity uri: mongodb://smartcity:smartcity@192.168.0.156:27017/smartcity
redis: redis:
database: 6 database: 6
# host: 192.168.0.156 host: 192.168.0.156
host: 121.36.71.250 # host: 121.36.71.250
# port: 6379 port: 6379
port: 58021 # port: 58021
password: 666 password: 666
timeout: 3000 timeout: 3000
jedis: jedis:

View File

@ -304,8 +304,6 @@
t1.full_name LIKE CONCAT('%', #{keywords}, '%') t1.full_name LIKE CONCAT('%', #{keywords}, '%')
OR OR
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%') t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')
OR
t1.full_name LIKE CONCAT('%', #{keywords}, '%')
) )
</if> </if>
<if test="politicalStatus != null and politicalStatus !=''"> <if test="politicalStatus != null and politicalStatus !=''">

View File

@ -16,10 +16,10 @@
<div class="layui-col-sm12 layui-col-md12 layui-col-space5"> <div class="layui-col-sm12 layui-col-md12 layui-col-space5">
<div class="layui-col-md12 layui-col-sm12"> <div class="layui-col-md12 layui-col-sm12">
<div class="layui-row layui-col-space5"> <div class="layui-row layui-col-space5">
<div class="layui-col-sm3 layui-col-md3"> <div class="layui-col-sm2 layui-col-md2">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
人口信息 户籍人口
<span class="layui-badge layui-bg-blue layuiadmin-badge"> <span class="layui-badge layui-bg-blue layuiadmin-badge">
<i class="layui-inline fa fa-user-o"></i> <i class="layui-inline fa fa-user-o"></i>
</span> </span>
@ -29,7 +29,33 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm3 layui-col-md3"> <div class="layui-col-sm2 layui-col-md2">
<div class="layui-card">
<div class="layui-card-header">
户籍人口(外出)
<span class="layui-badge layui-bg-blue layuiadmin-badge">
<i class="layui-inline fa fa-user-o"></i>
</span>
</div>
<div class="layui-card-body layuiadmin-card-list">
<p id="count11" class="layuiadmin-big-font">0</p>
</div>
</div>
</div>
<div class="layui-col-sm2 layui-col-md2">
<div class="layui-card">
<div class="layui-card-header">
非户籍人口
<span class="layui-badge layui-bg-blue layuiadmin-badge">
<i class="layui-inline fa fa-user-o"></i>
</span>
</div>
<div class="layui-card-body layuiadmin-card-list">
<p id="count3" class="layuiadmin-big-font">0</p>
</div>
</div>
</div>
<div class="layui-col-sm2 layui-col-md2">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
境外人员 境外人员
@ -42,19 +68,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm2 layui-col-md2">
<div class="layui-card">
<div class="layui-card-header">
流动人口
<span class="layui-badge layui-bg-blue layuiadmin-badge">
<i class="layui-inline fa fa-user-o"></i>
</span>
</div>
<div class="layui-card-body layuiadmin-card-list">
<p id="count3" class="layuiadmin-big-font">0</p>
</div>
</div>
</div>
<div class="layui-col-sm2 layui-col-md2"> <div class="layui-col-sm2 layui-col-md2">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
@ -382,6 +395,7 @@
$('#count8').html(data.count8); $('#count8').html(data.count8);
$('#count9').html(data.count9); $('#count9').html(data.count9);
$('#count10').html(data.count10); $('#count10').html(data.count10);
$('#count11').html(data.count11);
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });

View File

@ -25,7 +25,6 @@
<colgroup> <colgroup>
<col width="180"> <col width="180">
<col width="70"> <col width="70">
<col width="70">
<col width="90"> <col width="90">
<col width="70"> <col width="70">
<col width="70"> <col width="70">
@ -37,16 +36,13 @@
<col width="70"> <col width="70">
<col width="70"> <col width="70">
<col width="70"> <col width="70">
<col width="70">
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th style="text-align: center;">行政区域</th> <th style="text-align: center;">行政区域</th>
<th style="text-align: center;min-width: 70px;">人口库数量</th>
<th style="text-align: center;min-width: 70px;">户籍人口</th> <th style="text-align: center;min-width: 70px;">户籍人口</th>
<th style="text-align: center;min-width: 90px;">户籍人口(外出)</th> <th style="text-align: center;min-width: 90px;">户籍人口(外出)</th>
<th style="text-align: center;min-width: 70px;">非户籍人口</th> <th style="text-align: center;min-width: 70px;">非户籍人口</th>
<th style="text-align: center;min-width: 70px;">流动人口</th>
<th style="text-align: center;min-width: 70px;">境外人口</th> <th style="text-align: center;min-width: 70px;">境外人口</th>
<th style="text-align: center;min-width: 70px;">留守人员</th> <th style="text-align: center;min-width: 70px;">留守人员</th>
<th style="text-align: center;min-width: 70px;">刑满释放</th> <th style="text-align: center;min-width: 70px;">刑满释放</th>
@ -71,43 +67,37 @@
{{# } }} {{# } }}
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.areaPeopleNum}}{{i == d.length ? '人' : ''}}</b> <b>{{item.huJi == null ? '查询中' : item.huJi }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.huJi}}{{i == d.length ? '人' : ''}}</b> <b>{{item.changZhu == null ? '查询中' : item.changZhu }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.changZhu}}{{i == d.length ? '人' : ''}}</b> <b>{{item.waiLai == null ? '查询中' : item.waiLai }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.waiLai}}{{i == d.length ? '人' : ''}}</b> <b>{{item.jingWai == null ? '查询中' : item.jingWai }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.liuDong}}{{i == d.length ? '人' : ''}}</b> <b>{{item.liuShou == null ? '查询中' : item.liuShou }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.jingWai}}{{i == d.length ? '人' : ''}}</b> <b>{{item.xingMan == null ? '查询中' : item.xingMan }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.liuShou}}{{i == d.length ? '人' : ''}}</b> <b>{{item.jiaoZheng == null ? '查询中' : item.jiaoZheng }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.xingMan}}{{i == d.length ? '人' : ''}}</b> <b>{{item.jingShen == null ? '查询中' : item.jingShen }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.jiaoZheng}}{{i == d.length ? '人' : ''}}</b> <b>{{item.xiDu == null ? '查询中' : item.xiDu }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.jingShen}}{{i == d.length ? '人' : ''}}</b> <b>{{item.aiZi == null ? '查询中' : item.aiZi }}{{i == d.length ? '人' : ''}}</b>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<b>{{item.xiDu}}{{i == d.length ? '人' : ''}}</b> <b>{{item.zhongDian == null ? '查询中' : item.zhongDian }}{{i == d.length ? '人' : ''}}</b>
</td>
<td style="text-align: center;">
<b>{{item.aiZi}}{{i == d.length ? '人' : ''}}</b>
</td>
<td style="text-align: center;">
<b>{{item.zhongDian}}{{i == d.length ? '人' : ''}}</b>
</td> </td>
</tr> </tr>
{{# } }} {{# } }}

View File

@ -27,10 +27,10 @@
<col width="150"> <col width="150">
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th style="text-align: center;">行政区域</th> <th style="text-align: center;">行政区域</th>
<th style="text-align: center;">人员数量</th> <th style="text-align: center;">人员数量</th>
</tr> </tr>
</thead> </thead>
<tbody id="areaUserCountBox"></tbody> <tbody id="areaUserCountBox"></tbody>
<script type="text/html" id="areaUserCountTemplate"> <script type="text/html" id="areaUserCountTemplate">
@ -51,7 +51,7 @@
{{# } }} {{# } }}
{{# if(item.areaPeopleNum != '0'){ }} {{# if(item.areaPeopleNum != '0'){ }}
<a href="javascript:void(0)" class="people-event" style="color: #0a54a6;text-decoration: underline" <a href="javascript:void(0)" class="people-event" style="color: #0a54a6;text-decoration: underline"
data-areacode="{{item.areaCode}}">{{item.areaPeopleNum}} 人</a> data-areaid="{{item.areaId}}" data-areacode="{{item.areaCode}}">{{item.areaPeopleNum}} 人</a>
{{# } }} {{# } }}
</td> </td>
</tr> </tr>
@ -102,24 +102,23 @@
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table> <table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 --> <!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar"> <script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
<i class="fa fa-lg fa-trash"></i> 删除
</button>
</div>
</script> </script>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script id="popIdCardNumberSearchBox-template" type="text/html">
<div style="height: 40px;">
<div style="margin: 20px 10px 0px 10px;">
<input type="text" id="idCardNumberSearchValue" class="layui-input" value="" autocomplete="off" placeholder="请输入身份证号进行查询">
</div>
</div>
</script>
<script src="assets/layuiadmin/layui/layui.js"></script> <script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script> <script>
layui.config({ layui.config({
base: 'assets/layuiadmin/' base: 'assets/layuiadmin/'
@ -136,6 +135,7 @@
var resizeTimeout = null; var resizeTimeout = null;
var type = top.restAjax.params(window.location.href).type; var type = top.restAjax.params(window.location.href).type;
var tableUrl = 'api/basepopulationinfo/listpagebasepopulationinfo?type=' + type; var tableUrl = 'api/basepopulationinfo/listpagebasepopulationinfo?type=' + type;
var idCardNumberSearchValue = "";
var areaParentId = ['']; var areaParentId = [''];
var areaCode = ''; var areaCode = '';
@ -152,8 +152,7 @@
function listAreaUserCounts(){ function listAreaUserCounts(){
var loadIndex = layer.load(0,{shade : 0.3}); var loadIndex = layer.load(0,{shade : 0.3});
top.restAjax.get(top.restAjax.path('api/basepopulationinfo/list-area-user-counts?type=' + type, []), top.restAjax.get(top.restAjax.path('api/basepopulationinfo/list-area-user-counts?type=' + type, []), {areaParentId : areaParentId[areaParentId.length - 1]}, null, function (code, data) {
{areaParentId : areaParentId[areaParentId.length - 1]}, null, function (code, data) {
laytpl(document.getElementById('areaUserCountTemplate').innerHTML).render(data, function(html) { laytpl(document.getElementById('areaUserCountTemplate').innerHTML).render(data, function(html) {
document.getElementById('areaUserCountBox').innerHTML = html; document.getElementById('areaUserCountBox').innerHTML = html;
}); });
@ -191,7 +190,6 @@
reloadTable(1); reloadTable(1);
}); });
// 初始化民族下拉选择 // 初始化民族下拉选择
function initNationSelect() { function initNationSelect() {
top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) { top.restAjax.get(top.restAjax.path('api/mongo/data/list/parent-id/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) {
@ -230,7 +228,7 @@
height: $win.height() - 140, height: $win.height() - 140,
limit: 20, limit: 20,
limits: [20, 40, 60, 80, 100, 200], limits: [20, 40, 60, 80, 100, 200],
toolbar: false, toolbar: '#headerToolBar',
request: { request: {
pageName: 'page', pageName: 'page',
limitName: 'rows' limitName: 'rows'
@ -334,8 +332,9 @@
fullName: $('#fullName').val(), fullName: $('#fullName').val(),
idCardNumber: $('#idCardNumber').val(), idCardNumber: $('#idCardNumber').val(),
telephone: $('#telephone').val(), telephone: $('#telephone').val(),
fullName: $('#fullName').val(),
areaParentId : areaParentId[areaParentId.length -1], areaParentId : areaParentId[areaParentId.length -1],
politicalStatus: $("#politicalStatus").val(),
nation: $("#nation").val(),
type: type, type: type,
areaCode : areaCode == "gridId" ? "" : areaCode, areaCode : areaCode == "gridId" ? "" : areaCode,
gridId: gridId ? gridId : "" gridId: gridId ? gridId : ""
@ -348,6 +347,29 @@
listAreaUserCounts(); 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/basepopulationinfo/removebasepopulationinfo/{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() { $win.on('resize', function() {
clearTimeout(resizeTimeout); clearTimeout(resizeTimeout);
@ -360,6 +382,136 @@
$(document).on('click', '#search', function() { $(document).on('click', '#search', function() {
reloadTable(1); 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/basepopulationinfo/update-basepopulationinfo.html?basePopulationInfoId={basePopulationInfoId}', [checkDatas[0].basePopulationInfoId]),
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/basepopulationinfo/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['basePopulationInfoId'];
}
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("请填写有效的身份证号码");
});
}
function checkHasInfo(){
// 查询所输入身份证是否已有基本信息
top.restAjax.get(top.restAjax.path('api/basepopulationinfo/getbasepopulationinfo', []),
{idCardNumber : idCardNumberSearchValue}, null, function(code, data) {
if(typeof (data.basePopulationInfoId) === 'undefined' || data.basePopulationInfoId == ''){
top.layer.msg('未查询到基本信息,请先补充基本信息');
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/basepopulationinfo/save-base-user-info.html?idCardNumber={arg}', [idCardNumberSearchValue]),
end: function() {
reloadTable();
}
});
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/basepopulationinfo/update-basepopulationinfo.html?basePopulationInfoId={arg}', [data.basePopulationInfoId]),
end: function() {
reloadTable();
}
});
}
}, function(code, data) {
layer.msg(data.msg);
}
);
}
}); });
</script> </script>
</body> </body>

View File

@ -67,7 +67,33 @@
<div class="layui-card-body"> <div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;"> <div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline"> <div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入姓名/身份证号等"> <input type="text" id="fullName" class="layui-input " style="width: 120px" autocomplete="off" placeholder="姓名">
</div>
<div class="layui-inline">
<input type="text" id="idCardNumber" class="layui-input " style="width: 200px" autocomplete="off" placeholder="身份证号">
</div>
<div class="layui-inline">
<input type="text" id="telephone" class="layui-input" style="width: 150px" autocomplete="off" placeholder="手机号">
</div>
<div class="layui-inline layui-form" id="nationSelectTemplateBox" lay-filter="nationSelectTemplateBox">
<script id="nationSelectTemplate" type="text/html">
<select id="nation" name="nation" lay-search>
<option value="">请选择民族(支持搜索)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-inline layui-form" id="politicalStatusSelectTemplateBox" lay-filter="politicalStatusSelectTemplateBox">
<script id="politicalStatusSelectTemplate" type="text/html">
<select id="politicalStatus" name="politicalStatus" lay-search>
<option value="">请选择政治面貌(支持搜索)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div> </div>
<button type="button" id="search" class="layui-btn layui-btn-sm"> <button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索 <i class="fa fa-lg fa-search"></i> 搜索
@ -80,15 +106,6 @@
<!-- 表头按钮组 --> <!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar"> <script type="text/html" id="headerToolBar">
<div class="layui-btn-group"> <div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
<i class="fa fa-lg fa-trash"></i> 删除
</button>
</div> </div>
</script> </script>
</div> </div>
@ -109,7 +126,7 @@
base: 'assets/layuiadmin/' base: 'assets/layuiadmin/'
}).extend({ }).extend({
index: 'lib/index' index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common', 'laytpl'], function() { }).use(['index', 'table', 'laydate', 'common', 'laytpl', 'form'], function() {
var $ = layui.$; var $ = layui.$;
var $win = $(window); var $win = $(window);
var table = layui.table; var table = layui.table;
@ -120,6 +137,7 @@
var idCardNumberSearchValue = ''; var idCardNumberSearchValue = '';
var areaParentId = ['']; var areaParentId = [''];
var areaCode = ''; var areaCode = '';
var form = layui.form;
$('#left-card-div').height($win.height() - 30); $('#left-card-div').height($win.height() - 30);
$('#left-card-div').css('overflow', 'auto'); $('#left-card-div').css('overflow', 'auto');
@ -127,9 +145,35 @@
function initData(){ function initData(){
initTable(); initTable();
listAreaUserCounts(); listAreaUserCounts();
initPoliticalStatusSelect();
initNationSelect();
} }
initData(); 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(){ function listAreaUserCounts(){
var loadIndex = layer.load(0,{shade : 0.3}); var loadIndex = layer.load(0,{shade : 0.3});
top.restAjax.get(top.restAjax.path('api/floatingpopulation/list-area-user-counts', []), top.restAjax.get(top.restAjax.path('api/floatingpopulation/list-area-user-counts', []),
@ -147,13 +191,18 @@
$(document).on('click', '.change-area', function(){ $(document).on('click', '.change-area', function(){
areaParentId.push($(this).data().areaid); areaParentId.push($(this).data().areaid);
areaCode = ''; areaCode = '';
listAreaUserCounts();
reloadTable(1); reloadTable(1);
}); });
// 点击人员查看人员列表 // 点击人员查看人员列表
$(document).on('click', '.people-event', function(){ $(document).on('click', '.people-event', function(){
areaCode = $(this).data().areacode; 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); areaParentId.splice(areaParentId.length - 1, 1);
} }
areaCode = ''; areaCode = '';
listAreaUserCounts();
reloadTable(1); reloadTable(1);
}); });
@ -180,7 +230,7 @@
height: $win.height() - 90, height: $win.height() - 90,
limit: 20, limit: 20,
limits: [20, 40, 60, 80, 100, 200], limits: [20, 40, 60, 80, 100, 200],
toolbar: false, toolbar: '#headerToolBar',
request: { request: {
pageName: 'page', pageName: 'page',
limitName: 'rows' limitName: 'rows'
@ -288,13 +338,19 @@
} }
// 重载表格 // 重载表格
function reloadTable(currentPage) { function reloadTable(currentPage, gridId) {
table.reload('dataTable', { table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []), url: top.restAjax.path(tableUrl, []),
where : { where : {
keywords: $('#keywords').val(),
fullName: $('#fullName').val(),
idCardNumber: $('#idCardNumber').val(),
telephone: $('#telephone').val(),
politicalStatus: $("#politicalStatus").val(),
nation: $("#nation").val(),
areaParentId : areaParentId[areaParentId.length -1], areaParentId : areaParentId[areaParentId.length -1],
areaCode : areaCode, areaCode : areaCode == "gridId" ? "" : areaCode,
keywords: $('#keywords').val() gridId: gridId ? gridId : ""
}, },
page: { page: {
curr: currentPage curr: currentPage
@ -304,6 +360,29 @@
listAreaUserCounts(); 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() { $win.on('resize', function() {
clearTimeout(resizeTimeout); clearTimeout(resizeTimeout);
@ -319,6 +398,132 @@
reloadTable(1); 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);
}
);
}
}); });
</script> </script>
</body> </body>

View File

@ -39,7 +39,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>身份证号</label> <label class="layui-form-label"><span style="color: red">*</span>身份证号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="idCardNumber" name="idCardNumber" class="layui-input layui-disabled" value="" autocomplete="off" placeholder="请输入公民身份证号"> <input type="text" id="idCardNumber" name="idCardNumber" class="layui-input " value="" autocomplete="off" placeholder="请输入公民身份证号">
</div> </div>
</div> </div>
</div> </div>
@ -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() { function initForm() {
top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopuationbegin/{idCardNumber}', [idCardNumber]), {}, null, function(code, data) { top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopuationbegin/{idCardNumber}', [idCardNumber]), {}, null, function(code, data) {

View File

@ -24,13 +24,13 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm" id="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm" id="dataForm">
<blockquote class="layui-elem-quote">流动人口信息</blockquote> <blockquote class="layui-elem-quote">非户籍人口</blockquote>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md3 layui-col-sm3"> <div class="layui-col-md3 layui-col-sm3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>姓名</label> <label class="layui-form-label"><span style="color: red">*</span>姓名</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="fullName" name="fullName" class="layui-input layui-disabled" value="" lay-verify="required"> <input type="text" id="fullName" name="fullName" class="layui-input" value="" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
@ -38,7 +38,15 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>身份证号</label> <label class="layui-form-label"><span style="color: red">*</span>身份证号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="idCardNumber" name="idCardNumber" class="layui-input layui-disabled" value="" autocomplete="off" placeholder="请输入公民身份证号" lay-verify="identity"> <input type="text" id="idCardNumber" name="idCardNumber" class="layui-input" value="" autocomplete="off" placeholder="请输入公民身份证号" lay-verify="identity">
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-sm4">
<div class="layui-form-item">
<label class="layui-form-label">曾用名</label>
<div class="layui-input-block">
<input type="text" id="nameUsedBefore" name="nameUsedBefore" class="layui-input" value="" autocomplete="off" placeholder="请输入曾用名(非必填)">
</div> </div>
</div> </div>
</div> </div>
@ -69,6 +77,140 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">联系方式</label>
<div class="layui-input-block">
<input type="text" id="telephone" name="telephone" class="layui-input" autocomplete="off" value="" placeholder="请输入联系方式(手机号码或固话)">
</div>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">民族</label>
<div class="layui-input-block layui-form" id="nationSelectTemplateBox" lay-filter="nationSelectTemplateBox"></div>
<script id="nationSelectTemplate" type="text/html">
<select id="nation" name="nation" lay-search>
<option value="">请选择民族(支持搜索)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">宗教信仰</label>
<div class="layui-input-block layui-form" id="religionSelectTemplateBox" lay-filter="religionSelectTemplateBox"></div>
<script id="religionSelectTemplate" type="text/html">
<select id="religion" name="religion" lay-search>
<option value="">请选择宗教信仰</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">政治面貌</label>
<div class="layui-input-block layui-form" id="politicalStatusSelectTemplateBox" lay-filter="politicalStatusSelectTemplateBox"></div>
<script id="politicalStatusSelectTemplate" type="text/html">
<select id="politicalStatus" name="politicalStatus" lay-search>
<option value="">请选择政治面貌(支持搜索)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">婚姻情况</label>
<div class="layui-input-block layui-form" id="maritalStatusSelectTemplateBox" lay-filter="maritalStatusSelectTemplateBox"></div>
<script id="maritalStatusSelectTemplate" type="text/html">
<select id="maritalStatus" name="maritalStatus" lay-search>
<option value="">请选择婚姻情况</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">学历</label>
<div class="layui-input-block layui-form" id="educationSelectTemplateBox" lay-filter="educationSelectTemplateBox"></div>
<script id="educationSelectTemplate" type="text/html">
<select id="education" name="education" lay-search>
<option value="">请选择学历(支持搜索)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">职业类别</label>
<div class="layui-input-block layui-form" id="occupationCategorySelectTemplateBox" lay-filter="occupationCategorySelectTemplateBox"></div>
<script id="occupationCategorySelectTemplate" type="text/html">
<select id="occupationCategory" name="occupationCategory" lay-search>
<option value="">请选择职业类别(支持搜索)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">职业</label>
<div class="layui-input-block">
<input type="text" id="occupation" name="occupation" class="layui-input" value="" autocomplete="off" placeholder="请输入职业">
</div>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">服务处所</label>
<div class="layui-input-block">
<input type="text" id="serviceSpace" name="serviceSpace" class="layui-input" autocomplete="off" value="" placeholder="例如工作单位、工作地点" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">现住址</label>
<div class="layui-input-block">
<input type="text" id="currentResidenceAddr" name="currentResidenceAddr" class="layui-input" value="" autocomplete="off" placeholder="请输入现住地详细地址">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">户籍地址</label>
<div class="layui-input-block">
<input type="text" id="nativePlaceAddr" name="nativePlaceAddr" class="layui-input" autocomplete="off" value="" placeholder="请输入户籍地址详细地址">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md3 layui-col-sm3"> <div class="layui-col-md3 layui-col-sm3">
<div class="layui-form-item"> <div class="layui-form-item">
@ -180,6 +322,97 @@
} }
init(); 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() { function initForm() {
top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopulationbyid/{floatingPopulationId}', [floatingPopulationId]), {}, null, function(code, data) { top.restAjax.get(top.restAjax.path('api/floatingpopulation/getfloatingpopulationbyid/{floatingPopulationId}', [floatingPopulationId]), {}, null, function(code, data) {
@ -187,6 +420,16 @@
for(var i in data) { for(var i in data) {
dataFormData[i] = data[i] +''; 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']); initInflowReasonSelect(dataFormData['inflowReason']);
initRegistrationTypeSelect(dataFormData['registrationType']); initRegistrationTypeSelect(dataFormData['registrationType']);
initResidenceTypeSelect(dataFormData['residenceType']); initResidenceTypeSelect(dataFormData['residenceType']);