Merge remote-tracking branch 'origin/test' into test
1个文件已删除
27个文件已修改
30个文件已添加
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 房屋管控状态 |
| | | * |
| | | * @author LYQ |
| | | */ |
| | | @Getter |
| | | public enum PopulHouseControlStatusEnum |
| | | { |
| | | CG(1, "常规"), |
| | | GZ(2, "关注"), |
| | | GK(3, "管控"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulHouseControlStatusEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulHouseControlStatusEnum item : PopulHouseControlStatusEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulHouseControlStatusEnum item : PopulHouseControlStatusEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 房屋用途 |
| | | * |
| | | * @author LYQ |
| | | */ |
| | | @Getter |
| | | public enum PopulHousePurposeEnum |
| | | { |
| | | ZZ(1, "住宅"), |
| | | GY(2, "公寓"), |
| | | SS(3, "宿舍"), |
| | | CK(4, "仓库"), |
| | | QT(5, "其他"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulHousePurposeEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulHousePurposeEnum item : PopulHousePurposeEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 5; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulHousePurposeEnum item : PopulHousePurposeEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 房屋状态 |
| | | * |
| | | * @author LYQ |
| | | */ |
| | | @Getter |
| | | public enum PopulHouseStatusEnum |
| | | { |
| | | ZI_ZHU(1, "自住"), |
| | | ZU_ZHU(2, "租住"), |
| | | QI_TA(3, "其他"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulHouseStatusEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulHouseStatusEnum item : PopulHouseStatusEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 3; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulHouseStatusEnum item : PopulHouseStatusEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 是否状态(1.是 2.否) |
| | | * |
| | | * @author huanghongfa |
| | | */ |
| | | @Getter |
| | | public enum PopulIsOksEnum |
| | | { |
| | | YES(1, "是"), NO(2, "否"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulIsOksEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulIsOksEnum item : PopulIsOksEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 2; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulIsOksEnum item : PopulIsOksEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "否"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 本地外地 |
| | | * |
| | | * @author LYQ |
| | | */ |
| | | @Getter |
| | | public enum PopulOutOrLocalEnum |
| | | { |
| | | BD(1, "本地"), |
| | | WD(2, "外地"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulOutOrLocalEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulOutOrLocalEnum item : PopulOutOrLocalEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulOutOrLocalEnum item : PopulOutOrLocalEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.IdCardUtil; |
| | | import com.panzhihua.common.utlis.ListUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComMngPopulationServeExcelVO vo = new ComMngPopulationServeExcelVO(); |
| | | if(oneData.get(0) == null){ |
| | | //姓名和身份证都为空,为空户,无需操作,否则就解析年龄,性别,出生年月日 |
| | | if(StringUtils.isNotEmpty(oneData.get(0)) || StringUtils.isNotEmpty(oneData.get(1))){ |
| | | if(StringUtils.isEmpty(oneData.get(0))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第1列"); |
| | | importErrorVO.setErrorMsg("名字不可为空,请填写姓名"); |
| | |
| | | index++; |
| | | continue; |
| | | } |
| | | // if(!IdCardUtil.identityValidator(oneData.get(1))){ |
| | | // throw new ServiceException("500", "身份证号格式错误:第" + index + "行,第2列"); |
| | | // } |
| | | |
| | | //判断身份证号码位数 |
| | | if(oneData.get(1).length() != 18){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | |
| | | //根据身份证号码解析年龄以及性别 |
| | | //获取用户生日 |
| | | String birthday = vo.getCardNo().substring(6, 14); |
| | | if(StringUtils.isNotEmpty(birthday)){ |
| | | String year = birthday.substring(0,4); |
| | | String month = birthday.substring(4,6); |
| | | String day = birthday.substring(6,8); |
| | | vo.setBirthday(year + "-" + month + "-" + day); |
| | | } |
| | | //设置用户年龄 |
| | | vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); |
| | | // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); |
| | | //获取用户性别 |
| | | int sex = Integer.parseInt(vo.getCardNo().substring(16, 17)); |
| | | if(sex%2 == 1){ |
| | |
| | | }else{ |
| | | vo.setSex(PopulSexEnum.nv.getCode()); |
| | | } |
| | | if(oneData.get(2) != null){ |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(2))){ |
| | | vo.setNation(oneData.get(2)); |
| | | } |
| | | if(oneData.get(3) != null){ |
| | | if(StringUtils.isNotEmpty(oneData.get(3))){ |
| | | vo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3))); |
| | | } |
| | | if(oneData.get(4) != null){ |
| | | if(StringUtils.isNotEmpty(oneData.get(4))){ |
| | | vo.setIsRent(PopulIsOkEnum.getCodeByName(oneData.get(4))); |
| | | } |
| | | if(oneData.get(5) != null){ |
| | | if(StringUtils.isNotEmpty(oneData.get(5))){ |
| | | vo.setRelation(PopulRelationEnum.getCodeByName(oneData.get(5))); |
| | | } |
| | | if(oneData.get(6) != null){ |
| | | if(StringUtils.isEmpty(oneData.get(6))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第7列"); |
| | | importErrorVO.setErrorMsg("街路巷不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setRoad(oneData.get(6)); |
| | | if(StringUtils.isEmpty(oneData.get(7))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第8列"); |
| | | importErrorVO.setErrorMsg("小区号不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | if(oneData.get(7) != null){ |
| | | vo.setDoorNo(Integer.valueOf(oneData.get(7))); |
| | | vo.setDoorNo(oneData.get(7).trim()); |
| | | if(StringUtils.isEmpty(oneData.get(8))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第9列"); |
| | | importErrorVO.setErrorMsg("楼排号不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | if(oneData.get(8) != null){ |
| | | vo.setFloor(oneData.get(8)); |
| | | vo.setFloor(oneData.get(8).trim()); |
| | | if(StringUtils.isEmpty(oneData.get(9))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第10列"); |
| | | importErrorVO.setErrorMsg("单元号不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | if(oneData.get(9) != null){ |
| | | vo.setUnitNo(Integer.valueOf(oneData.get(9))); |
| | | vo.setUnitNo(oneData.get(9).trim()); |
| | | if(StringUtils.isEmpty(oneData.get(10))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第11列"); |
| | | importErrorVO.setErrorMsg("户室不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | if(oneData.get(10) != null){ |
| | | vo.setHouseNo(Integer.valueOf(oneData.get(10).trim())); |
| | | vo.setHouseNo(oneData.get(10).trim()); |
| | | if(StringUtils.isNotEmpty(oneData.get(11))){ |
| | | vo.setPhone(oneData.get(11).trim()); |
| | | } |
| | | if(oneData.get(11) != null){ |
| | | vo.setPhone(oneData.get(11)); |
| | | if(StringUtils.isNotEmpty(oneData.get(12))){ |
| | | vo.setNativePlace(oneData.get(12).trim()); |
| | | } |
| | | if(oneData.get(12) != null){ |
| | | vo.setNativePlace(oneData.get(12)); |
| | | if(StringUtils.isNotEmpty(oneData.get(13))){ |
| | | vo.setCultureLevel(PopulCultureLevelEnum.getCodeByName(oneData.get(13).trim())); |
| | | } |
| | | if(oneData.get(13) != null){ |
| | | vo.setCultureLevel(PopulCultureLevelEnum.getCodeByName(oneData.get(13))); |
| | | if(StringUtils.isNotEmpty(oneData.get(14))){ |
| | | vo.setMarriage(PopulMarriageEnum.getCodeByName(oneData.get(14).trim())); |
| | | } |
| | | if(oneData.get(14) != null){ |
| | | vo.setMarriage(PopulMarriageEnum.getCodeByName(oneData.get(14))); |
| | | if(StringUtils.isNotEmpty(oneData.get(15))){ |
| | | vo.setHealthy(oneData.get(15).trim()); |
| | | } |
| | | if(oneData.get(15) != null){ |
| | | vo.setHealthy(oneData.get(15)); |
| | | if(StringUtils.isNotEmpty(oneData.get(16))){ |
| | | vo.setWorkCompany(oneData.get(16).trim()); |
| | | } |
| | | if(oneData.get(16) != null){ |
| | | vo.setWorkCompany(oneData.get(16)); |
| | | if(StringUtils.isNotEmpty(oneData.get(17))){ |
| | | vo.setRemark(oneData.get(17).trim()); |
| | | } |
| | | |
| | | if(oneData.get(17) != null && StringUtils.isNotEmpty(oneData.get(17))){ |
| | | String outOrLocal = oneData.get(17); |
| | | if(outOrLocal.equals(ComMngPopulationServeExcelVO.outOrLocal.bd)){ |
| | | vo.setOutOrLocal(1); |
| | | }else if(outOrLocal.equals(ComMngPopulationServeExcelVO.outOrLocal.wd)){ |
| | | vo.setOutOrLocal(2); |
| | | if(StringUtils.isNotEmpty(oneData.get(18))){ |
| | | vo.setCensusRegister(oneData.get(18).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(19))){ |
| | | vo.setOutOrLocal(PopulOutOrLocalEnum.getCodeByName(oneData.get(19).trim())); |
| | | } |
| | | if(oneData.get(18) != null){ |
| | | vo.setCensusRegister(oneData.get(18)); |
| | | if(StringUtils.isNotEmpty(oneData.get(20))){ |
| | | vo.setHouseStatus(PopulHouseStatusEnum.getCodeByName(oneData.get(20).trim())); |
| | | } |
| | | if(oneData.get(19) != null){ |
| | | vo.setRemark(oneData.get(19)); |
| | | if(StringUtils.isNotEmpty(oneData.get(21))){ |
| | | vo.setHousePurpose(PopulHousePurposeEnum.getCodeByName(oneData.get(21).trim())); |
| | | } |
| | | for (int i = 20; i < headSize; i++) { |
| | | if(StringUtils.isNotEmpty(oneData.get(22))){ |
| | | vo.setControlStatus(PopulHouseControlStatusEnum.getCodeByName(oneData.get(22).trim())); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(23))){ |
| | | vo.setIsResidence(PopulIsOksEnum.getCodeByName(oneData.get(23).trim())); |
| | | } |
| | | for (int i = 24; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); |
| | | } |
| | | } |
| | | |
| | | //将重复的数据进行MD5加密实现去重 |
| | | String distinct = vo.getName() + vo.getCardNo() + vo.getRoad() + vo.getDoorNo() + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); |
| | | try { |
| | | String distinctPass = PayUtil.MD5(distinct); |
| | | if(StringUtils.isNotEmpty(distinctPass)){ |
| | | vo.setDistinctPass(distinctPass); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("组装MD5加密字段失败,数据表格行数:" + index); |
| | | continue; |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | |
| | | // throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | // } |
| | | //根据list中的IdCard城市来去重 |
| | | List<ComMngPopulationServeExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationServeExcelVO::getCardNo)).collect(Collectors.toList()); |
| | | List<ComMngPopulationServeExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationServeExcelVO::getDistinctPass)).collect(Collectors.toList()); |
| | | R r = communityService.listSavePopulationServeExcelVO(newVoList, communityId); |
| | | if (!R.isOk(r)) { |
| | | String errMsg = r.getMsg(); |
| | |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 房屋级联选择请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("房屋级联选择请求参数") |
| | | public class CascadeHouseDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value="级别(1.街路巷 2.门牌号 3.楼排号 4.单元号 5.户室)") |
| | | private Integer level = 1; |
| | | |
| | | @ApiModelProperty(value="房屋id") |
| | | private String houseId; |
| | | |
| | | @ApiModelProperty(value="社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value="小区id") |
| | | private Long villageId; |
| | | } |
| | |
| | | /** |
| | | * 小区id(实有房屋id) |
| | | */ |
| | | @ApiModelProperty(value="小区id(实有房屋id)",hidden = true) |
| | | @ApiModelProperty(value="小区id(实有房屋id)") |
| | | private Integer villageId; |
| | | /** |
| | | * 家庭成员(姓名) |
| | |
| | | * 门牌号 |
| | | */ |
| | | @ApiModelProperty(value="门牌号") |
| | | private Integer doorNo; |
| | | private String doorNo; |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | |
| | | * 单元号 |
| | | */ |
| | | @ApiModelProperty(value="单元号") |
| | | private Integer unitNo; |
| | | private String unitNo; |
| | | /** |
| | | * 户室(房间号) |
| | | */ |
| | | @ApiModelProperty(value="户室(房间号)") |
| | | private Integer houseNo; |
| | | private String houseNo; |
| | | /** |
| | | * 政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众) |
| | | */ |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import com.panzhihua.common.model.helper.sensitive.Sensitive; |
| | | import com.panzhihua.common.model.helper.sensitive.SensitiveStrategy; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 实有人口编辑请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口编辑请求参数") |
| | | public class ComMngPopulationEditDTO implements Serializable { |
| | | |
| | | @ApiModelProperty("实有人口id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | @NotBlank(groups = {PutGroup.class},message = "姓名不可为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | @NotBlank(groups = {PutGroup.class},message = "政治面貌不可为空") |
| | | private Integer politicalOutlook; |
| | | |
| | | @ApiModelProperty("是否租住 是否租住(0.否 1.是)") |
| | | @NotBlank(groups = {PutGroup.class},message = "是否租住不可为空") |
| | | private Integer isRent; |
| | | |
| | | @ApiModelProperty("与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)") |
| | | @NotBlank(groups = {PutGroup.class},message = "与户主关系不可为空") |
| | | private Integer relation; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | @NotBlank(groups = {PutGroup.class},message = "联系方式不可为空") |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)") |
| | | @NotBlank(groups = {PutGroup.class},message = "文化程度不可为空") |
| | | private Integer cultureLevel; |
| | | |
| | | @ApiModelProperty("婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)") |
| | | @NotBlank(groups = {PutGroup.class},message = "婚姻状况不可为空") |
| | | private Integer marriage; |
| | | |
| | | @ApiModelProperty("工作单位") |
| | | @NotBlank(groups = {PutGroup.class},message = "工作单位不可为空") |
| | | private String workCompany; |
| | | |
| | | @ApiModelProperty("外地or本地(1.本地 2.外地)") |
| | | @NotBlank(groups = {PutGroup.class},message = "外地/本地不可为空") |
| | | private Integer outOrLocal; |
| | | |
| | | @ApiModelProperty("户口所在地") |
| | | @NotBlank(groups = {PutGroup.class},message = "户口所在地不可为空") |
| | | private String censusRegister; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("标签集合(多个标签以,隔开,如物业工作人员,物业") |
| | | private String label; |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | | @ApiModelProperty("房屋信息请求参数") |
| | | private List<ComMngPopulationHouseEditDTO> houseEditDTOList; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 实有房屋DTO |
| | | */ |
| | | @Data |
| | | @ApiModel("实有房屋请求参数") |
| | | public class ComMngPopulationHouseAdminDTO implements Serializable { |
| | | /** |
| | | * 分页-当前页数 |
| | | */ |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | /** |
| | | * 分页-每页记录数 |
| | | */ |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | /** |
| | | * 街路巷 |
| | | */ |
| | | @ApiModelProperty("街路巷") |
| | | private String alley; |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | @ApiModelProperty(value="门牌号") |
| | | private String houseNum; |
| | | /** |
| | | * 小区组 |
| | | */ |
| | | @ApiModelProperty(value="小区组") |
| | | private String groupAt; |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.其他) |
| | | */ |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)") |
| | | private Integer status; |
| | | /** |
| | | * 房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他) |
| | | */ |
| | | @ApiModelProperty("房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)") |
| | | private Integer purpose; |
| | | /** |
| | | * 管控状态(1.常规 2.关注 3.管控) |
| | | */ |
| | | @ApiModelProperty(value="管控状态(1.常规 2.关注 3.管控)") |
| | | private Integer controlStatus; |
| | | |
| | | /** |
| | | * 房屋id |
| | | */ |
| | | @ApiModelProperty(value="房屋id") |
| | | private Long houseId; |
| | | |
| | | /** |
| | | * 级别(1.街路巷 2.门牌号 3.楼排号 4.单元号 5.户室) |
| | | */ |
| | | @ApiModelProperty(value="级别(1.街路巷 2.门牌号 3.楼排号 4.单元号 5.户室)") |
| | | private Integer level; |
| | | |
| | | /** |
| | | * 更新开始时间 |
| | | */ |
| | | @ApiModelProperty(value="更新开始时间") |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 更新结束时间 |
| | | */ |
| | | @ApiModelProperty(value="更新结束时间") |
| | | private String endTime; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value="社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 街路巷 |
| | | */ |
| | | @ApiModelProperty(value="街路巷",hidden = true) |
| | | private String road; |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | @ApiModelProperty(value="门牌号",hidden = true) |
| | | private String doorNo; |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | | @ApiModelProperty(value="楼排号",hidden = true) |
| | | private String floor; |
| | | /** |
| | | * 单元号 |
| | | */ |
| | | @ApiModelProperty(value="单元号",hidden = true) |
| | | private String unitNo; |
| | | /** |
| | | * 户室(房间号) |
| | | */ |
| | | @ApiModelProperty(value="户室(房间号)",hidden = true) |
| | | private String houseNo; |
| | | /** |
| | | * 小区id |
| | | */ |
| | | @ApiModelProperty(value="小区id") |
| | | private Long villageId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 实有房屋编辑请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有房屋编辑请求参数") |
| | | public class ComMngPopulationHouseEditAdminDTO implements Serializable { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | /** |
| | | * 建筑面积 |
| | | */ |
| | | @ApiModelProperty("建筑面积") |
| | | private BigDecimal constructArea; |
| | | /** |
| | | * 建筑用途 |
| | | */ |
| | | @ApiModelProperty(value="建筑用途") |
| | | private String constructPurpose; |
| | | /** |
| | | * 房屋编号 |
| | | */ |
| | | @ApiModelProperty(value="房屋编号") |
| | | private String code; |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.其他) |
| | | */ |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)") |
| | | private Integer status; |
| | | /** |
| | | * 房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他) |
| | | */ |
| | | @ApiModelProperty("房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)") |
| | | private Integer purpose; |
| | | /** |
| | | * 管控状态(1.常规 2.关注 3.管控) |
| | | */ |
| | | @ApiModelProperty(value="管控状态(1.常规 2.关注 3.管控)") |
| | | private Integer controlStatus; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 实有人口编辑请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口房屋编辑请求参数") |
| | | public class ComMngPopulationHouseEditDTO implements Serializable { |
| | | |
| | | @ApiModelProperty("实有房屋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "是否是居住地(1.是 2.否)") |
| | | private Integer isResidence; |
| | | |
| | | /** |
| | | * 是否是居住地(1.是 2.否) |
| | | */ |
| | | public interface isResidence{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | private Long villageId; |
| | | |
| | | |
| | | } |
| | |
| | | private String alley; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum; |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize; |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("小区/组") |
| | | private String groupAt; |
| | | |
| | | @ApiModelProperty("小区类型(1.城镇 2.农村 3.未知)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNum; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.area; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "查询社区地址信息") |
| | | public class AreaAddressVO { |
| | | |
| | | /** |
| | | * 省份名称 |
| | | */ |
| | | private String province; |
| | | |
| | | /** |
| | | * 城市名称 |
| | | */ |
| | | private String city; |
| | | |
| | | /** |
| | | * 区域名称 |
| | | */ |
| | | private String district; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("级联菜单返回参数") |
| | | public class ComMngCascadeHouseVO { |
| | | |
| | | /** |
| | | * 房屋id |
| | | */ |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | |
| | | /** |
| | | * 街路巷 |
| | | */ |
| | | @ApiModelProperty("街路巷") |
| | | private String alley; |
| | | |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNum; |
| | | |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | | @ApiModelProperty("楼排号") |
| | | private String floor; |
| | | |
| | | /** |
| | | *单元号 |
| | | */ |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | /** |
| | | *户室(房间号) |
| | | */ |
| | | @ApiModelProperty("户室(房间号)") |
| | | private String houseNo; |
| | | |
| | | /** |
| | | *公共显示字段 |
| | | */ |
| | | @ApiModelProperty("公共显示字段") |
| | | private String name; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 实有人口详情车辆信息 |
| | | * @author: lyq |
| | | * @date: 2021/5/19 12:28 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口详情车辆信息") |
| | | public class ComMngPopulationCarVO implements Serializable { |
| | | |
| | | @ApiModelProperty("主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("车牌号") |
| | | private String plateNum; |
| | | |
| | | @ApiModelProperty("车辆品牌型号") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty("车身颜色") |
| | | private String color; |
| | | |
| | | } |
| | |
| | | private String road; |
| | | |
| | | @ExcelProperty(value = "楼排号" ,index = 5) |
| | | private Integer doorNo; |
| | | private String doorNo; |
| | | |
| | | @ExcelProperty(value = "门牌号" ,index = 6) |
| | | private String floor; |
| | | |
| | | @ExcelProperty(value = "单元号" ,index = 7) |
| | | private Integer unitNo; |
| | | private String unitNo; |
| | | |
| | | @ExcelProperty(value = "户室" ,index = 8) |
| | | private Integer houseNo; |
| | | private String houseNo; |
| | | |
| | | @ExcelProperty(value = "民族" ,index = 9) |
| | | private String nation; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 实有房屋Vo |
| | | */ |
| | | @Data |
| | | @ApiModel("实有房屋") |
| | | public class ComMngPopulationHouseAdminVO { |
| | | |
| | | /** |
| | | * 实有房屋id |
| | | */ |
| | | @ApiModelProperty("实有房屋id") |
| | | private Long id; |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | @ApiModelProperty("房屋地址") |
| | | private String address; |
| | | /** |
| | | * 街/路/巷 |
| | | */ |
| | | @ApiModelProperty("街/路/巷") |
| | | private String alley; |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNum; |
| | | /** |
| | | * 小区/组 |
| | | */ |
| | | @ApiModelProperty("小区/组") |
| | | private String groupAt; |
| | | |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)") |
| | | private Integer purpose; |
| | | |
| | | @ApiModelProperty("管控状态(1.常规 2.关注 3.管控)") |
| | | private Integer controlStatus; |
| | | |
| | | @ApiModelProperty("空户(1.是 2.否)") |
| | | private Integer isEmpty; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 实有房屋Vo |
| | | */ |
| | | @Data |
| | | @ApiModel("实有房屋详情") |
| | | public class ComMngPopulationHouseDetailAdminVO { |
| | | |
| | | /** |
| | | * 实有房屋id |
| | | */ |
| | | @ApiModelProperty("实有房屋id") |
| | | private Long id; |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | @ApiModelProperty("房屋地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)") |
| | | private Integer purpose; |
| | | |
| | | @ApiModelProperty("管控状态(1.常规 2.关注 3.管控)") |
| | | private Integer controlStatus; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty("建筑面积") |
| | | private BigDecimal constructArea; |
| | | |
| | | @ApiModelProperty("建筑用途") |
| | | private String constructPurpose; |
| | | |
| | | @ApiModelProperty("房屋编号") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("实有房屋住户信息") |
| | | private List<ComMngPopulationHouseUserAdminVO> houseUserList; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 实有房屋统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有房屋统计返回参数") |
| | | public class ComMngPopulationHouseTotalVO { |
| | | |
| | | /** |
| | | * 房屋数量 |
| | | */ |
| | | @ApiModelProperty("房屋数量") |
| | | private Integer houseTotal = 0; |
| | | /** |
| | | * 空房屋数量 |
| | | */ |
| | | @ApiModelProperty("空房屋数量") |
| | | private Integer emptyTotal = 0; |
| | | /** |
| | | * 关注人口数量 |
| | | */ |
| | | @ApiModelProperty("关注人口数量") |
| | | private Integer followTotal = 0; |
| | | /** |
| | | * 管控人口数量 |
| | | */ |
| | | @ApiModelProperty("管控人口数量") |
| | | private Integer controlTotal = 0; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 实有房屋内人口信息Vo |
| | | */ |
| | | @Data |
| | | @ApiModel("实有房屋内住户信息") |
| | | @EncryptDecryptClass |
| | | public class ComMngPopulationHouseUserAdminVO { |
| | | |
| | | @ApiModelProperty("实有人口id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份证号码") |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("住户来源(1.系统录入 2.小程序登记)") |
| | | private Integer source = 1; |
| | | } |
| | |
| | | private String road; |
| | | |
| | | @ExcelProperty(value = "门牌号", index = 7) |
| | | private Integer doorNo; |
| | | private String doorNo; |
| | | |
| | | @ExcelProperty(value = "楼排号", index = 8) |
| | | private String floor; |
| | | |
| | | @ExcelProperty(value = "单元号", index = 9) |
| | | private Integer unitNo; |
| | | private String unitNo; |
| | | |
| | | @ExcelProperty(value = "户室(房间号)", index = 10) |
| | | private Integer houseNo; |
| | | private String houseNo; |
| | | |
| | | @ExcelProperty(value = "联系方式", index = 11) |
| | | private String phone; |
| | |
| | | @ExcelProperty(value = "工作单位", index = 16) |
| | | private String workCompany; |
| | | |
| | | @ExcelProperty(value = "外地or本地(1.本地 2.外地)", index = 17) |
| | | private Integer outOrLocal; |
| | | @ExcelProperty(value = "备注", index = 17) |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "户口所在地", index = 18) |
| | | private String censusRegister; |
| | | |
| | | @ExcelProperty(value = "备注", index = 19) |
| | | private String remark; |
| | | @ExcelProperty(value = "外地or本地(1.本地 2.外地)", index = 19) |
| | | private Integer outOrLocal; |
| | | |
| | | @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 20) |
| | | private Integer houseStatus; |
| | | |
| | | @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 21) |
| | | private Integer housePurpose; |
| | | |
| | | @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 22) |
| | | private Integer controlStatus; |
| | | |
| | | @ExcelProperty(value = "是否是居住地(1.是 2.否)", index = 23) |
| | | private Integer isResidence; |
| | | |
| | | /** |
| | | * 去重字段,使用(姓名+身份证号+街路巷+小区号+楼牌号+单元号+户室)组合字段进行MD5加密实现去重 |
| | | */ |
| | | private String distinctPass; |
| | | |
| | | /** |
| | | * 年龄 |
| | | */ |
| | | private Integer age; |
| | | |
| | | /** |
| | | * 性别(1.男 2.女) |
| | | */ |
| | | private Integer sex; |
| | | |
| | | /** |
| | | * 出生年月日 |
| | | */ |
| | | private String birthday; |
| | | |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 扩展字段用逗号隔开 |
| | | */ |
| | | private List<String> userTagStr = Lists.newArrayList(); |
| | | |
| | | /** |
| | | * 外地or本地(1.本地 2.外地) |
| | | */ |
| | | public interface outOrLocal{ |
| | | String bd = "本地"; |
| | | String wd = "外地"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 实有人口统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口统计返回参数") |
| | | public class ComMngPopulationTotalVO { |
| | | |
| | | /** |
| | | * 人口总数 |
| | | */ |
| | | @ApiModelProperty("人口总数") |
| | | private Long populationTotal; |
| | | /** |
| | | * 本地人口 |
| | | */ |
| | | @ApiModelProperty("本地人口") |
| | | private Integer localTotal; |
| | | /** |
| | | * 外地人口 |
| | | */ |
| | | @ApiModelProperty("外地人口") |
| | | private Integer outTotal; |
| | | /** |
| | | * 特殊群体 |
| | | */ |
| | | @ApiModelProperty("特殊群体") |
| | | private Integer specialTotal; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.helper.sensitive.SensitiveStrategy; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngHouseVo; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | @ApiModelProperty("单元号") |
| | | @NotBlank(groups = {AddGroup.class},message = "单元号不可为空") |
| | | private Integer unitNo; |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty("户室(房间号)") |
| | | @NotBlank(groups = {AddGroup.class},message = "户室(房间号)不可为空") |
| | | private Integer houseNo; |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | @NotBlank(groups = {AddGroup.class},message = "政治面貌不可为空") |
| | |
| | | @ApiModelProperty("与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)") |
| | | private Integer relation; |
| | | |
| | | @ApiModelProperty("房屋列表") |
| | | private List<ComMngHouseVo> houseList; |
| | | |
| | | @ApiModelProperty("车辆列表") |
| | | private List<ComMngPopulationCarVO> carList; |
| | | |
| | | public interface sex{ |
| | | int nan = 1; |
| | | int nv = 2; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("查询社区的省市区") |
| | | public class ComMngVillageRegionVO { |
| | | |
| | | @ApiModelProperty("省份行政区划代码") |
| | | private Integer provinceAdcode; |
| | | |
| | | @ApiModelProperty("省份行政区划名称") |
| | | private String provinceName; |
| | | |
| | | @ApiModelProperty("城市行政区划代码") |
| | | private Integer cityAdcode; |
| | | |
| | | @ApiModelProperty("城市行政区划名称") |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty("区县行政区划代码") |
| | | private Integer districtAdcode; |
| | | |
| | | @ApiModelProperty("区县行政区划名称") |
| | | private String districtName; |
| | | } |
| | |
| | | private String alley; |
| | | |
| | | @ExcelProperty(value = "门牌号" ,index = 1) |
| | | private Integer houseNum; |
| | | private String houseNum; |
| | | |
| | | @ExcelProperty(value = "小区(组)" ,index = 2) |
| | | private String groupAt; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 小区统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("小区统计返回参数") |
| | | public class ComMngVillageTotalVO { |
| | | |
| | | /** |
| | | * 小区数量 |
| | | */ |
| | | @ApiModelProperty("小区数量") |
| | | private Integer villageTotal = 0; |
| | | /** |
| | | * 城镇小区数量 |
| | | */ |
| | | @ApiModelProperty("城镇小区数量") |
| | | private Integer townTotal = 0; |
| | | /** |
| | | * 农村小区数量 |
| | | */ |
| | | @ApiModelProperty("农村小区数量") |
| | | private Integer countrysideTotal = 0; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModel("实有房屋(小区)") |
| | | public class ComMngVillageVO { |
| | | |
| | | @ApiModelProperty("小区id") |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | @NotBlank(groups = {AddGroup.class}, message = "街路巷不能为空") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | @NotBlank(groups = {AddGroup.class}, message = "门牌号不能为空") |
| | | private Integer houseNum; |
| | | private String houseNum; |
| | | |
| | | @ApiModelProperty("小区(组)") |
| | | private String groupAt; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("小区类型(1.城镇 2.农村 3.未知)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("小区地址") |
| | | private String address; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("更新时间") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty("栋数") |
| | | private Integer floorTotal = 0; |
| | | |
| | | @ApiModelProperty("户数") |
| | | private Integer houseTotal = 0; |
| | | |
| | | @ApiModelProperty("人口数") |
| | | private Integer populationTotal = 0; |
| | | |
| | | @ApiModelProperty("车辆数") |
| | | private Integer carTotal = 0; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | @NotBlank(groups = {AddGroup.class},message = "门牌号不可为空") |
| | | private Integer doorNo; |
| | | private String doorNo; |
| | | |
| | | @ApiModelProperty("楼排号") |
| | | @NotBlank(groups = {AddGroup.class},message = "楼排号不可为空") |
| | |
| | | |
| | | @ApiModelProperty("单元号") |
| | | @NotBlank(groups = {AddGroup.class},message = "单元号不可为空") |
| | | private Integer unitNo; |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty("户室(房间号)") |
| | | @NotBlank(groups = {AddGroup.class},message = "户室(房间号)不可为空") |
| | | private Integer houseNo; |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | @NotBlank(groups = {AddGroup.class},message = "政治面貌不可为空") |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("房屋成员信息") |
| | | @ApiModel("户主关系对象") |
| | | @EncryptDecryptClass |
| | | public class ComHouseMemberVo { |
| | | |
| | | @ApiModelProperty("房屋成员用户id") |
| | | private Long id; |
| | | private Long populId; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.PHONE) |
| | | // @Sensitive(strategy = SensitiveStrategy.PHONE) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("与户主关系") |
| | | @ApiModelProperty("与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)") |
| | | private String relation; |
| | | |
| | | @ApiModelProperty("年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | | @ApiModelProperty("身份证号") |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty("工作单位") |
| | | private String workCompany; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("实有人口详情房屋信息") |
| | | @EncryptDecryptClass |
| | | public class ComMngHouseVo { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | |
| | | @ApiModelProperty("房屋地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("房屋状态") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * @param editComMngPopulationVO |
| | | * @param populationEditDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/common/data/population/edit") |
| | | R editPopulation(@RequestBody EditComMngPopulationVO editComMngPopulationVO, @RequestParam("communityId") Long communityId); |
| | | R editPopulation(@RequestBody ComMngPopulationEditDTO populationEditDTO, @RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 微心愿删除 |
| | |
| | | @PostMapping("/common/data/population/edit/electronicArchives") |
| | | R editUserElectronicFile(@RequestBody UserElectronicFileVO userElectronicFileVO); |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/common/data/population/statistics") |
| | | R getPopulationTotalByAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询房屋级联菜单 |
| | | * @param cascadeHouseDTO 请求参数 |
| | | * @return 菜单列表 |
| | | */ |
| | | @PostMapping("/common/data/population/cascade/list") |
| | | R getCascadeHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO); |
| | | |
| | | /** |
| | | * 分页查询房屋列表 |
| | | * @param populationHouseAdminDTO 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | @PostMapping("/common/data/population/page/house") |
| | | R pageHouse(@RequestBody ComMngPopulationHouseAdminDTO populationHouseAdminDTO); |
| | | |
| | | /** |
| | | * 根据id查询实有房屋信息 |
| | | * @param houseId 房屋id |
| | | * @return 房屋信息 |
| | | */ |
| | | @PostMapping("/common/data/population/house/detail") |
| | | R getHouseDetail(@RequestParam(value = "houseId") Long houseId); |
| | | |
| | | /** |
| | | * 编辑实有房屋信息 |
| | | * @param houseEditAdminDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/common/data/population/house/edit") |
| | | R editHouse(@RequestBody ComMngPopulationHouseEditAdminDTO houseEditAdminDTO); |
| | | |
| | | /** |
| | | * 根据房屋id列表删除房屋信息 |
| | | * @param Ids 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/common/data/population/house/delete") |
| | | R deleteHouses(@RequestBody List<Long> Ids); |
| | | |
| | | /** |
| | | * 实有房屋统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/common/data/population/house/statistics") |
| | | R getHouseTotalByAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 根据社区id查询社区所有省市区 |
| | | * @param communityId 社区id |
| | | * @return 社区所在省市区 |
| | | */ |
| | | @PostMapping("/common/data/village/getRegion") |
| | | R getRegion(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 统计社区内小区数量 |
| | | * @param communityId 社区id |
| | | * @return 统计小区数量 |
| | | */ |
| | | @PostMapping("/common/data/village/statistics") |
| | | R villageStatistics(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * @param villageId 小区id |
| | | * @return 小区详情 |
| | | */ |
| | | @PostMapping("/village/getVillage") |
| | | R getVillage(@RequestParam("villageId") Long villageId); |
| | | |
| | | /** |
| | | * 新增高龄认证 |
| | |
| | | return age; |
| | | } |
| | | |
| | | public static int getAgeFromBirthTimes(String birthTimeString) { |
| | | // 先截取到字符串中的年、月、日 |
| | | int selectYear = Integer.parseInt(birthTimeString.substring(0,4)); |
| | | int selectMonth = Integer.parseInt(birthTimeString.substring(5,7)); |
| | | int selectDay = Integer.parseInt(birthTimeString.substring(8,10)); |
| | | // 得到当前时间的年、月、日 |
| | | Calendar cal = Calendar.getInstance(); |
| | | int yearNow = cal.get(Calendar.YEAR); |
| | | int monthNow = cal.get(Calendar.MONTH) + 1; |
| | | int dayNow = cal.get(Calendar.DATE); |
| | | |
| | | // 用当前年月日减去生日年月日 |
| | | int yearMinus = yearNow - selectYear; |
| | | int monthMinus = monthNow - selectMonth; |
| | | int dayMinus = dayNow - selectDay; |
| | | |
| | | int age = yearMinus;// 先大致赋值 |
| | | if (yearMinus < 0) {// 选了未来的年份 |
| | | age = 0; |
| | | } else if (yearMinus == 0) {// 同年的,要么为1,要么为0 |
| | | if (monthMinus < 0) {// 选了未来的月份 |
| | | age = 0; |
| | | } else if (monthMinus == 0) {// 同月份的 |
| | | if (dayMinus < 0) {// 选了未来的日期 |
| | | age = 0; |
| | | } else if (dayMinus >= 0) { |
| | | age = 1; |
| | | } |
| | | } else if (monthMinus > 0) { |
| | | age = 1; |
| | | } |
| | | } else if (yearMinus > 0) { |
| | | if (monthMinus < 0) {// 当前月>生日月 |
| | | } else if (monthMinus == 0) {// 同月份的,再根据日期计算年龄 |
| | | if (dayMinus < 0) { |
| | | } else if (dayMinus >= 0) { |
| | | age = age + 1; |
| | | } |
| | | } else if (monthMinus > 0) { |
| | | age = age + 1; |
| | | } |
| | | } |
| | | return age; |
| | | } |
| | | |
| | | // 根据时间戳计算年龄 |
| | | public static int getAgeFromBirthTime(long birthTimeLong) { |
| | | Date date = new Date(birthTimeLong * 1000l); |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String yese = "19980516"; |
| | | String year = yese.substring(0,4); |
| | | String month = yese.substring(4,6); |
| | | String ri = yese.substring(6,8); |
| | | System.out.println(); |
| | | int age = getAgeFromBirthTime("1995-08-18"); |
| | | System.out.println(age); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import java.util.*; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * 字符串工具类 |
| | |
| | | { |
| | | return (T) obj; |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为数字格式不限制位数 |
| | | * @param o |
| | | * 待校验参数 |
| | | * @return |
| | | * 如果全为数字,返回true;否则,返回false |
| | | */ |
| | | public static boolean isNumber(Object o){ |
| | | return (Pattern.compile("[0-9]*")).matcher(String.valueOf(o)).matches(); |
| | | } |
| | | } |
| | |
| | | return communityService.getDistrictByCityCode(cityAdcode); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询实有人口列表", response = ComMngPopulationVO.class) |
| | | @PostMapping("/population/pagePopulation") |
| | | public R pageQueryComMngRealAssets(@RequestBody ComMngPopulationDTO comMngPopulationVO) { |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | comMngPopulationVO.setActId(communityId); |
| | | return communityService.pagePopulation(comMngPopulationVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导入实有人口") |
| | | @PostMapping(value = "/serve/population/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | //获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, loginUserInfo.getCommunityId()); |
| | | EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "编辑实有人口") |
| | | @PostMapping(value = "/population/edit") |
| | | public R editPopulationInfo(@RequestBody EditComMngPopulationVO editComMngPopulationVO){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | return communityService.editPopulation(editComMngPopulationVO,loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel确认导入实有人口") |
| | | @PostMapping(value = "/serve/population/import/confirm", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R listSavePopulationConfirm(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | //获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComMngPopulationConfirmServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationConfirmServeExcelListen(communityService, loginUserInfo.getCommunityId()); |
| | | EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口详情", response = ComMngPopulationVO.class) |
| | | @PostMapping("/population/detail") |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.detailPopulation(populationId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有人口电子档案", response = UserElectronicFileVO.class) |
| | | @PostMapping("/population/electronicArchives") |
| | | public R electronicArchivesPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.electronicArchivesPopulation(populationId); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口标签修改", response = ComMngPopulationVO.class) |
| | | @PostMapping("/population/editTag") |
| | | public R editTagPopulation(@RequestBody ComMngPopulationTagDTO populationTagDTO) { |
| | | return communityService.editTagPopulation(populationTagDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口-下载模板") |
| | | @GetMapping("/population/export") |
| | | public R exportPopulation() { |
| | | //获取登陆用户 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "实有人口导入模板.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<List<String>> list = new ArrayList<>(); |
| | | list = headDataFilling(); |
| | | List<List<Object>> dataList = new ArrayList<>(); |
| | | List<Object> data = new ArrayList<>(); |
| | | data = formDataFilling(); |
| | | |
| | | //查询当前社区标签列表 |
| | | R tagsResult = userService.listTags(communityId); |
| | | if(Constants.SUCCESS.equals(tagsResult.getCode())){ |
| | | List<String> TagsList = (List<String>)tagsResult.getData(); |
| | | //动态加载标签列表到表头 |
| | | for (int i = 0; i < TagsList.size(); i++) { |
| | | List<String> head = new ArrayList<>(); |
| | | head.add(TagsList.get(i) + "(是/否)"); |
| | | list.add(head); |
| | | data.add("否"); |
| | | } |
| | | } |
| | | dataList.add(data); |
| | | EasyExcel.write(fileName).head(list).sheet("实有人口导入模板").doWrite(dataList); |
| | | |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + "实有人口导入模板.xlsx"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除实有人口") |
| | | @PostMapping("/population/delete") |
| | | public R deletePopulations(@RequestBody List<Long> Ids){ |
| | | return communityService.deletePopulations(Ids); |
| | | } |
| | | |
| | | private List<List<String>> headDataFilling(){ |
| | | List<List<String>> list = new ArrayList<List<String>>(); |
| | | List<String> head0 = new ArrayList<String>(); |
| | | head0.add("姓名"); |
| | | List<String> head1 = new ArrayList<String>(); |
| | | head1.add("身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("民族"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("政治面貌(群众/中共党员/共青团员)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("是否租住"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("与户主关系"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("街/路/巷"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("小区号(政府对于每个小区都有特定编号)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("楼排号"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("单元号"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | | head12.add("联系方式"); |
| | | List<String> head13 = new ArrayList<String>(); |
| | | head13.add("籍贯"); |
| | | List<String> head14 = new ArrayList<String>(); |
| | | head14.add("文化程度"); |
| | | List<String> head15 = new ArrayList<String>(); |
| | | head15.add("婚姻状况"); |
| | | List<String> head16 = new ArrayList<String>(); |
| | | head16.add("健康状况"); |
| | | List<String> head17 = new ArrayList<String>(); |
| | | head17.add("工作单位"); |
| | | List<String> head18 = new ArrayList<String>(); |
| | | head18.add("本地/外地"); |
| | | List<String> head19 = new ArrayList<String>(); |
| | | head19.add("户口所在地"); |
| | | List<String> head20 = new ArrayList<String>(); |
| | | head20.add("备注"); |
| | | list.add(head0); |
| | | list.add(head1); |
| | | list.add(head2); |
| | | list.add(head3); |
| | | list.add(head4); |
| | | list.add(head5); |
| | | list.add(head6); |
| | | list.add(head7); |
| | | list.add(head8); |
| | | list.add(head10); |
| | | list.add(head11); |
| | | list.add(head12); |
| | | list.add(head13); |
| | | list.add(head14); |
| | | list.add(head15); |
| | | list.add(head16); |
| | | list.add(head17); |
| | | list.add(head18); |
| | | list.add(head19); |
| | | list.add(head20); |
| | | return list; |
| | | } |
| | | |
| | | private List<Object> formDataFilling(){ |
| | | List<Object> data = new ArrayList<>(); |
| | | data.add("张三"); |
| | | data.add("513421199508187219"); |
| | | data.add("汉族"); |
| | | data.add("群众"); |
| | | data.add("是"); |
| | | data.add(""); |
| | | data.add("樱花街"); |
| | | data.add(115); |
| | | data.add("15栋"); |
| | | data.add(10); |
| | | data.add(1001); |
| | | data.add("13768548521"); |
| | | data.add("中国"); |
| | | data.add(""); |
| | | data.add(""); |
| | | data.add(""); |
| | | data.add("阿里巴巴"); |
| | | data.add("本地"); |
| | | data.add("四川成都"); |
| | | data.add(""); |
| | | return data; |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口-数据导出") |
| | | @PostMapping("/population/data/export") |
| | | public R dataExportPopulation(@RequestBody List<Long> Ids) { |
| | | //获取登陆用户 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "实有人口数据.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<ComMngPopulationVO> populList = null; |
| | | if(Ids.size() > 0){//导出部分 |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationLists(Ids).getData()),ComMngPopulationVO.class); |
| | | }else{//导出全部 |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationListByCommunityId(communityId).getData()),ComMngPopulationVO.class); |
| | | } |
| | | |
| | | List<ComMngPopulationExcelVo> populationExcelVoList = new ArrayList<>(); |
| | | if(populList != null && populList.size() > 0){ |
| | | for (ComMngPopulationVO popul:populList){ |
| | | ComMngPopulationExcelVo populationExcelVo = new ComMngPopulationExcelVo(); |
| | | BeanUtils.copyProperties(popul,populationExcelVo); |
| | | //设置性别 |
| | | populationExcelVo.setSex(PopulSexEnum.getCnDescByName(popul.getSex())); |
| | | //设置政治面貌 |
| | | populationExcelVo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(popul.getPoliticalOutlook())); |
| | | //设置是否租住 |
| | | populationExcelVo.setIsRent(PopulIsOkEnum.getCnDescByName(popul.getIsRent())); |
| | | populationExcelVoList.add(populationExcelVo); |
| | | } |
| | | } |
| | | |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationExcelVo.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("实有人口导出数据").build(); |
| | | excelWriter.write(populationExcelVoList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "编辑实有人口_电子档案") |
| | | @PostMapping("/population/edit/electronicArchives") |
| | | R editPopulation(@RequestBody UserElectronicFileVO userElectronicFileVO){ |
| | | return communityService.editUserElectronicFile(userElectronicFileVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.enums.PopulIsOkEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.listen.ComMngPopulationServeExcelListen; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"社区管理/基础数据库/实有人口"}) |
| | | @RestController |
| | | @RequestMapping("/common/data/population/") |
| | | public class PopulationApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | |
| | | @ApiOperation(value = "分页查询实有人口列表", response = ComMngPopulationVO.class) |
| | | @PostMapping("/pagePopulation") |
| | | public R pageQueryComMngRealAssets(@RequestBody ComMngPopulationDTO comMngPopulationVO) { |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | comMngPopulationVO.setActId(communityId); |
| | | return communityService.pagePopulation(comMngPopulationVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口统计接口", response = ComMngPopulationTotalVO.class) |
| | | @PostMapping("/statistics") |
| | | public R getPopulationTotalByAdmin() { |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.getPopulationTotalByAdmin(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导入实有人口") |
| | | @PostMapping(value = "/serve/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | //获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, loginUserInfo.getCommunityId()); |
| | | EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑实有人口") |
| | | @PostMapping(value = "/edit") |
| | | public R editPopulationInfo(@RequestBody ComMngPopulationEditDTO populationEditDTO){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | return communityService.editPopulation(populationEditDTO,loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口详情", response = ComMngPopulationVO.class) |
| | | @PostMapping("/detail") |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.detailPopulation(populationId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有人口电子档案", response = UserElectronicFileVO.class) |
| | | @PostMapping("/electronicArchives") |
| | | public R electronicArchivesPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.electronicArchivesPopulation(populationId); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口标签修改", response = ComMngPopulationVO.class) |
| | | @PostMapping("/editTag") |
| | | public R editTagPopulation(@RequestBody ComMngPopulationTagDTO populationTagDTO) { |
| | | return communityService.editTagPopulation(populationTagDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口-下载模板") |
| | | @GetMapping("/export") |
| | | public R exportPopulation() { |
| | | //获取登陆用户 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "实有人口导入模板.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<List<String>> list = new ArrayList<>(); |
| | | list = headDataFilling(); |
| | | List<List<Object>> dataList = new ArrayList<>(); |
| | | List<Object> data = new ArrayList<>(); |
| | | data = formDataFilling(); |
| | | |
| | | //查询当前社区标签列表 |
| | | R tagsResult = userService.listTags(communityId); |
| | | if(Constants.SUCCESS.equals(tagsResult.getCode())){ |
| | | List<String> TagsList = (List<String>)tagsResult.getData(); |
| | | //动态加载标签列表到表头 |
| | | for (int i = 0; i < TagsList.size(); i++) { |
| | | List<String> head = new ArrayList<>(); |
| | | head.add(TagsList.get(i) + "(是/否)"); |
| | | list.add(head); |
| | | data.add("否"); |
| | | } |
| | | } |
| | | dataList.add(data); |
| | | EasyExcel.write(fileName).head(list).sheet("实有人口导入模板").doWrite(dataList); |
| | | |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + "实有人口导入模板.xlsx"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除实有人口") |
| | | @PostMapping("/delete") |
| | | public R deletePopulations(@RequestBody List<Long> Ids){ |
| | | return communityService.deletePopulations(Ids); |
| | | } |
| | | |
| | | private List<List<String>> headDataFilling(){ |
| | | List<List<String>> list = new ArrayList<List<String>>(); |
| | | List<String> head0 = new ArrayList<String>(); |
| | | head0.add("姓名"); |
| | | List<String> head1 = new ArrayList<String>(); |
| | | head1.add("身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("民族"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("政治面貌(群众/中共党员/共青团员)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("是否租住(是/否)"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("与户主关系(户主/配偶/子女/孙女/父母/其他)"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*街/路/巷(必填)"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("*小区号(必填,政府对于每个小区都有特定编号)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("*楼排号(必填)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("*单元号(必填)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("*户室(必填,四位数表示。前两位楼层,后两位户号)"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | | head12.add("联系方式"); |
| | | List<String> head13 = new ArrayList<String>(); |
| | | head13.add("籍贯"); |
| | | List<String> head14 = new ArrayList<String>(); |
| | | head14.add("文化程度(小学/初中/高中/中专/大专/本科/硕士/博士/其他)"); |
| | | List<String> head15 = new ArrayList<String>(); |
| | | head15.add("婚姻状况(未婚/已婚/离异/丧偶/分居/其他)"); |
| | | List<String> head16 = new ArrayList<String>(); |
| | | head16.add("健康状况"); |
| | | List<String> head17 = new ArrayList<String>(); |
| | | head17.add("工作单位"); |
| | | List<String> head18 = new ArrayList<String>(); |
| | | head18.add("备注"); |
| | | List<String> head19 = new ArrayList<String>(); |
| | | head19.add("户口所在地"); |
| | | List<String> head20 = new ArrayList<String>(); |
| | | head20.add("本地外地(本地/外地)"); |
| | | List<String> head21 = new ArrayList<String>(); |
| | | head21.add("房屋状态(自住/租住/其他)"); |
| | | List<String> head22 = new ArrayList<String>(); |
| | | head22.add("房屋用途(住宅/公寓/宿舍/仓库/其他)"); |
| | | List<String> head23 = new ArrayList<String>(); |
| | | head23.add("管控状态(常规/关注/管控)"); |
| | | List<String> head24 = new ArrayList<String>(); |
| | | head24.add("是否为居住地(是/否)"); |
| | | |
| | | |
| | | list.add(head0); |
| | | list.add(head1); |
| | | list.add(head2); |
| | | list.add(head3); |
| | | list.add(head4); |
| | | list.add(head5); |
| | | list.add(head6); |
| | | list.add(head7); |
| | | list.add(head8); |
| | | list.add(head10); |
| | | list.add(head11); |
| | | list.add(head12); |
| | | list.add(head13); |
| | | list.add(head14); |
| | | list.add(head15); |
| | | list.add(head16); |
| | | list.add(head17); |
| | | list.add(head18); |
| | | list.add(head19); |
| | | list.add(head20); |
| | | list.add(head21); |
| | | list.add(head22); |
| | | list.add(head23); |
| | | list.add(head24); |
| | | return list; |
| | | } |
| | | |
| | | private List<Object> formDataFilling(){ |
| | | List<Object> data = new ArrayList<>(); |
| | | data.add("张三"); |
| | | data.add("513421199508187219"); |
| | | data.add("汉族"); |
| | | data.add("群众"); |
| | | data.add("是"); |
| | | data.add("户主"); |
| | | data.add("樱花街"); |
| | | data.add("115"); |
| | | data.add("15栋"); |
| | | data.add("1单元"); |
| | | data.add("1001"); |
| | | data.add("13768548521"); |
| | | data.add("中国"); |
| | | data.add("硕士"); |
| | | data.add("未婚"); |
| | | data.add(""); |
| | | data.add("阿里巴巴"); |
| | | data.add(""); |
| | | data.add("四川成都"); |
| | | data.add("本地"); |
| | | data.add("自住"); |
| | | data.add("公寓"); |
| | | data.add("常规"); |
| | | data.add("否"); |
| | | return data; |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口-数据导出") |
| | | @PostMapping("/data/export") |
| | | public R dataExportPopulation(@RequestBody List<Long> Ids) { |
| | | //获取登陆用户 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "实有人口数据.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<ComMngPopulationVO> populList = null; |
| | | if(Ids.size() > 0){//导出部分 |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationLists(Ids).getData()),ComMngPopulationVO.class); |
| | | }else{//导出全部 |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationListByCommunityId(communityId).getData()),ComMngPopulationVO.class); |
| | | } |
| | | |
| | | List<ComMngPopulationExcelVo> populationExcelVoList = new ArrayList<>(); |
| | | if(populList != null && populList.size() > 0){ |
| | | for (ComMngPopulationVO popul:populList){ |
| | | ComMngPopulationExcelVo populationExcelVo = new ComMngPopulationExcelVo(); |
| | | BeanUtils.copyProperties(popul,populationExcelVo); |
| | | //设置性别 |
| | | populationExcelVo.setSex(PopulSexEnum.getCnDescByName(popul.getSex())); |
| | | //设置政治面貌 |
| | | populationExcelVo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(popul.getPoliticalOutlook())); |
| | | //设置是否租住 |
| | | populationExcelVo.setIsRent(PopulIsOkEnum.getCnDescByName(popul.getIsRent())); |
| | | populationExcelVoList.add(populationExcelVo); |
| | | } |
| | | } |
| | | |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationExcelVo.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("实有人口导出数据").build(); |
| | | excelWriter.write(populationExcelVoList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑实有人口_电子档案") |
| | | @PostMapping("/edit/electronicArchives") |
| | | public R editPopulation(@RequestBody UserElectronicFileVO userElectronicFileVO){ |
| | | return communityService.editUserElectronicFile(userElectronicFileVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋级联菜单查询") |
| | | @PostMapping("/cascade/list") |
| | | public R getCascadeHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO){ |
| | | //获取登陆用户绑定社区id |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | if(loginUser != null){ |
| | | cascadeHouseDTO.setCommunityId(loginUser.getCommunityId()); |
| | | } |
| | | return communityService.getCascadeHouseAddress(cascadeHouseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询实有房屋列表", response = ComMngPopulationHouseAdminVO.class) |
| | | @PostMapping("/pageHouse") |
| | | public R pageHouse(@RequestBody ComMngPopulationHouseAdminDTO populationHouseAdminDTO) { |
| | | //获取登陆用户绑定社区id |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | if(loginUser != null){ |
| | | populationHouseAdminDTO.setCommunityId(loginUser.getCommunityId()); |
| | | } |
| | | return communityService.pageHouse(populationHouseAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有房屋详情", response = ComMngPopulationHouseDetailAdminVO.class) |
| | | @PostMapping("/house/detail") |
| | | public R getHouseDetail(@RequestParam(value = "houseId") Long houseId) { |
| | | return communityService.getHouseDetail(houseId); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑实有房屋") |
| | | @PostMapping("/edit/house") |
| | | public R editHouse(@RequestBody ComMngPopulationHouseEditAdminDTO houseEditAdminDTO) { |
| | | return communityService.editHouse(houseEditAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除实有房屋") |
| | | @PostMapping("/house/delete") |
| | | public R deleteHouses(@RequestBody List<Long> Ids){ |
| | | return communityService.deleteHouses(Ids); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有房屋统计接口", response = ComMngPopulationHouseTotalVO.class) |
| | | @PostMapping("/house/statistics") |
| | | public R getHouseTotalByAdmin() { |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.getHouseTotalByAdmin(communityId); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageRegionVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 实有房屋(小区)管理 |
| | | * @description: 小区管理 |
| | | * @author: llming |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"实有房屋管理"}) |
| | | @Api(tags = {"小区管理"}) |
| | | @RestController |
| | | @RequestMapping("/villagemanager/") |
| | | public class VillageApi extends BaseController { |
| | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询实有房屋", response = ComMngVillageVO.class) |
| | | @ApiOperation(value = "分页查询小区", response = ComMngVillageVO.class) |
| | | @PostMapping("pagevillage") |
| | | public R pageVillage(@RequestBody PageComMngVillageDTO pageComMngVillageDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | |
| | | return communityService.pageVillage(pageComMngVillageDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有房屋", response = ComMngVillageVO.class) |
| | | @ApiOperation(value = "小区详情", response = ComMngVillageVO.class) |
| | | @PostMapping("getVillage") |
| | | public R getVillage(@RequestParam("villageId") Long villageId) { |
| | | return communityService.getVillage(villageId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询小区", response = ComMngVillageVO.class) |
| | | @PostMapping("listvillage") |
| | | public R listVillage(@RequestBody ComMngVillageVO comMngVillageVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | |
| | | return communityService.listVillage(comMngVillageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增实有房屋", response = ComMngVillageVO.class) |
| | | @ApiOperation(value = "新增小区", response = ComMngVillageVO.class) |
| | | @PostMapping("addvillage") |
| | | public R addVillage(@Valid @RequestBody ComMngVillageVO comMngVillageVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | |
| | | return communityService.addVillage(comMngVillageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除实有房屋") |
| | | @ApiOperation(value = "删除小区") |
| | | @PostMapping("deletevillage") |
| | | public R delectVillage(@RequestBody List<Long> Ids) { |
| | | return communityService.delectVillage(Ids); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载模板-实有房屋") |
| | | @ApiOperation(value = "下载模板-小区") |
| | | @GetMapping(value = "/serve/download/template") |
| | | public R downloadTemplate(HttpServletResponse response){ |
| | | return R.ok(excelConvenientUrl + "实有房屋导入模板.xlsx"); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导入实有房屋") |
| | | @ApiOperation(value = "excel导入小区") |
| | | @PostMapping(value = "/serve/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | //获取文件名 |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑实有房屋", response = ComMngVillageVO.class) |
| | | @ApiOperation(value = "编辑小区", response = ComMngVillageVO.class) |
| | | @PostMapping("editvillage/{villageId}") |
| | | public R editvillage(@PathVariable("villageId")Long villageId,@Valid @RequestBody ComMngVillageVO comMngVillageVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | |
| | | return communityService.editvillage(villageId,comMngVillageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前社区所在省市区", response = ComMngVillageRegionVO.class) |
| | | @PostMapping("/getRegion") |
| | | public R getRegion() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | return communityService.getRegion(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "统计小区接口", response = ComMngVillageTotalVO.class) |
| | | @PostMapping("/statistics") |
| | | public R statistics() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | return communityService.villageStatistics(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | public R editvillage(@PathVariable("villageId")Long villageId,@Valid @RequestBody ComMngVillageVO comMngVillageVO) { |
| | | return comMngVillageService.editVillage(villageId,comMngVillageVO); |
| | | } |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * @param villageId 小区id |
| | | * @return 小区详情 |
| | | */ |
| | | @PostMapping("/village/getVillage") |
| | | public R getVillage(@RequestParam("villageId") Long villageId) { |
| | | return comMngVillageService.getVillage(villageId); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private ComMngProvinceService comMngProvinceService; |
| | | @Resource |
| | | private ComMngPopulationService comMngPopulationService; |
| | | @Resource |
| | | private ComMngPopulationHouseService comMngPopulationHouseService; |
| | | @Resource |
| | | private ComMngVillageService comMngVillageService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/population/import") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){ |
| | | public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId) throws Exception{ |
| | | return comMngPopulationService.listSavePopulation(list,communityId); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * @param editComMngPopulationVO |
| | | * @param populationEditDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/population/edit") |
| | | R editPopulation(@RequestBody EditComMngPopulationVO editComMngPopulationVO,@RequestParam("communityId") Long communityId){ |
| | | return comMngPopulationService.editPopulation(editComMngPopulationVO, communityId); |
| | | R editPopulation(@RequestBody ComMngPopulationEditDTO populationEditDTO,@RequestParam("communityId") Long communityId) throws Exception{ |
| | | return comMngPopulationService.editPopulation(populationEditDTO, communityId); |
| | | } |
| | | |
| | | /** |
| | |
| | | return comMngPopulationService.editUserElectronicFile(userElectronicFileVO); |
| | | } |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/population/statistics") |
| | | public R getPopulationTotalByAdmin(@RequestParam("communityId") Long communityId) { |
| | | return comMngPopulationService.getPopulationTotalByAdmin(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 查询房屋级联菜单 |
| | | * @param cascadeHouseDTO 请求参数 |
| | | * @return 菜单列表 |
| | | */ |
| | | @PostMapping("/population/cascade/list") |
| | | public R getCascadeHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO){ |
| | | return comMngPopulationHouseService.getCascadeHouseAddress(cascadeHouseDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询房屋列表 |
| | | * @param populationHouseAdminDTO 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | @PostMapping("/population/page/house") |
| | | public R getPageHouse(@RequestBody ComMngPopulationHouseAdminDTO populationHouseAdminDTO){ |
| | | return comMngPopulationHouseService.getPageHouse(populationHouseAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询实有房屋信息 |
| | | * @param houseId 房屋id |
| | | * @return 房屋信息 |
| | | */ |
| | | @PostMapping("/population/house/detail") |
| | | public R getHouseDetail(@RequestParam(value = "houseId") Long houseId) { |
| | | return comMngPopulationHouseService.getHouseDetail(houseId); |
| | | } |
| | | |
| | | /** |
| | | * 编辑实有房屋信息 |
| | | * @param houseEditAdminDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/population/house/edit") |
| | | public R editHouse(@RequestBody ComMngPopulationHouseEditAdminDTO houseEditAdminDTO) { |
| | | return comMngPopulationHouseService.editHouse(houseEditAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据房屋id列表删除房屋信息 |
| | | * @param Ids 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/population/house/delete") |
| | | public R deleteHouses(@RequestBody List<Long> Ids){ |
| | | return comMngPopulationHouseService.deleteHouses(Ids); |
| | | } |
| | | |
| | | /** |
| | | * 实有房屋统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/population/house/statistics") |
| | | public R getHouseTotalByAdmin(@RequestParam("communityId") Long communityId) { |
| | | return comMngPopulationHouseService.getHouseTotalByAdmin(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 根据社区id查询社区所有省市区 |
| | | * @param communityId 社区id |
| | | * @return 社区所在省市区 |
| | | */ |
| | | @PostMapping("/village/getRegion") |
| | | public R getRegion(@RequestParam("communityId") Long communityId) { |
| | | return comMngPopulationHouseService.getRegion(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 统计社区内小区数量 |
| | | * @param communityId 社区id |
| | | * @return 统计小区数量 |
| | | */ |
| | | @PostMapping("/village/statistics") |
| | | public R villageStatistics(@RequestParam("communityId") Long communityId) { |
| | | return comMngVillageService.villageStatistics(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | |
| | | /** |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface ComActVillageDAO extends BaseMapper<ComMngVillageDO> { |
| | | |
| | | @Select("select count(id) as houseTotal" + |
| | | ",(select count(DISTINCT floor) from com_mng_population_house where village_id = #{villageId}) as floorTotal" + |
| | | ",(select count(id) from com_mng_population where village_id = #{villageId}) as populationTotal" + |
| | | ",(select count(id) from com_mng_car where area_id = #{villageId}) as carTotal" + |
| | | " from com_mng_population_house where village_id = #{villageId}") |
| | | ComMngVillageVO getStatisticsCount(@Param("villageId") Long villageId); |
| | | |
| | | @Select("select count(village_id) as villageTotal" + |
| | | ",(select count(village_id) from com_mng_village where community_id = #{communityId} and type = 1) as townTotal" + |
| | | ",(select count(village_id) from com_mng_village where community_id = #{communityId} and type = 2) as countrysideTotal" + |
| | | " from com_mng_village where community_id = #{communityId}" ) |
| | | ComMngVillageTotalVO getVillageStatisticsCount(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select village_id,alley,house_num,group_at,type,address,update_at from com_mng_village where village_id = #{villageId}") |
| | | ComMngVillageVO getVillageById(@Param("villageId") Long villageId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngCarDTO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationCarVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngCarDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 车辆管理 |
| | |
| | | " LEFT JOIN com_mng_struct_area t2 ON t2.id = t.area_id " + |
| | | " LEFT JOIN sys_user t3 ON t.create_by = t3.user_id " + |
| | | " WHERE 1=1" + |
| | | "<if test='pageComMngCarDTO.name != null and pageComMngCarDTO.name.trim() != ""'>" + |
| | | "<if test='pageComMngCarDTO.name != null and pageComMngCarDTO.name != ""'>" + |
| | | " and t.user_name LIKE concat( '%',#{pageComMngCarDTO.name}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='pageComMngCarDTO.villageId != null'>" + |
| | | " and t.area_id = #{pageComMngCarDTO.villageId} " + |
| | | " </if> " + |
| | | "<if test='pageComMngCarDTO.communityId != null and pageComMngCarDTO.communityId != 0'>" + |
| | | " and t.community_id = #{pageComMngCarDTO.communityId} " + |
| | |
| | | " order by t.create_at desc" + |
| | | "</script>") |
| | | IPage<ComMngCarVO> pageQueryComMngCar(Page page, @Param(value = "pageComMngCarDTO") PageComMngCarDTO pageComMngCarDTO); |
| | | |
| | | @Select("select cmc.id,cmc.plate_num,cmc.color,cmc.brand from com_mng_car as cmc " + |
| | | " left join sys_user as su on su.user_id = cmc.user_id " + |
| | | " where su.id_card = #{idCard}") |
| | | List<ComMngPopulationCarVO> getPopulationCarListByIdCard(@Param(value = "idCard") String idCard); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.PageComActMessageVO; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | |
| | | @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at,card_photo_front,card_photo_back,family_book from com_mng_family_info where user_id=#{userId} order by create_at desc ") |
| | | List<ComMngFamilyInfoVO> listFamilyByUserId(Long userId); |
| | | |
| | | @Select("select id,`name`,phone,relation from com_mng_population where road = #{comMngPopulationDO.road} and door_no = #{comMngPopulationDO.doorNo} and floor = #{comMngPopulationDO.floor} and unit_no = #{comMngPopulationDO.unitNo} and house_no = #{comMngPopulationDO.houseNo} and id != #{comMngPopulationDO.id}") |
| | | List<ComHouseMemberVo> listHouseMermberByUserId(@Param("comMngPopulationDO") ComMngPopulationDO comMngPopulationDO); |
| | | @Select("select cmphu.popul_id,cmp.name,cmp.relation,cmp.age,cmp.phone,cmp.healthy,cmp.card_no,cmp.work_company from com_mng_population_house_user cmphu " + |
| | | " left join com_mng_population cmp on cmp.id = cmphu.popul_id " + |
| | | " where cmphu.house_id = #{houseId} and cmphu.popul_id != #{populId}") |
| | | List<ComHouseMemberVo> listHouseMermberByUserId(@Param("houseId") Long houseId, @Param("populId") Long populId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | |
| | | "cmp.out_or_local, \n" + |
| | | "cmp.census_register, \n" + |
| | | "cmp.healthy, \n" + |
| | | "cmp.birthday, \n" + |
| | | "cmp.is_rent \n" + |
| | | "FROM \n" + |
| | | "com_mng_population AS cmp " + |
| | |
| | | "<if test='comMngPopulationVO.actId != null'>" + |
| | | " and cmp.act_id = #{comMngPopulationVO.actId} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.villageId != null'>" + |
| | | " and cmp.village_id = #{comMngPopulationVO.villageId} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.road != null and comMngPopulationVO.road != ""'>" + |
| | | "AND cmp.road LIKE concat(#{comMngPopulationVO.road},'%') " + |
| | | "AND cmp.road = #{comMngPopulationVO.road} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo != ""'>" + |
| | | "AND cmp.door_no = #{comMngPopulationVO.doorNo} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.floor != null and comMngPopulationVO.floor != ""'>" + |
| | | "AND cmp.floor = #{comMngPopulationVO.floor} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.unitNo != null and comMngPopulationVO.unitNo != ""'>" + |
| | | "AND cmp.unit_no = #{comMngPopulationVO.unitNo} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.houseNo != null and comMngPopulationVO.houseNo != ""'>" + |
| | | "AND cmp.house_no = #{comMngPopulationVO.houseNo} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.alley != null and comMngPopulationVO.alley != ""'>" + |
| | | "AND cmv.alley LIKE concat(#{comMngPopulationVO.alley},'%') " + |
| | |
| | | "AND cmp.remark = #{comMngPopulationVO.remark} " + |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by cmp.create_at desc" + |
| | | "</script>") |
| | | IPage<ComMngPopulationVO> pagePopulation(Page page, @Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO); |
| | | |
| | |
| | | |
| | | @Select("update sys_user set card_photo_front=#{vo.cardPhotoFront},card_photo_back=#{vo.cardPhotoBack},family_book=#{vo.familyBook} where user_id=#{vo.userId}") |
| | | void updateSysUserElectronicFile(@Param("vo") UserElectronicFileVO vo); |
| | | |
| | | @Select("<script> " + |
| | | "select (select province_name from com_mng_struct_area_province where province_adcode = #{provinceCode}) as province," + |
| | | "(select city_name from com_mng_struct_area_city where city_adcode = #{cityCode}) as city," + |
| | | "(select district_name from com_mng_struct_area_district where district_adcode = #{districtCode}) as district" + |
| | | "</script>") |
| | | AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode,@Param("cityCode") String cityCode,@Param("districtCode") String districtCode); |
| | | |
| | | @Select("select count(id) as populationTotal " + |
| | | ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 1) as localTotal " + |
| | | ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 2) as outTotal " + |
| | | ",(select count(id) from com_mng_population where act_id = #{communityId} and label is null) as specialTotal " + |
| | | " from com_mng_population as cmp where act_id = #{communityId}") |
| | | ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.ComMngHouseVo; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:31 |
| | | * @describe 社区管理》小区管理》实有房屋mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngPopulationHouseDAO extends BaseMapper<ComMngPopulationHouseDO> { |
| | | |
| | | @Select("select cmphu.house_id,cmph.address,cmph.status from com_mng_population_house_user cmphu " + |
| | | " left join com_mng_population_house as cmph on cmph.id = cmphu.house_id " + |
| | | " where cmphu.popul_id = #{populId}") |
| | | List<ComMngHouseVo> getPopulHouseListByPopulId(@Param("populId")Long populId); |
| | | |
| | | @Select("<script> " + |
| | | "select id as houseId,cmv.alley from com_mng_population_house as cmph left join com_mng_village as cmv on cmv.village_id = cmph.village_id where cmph.community_id = #{communityId}" + |
| | | "<if test='villageId != null'>" + |
| | | "and cmv.village_id = #{villageId}" + |
| | | " </if> " + |
| | | " </script>") |
| | | List<ComMngCascadeHouseVO> getHouseLevelByAlley(@Param(value = "communityId") Long communityId,@Param(value = "villageId") Long villageId); |
| | | |
| | | @Select("<script> " + |
| | | "select id as houseId,cmv.alley,cmv.house_num from com_mng_population_house as cmph left join com_mng_village as cmv on cmv.village_id = cmph.village_id where cmph.community_id = #{communityId}" + |
| | | "<if test='name != null and name != ""'>" + |
| | | "and cmv.alley = #{name}" + |
| | | " </if> " + |
| | | "<if test='villageId != null'>" + |
| | | "and cmv.village_id = #{villageId}" + |
| | | " </if> " + |
| | | " </script>") |
| | | List<ComMngCascadeHouseVO> getHouseLevelByHouseNum(@Param("name") String name,@Param("communityId") Long communityId,@Param(value = "villageId") Long villageId); |
| | | |
| | | @Select("<script> " + |
| | | "select id as houseId,cmv.alley,cmv.house_num,cmph.floor from com_mng_population_house as cmph left join com_mng_village as cmv on cmv.village_id = cmph.village_id where cmph.community_id = #{communityId} " + |
| | | "<if test='name != null and name != ""'>" + |
| | | "and cmv.alley = #{name}" + |
| | | " </if> " + |
| | | "<if test='houseNum != null and houseNum != ""'>" + |
| | | "and cmv.house_num = #{houseNum}" + |
| | | " </if> " + |
| | | "<if test='villageId != null'>" + |
| | | "and cmv.village_id = #{villageId}" + |
| | | " </if> " + |
| | | " </script>") |
| | | List<ComMngCascadeHouseVO> getHouseLevelByFloor(@Param("name") String name,@Param("houseNum") String houseNum,@Param("communityId") Long communityId,@Param(value = "villageId") Long villageId); |
| | | |
| | | @Select("<script> " + |
| | | "select id as houseId,cmv.alley,cmv.house_num,cmph.floor,cmph.unit_no from com_mng_population_house as cmph left join com_mng_village as cmv on cmv.village_id = cmph.village_id where cmph.community_id = #{communityId} " + |
| | | "<if test='name != null and name != ""'>" + |
| | | "and cmv.alley = #{name}" + |
| | | " </if> " + |
| | | "<if test='houseNum != null and houseNum != ""'>" + |
| | | "and cmv.house_num = #{houseNum}" + |
| | | " </if> " + |
| | | "<if test='floor != null and floor != ""'>" + |
| | | "and cmph.floor = #{floor}" + |
| | | " </if> " + |
| | | "<if test='villageId != null'>" + |
| | | "and cmv.village_id = #{villageId}" + |
| | | " </if> " + |
| | | " </script>") |
| | | List<ComMngCascadeHouseVO> getHouseLevelByUnitNo(@Param("name") String name,@Param("houseNum") String houseNum,@Param("floor") String floor,@Param("communityId") Long communityId,@Param(value = "villageId") Long villageId); |
| | | |
| | | @Select("<script> " + |
| | | "select cmph.id as houseId,cmv.alley,cmv.house_num,cmph.floor,cmph.unit_no,cmph.house_no from com_mng_population_house as cmph left join com_mng_village as cmv on cmv.village_id = cmph.village_id where cmph.community_id = #{communityId} " + |
| | | "<if test='name != null and name != ""'>" + |
| | | "and cmv.alley = #{name}" + |
| | | " </if> " + |
| | | "<if test='houseNum != null and houseNum != ""'>" + |
| | | "and cmv.house_num = #{houseNum}" + |
| | | " </if> " + |
| | | "<if test='floor != null and floor != ""'>" + |
| | | "and cmph.floor = #{floor}" + |
| | | " </if> " + |
| | | "<if test='unitNo != null and unitNo != ""'>" + |
| | | "and cmph.unit_no = #{unitNo}" + |
| | | " </if> " + |
| | | "<if test='villageId != null'>" + |
| | | "and cmv.village_id = #{villageId}" + |
| | | " </if> " + |
| | | " </script>") |
| | | List<ComMngCascadeHouseVO> getHouseLevelByHouseNo(@Param("name") String name,@Param("houseNum") String houseNum,@Param("floor") String floor,@Param("unitNo") String unitNo,@Param("communityId") Long communityId,@Param(value = "villageId") Long villageId); |
| | | |
| | | @Select("update com_mng_population_house set is_empty = #{isEmpty} where id = #{houseId}") |
| | | void updateHouseByIsEmpty(@Param("houseId") Long houseId,@Param("isEmpty") Integer isEmpty); |
| | | |
| | | @Select("<script> " + |
| | | "select cmph.id,cmv.alley,cmv.house_num,cmv.group_at,cmph.address,cmph.status,cmph.purpose,cmph.control_status" + |
| | | ",cmph.update_at,cmph.is_empty from com_mng_population_house as cmph" + |
| | | " left join com_mng_village as cmv on cmv.village_id = cmph.village_id" + |
| | | "<where>" + |
| | | "<if test='populationHouseAdminDTO.communityId != null'>" + |
| | | " and cmph.community_id = #{populationHouseAdminDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.alley != null and populationHouseAdminDTO.alley != ""'>" + |
| | | // "AND cmv.alley like #{populationHouseAdminDTO.alley} " + |
| | | "AND cmv.alley like concat('%',#{populationHouseAdminDTO.alley},'%') " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.houseNum != null and populationHouseAdminDTO.houseNum != ""'>" + |
| | | "AND cmv.house_num = #{populationHouseAdminDTO.houseNum} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.groupAt != null and populationHouseAdminDTO.groupAt != ""'>" + |
| | | "AND cmv.group_at = #{populationHouseAdminDTO.groupAt} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.status != null'>" + |
| | | "AND cmph.status = #{populationHouseAdminDTO.status} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.purpose != null'>" + |
| | | "AND cmph.purpose = #{populationHouseAdminDTO.purpose} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.controlStatus != null'>" + |
| | | "AND cmph.control_status = #{populationHouseAdminDTO.controlStatus} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.startTime != null and populationHouseAdminDTO.startTime != "" '>" + |
| | | " AND cmph.update_at <![CDATA[>=]]> #{populationHouseAdminDTO.startTime} " + |
| | | "</if>" + |
| | | "<if test='populationHouseAdminDTO.endTime != null and populationHouseAdminDTO.startTime != "" '>" + |
| | | " AND cmph.update_at <![CDATA[<=]]> #{populationHouseAdminDTO.endTime} " + |
| | | " </if> " + |
| | | |
| | | "<if test='populationHouseAdminDTO.road != null and populationHouseAdminDTO.road != "" '>" + |
| | | " AND cmv.alley = #{populationHouseAdminDTO.road} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.doorNo != null and populationHouseAdminDTO.doorNo != "" '>" + |
| | | " AND cmv.houseNum = #{populationHouseAdminDTO.doorNo} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.floor != null and populationHouseAdminDTO.floor != "" '>" + |
| | | " AND cmph.floor = #{populationHouseAdminDTO.floor} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.unitNo != null and populationHouseAdminDTO.unitNo != "" '>" + |
| | | " AND cmph.unit_no = #{populationHouseAdminDTO.unitNo} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.houseNo != null and populationHouseAdminDTO.houseNo != "" '>" + |
| | | " AND cmph.house_no = #{populationHouseAdminDTO.houseNo} " + |
| | | " </if> " + |
| | | "<if test='populationHouseAdminDTO.villageId != null'>" + |
| | | " and cmph.village_id = #{populationHouseAdminDTO.villageId} " + |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by update_at desc" + |
| | | " </script>") |
| | | IPage<ComMngPopulationHouseAdminVO> getPageHouse(Page page, @Param("populationHouseAdminDTO") ComMngPopulationHouseAdminDTO populationHouseAdminDTO); |
| | | |
| | | @Select("select id,address,status,purpose,control_status,update_at,code,construct_purpose,construct_area from com_mng_population_house where id = #{houseId}") |
| | | ComMngPopulationHouseDetailAdminVO getHouseDetail(@Param("houseId") Long houseId); |
| | | |
| | | @Select("select count(id) as houseTotal" + |
| | | ",(select count(id) from com_mng_population_house where is_empty = 1 and community_id = #{communityId}) as emptyTotal" + |
| | | ",(select count(id) from com_mng_population_house where control_status = 2 and community_id = #{communityId}) as followTotal" + |
| | | ",(select count(id) from com_mng_population_house where control_status = 3 and community_id = #{communityId}) as controlTotal" + |
| | | " from com_mng_population_house as cmph where community_id = #{communityId}") |
| | | ComMngPopulationHouseTotalVO getHouseTotalByAdmin(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select (select province_name from com_mng_struct_area_province where province_adcode = ca.province_code) as provinceName," + |
| | | "(select city_name from com_mng_struct_area_city where city_adcode = ca.city_code) as cityName," + |
| | | "(select district_name from com_mng_struct_area_district where district_adcode = ca.area_code) as districtName" + |
| | | ",ca.province_code as provinceAdcode,ca.city_code as cityAdcode,ca.area_code as districtAdcode" + |
| | | " from com_act as ca where ca.community_id = #{communityId}") |
| | | ComMngVillageRegionVO getRegion(@Param("communityId") Long communityId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationHouseUserAdminVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:53 |
| | | * @describe 房屋居住信息关联表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngPopulationHouseUserDAO extends BaseMapper<ComMngPopulationHouseUserDO> { |
| | | |
| | | @Select("delete from com_mng_population_house_user where popul_id = #{populationId}") |
| | | void deletePopulationHouseByUserId(@Param("populationId") Long populationId); |
| | | |
| | | @Select("select house_id from com_mng_population_house_user where popul_id = #{populationId}") |
| | | List<Long> getPopulationHouseIdByUserId(@Param("populationId") Long populationId); |
| | | |
| | | @Select("select popul_id from com_mng_population_house_user where house_id = #{houseId}") |
| | | List<Long> getPopulationHouseIdByhHosueId(@Param("houseId") Long houseId); |
| | | |
| | | @Select("select cmp.id,cmp.name,cmp.card_no,cmp.phone from com_mng_population_house_user as cmphu " + |
| | | "left join com_mng_population as cmp on cmp.id = cmphu.popul_id where cmphu.house_id = #{houseId}") |
| | | List<ComMngPopulationHouseUserAdminVO> getHouseUserByHouseId(@Param("houseId") Long houseId); |
| | | |
| | | } |
| | |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | private Integer doorNo; |
| | | private String doorNo; |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | |
| | | /** |
| | | * 单元号 |
| | | */ |
| | | private Integer unitNo; |
| | | private String unitNo; |
| | | /** |
| | | * 户室(房间号) |
| | | */ |
| | | private Integer houseNo; |
| | | private String houseNo; |
| | | /** |
| | | * 政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众) |
| | | */ |
| | |
| | | private String healthy; |
| | | |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | private String houseAddress; |
| | | |
| | | /** |
| | | * 出生年月日 |
| | | */ |
| | | private String birthday; |
| | | |
| | | /** |
| | | * 居住地房屋id |
| | | */ |
| | | private Long houseId; |
| | | |
| | | /** |
| | | * 性别(1.男 2.女 3.未知) |
| | | */ |
| | | public interface sex{ |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:31 |
| | | * @describe 社区管理》小区管理》实有房屋实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_mng_population_house") |
| | | public class ComMngPopulationHouseDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 房屋编号 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 街路巷id |
| | | */ |
| | | private String alley; |
| | | |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | private String houseNum; |
| | | |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | | private String floor; |
| | | /** |
| | | * 单元号 |
| | | */ |
| | | private String unitNo; |
| | | /** |
| | | * 户室(房间号) |
| | | */ |
| | | private String houseNo; |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.其他) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他) |
| | | */ |
| | | private Integer purpose; |
| | | |
| | | /** |
| | | * 管控状态(1.常规 2.关注 3.管控) |
| | | */ |
| | | private Integer controlStatus; |
| | | |
| | | /** |
| | | * 空户(1.是 2.否) |
| | | */ |
| | | private Integer isEmpty; |
| | | |
| | | /** |
| | | * 建筑用途 |
| | | */ |
| | | private String constructPurpose; |
| | | |
| | | /** |
| | | * 建筑面积 |
| | | */ |
| | | private BigDecimal constructArea; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 小区id |
| | | */ |
| | | private Long villageId; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComMngPopulationHouseDO{" + |
| | | "id=" + id + |
| | | ", address=" + address + |
| | | ", code=" + code + |
| | | ", alley=" + alley + |
| | | ", houseNum=" + houseNum + |
| | | ", status=" + status + |
| | | ", purpose=" + purpose + |
| | | ", controlStatus=" + controlStatus + |
| | | ", isEmpty=" + isEmpty + |
| | | ", constructPurpose=" + constructPurpose + |
| | | ", constructArea=" + constructArea + |
| | | ", createAt=" + createAt + |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:53 |
| | | * @describe 房屋居住信息关联表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_mng_population_house_user") |
| | | public class ComMngPopulationHouseUserDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 实有人口id |
| | | */ |
| | | private Long populId; |
| | | |
| | | /** |
| | | * 实有房屋id |
| | | */ |
| | | private Long houseId; |
| | | |
| | | /** |
| | | * 与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他) |
| | | */ |
| | | private Integer relation; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComMngPopulationHouseUserDO{" + |
| | | "id=" + id + |
| | | ", populId=" + populId + |
| | | ", houseId=" + houseId + |
| | | ", createAt=" + createAt + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | private Integer houseNum; |
| | | private String houseNum; |
| | | /** |
| | | * 小区(组) |
| | | */ |
| | |
| | | * 街道id |
| | | */ |
| | | private Long streetId; |
| | | |
| | | /** |
| | | * 小区类型(1.城镇 2.农村 3.未知) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 小区地址 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.CascadeHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:31 |
| | | * @describe 社区管理》小区管理》实有房屋服务类 |
| | | */ |
| | | public interface ComMngPopulationHouseService extends IService<ComMngPopulationHouseDO> { |
| | | |
| | | /** |
| | | * 查询房屋级联菜单 |
| | | * @param cascadeHouseDTO 请求参数 |
| | | * @return 菜单列表 |
| | | */ |
| | | R getCascadeHouseAddress(CascadeHouseDTO cascadeHouseDTO); |
| | | |
| | | /** |
| | | * 分页查询房屋列表 |
| | | * @param populationHouseAdminDTO 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | R getPageHouse(ComMngPopulationHouseAdminDTO populationHouseAdminDTO); |
| | | |
| | | /** |
| | | * 根据id查询实有房屋信息 |
| | | * @param houseId 房屋id |
| | | * @return 房屋信息 |
| | | */ |
| | | R getHouseDetail(Long houseId); |
| | | |
| | | /** |
| | | * 编辑实有房屋信息 |
| | | * @param houseEditAdminDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | R editHouse(ComMngPopulationHouseEditAdminDTO houseEditAdminDTO); |
| | | |
| | | /** |
| | | * 根据房屋id列表删除房屋信息 |
| | | * @param Ids 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteHouses(List<Long> Ids); |
| | | |
| | | /** |
| | | * 实有房屋统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | R getHouseTotalByAdmin(Long communityId); |
| | | |
| | | /** |
| | | * 根据社区id查询社区所有省市区 |
| | | * @param communityId 社区id |
| | | * @return 社区所在省市区 |
| | | */ |
| | | R getRegion(Long communityId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:53 |
| | | * @describe 房屋居住信息关联表服务类 |
| | | */ |
| | | public interface ComMngPopulationHouseUserService extends IService<ComMngPopulationHouseUserDO> { |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId); |
| | | R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception; |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * @param editComMngPopulationVO |
| | | * @param populationEditDTO |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R editPopulation(EditComMngPopulationVO editComMngPopulationVO, Long communityId); |
| | | R editPopulation(ComMngPopulationEditDTO populationEditDTO, Long communityId) throws Exception; |
| | | |
| | | /** |
| | | * 分页查询特殊群体 |
| | |
| | | * @return |
| | | */ |
| | | R editUserElectronicFile(UserElectronicFileVO userElectronicFileVO); |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | R getPopulationTotalByAdmin(Long communityId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R editVillage(Long villageId, ComMngVillageVO comMngVillageVO); |
| | | |
| | | /** |
| | | * 统计社区内小区数量 |
| | | * @param communityId 社区id |
| | | * @return 统计小区数量 |
| | | */ |
| | | R villageStatistics(Long communityId); |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * @param villageId 小区id |
| | | * @return 小区详情 |
| | | */ |
| | | R getVillage(Long villageId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.CascadeHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngCascadeHouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationHouseDetailAdminVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationHouseTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationHouseUserAdminVO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationHouseDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationHouseUserDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:31 |
| | | * @describe 社区管理》小区管理》实有房屋服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComMngPopulationHouseServiceImpl extends ServiceImpl<ComMngPopulationHouseDAO, ComMngPopulationHouseDO> implements ComMngPopulationHouseService { |
| | | |
| | | @Resource |
| | | private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO; |
| | | |
| | | /** |
| | | * 查询房屋级联菜单 |
| | | * @param cascadeHouseDTO 请求参数 |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public R getCascadeHouseAddress(CascadeHouseDTO cascadeHouseDTO){ |
| | | List<ComMngCascadeHouseVO> cascadeHouseVOList = new ArrayList<>(); |
| | | |
| | | ComMngPopulationHouseDO houseDO = null; |
| | | if(cascadeHouseDTO.getHouseId() != null){ |
| | | houseDO = this.baseMapper.selectById(cascadeHouseDTO.getHouseId()); |
| | | } |
| | | |
| | | switch (cascadeHouseDTO.getLevel()){ |
| | | case 1: |
| | | cascadeHouseVOList = this.baseMapper.getHouseLevelByAlley(cascadeHouseDTO.getCommunityId(),cascadeHouseDTO.getVillageId()); |
| | | cascadeHouseVOList = cascadeHouseVOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley()))), ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getAlley()); |
| | | }); |
| | | break; |
| | | case 2: |
| | | if(houseDO != null){ |
| | | cascadeHouseVOList = this.baseMapper.getHouseLevelByHouseNum(houseDO.getAlley(),cascadeHouseDTO.getCommunityId(),cascadeHouseDTO.getVillageId()); |
| | | cascadeHouseVOList = cascadeHouseVOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley() + ";" + o.getHouseNum()))), ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getHouseNum()); |
| | | }); |
| | | } |
| | | break; |
| | | case 3: |
| | | if(houseDO != null) { |
| | | cascadeHouseVOList = this.baseMapper.getHouseLevelByFloor(houseDO.getAlley(), houseDO.getHouseNum(), cascadeHouseDTO.getCommunityId(),cascadeHouseDTO.getVillageId()); |
| | | cascadeHouseVOList = cascadeHouseVOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley() + ";" + o.getHouseNum() + ";" + o.getFloor()))), ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getFloor()); |
| | | }); |
| | | } |
| | | break; |
| | | case 4: |
| | | if(houseDO != null) { |
| | | cascadeHouseVOList = this.baseMapper.getHouseLevelByUnitNo(houseDO.getAlley(), houseDO.getHouseNum(), houseDO.getFloor(), cascadeHouseDTO.getCommunityId(),cascadeHouseDTO.getVillageId()); |
| | | cascadeHouseVOList = cascadeHouseVOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley() + ";" + o.getHouseNum() + ";" + o.getFloor() + ";" + o.getUnitNo()))), ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getUnitNo()); |
| | | }); |
| | | } |
| | | break; |
| | | case 5: |
| | | if(houseDO != null) { |
| | | cascadeHouseVOList = this.baseMapper.getHouseLevelByHouseNo(houseDO.getAlley(), houseDO.getHouseNum(), houseDO.getFloor(), houseDO.getUnitNo(), cascadeHouseDTO.getCommunityId(),cascadeHouseDTO.getVillageId()); |
| | | cascadeHouseVOList = cascadeHouseVOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley() + ";" + o.getHouseNum() + ";" + o.getFloor() + ";" + o.getUnitNo() + ";" + o.getHouseNo()))), ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getHouseNo()); |
| | | }); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return R.ok(cascadeHouseVOList); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询房屋列表 |
| | | * @param populationHouseAdminDTO 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | @Override |
| | | public R getPageHouse(ComMngPopulationHouseAdminDTO populationHouseAdminDTO){ |
| | | |
| | | if(populationHouseAdminDTO.getHouseId() != null){ |
| | | ComMngPopulationHouseDO houseDO = this.baseMapper.selectById(populationHouseAdminDTO.getHouseId()); |
| | | if(houseDO != null){ |
| | | switch (populationHouseAdminDTO.getLevel()){ |
| | | case 1: |
| | | populationHouseAdminDTO.setRoad(houseDO.getAlley()); |
| | | break; |
| | | case 2: |
| | | populationHouseAdminDTO.setRoad(houseDO.getAlley()); |
| | | populationHouseAdminDTO.setDoorNo(houseDO.getHouseNum()); |
| | | break; |
| | | case 3: |
| | | populationHouseAdminDTO.setRoad(houseDO.getAlley()); |
| | | populationHouseAdminDTO.setDoorNo(houseDO.getHouseNum()); |
| | | populationHouseAdminDTO.setFloor(houseDO.getFloor()); |
| | | break; |
| | | case 4: |
| | | populationHouseAdminDTO.setRoad(houseDO.getAlley()); |
| | | populationHouseAdminDTO.setDoorNo(houseDO.getHouseNum()); |
| | | populationHouseAdminDTO.setFloor(houseDO.getFloor()); |
| | | populationHouseAdminDTO.setUnitNo(houseDO.getUnitNo()); |
| | | break; |
| | | case 5: |
| | | populationHouseAdminDTO.setRoad(houseDO.getAlley()); |
| | | populationHouseAdminDTO.setDoorNo(houseDO.getHouseNum()); |
| | | populationHouseAdminDTO.setFloor(houseDO.getFloor()); |
| | | populationHouseAdminDTO.setUnitNo(houseDO.getUnitNo()); |
| | | populationHouseAdminDTO.setHouseNo(houseDO.getHouseNo()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(this.baseMapper.getPageHouse(new Page(populationHouseAdminDTO.getPageNum(),populationHouseAdminDTO.getPageSize()),populationHouseAdminDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询实有房屋信息 |
| | | * @param houseId 房屋id |
| | | * @return 房屋信息 |
| | | */ |
| | | @Override |
| | | public R getHouseDetail(Long houseId){ |
| | | ComMngPopulationHouseDetailAdminVO houseDetailAdminVO = this.baseMapper.getHouseDetail(houseId); |
| | | if(houseDetailAdminVO != null){ |
| | | //查询房屋下住户信息 |
| | | List<ComMngPopulationHouseUserAdminVO> houseUserList = comMngPopulationHouseUserDAO.getHouseUserByHouseId(houseDetailAdminVO.getId()); |
| | | if(!houseUserList.isEmpty()){ |
| | | houseDetailAdminVO.setHouseUserList(houseUserList); |
| | | } |
| | | } |
| | | return R.ok(houseDetailAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑实有房屋信息 |
| | | * @param houseEditAdminDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | public R editHouse(ComMngPopulationHouseEditAdminDTO houseEditAdminDTO){ |
| | | |
| | | //查询实有房屋信息 |
| | | ComMngPopulationHouseDO houseDO = this.baseMapper.selectById(houseEditAdminDTO.getHouseId()); |
| | | if(houseDO == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | |
| | | BeanUtils.copyProperties(houseEditAdminDTO,houseDO); |
| | | houseDO.setUpdateAt(new Date()); |
| | | if(this.baseMapper.updateById(houseDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据房屋id列表删除房屋信息 |
| | | * @param Ids 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deleteHouses(List<Long> Ids){ |
| | | if(this.baseMapper.deleteBatchIds(Ids) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 实有房屋统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R getHouseTotalByAdmin(Long communityId){ |
| | | ComMngPopulationHouseTotalVO houseTotalVO = new ComMngPopulationHouseTotalVO(); |
| | | if(communityId != null){ |
| | | houseTotalVO = this.baseMapper.getHouseTotalByAdmin(communityId); |
| | | } |
| | | return R.ok(houseTotalVO); |
| | | } |
| | | |
| | | /** |
| | | * 根据社区id查询社区所有省市区 |
| | | * @param communityId 社区id |
| | | * @return 社区所在省市区 |
| | | */ |
| | | @Override |
| | | public R getRegion(Long communityId){ |
| | | return R.ok(this.baseMapper.getRegion(communityId)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationHouseUserDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-18 09:26:53 |
| | | * @describe 房屋居住信息关联表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComMngPopulationHouseUserServiceImpl extends ServiceImpl<ComMngPopulationHouseUserDAO, ComMngPopulationHouseUserDO> implements ComMngPopulationHouseUserService { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.base.Joiner; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.PopulIsOksEnum; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.PayUtil; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.crypto.BadPaddingException; |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComActVillageDAO comActVillageDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseDAO comMngPopulationHouseDAO; |
| | | @Resource |
| | | private ComStreetDAO comStreetDAO; |
| | | @Resource |
| | | private ComMngCarDAO comMngCarDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseUserService comMngPopulationHouseUserService; |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | |
| | | if (ObjectUtils.isEmpty(comMngPopulationDO)) { |
| | | return R.fail("用户信息不存在"); |
| | | } |
| | | if(StringUtils.isNotEmpty(comMngPopulationDO.getBirthday())){//计算年龄 |
| | | comMngPopulationDO.setAge(AgeUtils.getAgeFromBirthTimes(comMngPopulationDO.getBirthday())); |
| | | } |
| | | |
| | | ComMngPopulationVO comMngPopulationVO = new ComMngPopulationVO(); |
| | | BeanUtils.copyProperties(comMngPopulationDO, comMngPopulationVO); |
| | | |
| | | //查询户主关系信息 |
| | | List<ComHouseMemberVo> comMngFamilyInfoVOS = populationDAO.listHouseMermberByUserId(comMngPopulationDO); |
| | | List<ComHouseMemberVo> comMngFamilyInfoVOS = populationDAO.listHouseMermberByUserId(comMngPopulationDO.getHouseId(),comMngPopulationDO.getId()); |
| | | if (!comMngFamilyInfoVOS.isEmpty()) { |
| | | comMngPopulationVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | |
| | | comMngPopulationVO.setFamilyInfoVOList(familyInfoVOList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //查询当前用户房屋信息 |
| | | List<ComMngHouseVo> houseList = comMngPopulationHouseDAO.getPopulHouseListByPopulId(populationId); |
| | | if(!houseList.isEmpty()){ |
| | | houseList.forEach(house ->{ |
| | | |
| | | }); |
| | | comMngPopulationVO.setHouseList(houseList); |
| | | } |
| | | |
| | | //查询当前实有人口车辆信息 |
| | | List<ComMngPopulationCarVO> carList = comMngCarDAO.getPopulationCarListByIdCard(comMngPopulationDO.getCardNo()); |
| | | if(!carList.isEmpty()){ |
| | | comMngPopulationVO.setCarList(carList); |
| | | } |
| | | return R.ok(comMngPopulationVO); |
| | | } |
| | |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO); |
| | | iPage.getRecords().forEach(vo->{ |
| | | //获取用户生日 |
| | | String date = vo.getCardNo().substring(6, 14); |
| | | String year = date.substring(0,4); |
| | | String month = date.substring(4,6); |
| | | String day = date.substring(6,8); |
| | | String birthday = year + "-" + month + "-" + day; |
| | | //设置用户年龄 |
| | | vo.setBirthday(birthday); |
| | | if(!iPage.getRecords().isEmpty()){ |
| | | iPage.getRecords().forEach(populDO -> { |
| | | if(StringUtils.isNotEmpty(populDO.getBirthday())){ |
| | | populDO.setAge(AgeUtils.getAgeFromBirthTimes(populDO.getBirthday())); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception{ |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | List<ComMngPopulationDO> comMngPopulationDOS = populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getActId, communityId)); |
| | | //查询该社区所有(实有房屋)小区 |
| | | // List<ComMngVillageDO> villageDOList = comActVillageDAO.selectList(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getCommunityId, communityId)); |
| | | //查询该社区 |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | ArrayList<ComMngPopulationDO> populationDOList = Lists.newArrayList(); |
| | | int index = 2; |
| | | for (ComMngPopulationServeExcelVO vo : list) { |
| | | //判断DB和exel数据重复判断 |
| | | boolean result = comMngPopulationDOS.stream().anyMatch(population -> population.getCardNo().equals(vo.getCardNo())); |
| | | if (result) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("导入实有人口已存在(" + vo.getCardNo() + ")"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | // return R.fail(501,"导入实有人口已存在(" + vo.getCardNo() + ")"); |
| | | //查询该社区的省市区地址 |
| | | AreaAddressVO areaAddressVO = populationDAO.getAreaAddress(comActDO.getProvinceCode(),comActDO.getCityCode(),comActDO.getAreaCode()); |
| | | //查询社区上街道信息 |
| | | String street = ""; |
| | | if(comActDO.getStreetId() != null){ |
| | | ComStreetDO streetDO = comStreetDAO.selectById(comActDO.getStreetId()); |
| | | if(streetDO != null){ |
| | | street = streetDO.getName(); |
| | | } |
| | | |
| | | ComMngPopulationDO comMngPopulationDO = new ComMngPopulationDO(); |
| | | } |
| | | int index = 2; |
| | | //处理实有人口信息 |
| | | List<ComMngPopulationDO> savePopulList = new ArrayList<>(); |
| | | List<ComMngPopulationHouseDO> saveHouseList = new ArrayList<>(); |
| | | for (ComMngPopulationServeExcelVO vo : list) { |
| | | String address = ""; |
| | | //查询街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | // ComMngVillageDO comMngVillageDO = villageDOList.stream().filter(village -> village.getAlley().equals(vo.getRoad()) && village.getHouseNum().equals(Integer.valueOf(vo.getDoorNo()))).findFirst().orElse(null); |
| | | BeanUtils.copyProperties(vo, comMngPopulationDO); |
| | | if (comMngVillageDO == null) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("查无:" + vo.getRoad() + "小区/房租地址,请先新建地址"); |
| | | importErrorVO.setErrorMsg("查无:" + vo.getRoad() + vo.getDoorNo() + "小区/房租地址,请先新建地址"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第7、8列"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | |
| | | address = areaAddressVO.getProvince() + areaAddressVO.getCity() |
| | | + areaAddressVO.getDistrict() + street + comMngVillageDO.getAlley() + comMngVillageDO.getHouseNum() + "号" |
| | | + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); |
| | | vo.setAddress(address); |
| | | |
| | | //先判断房屋是否存在 |
| | | ComMngPopulationHouseDO populationHouseDO = comMngPopulationHouseDAO.selectOne(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getCommunityId,communityId).eq(ComMngPopulationHouseDO::getVillageId,comMngVillageDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,vo.getFloor()).eq(ComMngPopulationHouseDO::getUnitNo,vo.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,vo.getHouseNo())); |
| | | if(populationHouseDO == null){ |
| | | boolean isExits = true; |
| | | if(!saveHouseList.isEmpty()){ |
| | | for (ComMngPopulationHouseDO saveHouse:saveHouseList){ |
| | | if(saveHouse.getVillageId().equals(comMngVillageDO.getVillageId()) |
| | | && saveHouse.getFloor().equals(vo.getFloor()) && saveHouse.getUnitNo().equals(vo.getUnitNo()) |
| | | && saveHouse.getHouseNo().equals(vo.getHouseNo())){ |
| | | populationHouseDO = saveHouse; |
| | | isExits = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if(isExits){ |
| | | //查询该房屋未建立,执行建立房屋信息 |
| | | populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationHouseDO.setCommunityId(communityId); |
| | | populationHouseDO.setFloor(vo.getFloor()); |
| | | populationHouseDO.setUnitNo(vo.getUnitNo()); |
| | | populationHouseDO.setHouseNo(vo.getHouseNo()); |
| | | populationHouseDO.setAddress(address); |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | } |
| | | if(vo.getHouseStatus() != null){ |
| | | populationHouseDO.setStatus(vo.getHouseStatus()); |
| | | } |
| | | if(vo.getHousePurpose() != null){ |
| | | populationHouseDO.setPurpose(vo.getHousePurpose()); |
| | | } |
| | | if(vo.getControlStatus() != null){ |
| | | populationHouseDO.setControlStatus(vo.getControlStatus()); |
| | | } |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | saveHouseList.add(populationHouseDO); |
| | | } |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | //空户处理完房屋信息,直接返回 |
| | | continue; |
| | | } |
| | | |
| | | //判断实有人口是否已存在 |
| | | ComMngPopulationDO populationDO = this.baseMapper.selectOne(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getCardNo,AESUtil.encrypt128(vo.getCardNo(), aesKey)).eq(ComMngPopulationDO::getName,vo.getName())); |
| | | if(populationDO == null){ |
| | | if(savePopulList.size() > 0){ |
| | | String name = vo.getName(); |
| | | String cardNo = AESUtil.encrypt128(vo.getCardNo(), aesKey); |
| | | if(savePopulList.stream().anyMatch(populDo -> name.equals(populDo.getName()) && cardNo.equals(populDo.getCardNo()))){ |
| | | //实有人口已存在,判断录入的这个房屋信息是否是用户的居住地 |
| | | for (ComMngPopulationDO savePopul:savePopulList) { |
| | | if(savePopul.getName().equals(name) && savePopul.getCardNo().equals(cardNo)){ |
| | | if(vo.getIsResidence() != null && vo.getIsResidence().equals(PopulIsOksEnum.YES.getCode())) { |
| | | savePopul.setRoad(vo.getRoad()); |
| | | savePopul.setDoorNo(vo.getDoorNo()); |
| | | savePopul.setFloor(vo.getFloor()); |
| | | savePopul.setUnitNo(vo.getUnitNo()); |
| | | savePopul.setHouseNo(vo.getHouseNo()); |
| | | savePopul.setHouseAddress(vo.getAddress()); |
| | | savePopul.setHouseId(populationHouseDO.getId()); |
| | | savePopul.setCardNo(cardNo); |
| | | savePopul.setPhone(AESUtil.encrypt128(savePopul.getPhone(), aesKey)); |
| | | this.baseMapper.updateById(savePopul); |
| | | } |
| | | populationDO = savePopul; |
| | | break; |
| | | } |
| | | } |
| | | }else{ |
| | | //不存在实有人口则新增 |
| | | populationDO = new ComMngPopulationDO(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | comMngPopulationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | comMngPopulationDO.setActId(comActDO.getCommunityId()); |
| | | comMngPopulationDO.setStreetId(comActDO.getStreetId()); |
| | | comMngPopulationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | comMngPopulationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDOList.add(comMngPopulationDO); |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDO.setHouseAddress(address); |
| | | populationDO.setHouseId(populationHouseDO.getId()); |
| | | this.baseMapper.insert(populationDO); |
| | | savePopulList.add(populationDO); |
| | | index++; |
| | | } |
| | | }else { |
| | | //不存在实有人口则新增 |
| | | populationDO = new ComMngPopulationDO(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDO.setHouseAddress(address); |
| | | populationDO.setHouseId(populationHouseDO.getId()); |
| | | this.baseMapper.insert(populationDO); |
| | | savePopulList.add(populationDO); |
| | | index++; |
| | | } |
| | | }else { |
| | | //实有人口已存在,判断录入的这个房屋信息是否是用户的居住地 |
| | | if(vo.getIsResidence() != null && vo.getIsResidence().equals(PopulIsOksEnum.YES.getCode())){ |
| | | populationDO.setRoad(vo.getRoad()); |
| | | populationDO.setDoorNo(vo.getDoorNo()); |
| | | populationDO.setFloor(vo.getFloor()); |
| | | populationDO.setUnitNo(vo.getUnitNo()); |
| | | populationDO.setHouseNo(vo.getHouseNo()); |
| | | populationDO.setHouseAddress(address); |
| | | populationDO.setCardNo(AESUtil.encrypt128(populationDO.getCardNo(), aesKey)); |
| | | populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey)); |
| | | populationDO.setHouseId(populationHouseDO.getId()); |
| | | this.baseMapper.updateById(populationDO); |
| | | } |
| | | } |
| | | |
| | | //处理实有房屋居住信息 |
| | | if(populationDO != null){ |
| | | ComMngPopulationHouseUserDO populationHouseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>() |
| | | .lambda().eq(ComMngPopulationHouseUserDO::getHouseId,populationHouseDO.getId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,populationDO.getId())); |
| | | if(populationHouseUserDO == null){ |
| | | populationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | populationHouseUserDO.setHouseId(populationHouseDO.getId()); |
| | | populationHouseUserDO.setPopulId(populationDO.getId()); |
| | | populationHouseUserDO.setRelation(populationDO.getRelation()); |
| | | comMngPopulationHouseUserDAO.insert(populationHouseUserDO); |
| | | } |
| | | } |
| | | } |
| | | //如果有错误,返回错误 |
| | | //暂时注释,等客户完成任务需要恢复 |
| | |
| | | } |
| | | this.saveBatch(populationDOList);*/ |
| | | |
| | | this.saveBatch(populationDOList); |
| | | if(!populationImportErrorVOList.isEmpty()){ |
| | | return R.fail(JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | return R.ok("共计导入实有人口数量:" + populationDOList.size()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deletePopulations(List<Long> Ids) { |
| | | if(!Ids.isEmpty()){ |
| | | Ids.forEach(id -> { |
| | | //清除用户房屋居住信息 |
| | | comMngPopulationHouseUserDAO.deletePopulationHouseByUserId(id); |
| | | }); |
| | | } |
| | | int delete = populationDAO.deleteBatchIds(Ids); |
| | | if (delete > 0) { |
| | | return R.ok(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R editPopulation(EditComMngPopulationVO vo, Long communityId) { |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | public R editPopulation(ComMngPopulationEditDTO vo, Long communityId) throws Exception{ |
| | | ComMngPopulationDO populationDO = populationDAO.selectById(vo.getId()); |
| | | if(populationDO==null){ |
| | | return R.fail(); |
| | | } |
| | | String cardNo = populationDO.getCardNo(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | try { |
| | | //TODO 修改拦截器时候需要维护加密操作 |
| | | if(!cardNo.equals(vo.getCardNo())){//判断是否修改身份证号码 |
| | | //判断要修改的身份证号码是否已存在 |
| | | ComMngPopulationDO cardNoDO = populationDAO.selectOne(new QueryWrapper<ComMngPopulationDO>() |
| | | .lambda().eq(ComMngPopulationDO::getCardNo,vo.getCardNo())); |
| | | if(cardNoDO != null){ |
| | | return R.fail("您输入的身份证已存在,请重新输入"); |
| | | } |
| | | populationDO.setCardNo(AESUtil.encrypt128(vo.getCardNo(), aesKey)); |
| | | }else{ |
| | | populationDO.setCardNo(AESUtil.encrypt128(cardNo, aesKey)); |
| | | } |
| | | populationDO.setCardNo(null); |
| | | populationDO.setPhone(AESUtil.encrypt128(vo.getPhone(), aesKey)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | if (comMngVillageDO == null) { |
| | | return R.fail("街道巷:" + vo.getRoad() + vo.getDoorNo() + "不存在!"); |
| | | // throw new ServiceException("街道巷:" + vo.getRoad() + "不存在!"); |
| | | } |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | if(comActDO != null){ |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | } |
| | | |
| | | //查询当前用户所有房屋id |
| | | List<Long> houseIds = comMngPopulationHouseUserDAO.getPopulationHouseIdByUserId(vo.getId()); |
| | | //清除用户房屋居住信息 |
| | | comMngPopulationHouseUserDAO.deletePopulationHouseByUserId(vo.getId()); |
| | | if(!houseIds.isEmpty()){ |
| | | houseIds.forEach(houseId -> { |
| | | //查询当前房屋下是否有人口信息,如果没有则将房屋设置为空户 |
| | | List<Long> oldHouseIds = comMngPopulationHouseUserDAO.getPopulationHouseIdByhHosueId(houseId); |
| | | if(oldHouseIds.isEmpty()){ |
| | | //修改房屋信息为空户 |
| | | comMngPopulationHouseDAO.updateHouseByIsEmpty(houseId,1); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | //更新用户的房屋信息 |
| | | Long houseId = null; |
| | | List<ComMngPopulationHouseUserDO> populationHouseUserDOList = new ArrayList<>(); |
| | | if(!vo.getHouseEditDTOList().isEmpty()){ |
| | | for (ComMngPopulationHouseEditDTO houseEditDto:vo.getHouseEditDTOList()) { |
| | | ComMngPopulationHouseUserDO populationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | populationHouseUserDO.setPopulId(populationDO.getId()); |
| | | populationHouseUserDO.setHouseId(houseEditDto.getId()); |
| | | if(houseEditDto.getIsResidence().equals(ComMngPopulationHouseEditDTO.isResidence.yes)){ |
| | | houseId = houseEditDto.getId();//居住地 |
| | | } |
| | | populationHouseUserDOList.add(populationHouseUserDO); |
| | | |
| | | //修改房屋信息不为空户 |
| | | comMngPopulationHouseDAO.updateHouseByIsEmpty(houseEditDto.getId(),2); |
| | | } |
| | | } |
| | | comMngPopulationHouseUserService.saveBatch(populationHouseUserDOList); |
| | | |
| | | if(houseId != null){//居住地更新 |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(houseId); |
| | | if(houseDO != null){ |
| | | populationDO.setRoad(houseDO.getAlley()); |
| | | populationDO.setDoorNo(houseDO.getHouseNum()); |
| | | populationDO.setFloor(houseDO.getFloor()); |
| | | populationDO.setUnitNo(houseDO.getUnitNo()); |
| | | populationDO.setHouseNo(houseDO.getHouseNo()); |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().lambda() |
| | | .eq(ComMngVillageDO::getAlley,houseDO.getAlley()).eq(ComMngVillageDO::getHouseNum,houseDO.getHouseNum()) |
| | | .eq(ComMngVillageDO::getCommunityId,communityId)); |
| | | if (comMngVillageDO != null) { |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | if(!StringUtils.isEmpty(comMngVillageDO.getGroupAt())){ |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | populationDO.setUpdateAt(new Date()); |
| | | // this.updateById(populationDO); |
| | | if(populationDAO.updateById(populationDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | |
| | | populationDAO.updateSysUserElectronicFile(userElectronicFileVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R getPopulationTotalByAdmin(Long communityId){ |
| | | return R.ok(this.baseMapper.getPopulationTotalByAdmin(communityId)); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // List<ComMngPopulationHouseUserDO> distinctClass = populationHouseUserDOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPopulId() + ";" + o.getHouseId() + ";" + o.getId() + ";" + o.getRelation()))), ArrayList::new)); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationHouseDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.service.ComMngVillageService; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | ComActDAO comActDAO; |
| | | @Resource |
| | | ComMngPopulationDAO populationDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseDAO comMngPopulationHouseDAO; |
| | | |
| | | @Override |
| | | public R addComActVillage(ComMngVillageVO comMngVillageVO) { |
| | |
| | | return R.fail("社区没有绑定街道,请绑定后操作!"); |
| | | } |
| | | comMngVillageDO.setStreetId(comActDO.getStreetId()); |
| | | comMngVillageDO.setUpdateAt(new Date()); |
| | | int insert = comActVillageDAO.insert(comMngVillageDO); |
| | | if (insert > 0) { |
| | | param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley()); |
| | | param.eq(ComMngVillageDO::getHouseNum, comMngVillageVO.getHouseNum()); |
| | | ComMngVillageDO comMngVillageDO1 = comActVillageDAO.selectOne(param); |
| | | BeanUtils.copyProperties(comMngVillageDO1, comMngVillageVO); |
| | | // param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley()); |
| | | // param.eq(ComMngVillageDO::getHouseNum, comMngVillageVO.getHouseNum()); |
| | | // ComMngVillageDO comMngVillageDO1 = comActVillageDAO.selectOne(param); |
| | | BeanUtils.copyProperties(comMngVillageDO, comMngVillageVO); |
| | | return R.ok(comMngVillageVO); |
| | | } |
| | | return R.fail(); |
| | |
| | | |
| | | @Override |
| | | public R pageComActVillage(PageComMngVillageDTO pageComMngVillageDTO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = pageComMngVillageDTO.getPageNum(); |
| | | Long pageSize = pageComMngVillageDTO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | LambdaQueryWrapper<ComMngVillageDO> userLambdaQueryWrapper = Wrappers.lambdaQuery(); |
| | | if(pageComMngVillageDTO.getCommunityId() != null){ |
| | | userLambdaQueryWrapper.eq(ComMngVillageDO::getCommunityId,pageComMngVillageDTO.getCommunityId()); |
| | |
| | | if (pageComMngVillageDTO.getAlley() != null) { |
| | | userLambdaQueryWrapper.like(ComMngVillageDO::getAlley, pageComMngVillageDTO.getAlley()); |
| | | } |
| | | Page userPage = new Page(pageNum, pageSize); |
| | | if (StringUtils.isNotEmpty(pageComMngVillageDTO.getHouseNum())) { |
| | | userLambdaQueryWrapper.eq(ComMngVillageDO::getHouseNum, pageComMngVillageDTO.getHouseNum()); |
| | | } |
| | | if (StringUtils.isNotEmpty(pageComMngVillageDTO.getGroupAt())) { |
| | | userLambdaQueryWrapper.eq(ComMngVillageDO::getGroupAt, pageComMngVillageDTO.getGroupAt()); |
| | | } |
| | | if(pageComMngVillageDTO.getType() != null){ |
| | | userLambdaQueryWrapper.eq(ComMngVillageDO::getType, pageComMngVillageDTO.getType()); |
| | | } |
| | | Page userPage = new Page(pageComMngVillageDTO.getPageNum(), pageComMngVillageDTO.getPageSize()); |
| | | IPage<ComMngVillageDO> doPager = comActVillageDAO.selectPage(userPage, userLambdaQueryWrapper.orderByDesc(ComMngVillageDO::getCreateAt)); |
| | | return R.ok(doPager); |
| | | |
| | | IPage<ComMngVillageVO> villageVOIPage = new Page<>(); |
| | | villageVOIPage.setCurrent(doPager.getCurrent()); |
| | | villageVOIPage.setPages(doPager.getPages()); |
| | | villageVOIPage.setSize(doPager.getSize()); |
| | | villageVOIPage.setTotal(doPager.getTotal()); |
| | | if(!doPager.getRecords().isEmpty()){ |
| | | List<ComMngVillageVO> villageVOList = new ArrayList<>(); |
| | | //统计小区下的数据 |
| | | doPager.getRecords().forEach(village -> { |
| | | ComMngVillageVO villageVO = new ComMngVillageVO(); |
| | | BeanUtils.copyProperties(village,villageVO); |
| | | //查询小区统计数据 |
| | | ComMngVillageVO villageTotal = comActVillageDAO.getStatisticsCount(village.getVillageId()); |
| | | if(villageTotal != null){ |
| | | villageVO.setFloorTotal(villageTotal.getFloorTotal()); |
| | | villageVO.setCarTotal(villageTotal.getCarTotal()); |
| | | villageVO.setHouseTotal(villageTotal.getHouseTotal()); |
| | | villageVO.setPopulationTotal(villageTotal.getPopulationTotal()); |
| | | } |
| | | villageVOList.add(villageVO); |
| | | |
| | | }); |
| | | villageVOIPage.setRecords(villageVOList); |
| | | } |
| | | return R.ok(villageVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R delecComActVillage(List<Long> Ids) { |
| | | LambdaQueryWrapper<ComMngPopulationHouseDO> paramHouseWrapper = Wrappers.lambdaQuery(); |
| | | paramHouseWrapper.in(ComMngPopulationHouseDO::getVillageId,Ids); |
| | | List<ComMngPopulationHouseDO> populationHouseDOList = comMngPopulationHouseDAO.selectList(paramHouseWrapper); |
| | | if (!populationHouseDOList.isEmpty()) { |
| | | return R.fail("无法删除,已绑定实有房屋!"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<ComMngPopulationDO> paramWrapper = Wrappers.lambdaQuery(); |
| | | paramWrapper.in(ComMngPopulationDO::getVillageId, Ids); |
| | | ComMngPopulationDO mngPopulationDO = populationDAO.selectOne(paramWrapper); |
| | | if (mngPopulationDO != null) { |
| | | List<ComMngPopulationDO> mngPopulationDOList = populationDAO.selectList(paramWrapper); |
| | | if (!mngPopulationDOList.isEmpty()) { |
| | | return R.fail("无法删除,已绑定实有人口!"); |
| | | } |
| | | int delete = comActVillageDAO.deleteBatchIds(Ids); |
| | |
| | | return R.fail("街路巷第" + index + "行为空!"); |
| | | } |
| | | //判断DB和exel数据重复判断 |
| | | boolean result = comMngVillageDOs.stream().anyMatch(village -> village.getAlley().equals(vo.getAlley()) && village.getHouseNum().intValue() == vo.getHouseNum().intValue()); |
| | | boolean result = comMngVillageDOs.stream().anyMatch(village -> village.getAlley().equals(vo.getAlley()) && village.getHouseNum().equals(vo.getHouseNum())); |
| | | if (result) { |
| | | return R.fail("导入街路巷已存在(" + vo.getAlley() + ")"); |
| | | } |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 统计社区内小区数量 |
| | | * @param communityId 社区id |
| | | * @return 统计小区数量 |
| | | */ |
| | | @Override |
| | | public R villageStatistics(Long communityId){ |
| | | return R.ok(this.baseMapper.getVillageStatisticsCount(communityId)); |
| | | } |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * @param villageId 小区id |
| | | * @return 小区详情 |
| | | */ |
| | | @Override |
| | | public R getVillage(Long villageId){ |
| | | return R.ok(this.baseMapper.getVillageById(villageId)); |
| | | } |
| | | } |