tangxiaobao
2021-07-19 11909203390b1207b8b43020cfd7348ec9fdfa95
社区后台基础数据库bug修改
11个文件已修改
115 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngCarSaveDTO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngCarExcelVO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngCarVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationHouseDetailAdminVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/ComHouseMemberVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngCarDAO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngCarDO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -171,11 +171,24 @@
                }
                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("您填写的与户主关系有误");
@@ -183,9 +196,8 @@
                        index++;
                        continue;
                    }else{
                        vo.setRelation(Integer.valueOf(relation));
                        vo.setRelation(isOk);
                    }
                }
                if(StringUtils.isEmpty(oneData.get(6))){
                    ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO();
@@ -434,8 +446,6 @@
            }else{
                if(!populationImportErrorVOList.isEmpty()){
                    throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList));
                }else {
                    R r1 = communityService.listSavePopulationConfirm(newVoList, communityId);
                }
            }
        } catch (NumberFormatException e) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngCarSaveDTO.java
@@ -43,6 +43,11 @@
    @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;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngCarExcelVO.java
@@ -27,33 +27,39 @@
    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;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngCarVO.java
@@ -41,6 +41,9 @@
    @ApiModelProperty("车主姓名")
    private String userName;
    @ApiModelProperty("车主身份证号码")
    private String cardNo;
    @ApiModelProperty("车主用户ID")
    private Long userId;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationHouseDetailAdminVO.java
@@ -1,6 +1,8 @@
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;
@@ -19,6 +21,7 @@
    /**
     * 实有房屋id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("实有房屋id")
    private Long id;
    /**
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/ComHouseMemberVo.java
@@ -33,6 +33,9 @@
    @ApiModelProperty("年龄")
    private Integer age;
    @ApiModelProperty("出生年月")
    private String birthDay;
    @ApiModelProperty("健康状况")
    private String healthy;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngCarDAO.java
@@ -31,6 +31,7 @@
            " 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, " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -126,6 +126,11 @@
            " 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`, " +
@@ -200,12 +205,15 @@
            "<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != &quot;&quot;'>" +
            "AND cmp.sex = #{comMngPopulationVO.sex} " +
            " </if> " +
            "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != &quot;&quot;'>" +
            "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != &quot;&quot; and comMngPopulationVO.ageEndTime == null'>" +
            "AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ <= ]]> #{comMngPopulationVO.ageStartTime} " +
            " </if> " +
            "<if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != &quot;&quot;'>" +
            "<if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != &quot;&quot; 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 != &quot;&quot;'>" +
            "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " +
            " </if> " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngCarDO.java
@@ -1,6 +1,7 @@
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;
@@ -32,6 +33,10 @@
    /**车主姓名*/
    private String userName;
    /**身份证号*/
    @EncryptDecryptField
    private String cardNo;
    /**车主用户ID*/
    private Long userId;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java
@@ -9,6 +9,7 @@
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;
@@ -23,6 +24,7 @@
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;
@@ -43,6 +45,8 @@
    private ComMngStructAreaDAO comMngStructAreaDAO;
    @Resource
    private UserService userService;
    @Value("${domain.aesKey:}")
    private String aesKey;
    @Override
@@ -112,10 +116,18 @@
        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());
@@ -161,6 +173,11 @@
            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());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -11,6 +11,7 @@
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.*;
@@ -180,6 +181,14 @@
//        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()) {
@@ -466,6 +475,19 @@
        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());