DESKTOP-71BH0QO\L、ming
2021-04-22 6065030831a79425d0550cbe5844754ab13708ae
ADD:新增实有人口编辑
1个文件已添加
6个文件已修改
350 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationVO.java 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/EditComMngPopulationVO.java 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommonDataApi.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationVO.java
@@ -49,149 +49,99 @@
    @ApiModelProperty("家庭成员(姓名)")
    @NotBlank(groups = {AddGroup.class},message = "家庭成员(姓名)不可为空")
    private String name;
    /**
     * 性别(1.男 2.女 3.未知)
     */
    @ApiModelProperty("性别(1.男 2.女 3.未知)")
    @NotBlank(groups = {AddGroup.class},message = "性别不可为空")
    private Integer sex;
    /**
     * 年龄
     */
    @ApiModelProperty("年龄")
    @NotBlank(groups = {AddGroup.class},message = "年龄不可为空")
    private Integer age;
    /**
     * 身份证号码
     */
    @ApiModelProperty("身份证号码")
    @NotBlank(groups = {AddGroup.class},message = "身份证号码不可为空")
    @EncryptDecryptField
    @Sensitive(strategy = SensitiveStrategy.ID_CARD)
    private String cardNo;
    /**
     * 街路巷
     */
    @ApiModelProperty("街路巷")
    @NotBlank(groups = {AddGroup.class},message = "街路巷不可为空")
    private String road;
    /**
     * 门牌号
     */
    @ApiModelProperty("门牌号")
    @NotBlank(groups = {AddGroup.class},message = "门牌号不可为空")
    private Integer doorNo;
    /**
     * 楼排号
     */
    @ApiModelProperty("楼排号")
    @NotBlank(groups = {AddGroup.class},message = "楼排号不可为空")
    private String floor;
    /**
     * 单元号
     */
    @ApiModelProperty("单元号")
    @NotBlank(groups = {AddGroup.class},message = "单元号不可为空")
    private Integer unitNo;
    /**
     * 户室(房间号)
     */
    @ApiModelProperty("户室(房间号)")
    @NotBlank(groups = {AddGroup.class},message = "户室(房间号)不可为空")
    private Integer houseNo;
    /**
     * 政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)
     */
    @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)")
    @NotBlank(groups = {AddGroup.class},message = "政治面貌不可为空")
    private Integer politicalOutlook;
    /**
     * 工作单位
     */
    @ApiModelProperty("工作单位")
    private String workCompany;
    /**
     * 特殊情况
     */
    @ApiModelProperty("特殊情况")
    private String specialSituation;
    /**
     * 联系方式
     */
    @ApiModelProperty("联系方式")
    @NotBlank(groups = {AddGroup.class},message = "联系方式不可为空")
    @EncryptDecryptField
    @Sensitive(strategy = SensitiveStrategy.PHONE)
    private String phone;
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remark;
    /**
     * 标签集合(多个标签以,隔开)
     */
    @ApiModelProperty("标签集合(多个标签以,隔开)")
    @ApiModelProperty("标签集合(多个标签以,隔开,如物业工作人员,物业")
    private String label;
    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private Date createAt;
    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private Date updateAt;
    /**
     * 籍贯
     */
    @ApiModelProperty("籍贯")
    private String nativePlace;
    /**
     * 民族
     */
    @ApiModelProperty("民族")
    private String nation;
    /**
     * 小区名字
     */
    @ApiModelProperty("小区名字")
    private String alley;
    /**
     * 房屋成员
     */
    @ApiModelProperty("房屋成员")
    private List<ComHouseMemberVo> comMngFamilyInfoVOS;
    /**
     * 是否租住(0.否 1.是)
     */
    @ApiModelProperty("是否租住")
    @ApiModelProperty("是否租住 是否租住(0.否 1.是)")
    @NotBlank(groups = {AddGroup.class},message = "是否租住不可为空")
    private Integer isRent;
    /**
     * 文化程度
     */
    @ApiModelProperty("文化程度")
    private String cultureLevel;
    /**
     * 婚姻状况
     */
    @ApiModelProperty("婚姻状况")
    private String marriage;
    /**
     * 健康状况
     */
    @ApiModelProperty("健康状况")
    private String healthy;
    /**
     * 性别(1.男 2.女 3.未知)
     */
    public interface sex{
        int nan = 1;
        int nv = 2;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/EditComMngPopulationVO.java
New file
@@ -0,0 +1,149 @@
package com.panzhihua.common.model.vos.community;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
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.model.vos.user.ComHouseMemberVo;
import com.panzhihua.common.validated.AddGroup;
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.Date;
import java.util.List;
/**
 * 实有人口Vo
 */
@Data
@ApiModel("实有人口表")
@EncryptDecryptClass
public class EditComMngPopulationVO implements Serializable {
    /**
     * 自增 id
     */
    @ApiModelProperty("实有人口id")
    private Long id;
    /**
     * 小区id(实有房屋id)
     */
    @ApiModelProperty("小区id(实有房屋id)")
    private Integer villageId;
    /**
     * 家庭成员(姓名)
     */
    @ApiModelProperty("家庭成员(姓名)")
    @NotBlank(groups = {AddGroup.class},message = "家庭成员(姓名)不可为空")
    private String name;
    @ApiModelProperty("性别(1.男 2.女 3.未知)")
    @NotBlank(groups = {AddGroup.class},message = "性别不可为空")
    private Integer sex;
    @ApiModelProperty("年龄")
    @NotBlank(groups = {AddGroup.class},message = "年龄不可为空")
    private Integer age;
    @NotBlank(groups = {AddGroup.class},message = "身份证号码不可为空")
    @ApiModelProperty("身份证号码")
    @EncryptDecryptField
    @Sensitive(strategy = SensitiveStrategy.ID_CARD)
    private String cardNo;
    @ApiModelProperty("街路巷")
    @NotBlank(groups = {AddGroup.class},message = "街路巷不可为空")
    private String road;
    @ApiModelProperty("门牌号")
    @NotBlank(groups = {AddGroup.class},message = "门牌号不可为空")
    private Integer doorNo;
    @ApiModelProperty("楼排号")
    @NotBlank(groups = {AddGroup.class},message = "楼排号不可为空")
    private String floor;
    @ApiModelProperty("单元号")
    @NotBlank(groups = {AddGroup.class},message = "单元号不可为空")
    private Integer unitNo;
    @ApiModelProperty("户室(房间号)")
    @NotBlank(groups = {AddGroup.class},message = "户室(房间号)不可为空")
    private Integer houseNo;
    @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)")
    @NotBlank(groups = {AddGroup.class},message = "政治面貌不可为空")
    private Integer politicalOutlook;
    @ApiModelProperty("工作单位")
    private String workCompany;
    @ApiModelProperty("特殊情况")
    private String specialSituation;
    @ApiModelProperty("联系方式")
    @NotBlank(groups = {AddGroup.class},message = "联系方式不可为空")
    @EncryptDecryptField
    @Sensitive(strategy = SensitiveStrategy.ID_CARD)
    private String phone;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("标签集合(多个标签以,隔开,如物业工作人员,物业")
    private String label;
    @ApiModelProperty("籍贯")
    private String nativePlace;
    @ApiModelProperty("民族")
    private String nation;
    @ApiModelProperty("小区名字")
    private String alley;
    @ApiModelProperty("是否租住 是否租住(0.否 1.是)")
    @NotBlank(groups = {AddGroup.class},message = "是否租住不可为空")
    private Integer isRent;
    @ApiModelProperty("文化程度")
    private String cultureLevel;
    @ApiModelProperty("婚姻状况")
    private String marriage;
    @ApiModelProperty("健康状况")
    private String healthy;
    public interface sex{
        int nan = 1;
        int nv = 2;
        int no = 3;
    }
    /**
     * 是否租住
     */
    public interface isOk{
        int yes = 1;
        int no = 0;
    }
    /**
     * 政治面貌
     */
    public interface politicalOutlook{
        int dang = 1;
        int tuan = 3;
        int wu = 12;
        int qun = 13;
        int no = 13;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -22,7 +22,6 @@
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
@@ -1629,6 +1628,7 @@
    @PostMapping("/common/data/population/detail")
    R detailPopulation(@RequestParam(value = "populationId") Long populationId);
    /**
     * 根据id修改实有人口标签列表
     *
@@ -2138,4 +2138,12 @@
     */
    @PostMapping("/shop/wxPay")
    R wxPay(@RequestBody OrderPayDTO orderPayDTO);
    /**
     * 编辑实有人口
     * @param editComMngPopulationVO
     * @return
     */
    @PostMapping("/common/data/population/edit")
    R editPopulation(@RequestBody EditComMngPopulationVO editComMngPopulationVO, @RequestParam("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommonDataApi.java
@@ -712,6 +712,13 @@
        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 = "实有人口详情", response = ComMngPopulationVO.class)
    @PostMapping("/population/detail")
    public R detailPopulation(@RequestParam(value = "populationId") Long populationId) {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
@@ -3,7 +3,6 @@
import com.panzhihua.common.model.dtos.community.*;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.service.*;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -286,6 +285,7 @@
        return comMngPopulationService.detailPopulation(populationId);
    }
    /**
     * 根据实有人口id修改标签列表
     * @param populationTagDTO 请求参数
@@ -328,4 +328,14 @@
    public R getPopulationLists(@RequestBody List<Long> Ids) {
        return comMngPopulationService.getPopulationLists(Ids);
    }
    /**
     * 编辑实有人口
     * @param editComMngPopulationVO
     * @return
     */
    @PostMapping("/population/edit")
    R editPopulation(@RequestBody EditComMngPopulationVO editComMngPopulationVO,@RequestParam("communityId") Long communityId){
        return comMngPopulationService.editPopulation(editComMngPopulationVO, communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -5,8 +5,7 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngPopulationVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import com.panzhihua.common.model.vos.community.EditComMngPopulationVO;
import java.util.List;
@@ -92,5 +91,11 @@
     */
    R getPopulationLists(List<Long> Ids);
    /**
     * 编辑实有人口
     * @param editComMngPopulationVO
     * @param communityId
     * @return
     */
    R editPopulation(EditComMngPopulationVO editComMngPopulationVO, Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -1,6 +1,5 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -10,29 +9,30 @@
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.PageComActDTO;
import com.panzhihua.common.model.helper.AESUtil;
import com.panzhihua.common.model.vos.R;
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.service_community.dao.ComActActivityDAO;
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.ComActActivityDO;
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.service_community.service.ComMngPopulationService;
import org.springframework.beans.BeanUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -46,6 +46,8 @@
    private ComActDAO comActDAO;
    @Resource
    private ComActVillageDAO comActVillageDAO;
    @Value("${domain.aesKey:}")
    private String aesKey;
    /**
@@ -304,4 +306,43 @@
        }
        return R.ok(resultList);
    }
    @Override
    public R editPopulation(EditComMngPopulationVO vo, Long communityId) {
        ComActDO comActDO = comActDAO.selectById(communityId);
        ComMngPopulationDO populationDO = populationDAO.selectById(vo.getId());
        if(populationDO==null){
            return R.fail();
        }
        BeanUtils.copyProperties(vo,populationDO);
        try {
            //TODO 修改拦截器时候需要维护加密操作
             populationDO.setCardNo(AESUtil.encrypt128(populationDO.getCardNo(), aesKey));
             populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey));
        } catch (NoSuchPaddingException e) {
            e.printStackTrace();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (InvalidKeyException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (BadPaddingException e) {
            e.printStackTrace();
        } catch (IllegalBlockSizeException e) {
            e.printStackTrace();
        }
        ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId));
        if (comMngVillageDO == null) {
            throw new ServiceException("街道巷:" + vo.getRoad() + "不存在!");
        }
        populationDO.setVillageId(comMngVillageDO.getVillageId());
        populationDO.setActId(comActDO.getCommunityId());
        populationDO.setStreetId(comActDO.getStreetId());
        populationDO.setVillageName(comMngVillageDO.getGroupAt());
        this.updateById(populationDO);
        return R.ok();
    }
}