将流动人口改为了非户籍人口
This commit is contained in:
parent
aa4c538d8a
commit
75981df063
@ -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<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 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;
|
||||
}
|
||||
|
||||
|
@ -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<String, Object> params = requestParams();
|
||||
if(!IdCardVerifyUtil.isIDCard(idCardNumber)){
|
||||
throw new SearchException("请填写有效的身份证号");
|
||||
}
|
||||
return floatingPopulationService.getFloatingPopulationByIdCardNumber(idCardNumber);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员信息基础表分页列表(区域下钻)", notes = "人员信息基础表分页列表接口(区域下钻)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
|
@ -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<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日新增)")
|
||||
private String nameUsedBefore;
|
||||
|
@ -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<String, Integer> 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<String, Object> result = new HashMap<String, Object>();
|
||||
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<Map<String, Object>> areaList = new ArrayList<>();
|
||||
List<Map<String, Object>> areaList = Collections.synchronizedList(new ArrayList<>());
|
||||
AreaDTO parentDTO = mongoAreaService.get(areaParentId);
|
||||
// 查询社区下的网格
|
||||
if (parentDTO.getAreaLevel().equals("4")) {
|
||||
|
@ -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<String, Object> 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<String, Object> 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<FloatingPopulationDTO> listFloatingPopulation(Map<String, Object> params) throws SearchException {
|
||||
List<FloatingPopulationDTO> 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<Map<String, Object>> areaList = new ArrayList<>();
|
||||
List<Map<String, Object>> 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<AreaDTO> areaDTOS = mongoAreaService.listByParentId(areaParentId);
|
||||
int totalPeopleNum = 0;
|
||||
//final AtomicInteger totalPeopleNum = new AtomicInteger(0);
|
||||
//int totalPeopleNum = 0;
|
||||
final AtomicInteger totalPeopleNum = new AtomicInteger(0);
|
||||
List<AreaDTO> 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<String, Object> temp = 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);
|
||||
temp.put("areaPeopleNum", counts);
|
||||
areaList.add(temp);
|
||||
totalPeopleNum += counts;
|
||||
//totalPeopleNum.addAndGet(counts);
|
||||
}//);
|
||||
// Collections.sort(areaList, new Comparator<Map<String, Object>>() {
|
||||
// @Override
|
||||
// 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()) ;
|
||||
// return i;
|
||||
// }
|
||||
// });
|
||||
//totalPeopleNum += counts;
|
||||
totalPeopleNum.addAndGet(counts);
|
||||
});
|
||||
Collections.sort(areaList, new Comparator<Map<String, Object>>() {
|
||||
@Override
|
||||
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()) ;
|
||||
return i;
|
||||
}
|
||||
});
|
||||
Map<String, Object> 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<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;
|
||||
}
|
||||
|
||||
|
||||
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<String, Object> data) {
|
||||
return floatingPopulationDao.getExists(data);
|
||||
|
@ -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<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) {
|
||||
@ -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);
|
||||
|
@ -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("----------------------------缓存初始化完成-------------------------");
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="politicalStatus != null and politicalStatus !=''">
|
||||
|
@ -16,10 +16,10 @@
|
||||
<div class="layui-col-sm12 layui-col-md12 layui-col-space5">
|
||||
<div class="layui-col-md12 layui-col-sm12">
|
||||
<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-header">
|
||||
人口信息
|
||||
户籍人口
|
||||
<span class="layui-badge layui-bg-blue layuiadmin-badge">
|
||||
<i class="layui-inline fa fa-user-o"></i>
|
||||
</span>
|
||||
@ -29,7 +29,33 @@
|
||||
</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-header">
|
||||
境外人员
|
||||
@ -42,19 +68,6 @@
|
||||
</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-header">
|
||||
@ -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);
|
||||
});
|
||||
|
@ -25,7 +25,6 @@
|
||||
<colgroup>
|
||||
<col width="180">
|
||||
<col width="70">
|
||||
<col width="70">
|
||||
<col width="90">
|
||||
<col width="70">
|
||||
<col width="70">
|
||||
@ -37,16 +36,13 @@
|
||||
<col width="70">
|
||||
<col width="70">
|
||||
<col width="70">
|
||||
<col width="70">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<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: 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>
|
||||
@ -71,43 +67,37 @@
|
||||
{{# } }}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.areaPeopleNum}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.huJi == null ? '查询中' : item.huJi }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.huJi}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.changZhu == null ? '查询中' : item.changZhu }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.changZhu}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.waiLai == null ? '查询中' : item.waiLai }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.waiLai}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.jingWai == null ? '查询中' : item.jingWai }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.liuDong}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.liuShou == null ? '查询中' : item.liuShou }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.jingWai}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.xingMan == null ? '查询中' : item.xingMan }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.liuShou}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.jiaoZheng == null ? '查询中' : item.jiaoZheng }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.xingMan}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.jingShen == null ? '查询中' : item.jingShen }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.jiaoZheng}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.xiDu == null ? '查询中' : item.xiDu }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.jingShen}}{{i == d.length ? '人' : ''}}</b>
|
||||
<b>{{item.aiZi == null ? '查询中' : item.aiZi }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<b>{{item.xiDu}}{{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>
|
||||
<b>{{item.zhongDian == null ? '查询中' : item.zhongDian }}{{i == d.length ? '人' : ''}}</b>
|
||||
</td>
|
||||
</tr>
|
||||
{{# } }}
|
||||
|
@ -27,10 +27,10 @@
|
||||
<col width="150">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">行政区域</th>
|
||||
<th style="text-align: center;">人员数量</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: center;">行政区域</th>
|
||||
<th style="text-align: center;">人员数量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="areaUserCountBox"></tbody>
|
||||
<script type="text/html" id="areaUserCountTemplate">
|
||||
@ -51,7 +51,7 @@
|
||||
{{# } }}
|
||||
{{# if(item.areaPeopleNum != '0'){ }}
|
||||
<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>
|
||||
</tr>
|
||||
@ -102,24 +102,23 @@
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<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>
|
||||
</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/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
@ -136,6 +135,7 @@
|
||||
var resizeTimeout = null;
|
||||
var type = top.restAjax.params(window.location.href).type;
|
||||
var tableUrl = 'api/basepopulationinfo/listpagebasepopulationinfo?type=' + type;
|
||||
var idCardNumberSearchValue = "";
|
||||
var areaParentId = [''];
|
||||
var areaCode = '';
|
||||
|
||||
@ -152,8 +152,7 @@
|
||||
|
||||
function listAreaUserCounts(){
|
||||
var loadIndex = layer.load(0,{shade : 0.3});
|
||||
top.restAjax.get(top.restAjax.path('api/basepopulationinfo/list-area-user-counts?type=' + type, []),
|
||||
{areaParentId : areaParentId[areaParentId.length - 1]}, null, function (code, data) {
|
||||
top.restAjax.get(top.restAjax.path('api/basepopulationinfo/list-area-user-counts?type=' + type, []), {areaParentId : areaParentId[areaParentId.length - 1]}, null, function (code, data) {
|
||||
laytpl(document.getElementById('areaUserCountTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('areaUserCountBox').innerHTML = html;
|
||||
});
|
||||
@ -191,7 +190,6 @@
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
|
||||
// 初始化民族下拉选择
|
||||
function initNationSelect() {
|
||||
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,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: false,
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
@ -334,8 +332,9 @@
|
||||
fullName: $('#fullName').val(),
|
||||
idCardNumber: $('#idCardNumber').val(),
|
||||
telephone: $('#telephone').val(),
|
||||
fullName: $('#fullName').val(),
|
||||
areaParentId : areaParentId[areaParentId.length -1],
|
||||
politicalStatus: $("#politicalStatus").val(),
|
||||
nation: $("#nation").val(),
|
||||
type: type,
|
||||
areaCode : areaCode == "gridId" ? "" : areaCode,
|
||||
gridId: gridId ? gridId : ""
|
||||
@ -348,6 +347,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/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() {
|
||||
clearTimeout(resizeTimeout);
|
||||
@ -360,6 +382,136 @@
|
||||
$(document).on('click', '#search', function() {
|
||||
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>
|
||||
</body>
|
||||
|
@ -67,7 +67,33 @@
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<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>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
@ -80,15 +106,6 @@
|
||||
<!-- 表头按钮组 -->
|
||||
<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>
|
||||
</div>
|
||||
@ -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);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red">*</span>身份证号</label>
|
||||
<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>
|
||||
@ -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) {
|
||||
|
@ -24,13 +24,13 @@
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<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-col-md3 layui-col-sm3">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red">*</span>姓名</label>
|
||||
<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>
|
||||
@ -38,7 +38,15 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red">*</span>身份证号</label>
|
||||
<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>
|
||||
@ -69,6 +77,140 @@
|
||||
</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-col-md3 layui-col-sm3">
|
||||
<div class="layui-form-item">
|
||||
@ -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']);
|
||||
|
Loading…
Reference in New Issue
Block a user