| | |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(5))){ |
| | | |
| | | String ra = convertRelation(oneData.get(5)); |
| | | |
| | | String relation = dictMap.get(ra); |
| | | if(StringUtils.isEmpty(relation)){ |
| | | // vo.setRelationStr(ra); |
| | | // String ra = convertRelation(oneData.get(5)); |
| | | // |
| | | // String relation = dictMap.get(ra); |
| | | // if(StringUtils.isEmpty(relation)){ |
| | | //// vo.setRelationStr(ra); |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第6列"); |
| | | // importErrorVO.setErrorMsg("您填写的与户主关系有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // }else{ |
| | | // vo.setRelation(Integer.valueOf(relation)); |
| | | // } |
| | | String relation = convertMarriage(oneData.get(5)); |
| | | Integer isOk = PopulRelationEnum.getCodeByName(relation); |
| | | if(isOk.equals(-1)){ |
| | | // vo.setMarriageStr(ma); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第6列"); |
| | | importErrorVO.setErrorMsg("您填写的与户主关系有误"); |
| | |
| | | index++; |
| | | continue; |
| | | }else{ |
| | | vo.setRelation(Integer.valueOf(relation)); |
| | | vo.setRelation(isOk); |
| | | } |
| | | |
| | | } |
| | | if(StringUtils.isEmpty(oneData.get(6))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | |
| | | }else{ |
| | | if(!populationImportErrorVOList.isEmpty()){ |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | }else { |
| | | R r1 = communityService.listSavePopulationConfirm(newVoList, communityId); |
| | | } |
| | | } |
| | | } catch (NumberFormatException e) { |
| | |
| | | @NotBlank(groups = {AddGroup.class},message = "车主姓名不能为空") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "身份证号") |
| | | @NotBlank(groups = {AddGroup.class},message = "车主身份证号码不能为空") |
| | | private String cardNo; |
| | | |
| | | |
| | | @ApiModelProperty(value = "车主手机号码") |
| | | @NotBlank(groups = {AddGroup.class},message = "车主手机号码不能为空") |
| | | private String mobile; |
| | |
| | | private String userName; |
| | | |
| | | /** |
| | | * 车主身份证号码 |
| | | */ |
| | | @ExcelProperty(value = "车主身份证号码" ,index = 2) |
| | | private String cardNo; |
| | | |
| | | /** |
| | | * 品牌型号 |
| | | */ |
| | | @ExcelProperty(value = "品牌型号" ,index = 2) |
| | | @ExcelProperty(value = "品牌型号" ,index = 3) |
| | | private String brand; |
| | | |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | @ExcelProperty(value = "车牌号" ,index = 3) |
| | | @ExcelProperty(value = "车牌号" ,index = 4) |
| | | private String plateNum; |
| | | |
| | | /** |
| | | * 车身颜色 |
| | | */ |
| | | @ExcelProperty(value = "颜色" ,index = 4) |
| | | @ExcelProperty(value = "颜色" ,index = 5) |
| | | private String color; |
| | | |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ExcelProperty(value = "联系方式" ,index = 5) |
| | | @ExcelProperty(value = "联系方式" ,index = 6) |
| | | private String mobile; |
| | | |
| | | /** |
| | | * 详细住址 |
| | | */ |
| | | @ExcelProperty(value = "详细住址" ,index = 6) |
| | | @ExcelProperty(value = "详细住址" ,index = 7) |
| | | private String address; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("车主姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("车主身份证号码") |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty("车主用户ID") |
| | | private Long userId; |
| | | |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * 实有房屋id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("实有房屋id") |
| | | private Long id; |
| | | /** |
| | |
| | | @ApiModelProperty("年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty("出生年月") |
| | | private String birthDay; |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | |
| | | " t.id, " + |
| | | " t.community_id AS communityId, " + |
| | | " t1.`name` AS communityName, " + |
| | | " t.card_no AS cardNo, " + |
| | | " t.area_id AS areaId, " + |
| | | " t2.area_name AS areaName, " + |
| | | " t.user_id userId, " + |
| | |
| | | " where cmphu.house_id = #{houseId} and cmphu.popul_id != #{populId}") |
| | | List<ComHouseMemberVo> listHouseMermberByUserId(@Param("houseId") Long houseId, @Param("populId") Long populId); |
| | | |
| | | @Select("SELECT cmphu.popul_id,cmphu.relation,cmp.NAME,cmp.phone,cmp.healthy,cmp.card_no,cmp.work_company,cmp.birthday FROM com_mng_population_house_user cmphu " + |
| | | " LEFT JOIN com_mng_population cmp ON cmphu.popul_id = cmp.id " + |
| | | " WHERE cmphu.popul_id = #{populId}") |
| | | List<ComHouseMemberVo> listHouseMermberByPopuId(@Param("populId") Long populId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | "cmp.`name`, " + |
| | |
| | | "<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != ""'>" + |
| | | "AND cmp.sex = #{comMngPopulationVO.sex} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != ""'>" + |
| | | "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != "" and comMngPopulationVO.ageEndTime == null'>" + |
| | | "AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ <= ]]> #{comMngPopulationVO.ageStartTime} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != ""'>" + |
| | | "<if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != "" and comMngPopulationVO.ageStartTime == null'>" + |
| | | "AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ >= ]]> #{comMngPopulationVO.ageEndTime} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime == comMngPopulationVO.ageEndTime'>" + |
| | | "AND date_format(cmp.birthday,'%Y-%m-%d') = #{comMngPopulationVO.ageStartTime} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != ""'>" + |
| | | "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " + |
| | | " </if> " + |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | /**车主姓名*/ |
| | | private String userName; |
| | | |
| | | /**身份证号*/ |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | /**车主用户ID*/ |
| | | private Long userId; |
| | | |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngCarSaveDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportComMngCarExcelDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngCarDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarVO; |
| | |
| | | import com.panzhihua.service_community.model.dos.ComMngStructAreaDO; |
| | | import com.panzhihua.service_community.service.ComMngCarService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | private ComMngStructAreaDAO comMngStructAreaDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | | |
| | | @Override |
| | |
| | | if (ObjectUtils.isEmpty(comMngCarSaveDTO.getMobile())) { |
| | | return R.fail("车主手机号码不能为空"); |
| | | } |
| | | if (ObjectUtils.isEmpty(comMngCarSaveDTO.getCardNo())) { |
| | | return R.fail("车主身份证号码不能为空"); |
| | | } |
| | | ComMngCarDO comMngCarDO = new ComMngCarDO(); |
| | | BeanUtils.copyProperties(comMngCarSaveDTO, comMngCarDO); |
| | | comMngCarDO.setAreaName(comMngStructAreaDO.getAreaName()); |
| | | comMngCarDO.setCommunityId(comMngStructAreaDO.getCommunityId()); |
| | | try { |
| | | comMngCarDO.setCardNo(AESUtil.encrypt128(comMngCarSaveDTO.getCardNo(),aesKey)); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | comMngCarDO.setCreateAt(new Date()); |
| | | comMngCarDO.setSource(2); |
| | | R<SysUserVO> sysUserVOR = userService.getSysUserVOByPhone(comMngCarSaveDTO.getMobile()); |
| | |
| | | if (count == 0 && areaMap.containsKey(vo.getAreaName())) { |
| | | ComMngCarDO comMngCarDO = new ComMngCarDO(); |
| | | BeanUtils.copyProperties(vo, comMngCarDO); |
| | | try { |
| | | comMngCarDO.setCardNo(AESUtil.encrypt128(vo.getCardNo(),aesKey)); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | comMngCarDO.setCommunityId(communityId); |
| | | comMngCarDO.setAreaId(areaMap.get(vo.getAreaName()).getId()); |
| | | R<SysUserVO> sysUserVOR = userService.getSysUserVOByPhone(vo.getMobile()); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.base.Joiner; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | |
| | | // if (!comMngFamilyInfoVOS.isEmpty()) { |
| | | // comMngPopulationVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | // } |
| | | //查询户主关系信息 |
| | | List<ComHouseMemberVo> comMngFamilyInfoVOS = populationDAO.listHouseMermberByPopuId(comMngPopulationDO.getId()); |
| | | if (!comMngFamilyInfoVOS.isEmpty()) { |
| | | for (ComHouseMemberVo comHouseMemberVo : comMngFamilyInfoVOS){ |
| | | comHouseMemberVo.setAge(AgeUtils.getAgeFromBirthTimes(comHouseMemberVo.getBirthDay())); |
| | | } |
| | | comMngPopulationVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | | //设置户主关系 |
| | | List<ComMngPopulationHouseUserDO> comMngPopulationHouseUserDOS = comMngPopulationHouseUserDAO.selectList((new QueryWrapper<ComMngPopulationHouseUserDO>().lambda().eq(ComMngPopulationHouseUserDO::getPopulId, populationId))); |
| | | if (!comMngPopulationHouseUserDOS.isEmpty()) { |
| | |
| | | BeanUtils.copyProperties(vo, populationDO); |
| | | populationDO.setId(Snowflake.getId()); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | //查询当前社区标签列表 |
| | | List<String> list = new ArrayList<>(); |
| | | List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO.selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", comActDO.getCommunityId())); |
| | | if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { |
| | | list = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()).collect(Collectors.toList()); |
| | | } |
| | | //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 |
| | | Iterator<String> iterator = userTag.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String s = iterator.next(); |
| | | if (!list.contains(s)) |
| | | iterator.remove(); |
| | | } |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |