Merge remote-tracking branch 'origin/upgrade' into upgrade

# Conflicts:
#	src/main/java/com/cm/population/dao/populationinfo/IPopulationInfoDao.java
This commit is contained in:
java_cuibaocheng@163.com 2023-11-25 13:48:15 +08:00
commit 94b4744d4c
16 changed files with 512 additions and 94 deletions

View File

@ -139,13 +139,13 @@ public class PopulationController extends AbstractController {
@GetMapping("findHouse")
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
Map<String, Object> params = requestParams();
if(null == params.get("keywords")) {
try {
throw new SearchException("身份证号/手机号/姓名不能为空");
} catch (SearchException e) {
e.printStackTrace();
}
}
// if(null == params.get("keywords")) {
// try {
// throw new SearchException("身份证号/手机号/姓名不能为空");
// } catch (SearchException e) {
// e.printStackTrace();
// }
// }
page.setParams(params);
return populationService.findHouse(page);
}

View File

@ -126,4 +126,6 @@ public interface IHouseDao {
List<PopulationDTO> findPopulation(Map<String, Object> params);
List<HouseDTO> listForAll(Map<String, Object> params);
List<HouseDTO> getBatch(Map<String, Object> params);
}

View File

@ -134,4 +134,6 @@ public interface IPopulationDao {
List<PopulationDTO> listAll(Map<String, Object> params);
void updateBindTime(Map<String, Object> params);
List<PopulationDTO> listBatch(Map<String, Object> params);
}

View File

@ -122,5 +122,7 @@ public interface IPopulationInfoDao {
void updateCreator(Map<String, Object> params);
List<PopulationInfoDTO> getBatch(Map<String, Object> params);
PopulationInfoAreaDTO getCreatorArea(String creator);
}

View File

@ -1,6 +1,7 @@
package com.cm.population.pojo.dtos.population;
import com.cm.population.pojo.dtos.house.HouseDTO;
import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO;
import com.cm.population.pojo.dtos.populationinfo.PopulationInfoDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -44,10 +45,10 @@ public class PopulationDTO {
private Integer isDelete;
@ApiModelProperty(name = "houseDTO", value = "房屋详情")
private HouseDTO houseDTO;
@ApiModelProperty(name = "populationInfoHouseDTO", value = "人口详情")
private PopulationInfoHouseDTO populationInfoHouseDTO;
@ApiModelProperty(name = "populationInfoDTO", value = "人口详情")
@ApiModelProperty(name = "populationInfoDTO", value = "人员基本信息")
private PopulationInfoDTO populationInfoDTO;
@ApiModelProperty(name = "populationInfoBaseDTO", value = "人员基本信息")
private PopulationInfoBaseDTO populationInfoBaseDTO;
public String getPopulationId() {
return populationId == null ? "" : populationId.trim();
@ -161,14 +162,6 @@ public class PopulationDTO {
this.houseDTO = houseDTO;
}
public PopulationInfoHouseDTO getPopulationInfoHouseDTO() {
return populationInfoHouseDTO;
}
public void setPopulationInfoHouseDTO(PopulationInfoHouseDTO populationInfoHouseDTO) {
this.populationInfoHouseDTO = populationInfoHouseDTO;
}
public PopulationInfoDTO getPopulationInfoDTO() {
return populationInfoDTO;
}
@ -176,4 +169,12 @@ public class PopulationDTO {
public void setPopulationInfoDTO(PopulationInfoDTO populationInfoDTO) {
this.populationInfoDTO = populationInfoDTO;
}
public PopulationInfoBaseDTO getPopulationInfoBaseDTO() {
return populationInfoBaseDTO;
}
public void setPopulationInfoBaseDTO(PopulationInfoBaseDTO populationInfoBaseDTO) {
this.populationInfoBaseDTO = populationInfoBaseDTO;
}
}

View File

@ -105,7 +105,7 @@ public class PopulationInfoBaseDTO {
}
public String getHealthStatus() {
return healthStatus;
return healthStatus == null ? "" : healthStatus;
}
public void setHealthStatus(String healthStatus) {
@ -113,7 +113,7 @@ public class PopulationInfoBaseDTO {
}
public String getIsMinority() {
if(getAge() < 18) {
if (getAge() < 18) {
return "";
}
return "";
@ -124,7 +124,7 @@ public class PopulationInfoBaseDTO {
}
public String getIsSeriousIllness() {
if(getHealthStatus().contains("重病")) {
if (getHealthStatus().contains("重病")) {
return "";
}
return "";
@ -135,6 +135,9 @@ public class PopulationInfoBaseDTO {
}
public Integer getAge() {
if (StringUtils.isBlank(this.getBirthday())) {
return 0;
}
LocalDate birthDate = LocalDate.parse(this.birthday);
Period period = Period.between(birthDate, LocalDate.now());
return period.getYears();

View File

@ -232,4 +232,6 @@ public interface IHouseService {
* @param autoHouseDTO
*/
void saveAuto(String token, AutoHouseDTO autoHouseDTO);
List<HouseDTO> getBatch(List<String> houseIds);
}

View File

@ -19,7 +19,6 @@ import com.cm.population.pojo.dtos.residential.ResidentialDTO;
import com.cm.population.pojo.pos.house.HousePO;
import com.cm.population.pojo.vos.building.BuildingBatchVO;
import com.cm.population.pojo.vos.house.HouseVO;
import com.cm.population.pojo.vos.population.PopulationVO;
import com.cm.population.service.building.IBuildingService;
import com.cm.population.service.house.IHouseService;
import com.cm.population.service.population.IPopulationService;
@ -29,19 +28,12 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
/**
* @ClassName: HouseServiceImpl
@ -603,4 +595,11 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
}
}
@Override
public List<HouseDTO> getBatch(List<String> houseIds) {
Map<String, Object> params = getHashMap(2);
params.put("houseIds", houseIds);
return houseDao.getBatch(params);
}
}

View File

@ -10,7 +10,6 @@ import com.cm.population.dao.house.IHouseDao;
import com.cm.population.dao.population.IPopulationDao;
import com.cm.population.pojo.bos.population.PopulationBO;
import com.cm.population.pojo.dtos.house.HouseDTO;
import com.cm.population.pojo.dtos.population.HouseUserDTO;
import com.cm.population.pojo.dtos.population.PopulationDTO;
import com.cm.population.pojo.dtos.population.PopulationInfoHouseDTO;
import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO;
@ -20,7 +19,6 @@ import com.cm.population.pojo.vos.population.PopulationVO;
import com.cm.population.service.house.IHouseService;
import com.cm.population.service.population.IPopulationService;
import com.cm.population.service.populationinfo.IPopulationInfoService;
import com.cm.population.service.populationinfo.impl.PopulationInfoServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
@ -28,10 +26,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import sun.security.krb5.internal.PAData;
import javax.mail.search.SearchException;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
/**
* @ClassName: PopulationServiceImpl
@ -60,15 +59,15 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
params.put("outHouse", "0");
List<PopulationDTO> list = populationDao.listAll(params);
Map<String, PopulationDTO> map = new HashMap<>();
for(PopulationDTO dto : list) {
for (PopulationDTO dto : list) {
map.put(dto.getPopulationInfoId(), dto);
}
// 1. 判断创建房屋时是否有人员信息一起
// 2. 有的话删除旧的人员信息并录入新的人员信息
if(!CollectionUtils.isEmpty(populationVOList)) {
if (!CollectionUtils.isEmpty(populationVOList)) {
for (PopulationVO populationVO : populationVOList) {
// 2.将搬离的改掉
if("1".equals(populationVO.getOutHouse())) {
if ("1".equals(populationVO.getOutHouse())) {
update(populationVO.getPopulationId(), populationVO);
map.remove(populationVO.getPopulationInfoId());
}
@ -81,12 +80,12 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
}
}
// 删除旧的所有的入住信息
if(isAllData) {
if (isAllData) {
populationDao.deleteByHouseId(houseId);
}else{
} else {
// 剔除已存在的人员的再次新增
Iterator<PopulationVO> iterator = populationVOList.iterator();
while(iterator.hasNext()) {
while (iterator.hasNext()) {
PopulationVO vo = iterator.next();
if (map.get(vo.getPopulationInfoId()) != null) {
// 更新绑定事件
@ -100,7 +99,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
}
// 保存新的入住信息
for (PopulationVO populationVO : populationVOList) {
if(!"1".equals(populationVO.getOutHouse())) {
if (!"1".equals(populationVO.getOutHouse())) {
populationVO.setHouseId(houseId);
save(token, populationVO);
}
@ -142,7 +141,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
params.put("outHouse", 0);
// 解除脱敏
if(null != params.get("populationInfoId") && StringUtils.isNotEmpty(params.get("populationInfoId").toString())) {
if (null != params.get("populationInfoId") && StringUtils.isNotEmpty(params.get("populationInfoId").toString())) {
PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationVO.getPopulationInfoId());
params.put("name", populationInfoDTO.getName());
params.put("cardNum", populationInfoDTO.getIdcard());
@ -290,14 +289,14 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
@Override
public Boolean hasUser(Map<String, Object> params) {
if(null == params.get("populationInfoId")) {
if (null == params.get("populationInfoId")) {
try {
throw new SearchException("人员信息ID不能为空");
} catch (SearchException e) {
e.printStackTrace();
}
}
if(null == params.get("houseId")) {
if (null == params.get("houseId")) {
try {
throw new SearchException("房屋信息ID不能为空");
} catch (SearchException e) {
@ -306,13 +305,13 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
}
Integer count = populationDao.count(params);
if(count > 0) {
if (count > 0) {
return true;
}
return false;
}
@Override
/*@Override
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<PopulationDTO> populationDTOList = list(page.getParams());
@ -345,6 +344,106 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
}
PageInfo<PopulationDTO> pageInfo = new PageInfo<>(populationDTOList);
return new SuccessResultList<>(populationDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
}*/
@Override
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
// List<PopulationDTO> populationDTOList = list(page.getParams());
List<PopulationDTO> populationDTOList = listBatch(page.getParams());
List<String> populationInfoIds = new ArrayList<>();
List<String> houseIds = new ArrayList<>();
for (PopulationDTO populationDTO : populationDTOList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
populationInfoIds.add(populationDTO.getPopulationInfoId());
}
if (StringUtils.isNotEmpty(populationDTO.getHouseId())) {
houseIds.add(populationDTO.getHouseId());
}
}
// 一次性获取所有的人口信息
List<PopulationInfoDTO> populationInfoDTOs = populationInfoService.getBatch(populationInfoIds);
// 一次性获取所有的房屋信息
List<HouseDTO> houseDTOs = houseService.getBatch(houseIds);
Map<String, PopulationInfoDTO> populationInfoMap = null;
Map<String, HouseDTO> houseMap = null;
if (!CollectionUtils.isEmpty(populationInfoDTOs)) {
populationInfoMap = populationInfoDTOs.stream()
.collect(Collectors.toMap(PopulationInfoDTO::getPopulationInfoId,
populationInfoDTO -> populationInfoDTO));
}
if (!CollectionUtils.isEmpty(houseDTOs)) {
houseMap = houseDTOs.stream()
.collect(Collectors.toMap(HouseDTO::getHouseId,
houseDTO -> houseDTO));
}
for (PopulationDTO populationDTO : populationDTOList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
PopulationInfoDTO populationInfoDTO;
if (null != populationInfoMap) {
populationInfoDTO = populationInfoMap
.get(populationDTO.getPopulationInfoId());
if (null != populationInfoDTO) {
populationInfoService.getTuoMin(populationInfoDTO);
}
} else {
populationInfoDTO = setPopulationInfo(populationDTO);
}
populationDTO.setPopulationInfoDTO(populationInfoDTO);
} else {
PopulationInfoDTO populationInfoDTO = setPopulationInfo(populationDTO);
populationDTO.setPopulationInfoDTO(populationInfoDTO);
}
if (null != houseMap) {
HouseDTO houseDTO = houseMap.get(populationDTO.getHouseId());
if (null != houseDTO) {
if (1 == houseDTO.getIsRental()) {
houseDTO.setHouseType("出租房");
}
if (1 == houseDTO.getIsVacant()) {
houseDTO.setHouseType("空置房");
}
if (0 == houseDTO.getIsRental() && 0 == houseDTO.getIsVacant()) {
houseDTO.setHouseType("自住房");
}
populationDTO.setHouseDTO(houseDTO);
}
}
}
PageInfo<PopulationDTO> pageInfo = new PageInfo<>(populationDTOList);
return new SuccessResultList<>(populationDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
}
private PopulationInfoDTO setPopulationInfo(PopulationDTO populationDTO) {
PopulationInfoDTO populationInfoDTO = new PopulationInfoDTO();
populationInfoDTO.setIdcard(populationDTO.getCardNum());
populationInfoDTO.setName(populationDTO.getName());
populationInfoDTO.setPhone(populationDTO.getPhone());
populationInfoDTO.setIdcardType("身份证");
populationInfoService.getTuoMin(populationInfoDTO);
return populationInfoDTO;
}
private PopulationInfoBaseDTO setPopulationBaseInfo(PopulationDTO populationDTO) {
PopulationInfoBaseDTO populationInfoDTO = new PopulationInfoBaseDTO();
populationInfoDTO.setIdcard(populationDTO.getCardNum());
populationInfoDTO.setName(populationDTO.getName());
populationInfoDTO.setPhone(populationDTO.getPhone());
populationInfoDTO.setIdcardType("身份证");
populationInfoService.getTuoMin(populationInfoDTO);
return populationInfoDTO;
}
private List<PopulationDTO> listBatch(Map<String, Object> params) {
List<PopulationDTO> list = populationDao.listBatch(params);
return list;
}
@Override
@ -352,9 +451,94 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
PageHelper.startPage(page.getPage(), page.getRows());
List<PopulationDTO> overList = houseDao.findPopulation(page.getParams());
// 获取人口详情
List<String> populationInfoIds = new ArrayList<>();
List<String> houseIds = new ArrayList<>();
for (PopulationDTO populationDTO : overList) {
if(StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
populationInfoIds.add(populationDTO.getPopulationInfoId());
}
if (StringUtils.isNotEmpty(populationDTO.getHouseId())) {
houseIds.add(populationDTO.getHouseId());
}
}
// 一次性获取所有的人口信息
List<PopulationInfoDTO> populationInfoDTOs = populationInfoService.getBatch(populationInfoIds);
// 一次性获取所有的房屋信息
List<HouseDTO> houseDTOs = houseService.getBatch(houseIds);
// 获取base
List<PopulationInfoBaseDTO> populationInfoBaseDTOs = new ArrayList<>();
int size = populationInfoIds.size();
int numThreads = size / 2 + (size % 2 == 0 ? 0 : 1); // 计算需要的线程数
ExecutorService executorService = Executors.newFixedThreadPool(numThreads);
Callable<List<PopulationInfoBaseDTO>> task = () -> {
List<PopulationInfoBaseDTO> output = new ArrayList<>();
for (String str : populationInfoIds) {
PopulationInfoBaseDTO base = populationInfoService.getBase(str);
output.add(base);
}
return output;
};
Future<List<PopulationInfoBaseDTO>> futureResult = executorService.submit(task);
try {
List<PopulationInfoBaseDTO> result = futureResult.get();
populationInfoBaseDTOs.addAll(result);
executorService.shutdown();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
Map<String, PopulationInfoDTO> populationInfoMap = null;
Map<String, HouseDTO> houseMap = null;
Map<String, PopulationInfoBaseDTO> baseMap = null;
if (!CollectionUtils.isEmpty(populationInfoDTOs)) {
populationInfoMap = populationInfoDTOs.stream()
.collect(Collectors.toMap(PopulationInfoDTO::getPopulationInfoId,
populationInfoDTO -> populationInfoDTO));
}
if (!CollectionUtils.isEmpty(houseDTOs)) {
houseMap = houseDTOs.stream()
.collect(Collectors.toMap(HouseDTO::getHouseId,
houseDTO -> houseDTO));
}
if (!CollectionUtils.isEmpty(populationInfoBaseDTOs)) {
baseMap = populationInfoBaseDTOs.stream()
.collect(Collectors.toMap(PopulationInfoBaseDTO::getPopulationInfoId,
baseDTO -> baseDTO));
}
for (PopulationDTO populationDTO : overList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
PopulationInfoBaseDTO populationInfoBaseDTO = null;
if (null != baseMap) {
// 获取人员
populationInfoBaseDTO = baseMap.get(populationDTO.getPopulationInfoId());
} else {
populationInfoBaseDTO = setPopulationBaseInfo(populationDTO);
}
// populationInfoService.getTuoMin(populationInfoBaseDTO);
populationDTO.setPopulationInfoBaseDTO(populationInfoBaseDTO);
} else {
PopulationInfoBaseDTO populationInfoBaseDTO = setPopulationBaseInfo(populationDTO);
populationDTO.setPopulationInfoBaseDTO(populationInfoBaseDTO);
}
if (null != houseMap) {
HouseDTO houseDTO = houseMap.get(populationDTO.getHouseId());
populationDTO.setHouseDTO(houseDTO);
}
}
// 获取人口详情
/*for (PopulationDTO populationDTO : overList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId());
PopulationInfoHouseDTO populationInfoHouseDTO = new PopulationInfoHouseDTO();
BeanUtils.copyProperties(populationInfoDTO, populationInfoHouseDTO);
@ -369,10 +553,10 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
// 获取房屋详情
HouseDTO houseDTO = houseService.get(populationDTO.getHouseId());
if(null != houseDTO) {
if (null != houseDTO) {
populationDTO.setHouseDTO(houseDTO);
}
}
}*/
PageInfo<PopulationDTO> pageInfo = new PageInfo<>(overList);
return new SuccessResultList<>(overList, pageInfo.getPageNum(), pageInfo.getTotal());
@ -398,4 +582,22 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
return new SuccessResultList<>(populationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
public class getBase implements Runnable {
private List<String> dataList;
private List<PopulationInfoBaseDTO> baseDTOList;
public getBase(List<String> dataList, List<PopulationInfoBaseDTO> baseDTOList) {
this.dataList = dataList;
this.baseDTOList = baseDTOList;
}
@Override
public void run() {
for (String s : dataList) {
PopulationInfoBaseDTO base = populationInfoService.getBase(s);
baseDTOList.add(base);
}
}
}
}

View File

@ -219,4 +219,5 @@ public interface IPopulationInfoService {
void updateCreator(String populationInfoId, String creator);
List<PopulationInfoDTO> getBatch(List<String> populationInfoIds);
}

View File

@ -594,4 +594,11 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul
populationInfoDao.updateCreator(params);
}
@Override
public List<PopulationInfoDTO> getBatch(List<String> populationInfoIds) {
Map<String, Object> params = getHashMap(2);
params.put("populationInfoIds", populationInfoIds);
return populationInfoDao.getBatch(params);
}
}

View File

@ -31,17 +31,19 @@ public class AreaUtils {
@PostConstruct
public void init() {
PopulationInfoStaticService = PopulationInfoService;
initArea0();
initArea1();
initArea2();
initArea3();
initArea4();
aree.put(0, area0);
aree.put(1, area1);
aree.put(2, area2);
aree.put(3, area3);
aree.put(4, area4);
new Thread(() -> {
PopulationInfoStaticService = PopulationInfoService;
initArea0();
initArea1();
initArea2();
initArea3();
initArea4();
aree.put(0, area0);
aree.put(1, area1);
aree.put(2, area2);
aree.put(3, area3);
aree.put(4, area4);
}).start();
}
public List<AreaZtreeDTO> getList(String id) {
@ -50,7 +52,7 @@ public class AreaUtils {
Integer level = -1;
Integer subCount = 0;
// 确定级别
if (!StringUtils.isEmpty(id) ) {
if (!StringUtils.isEmpty(id)) {
AreaZtreeDTO areaDTO = PopulationInfoStaticService.getAreaByAreaId(id);
level = Integer.valueOf(areaDTO.getAreaLevel());
subCount = areaDTO.getSubCount();
@ -58,11 +60,11 @@ public class AreaUtils {
Map<String, AreaZtreeDTO> dataMap = aree.get(level + 1);
if (dataMap != null) {
// 找出所有的子类
for(Map.Entry<String, AreaZtreeDTO> m : dataMap.entrySet()) {
for (Map.Entry<String, AreaZtreeDTO> m : dataMap.entrySet()) {
AreaZtreeDTO ztreeDTO = m.getValue();
String pId = ztreeDTO.getpId();
String title = ztreeDTO.getTitle();
if(!StringUtils.isEmpty(id) && pId.equals(id)) {
if (!StringUtils.isEmpty(id) && pId.equals(id)) {
if (StringUtils.isEmpty(title)) {
ArrayList<String> names = new ArrayList<>();
getParent(level, names, id);
@ -74,14 +76,14 @@ public class AreaUtils {
break;
}
}
if(StringUtils.isEmpty(id)) {
if (StringUtils.isEmpty(id)) {
ztreeDTO.setTitle(ztreeDTO.getName());
list.add(ztreeDTO);
}
}
}
return list;
return list;
}
// 递归拼接全名称
@ -89,11 +91,11 @@ public class AreaUtils {
Map<String, AreaZtreeDTO> dataMap = aree.get(level);
if (level > -1 && dataMap != null) {
level--;
for(Map.Entry<String, AreaZtreeDTO> m : dataMap.entrySet()) {
for (Map.Entry<String, AreaZtreeDTO> m : dataMap.entrySet()) {
String id = m.getValue().getId();
if(pId.equals(id)) {
if (pId.equals(id)) {
names.add(0, m.getValue().getName());
getParent(level, names, m.getValue().getpId());
getParent(level, names, m.getValue().getpId());
break;
}
}
@ -103,8 +105,8 @@ public class AreaUtils {
private static void initArea0() {
List<AreaZtreeDTO> dto = PopulationInfoStaticService.getAreaListByLevel("0", -1);
for(AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0 ) {
for (AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0) {
areaDTO.setIsParent(true);
}
area0.put(areaDTO.getId(), areaDTO);
@ -113,8 +115,8 @@ public class AreaUtils {
private static void initArea1() {
List<AreaZtreeDTO> dto = PopulationInfoStaticService.getAreaListByLevel("1", -1);
for(AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0 ) {
for (AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0) {
areaDTO.setIsParent(true);
}
area1.put(areaDTO.getId(), areaDTO);
@ -123,8 +125,8 @@ public class AreaUtils {
private static void initArea2() {
List<AreaZtreeDTO> dto = PopulationInfoStaticService.getAreaListByLevel("2", -1);
for(AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0 ) {
for (AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0) {
areaDTO.setIsParent(true);
}
area2.put(areaDTO.getId(), areaDTO);
@ -132,10 +134,10 @@ public class AreaUtils {
}
private static void initArea3() {
for(int i = 0 ; i < 9 ; i++ ) {
for (int i = 0; i < 9; i++) {
List<AreaZtreeDTO> dto = PopulationInfoStaticService.getAreaListByLevel("3", i);
for(AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0 ) {
for (AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0) {
areaDTO.setIsParent(true);
}
area3.put(areaDTO.getId(), areaDTO);
@ -144,10 +146,10 @@ public class AreaUtils {
}
private static void initArea4() {
for(int i = 0 ; i < 67 ; i++ ) {
for (int i = 0; i < 67; i++) {
List<AreaZtreeDTO> dto = PopulationInfoStaticService.getAreaListByLevel("4", i);
for(AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0 ) {
for (AreaZtreeDTO areaDTO : dto) {
if (areaDTO.getSubCount() > 0) {
areaDTO.setIsParent(true);
}
area4.put(areaDTO.getId(), areaDTO);

View File

@ -1027,19 +1027,6 @@
<if test="isVacant != null">
AND is_vacant = #{isVacant}
</if>
<if test="keywords != null and keywords != ''">
AND (
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="houseIds != null and houseIds.size > 0">
AND
t1.house_id IN
@ -1078,4 +1065,68 @@
(t1.affiliation_unit + 0), (t1.affiliation_floors + 0), (t1.house_num + 0) ASC
</select>
<!-- 房院管理详情 -->
<select id="getBatch" parameterType="map" resultMap="houseDTO">
SELECT
t1.street,
t1.street_name,
t1.community,
t1.community_name,
t1.residential_id,
t1.residential_name,
t1.building_id,
t1.building_name,
t1.affiliation_unit,
t1.affiliation_floors,
t1.house_num,
t1.category_id,
t1.category_name,
t1.nature_id,
t1.nature_name,
t1.type_id,
t1.type_name,
t1.structure_id,
t1.structure_name,
t1.building_purpose_id,
t1.building_purpose_name,
t1.room_num,
t1.room_area,
t1.room_use_id,
t1.room_use_name,
t1.danger_id,
t1.danger_name,
t1.certificate_num,
t1.registration_date,
t1.affiliated_unit,
t1.is_rental,
t1.is_vacant,
t1.lodge_type_id,
t1.lodge_type_name,
t1.rental_purposes,
t1.homeowner,
t1.document_id,
t1.document_name,
t1.document_num,
t1.phone,
t1.custodian,
t1.custodian_document_id,
t1.custodian_document_name,
t1.custodian_document_num,
t1.custodian_phone,
t1.relationship_homeowner,
t1.house_id,
t1.creator
FROM
house_house t1
WHERE
t1.is_delete = 0
<if test="houseIds != null and houseIds.size > 0">
AND
house_id IN
<foreach collection="houseIds" index="index" open="(" separator="," close=")">
#{houseIds[${index}]}
</foreach>
</if>
</select>
</mapper>

View File

@ -444,4 +444,50 @@
</if>
</select>
<select id="listBatch" parameterType="map" resultMap="populationDTO">
SELECT
t1.population_id,
t1.house_id,
t1.population_info_id,
t1.name,
t1.card_num,
t1.phone,
t1.bind_time,
t1.out_house,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
house_population t1
LEFT JOIN house_house t2 ON t1.house_id = t2.house_id
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
AND (t1.out_house = 0
OR t1.out_house IS NULL)
<if test="keywords != null and keywords != ''">
AND (
t1.card_num LIKE CONCAT('%', #{keywords}, '%')
OR t1.phone LIKE CONCAT('%', #{keywords}, '%')
OR t1.name LIKE CONCAT('%', #{keywords}, '%')
OR t1.house_id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="houseId != null and houseId != ''">
AND t1.house_id = #{houseId}
</if>
<if test="outHouse != null and outHouse != ''">
AND t1.out_house = #{outHouse}
</if>
<if test="populationIds != null and populationIds.size > 0">
AND
t1.population_id IN
<foreach collection="populationIds" index="index" open="(" separator="," close=")">
#{populationIds[${index}]}
</foreach>
</if>
</select>
</mapper>

View File

@ -1343,4 +1343,98 @@
1 = 1
</select>
<!-- 批量获取基础人口信息详情——renpc -->
<select id="getBatch" parameterType="map" resultMap="populationInfoDTO">
SELECT
t1.population_info_id,
t1.name,
t1.label,
t1.idcard,
t1.idcard_type,
t1.birthday,
t1.sex,
t1.nation,
t1.education,
t1.description,
t1.organization,
t1.religion,
t1.marriage_status,
t1.marriage_change_time,
t1.marriage_first_time,
t1.social_security,
t1.health_status,
t1.department_type,
t1.department,
t1.pastion,
t1.pastion_title,
t1.expertise,
t1.phone,
t1.father_id,
t1.father_name,
t1.father_idcard,
t1.father_phone,
t1.mother_id,
t1.mother_name,
t1.mother_idcard,
t1.mother_phone,
t1.relationship,
t1.domicile_address,
t1.domicile_address_type,
t1.domicile_area_code,
t1.domicile_area_name,
t1.origin_address,
t1.origin_area_code,
t1.origin_area_name,
t1.flow_time,
t1.flow_reason,
t1.flow_reasontext,
t1.is_oldage,
t1.oldage_type,
t1.oldage_department,
t1.oldage_lift,
t1.oldage_health_status,
t1.oldage_selfcare,
t1.oldage_live,
t1.is_disability,
t1.disability_type,
t1.disability_level,
t1.disability_number,
t1.disability_carnumber,
t1.disability_address,
t1.disability_area_code,
t1.disability_area_name,
t1.disability_income,
t1.disability_house,
t1.disability_time,
t1.disability_guardian,
t1.disability_guardian_phone,
t1.disability_guardian_relation,
t1.is_military,
t1.military_time,
t1.military_position,
t1.is_succour,
t1.succour_dibao,
t1.succour_help,
t1.succour_difficulty,
t1.succour_subsidy,
t1.is_party,
t1.party_organization,
t1.party_time,
t1.othertext,
t1.population_info_id,
t1.creator
FROM
population_population_info t1
WHERE
t1.is_delete = 0
<if test="populationInfoIds != null and populationInfoIds.size > 0">
AND
t1.population_info_id IN
<foreach collection="populationInfoIds" index="index" open="(" separator="," close=")">
#{populationInfoIds[${index}]}
</foreach>
</if>
</select>
</mapper>

View File

@ -407,12 +407,16 @@
var renderMain = function() {
var main = '';
$.each(data.floors, function(index, item) {
var units = '';
$.each(item.units, function(jndex, jtem) {
var houses = '';
if(jtem.houses.length > data.units[jndex].maxHouseCount) {
data.units[jndex].maxHouseCount = jtem.houses.length;
}
});
});
$.each(data.floors, function(index, item) {
var units = '';
$.each(item.units, function(jndex, jtem) {
var houses = '';
$.each(jtem.houses, function(kndex, ktem) {
var option = ktem.isCreator === 1 ? `
<div class="option">