1
0

3 コミット cefaad3271 ... 8f3f20cc3a

作者 SHA1 メッセージ 日付
  Newspaper 8f3f20cc3a 补贴项目 3 ヶ月 前
  Newspaper b899bae0a4 补贴项目 3 ヶ月 前
  Newspaper bf4be173a0 1 4 ヶ月 前
29 ファイル変更737 行追加298 行削除
  1. 0 33
      app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java
  2. 0 32
      app-admin/src/main/java/com/ruoyi/web/controller/system/PersonInfoController.java
  3. 0 32
      app-admin/src/main/java/com/ruoyi/web/controller/system/ProjectsController.java
  4. 43 0
      app-admin/src/main/java/com/ruoyi/web/controller/system/SubsidyProjectsController.java
  5. 52 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/SubsidyProjects/SubsidyProjectsQueryRequest.java
  6. 2 42
      app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoQueryRequest.java
  7. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/entity/HouseInfo.java
  8. 50 0
      app-admin/src/main/java/com/ruoyi/web/domain/entity/PersonHouseRelation.java
  9. 82 0
      app-admin/src/main/java/com/ruoyi/web/domain/entity/SubsidyProjects.java
  10. 5 10
      app-admin/src/main/java/com/ruoyi/web/domain/vo/HouseInfoVO.java
  11. 0 2
      app-admin/src/main/java/com/ruoyi/web/domain/vo/PersonInfoVO.java
  12. 16 0
      app-admin/src/main/java/com/ruoyi/web/mapper/PersonHouseRelationMapper.java
  13. 15 0
      app-admin/src/main/java/com/ruoyi/web/mapper/SubsidyProjectsMapper.java
  14. 0 8
      app-admin/src/main/java/com/ruoyi/web/service/HouseInfoService.java
  15. 12 0
      app-admin/src/main/java/com/ruoyi/web/service/PersonHouseRelationService.java
  16. 14 10
      app-admin/src/main/java/com/ruoyi/web/service/PersonInfoService.java
  17. 0 8
      app-admin/src/main/java/com/ruoyi/web/service/ProjectsService.java
  18. 31 0
      app-admin/src/main/java/com/ruoyi/web/service/SubsidyProjectsService.java
  19. 55 53
      app-admin/src/main/java/com/ruoyi/web/service/impl/HouseInfoServiceImpl.java
  20. 21 0
      app-admin/src/main/java/com/ruoyi/web/service/impl/PersonHouseRelationServiceImpl.java
  21. 39 31
      app-admin/src/main/java/com/ruoyi/web/service/impl/PersonInfoServiceImpl.java
  22. 0 23
      app-admin/src/main/java/com/ruoyi/web/service/impl/ProjectsServiceImpl.java
  23. 114 0
      app-admin/src/main/java/com/ruoyi/web/service/impl/SubsidyProjectsServiceImpl.java
  24. 1 1
      app-admin/src/main/resources/mapper/web/HouseholdInfoMapper.xml
  25. 20 0
      app-admin/src/main/resources/mapper/web/PersonHouseRelationMapper.xml
  26. 1 1
      app-admin/src/main/resources/mapper/web/PersonInfoMapper.xml
  27. 117 0
      app-common/src/main/java/com/ruoyi/common/utils/SecureSensitiveUtils.java
  28. 5 5
      app-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
  29. 41 6
      sql/sql.sql

+ 0 - 33
app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java

@@ -25,39 +25,6 @@ public class HouseInfoController {
     private HouseInfoService houseInfoService;
 
     /**
-     * 根据 id 查询房屋信息
-     *
-     * @param id
-     * @return
-     */
-    @ApiOperation("根据 id 查询房屋信息")
-    @GetMapping("/get")
-    public AjaxResult getHouseById(Long id) {
-        System.out.println(1);
-        if (id <= 0) {
-            return error("请求参数异常");
-        }
-        HouseInfo houseInfo = houseInfoService.getById(id);
-        if (houseInfo == null) {
-            return success("未查到数据");
-        }
-        return success(houseInfo);
-    }
-
-    /**
-     * 查询房屋信息列表
-     *
-     * @param houseInfoQueryRequest
-     * @return
-     */
-    @ApiOperation("查询房屋信息列表")
-    @PostMapping("/list")
-    public AjaxResult listHouseInfo(@RequestBody HouseInfoQueryRequest houseInfoQueryRequest) {
-        List<HouseInfoVO> houseInfoVOList = houseInfoService.getHouseInfo(houseInfoQueryRequest);
-        return success(houseInfoVOList);
-    }
-
-    /**
      * 分页获取房屋列表  mybatis-plus
      *
      * @param houseInfoQueryRequest

+ 0 - 32
app-admin/src/main/java/com/ruoyi/web/controller/system/PersonInfoController.java

@@ -27,38 +27,6 @@ public class PersonInfoController{
     private PersonInfoService personInfoService;
 
     /**
-     * 根据 id 查询人员信息
-     *
-     * @param id
-     * @return
-     */
-    @ApiOperation("根据 id 查询人员信息")
-    @GetMapping("/get")
-    public AjaxResult getPersonById(Long id) {
-        if (id <= 0) {
-            return error("请求参数异常");
-        }
-        PersonInfo personInfo = personInfoService.getById(id);
-        if (personInfo == null){
-            return success("未查到数据");
-        }
-        return success(personInfo);
-    }
-
-    /**
-     * 查询人员信息列表
-     *
-     * @param personInfoQueryRequest
-     * @return
-     */
-    @ApiOperation("查询人员信息列表")
-    @PostMapping("/list")
-    public AjaxResult listPersonInfo(@RequestBody PersonInfoQueryRequest personInfoQueryRequest) {
-        List<PersonInfoVO> personInfoVOList = personInfoService.getPersonInfo(personInfoQueryRequest);
-        return success(personInfoVOList);
-    }
-
-    /**
      * 分页获取人员列表  mybatis-plus
      *
      * @param personInfoQueryRequest

+ 0 - 32
app-admin/src/main/java/com/ruoyi/web/controller/system/ProjectsController.java

@@ -25,38 +25,6 @@ public class ProjectsController {
     private ProjectsService projectsService;
 
     /**
-     * 根据 id 查询项目信息
-     *
-     * @param id
-     * @return
-     */
-    @ApiOperation("根据 id 查询项目信息")
-    @GetMapping("/get")
-    public AjaxResult getProjectsById(Long id) {
-        if (id <= 0) {
-            return error("请求参数异常");
-        }
-        Projects projects = projectsService.getById(id);
-        if (projects == null){
-            return success("未查到数据");
-        }
-        return success(projects);
-    }
-
-    /**
-     * 查询项目信息列表
-     *
-     * @param projectsQueryRequest
-     * @return
-     */
-    @ApiOperation("查询项目信息列表")
-    @PostMapping("/list")
-    public AjaxResult listProjects(@RequestBody ProjectsQueryRequest projectsQueryRequest) {
-        List<ProjectsVO> projectsVOList = projectsService.getProjects(projectsQueryRequest);
-        return success(projectsVOList);
-    }
-
-    /**
      * 分页获取项目列表  mybatis-plus
      *
      * @param projectsQueryRequest

+ 43 - 0
app-admin/src/main/java/com/ruoyi/web/controller/system/SubsidyProjectsController.java

@@ -0,0 +1,43 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.domain.dto.SubsidyProjects.SubsidyProjectsQueryRequest;
+import com.ruoyi.web.domain.entity.SubsidyProjects;
+import com.ruoyi.web.service.SubsidyProjectsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+@Api("补贴-项目信息管理")
+@RestController
+@RequestMapping("/system/subsidy/projects")
+public class SubsidyProjectsController {
+
+    @Autowired
+    private SubsidyProjectsService subsidyProjectsService;
+
+    /**
+     * 分页获取补贴-项目列表
+     *
+     * @param subsidyProjectsQueryRequest
+     * @return
+     */
+    @ApiOperation("分页获取补贴-项目列表")
+    @PostMapping("/list/page")
+    public AjaxResult listSubsidyProjectsByPage(@RequestBody SubsidyProjectsQueryRequest subsidyProjectsQueryRequest) {
+        if (subsidyProjectsQueryRequest == null) {
+            return error("请求参数为空");
+        }
+        Page<SubsidyProjects> listSubsidyProjectsByPage = subsidyProjectsService.getListSubsidyProjectsByPage(subsidyProjectsQueryRequest);
+        return success(listSubsidyProjectsByPage);
+    }
+
+}

+ 52 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/SubsidyProjects/SubsidyProjectsQueryRequest.java

@@ -0,0 +1,52 @@
+package com.ruoyi.web.domain.dto.SubsidyProjects;
+
+import com.ruoyi.web.common.PageRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 补贴-项目查询请求
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class SubsidyProjectsQueryRequest extends PageRequest implements Serializable {
+    /**
+     * 序号ID
+     */
+    private Integer id;
+
+    /**
+     * 补贴类别
+     */
+    private String subsidyType;
+
+    /**
+     * 姓名
+     */
+    private String realname;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 开始时间
+     */
+    private Date startDate;
+
+    /**
+     * 结束时间
+     */
+    private Date endDate;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    private static final long serialVersionUID = 1L;
+}

+ 2 - 42
app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoQueryRequest.java

@@ -24,31 +24,11 @@ public class HouseInfoQueryRequest extends PageRequest implements Serializable {
     private Integer id;
 
     /**
-     * 房屋编号(如FW0000580689)
-     */
-    private String houseCode;
-
-    /**
-     * 所属行政村ID
-     */
-    private Integer villageId;
-
-    /**
-     * 所属行政村名称
-     */
-    private String villageName;
-
-    /**
      * 门牌号
      */
     private String doorplateNumber;
 
     /**
-     * 房屋详细地址
-     */
-    private String houseAddress;
-
-    /**
      * 房主人员ID
      */
     private Integer houseOwnerId;
@@ -59,34 +39,14 @@ public class HouseInfoQueryRequest extends PageRequest implements Serializable {
     private String houseOwnerName;
 
     /**
-     * 房主身份证号
-     */
-    private String idCard;
-
-    /**
-     * 房主电话
-     */
-    private String phone;
-
-    /**
-     * 房屋性质:1-自建房,2-商铺,3-公租房
-     */
-    private Integer houseType;
-
-    /**
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
     private Integer houseCategory;
 
     /**
-     * 宅基地面积(㎡)
-     */
-    private BigDecimal buildingArea;
-
-    /**
-     * 所属网格ID
+     * 所属网格
      */
-    private Integer gridId;
+    private Integer grid;
 
     /**
      * 家庭标签(JSON数组)

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/entity/HouseInfo.java

@@ -31,7 +31,7 @@ public class HouseInfo implements Serializable {
     private String doorplateNumber;
 
     /**
-     * 房屋详细地址
+     * 房屋地址
      */
     private String houseAddress;
 

+ 50 - 0
app-admin/src/main/java/com/ruoyi/web/domain/entity/PersonHouseRelation.java

@@ -0,0 +1,50 @@
+package com.ruoyi.web.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 人员房屋关系表
+ * @TableName person_house_relation
+ */
+@TableName(value ="person_house_relation")
+@Data
+public class PersonHouseRelation implements Serializable {
+    /**
+     * ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 人员ID
+     */
+    private Integer personId;
+
+    /**
+     * 房屋ID
+     */
+    private Integer houseId;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标志
+     */
+    @TableLogic
+    private String delFlag;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 82 - 0
app-admin/src/main/java/com/ruoyi/web/domain/entity/SubsidyProjects.java

@@ -0,0 +1,82 @@
+package com.ruoyi.web.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 补贴项目管理表
+ *
+ * @TableName subsidy_projects
+ */
+@TableName(value = "subsidy_projects")
+@Data
+public class SubsidyProjects implements Serializable {
+    /**
+     * 序号ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 补贴类别
+     */
+    private String subsidyType;
+
+    /**
+     * 姓名
+     */
+    private String realname;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 实发金额(元)
+     */
+    private BigDecimal subsidyAmount;
+
+    /**
+     * 银行账号SHA-256哈希(加密存储)
+     */
+    private String bankAccount;
+
+    /**
+     * 兑现时间
+     */
+    private Date paymentDate;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标志
+     */
+    @TableLogic
+    private String delFlag;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 5 - 10
app-admin/src/main/java/com/ruoyi/web/domain/vo/HouseInfoVO.java

@@ -51,11 +51,6 @@ public class HouseInfoVO implements Serializable {
     private Integer remainingPoints;
 
     /**
-     * 房屋性质:1-自建房,2-商铺,3-公租房
-     */
-    private Integer houseType;
-
-    /**
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
     private Integer houseCategory;
@@ -71,6 +66,11 @@ public class HouseInfoVO implements Serializable {
     private String grid;
 
     /**
+     * 成员数量
+     */
+    private Integer memberCount;
+
+    /**
      * 照片URL
      */
     private String photoUrl;
@@ -81,11 +81,6 @@ public class HouseInfoVO implements Serializable {
     private String houseTags;
 
     /**
-     * 门牌二维码图片URL
-     */
-    private String qrCodeUrl;
-
-    /**
      * 创建时间
      */
     private Date createTime;

+ 0 - 2
app-admin/src/main/java/com/ruoyi/web/domain/vo/PersonInfoVO.java

@@ -1,7 +1,5 @@
 package com.ruoyi.web.domain.vo;
 
-import com.baomidou.mybatisplus.annotation.*;
-import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 import java.io.Serializable;

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/mapper/PersonHouseRelationMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.domain.entity.PersonHouseRelation;
+
+/**
+ * @Entity generator.domain.PersonHouseRelation
+ */
+public interface PersonHouseRelationMapper extends BaseMapper<PersonHouseRelation> {
+
+}
+
+
+
+

+ 15 - 0
app-admin/src/main/java/com/ruoyi/web/mapper/SubsidyProjectsMapper.java

@@ -0,0 +1,15 @@
+package com.ruoyi.web.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.domain.entity.SubsidyProjects;
+
+/**
+ * @Entity generator.domain.SubsidyProjects
+ */
+public interface SubsidyProjectsMapper extends BaseMapper<SubsidyProjects> {
+
+}
+
+
+
+

+ 0 - 8
app-admin/src/main/java/com/ruoyi/web/service/HouseInfoService.java

@@ -15,14 +15,6 @@ import java.util.List;
  */
 public interface HouseInfoService extends IService<HouseInfo> {
     /**
-     * 查询人员信息列表
-     *
-     * @param houseInfoQueryRequest
-     * @return
-     */
-    List<HouseInfoVO> getHouseInfo(HouseInfoQueryRequest houseInfoQueryRequest);
-
-    /**
      * 分页获取人员列表
      *
      * @param houseInfoQueryRequest

+ 12 - 0
app-admin/src/main/java/com/ruoyi/web/service/PersonHouseRelationService.java

@@ -0,0 +1,12 @@
+package com.ruoyi.web.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.domain.entity.PersonHouseRelation;
+
+/**
+ *
+ */
+public interface PersonHouseRelationService extends IService<PersonHouseRelation> {
+
+}

+ 14 - 10
app-admin/src/main/java/com/ruoyi/web/service/PersonInfoService.java

@@ -7,20 +7,10 @@ import com.ruoyi.web.domain.dto.person.PersonInfoQueryRequest;
 import com.ruoyi.web.domain.entity.PersonInfo;
 import com.ruoyi.web.domain.vo.PersonInfoVO;
 
-import java.util.List;
-
 /**
  *
  */
 public interface PersonInfoService extends IService<PersonInfo> {
-
-    /**
-     * 查询人员信息列表
-     * @param personInfoQueryRequest
-     * @return
-     */
-    List<PersonInfoVO> getPersonInfo(PersonInfoQueryRequest personInfoQueryRequest);
-
     /**
      * 分页获取人员列表
      * @param personInfoQueryRequest
@@ -35,4 +25,18 @@ public interface PersonInfoService extends IService<PersonInfo> {
      * @return
      */
     QueryWrapper<PersonInfo> getQueryWrapper(PersonInfoQueryRequest personInfoQueryRequest) ;
+
+    /**
+     * 解密身份证
+     * @param idCard
+     * @return
+     */
+    String decryptIdCard(String idCard);
+
+    /**
+     * 加密身份证
+     * @param idCard
+     * @return
+     */
+    String encryptIdCard(String idCard);
 }

+ 0 - 8
app-admin/src/main/java/com/ruoyi/web/service/ProjectsService.java

@@ -15,14 +15,6 @@ import java.util.List;
  */
 public interface ProjectsService extends IService<Projects> {
     /**
-     * 查询项目信息列表
-     *
-     * @param projectsQueryRequest
-     * @return
-     */
-    List<ProjectsVO> getProjects(ProjectsQueryRequest projectsQueryRequest);
-
-    /**
      * 分页获取项目列表
      *
      * @param projectsQueryRequest

+ 31 - 0
app-admin/src/main/java/com/ruoyi/web/service/SubsidyProjectsService.java

@@ -0,0 +1,31 @@
+package com.ruoyi.web.service;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.domain.dto.SubsidyProjects.SubsidyProjectsQueryRequest;
+import com.ruoyi.web.domain.entity.SubsidyProjects;
+
+
+/**
+ *
+ */
+public interface SubsidyProjectsService extends IService<SubsidyProjects> {
+    /**
+     * 分页获取补贴-项目列表
+     *
+     * @param subsidyProjectsQueryRequest
+     * @return
+     */
+    Page<SubsidyProjects> getListSubsidyProjectsByPage(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest);
+
+
+    /**
+     * 获取查询条件
+     *
+     * @param subsidyProjectsQueryRequest
+     * @return
+     */
+    QueryWrapper<SubsidyProjects> getQueryWrapper(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest);
+}

+ 55 - 53
app-admin/src/main/java/com/ruoyi/web/service/impl/HouseInfoServiceImpl.java

@@ -3,23 +3,25 @@ package com.ruoyi.web.service.impl;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.SecureSensitiveUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.web.domain.dto.house.HouseInfoQueryRequest;
 import com.ruoyi.web.domain.entity.HouseInfo;
-import com.ruoyi.web.domain.entity.HouseholdInfo;
+import com.ruoyi.web.domain.entity.PersonHouseRelation;
 import com.ruoyi.web.domain.entity.PersonInfo;
 import com.ruoyi.web.domain.vo.HouseInfoVO;
 import com.ruoyi.web.domain.vo.PersonInfoVO;
 import com.ruoyi.web.mapper.HouseInfoMapper;
 import com.ruoyi.web.service.HouseInfoService;
+import com.ruoyi.web.service.PersonHouseRelationService;
 import com.ruoyi.web.service.PersonInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.math.BigDecimal;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,38 +35,11 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
     @Autowired
     private PersonInfoService personInfoService;
 
-    /**
-     * 查询人员信息列表
-     *
-     * @param houseInfoQueryRequest
-     * @return
-     */
-    @Override
-    public List<HouseInfoVO> getHouseInfo(HouseInfoQueryRequest houseInfoQueryRequest) {
-        HouseInfo houseInfoQuery = new HouseInfo();
-        if (houseInfoQueryRequest != null) {
-            BeanUtils.copyProperties(houseInfoQueryRequest, houseInfoQuery);
-        }
-        QueryWrapper<HouseInfo> queryWrapper = new QueryWrapper<>(houseInfoQuery);
-        List<HouseInfo> houseInfoList = this.list(queryWrapper);
-        // houseOwnerId
-        return houseInfoList.stream().map(houseInfo -> {
-            // 通过房主id 查询房主信息 填充返回
-            HouseInfoVO houseInfoVO = new HouseInfoVO();
-            BeanUtils.copyProperties(houseInfo, houseInfoVO);
-
-            Integer houseOwnerId = houseInfo.getHouseOwnerId();
-            PersonInfo houseOwnerInfo = personInfoService.getById(houseOwnerId);
-            PersonInfoVO houseOwnerInfoVO = new PersonInfoVO();
-            BeanUtils.copyProperties(houseOwnerInfo, houseOwnerInfoVO);
-
-            houseInfoVO.setHouseOwnerInfo(houseOwnerInfoVO);
-            return houseInfoVO;
-        }).collect(Collectors.toList());
-    }
+    @Autowired
+    private PersonHouseRelationService personHouseRelationService;
 
     /**
-     * 分页获取人员列表
+     * 分页获取房屋列表
      *
      * @param houseInfoQueryRequest
      * @return
@@ -73,6 +48,7 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
     public Page<HouseInfoVO> getListHouseInfoByPage(HouseInfoQueryRequest houseInfoQueryRequest) {
         long current = houseInfoQueryRequest.getCurrent();
         long size = houseInfoQueryRequest.getPageSize();
+        // 1. 分页查询房屋基础信息
         Page<HouseInfo> houseInfoPage = this.page(new Page<>(current, size),
                 getQueryWrapper(houseInfoQueryRequest));
 
@@ -82,16 +58,32 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
 
         // 3. 处理每条记录
         List<HouseInfoVO> viewList = houseInfoPage.getRecords().stream().map(houseInfo -> {
-            // 通过房主id 查询房主信息 填充返回
             HouseInfoVO houseInfoVO = new HouseInfoVO();
             BeanUtils.copyProperties(houseInfo, houseInfoVO);
 
+            // 通过关联表 获取 成员数量
+            Integer houseInfoId = houseInfo.getId();
+            Integer memberCount = personHouseRelationService.lambdaQuery()
+                    .eq(PersonHouseRelation::getHouseId, houseInfoId)
+                    .count()
+                    .intValue();
+            houseInfoVO.setMemberCount(memberCount);
+
+            // 通过房主id 查询房主信息 填充返回
             Integer houseOwnerId = houseInfo.getHouseOwnerId();
-            PersonInfo houseOwnerInfo = personInfoService.getById(houseOwnerId);
             PersonInfoVO houseOwnerInfoVO = new PersonInfoVO();
-            BeanUtils.copyProperties(houseOwnerInfo, houseOwnerInfoVO);
-
-            houseInfoVO.setHouseOwnerInfo(houseOwnerInfoVO);
+            if (houseOwnerId != null) {
+                PersonInfo houseOwnerInfo = personInfoService.getById(houseOwnerId);
+                BeanUtils.copyProperties(houseOwnerInfo, houseOwnerInfoVO);
+                // 获取 房主 身份证 解密 脱敏
+                String idCard = houseOwnerInfoVO.getIdCard();
+                idCard = personInfoService.decryptIdCard(idCard);
+                houseOwnerInfoVO.setIdCard(SecureSensitiveUtils.maskIdCard(idCard));
+                // 手机号脱敏
+                String phone = houseOwnerInfoVO.getPhone();
+                houseOwnerInfoVO.setPhone(SecureSensitiveUtils.maskPhone(phone));
+                houseInfoVO.setHouseOwnerInfo(houseOwnerInfoVO);
+            }
             return houseInfoVO;
         }).collect(Collectors.toList());
         resultPage.setRecords(viewList);
@@ -99,6 +91,8 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
     }
 
 
+
+
     /**
      * 获取查询条件
      *
@@ -114,39 +108,47 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
 
         // 从对象中取值
         Integer id = houseInfoQueryRequest.getId();
-        String houseCode = houseInfoQueryRequest.getHouseCode();
-        Integer villageId = houseInfoQueryRequest.getVillageId();
-        String villageName = houseInfoQueryRequest.getVillageName();
         String doorplateNumber = houseInfoQueryRequest.getDoorplateNumber();
-        String houseAddress = houseInfoQueryRequest.getHouseAddress();
         Integer houseOwnerId = houseInfoQueryRequest.getHouseOwnerId();
         String houseOwnerName = houseInfoQueryRequest.getHouseOwnerName();
-        String idCard = houseInfoQueryRequest.getIdCard();
-        String phone = houseInfoQueryRequest.getPhone();
-        Integer houseType = houseInfoQueryRequest.getHouseType();
         Integer houseCategory = houseInfoQueryRequest.getHouseCategory();
-        BigDecimal buildingArea = houseInfoQueryRequest.getBuildingArea();
-        Integer gridId = houseInfoQueryRequest.getGridId();
+        Integer grid = houseInfoQueryRequest.getGrid();
         List<String> houseTags = houseInfoQueryRequest.getHouseTags();
         String sortField = houseInfoQueryRequest.getSortField();
         String sortOrder = houseInfoQueryRequest.getSortOrder();
 
-        //门牌号、房主、房屋类别、所属网格、家庭标签
+        //门牌号、房主ID、房屋类别、所属网格、家庭标签
         queryWrapper.eq(ObjectUtil.isNotEmpty(id), "id", id);
-        queryWrapper.eq(StrUtil.isNotBlank(houseCode), "house_code", houseCode);
-        queryWrapper.eq(StrUtil.isNotBlank(houseOwnerName), "houseOwner_name", houseOwnerName);
-        queryWrapper.eq(StrUtil.isNotBlank(idCard), "id_card", idCard);
-        queryWrapper.eq(StrUtil.isNotBlank(phone), "phone", phone);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(gridId), "grid_id", gridId);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(houseType), "house_type", houseType);
+        queryWrapper.eq(StrUtil.isNotBlank(doorplateNumber), "doorplate_number", doorplateNumber);
+        queryWrapper.eq(ObjectUtil.isNotEmpty(houseOwnerId), "house_owner_id", houseOwnerId);
+        queryWrapper.eq(ObjectUtil.isNotEmpty(grid), "grid", grid);
         queryWrapper.eq(ObjectUtil.isNotEmpty(houseCategory), "house_category", houseCategory);
 
+        // 房主姓名查询条件
+        if (StrUtil.isNotBlank(houseOwnerName)){
+            // 先查询符合姓名条件的人员ID列表
+            List<Integer> ownerIds = personInfoService.list(
+                    new LambdaQueryWrapper<PersonInfo>()
+                            .like(PersonInfo::getRealname, houseOwnerName)
+                            .select(PersonInfo::getId)
+            ).stream().map(PersonInfo::getId).collect(Collectors.toList());
+
+            if (!ownerIds.isEmpty()) {
+                queryWrapper.in("house_owner_id", ownerIds);
+            } else {
+                // 如果没有匹配的姓名,确保查询不到结果
+                queryWrapper.apply("1 = 0"); // 无匹配结果
+                //queryWrapper.isNull("house_owner_id");
+            }
+        }
+
         // 家庭标签 JSON 数组查询
         if (CollUtil.isNotEmpty(houseTags)) {
             for (String tag : houseTags) {
                 queryWrapper.like("house_tags", "\"" + tag + "\"");
             }
         }
+
         // 排序
         queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), sortOrder.equals("ascend"), sortField);
         return queryWrapper;

+ 21 - 0
app-admin/src/main/java/com/ruoyi/web/service/impl/PersonHouseRelationServiceImpl.java

@@ -0,0 +1,21 @@
+package com.ruoyi.web.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import com.ruoyi.web.domain.entity.PersonHouseRelation;
+import com.ruoyi.web.mapper.PersonHouseRelationMapper;
+import com.ruoyi.web.service.PersonHouseRelationService;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ */
+@Service
+public class PersonHouseRelationServiceImpl extends ServiceImpl<PersonHouseRelationMapper, PersonHouseRelation>
+    implements PersonHouseRelationService {
+
+}
+
+
+
+

+ 39 - 31
app-admin/src/main/java/com/ruoyi/web/service/impl/PersonInfoServiceImpl.java

@@ -6,24 +6,20 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
+import com.ruoyi.common.utils.SecureSensitiveUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.web.domain.dto.person.PersonInfoQueryRequest;
 import com.ruoyi.web.domain.entity.HouseInfo;
 import com.ruoyi.web.domain.entity.HouseholdInfo;
 import com.ruoyi.web.domain.entity.PersonInfo;
+import com.ruoyi.web.domain.vo.PersonInfoVO;
 import com.ruoyi.web.mapper.HouseInfoMapper;
 import com.ruoyi.web.mapper.PersonInfoMapper;
-import com.ruoyi.web.service.HouseInfoService;
 import com.ruoyi.web.service.HouseholdInfoService;
 import com.ruoyi.web.service.PersonInfoService;
-import com.ruoyi.web.domain.vo.PersonInfoVO;
-import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -35,36 +31,11 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         implements PersonInfoService {
 
     @Autowired
-    private HouseInfoService houseInfoService;
-
-    @Autowired
     private  HouseInfoMapper houseInfoMapper;
 
     @Autowired
     private HouseholdInfoService householdInfoService;
 
-
-    /**
-     * 查询人员信息列表
-     *
-     * @param personInfoQueryRequest
-     * @return
-     */
-    @Override
-    public List<PersonInfoVO> getPersonInfo(PersonInfoQueryRequest personInfoQueryRequest) {
-        PersonInfo personInfoQuery = new PersonInfo();
-        if (personInfoQueryRequest != null) {
-            BeanUtils.copyProperties(personInfoQueryRequest, personInfoQuery);
-        }
-        QueryWrapper<PersonInfo> queryWrapper = new QueryWrapper<>(personInfoQuery);
-        List<PersonInfo> personInfoList = this.list(queryWrapper);
-        return personInfoList.stream().map(personInfo -> {
-            PersonInfoVO personInfoVO = new PersonInfoVO();
-            BeanUtils.copyProperties(personInfo, personInfoVO);
-            return personInfoVO;
-        }).collect(Collectors.toList());
-    }
-
     /**
      * 分页获取人员列表
      *
@@ -86,6 +57,13 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         List<PersonInfoVO> viewList = personInfoPage.getRecords().stream().map(personInfo -> {
             PersonInfoVO personInfoVO = new PersonInfoVO();
             BeanUtils.copyProperties(personInfo, personInfoVO);
+            // 获取身份证号 解密 -> 脱敏
+            String idCard = personInfoVO.getIdCard();
+            idCard= this.decryptIdCard(idCard);
+            personInfoVO.setIdCard(SecureSensitiveUtils.maskIdCard(idCard));
+            // 手机号脱敏
+            String phone = personInfoVO.getPhone();
+            personInfoVO.setPhone(SecureSensitiveUtils.maskPhone(phone));
 
             // 联表查询补充数据
             if (personInfo.getHouseholdId() != null) {
@@ -168,6 +146,36 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), sortOrder.equals("ascend"), sortField);
         return queryWrapper;
     }
+
+    /**
+     * 解密身份证
+     * @param idCard
+     * @return
+     */
+    @Override
+    public String decryptIdCard(String idCard) {
+        try {
+            idCard = SecureSensitiveUtils.decrypt(idCard, SecureSensitiveUtils.generateAesKey());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return idCard;
+    }
+
+    /**
+     * 加密身份证
+     * @param idCard
+     * @return
+     */
+    @Override
+    public String encryptIdCard(String idCard) {
+        try {
+            idCard = SecureSensitiveUtils.encrypt(idCard, SecureSensitiveUtils.generateAesKey());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return idCard;
+    }
 }
 
 

+ 0 - 23
app-admin/src/main/java/com/ruoyi/web/service/impl/ProjectsServiceImpl.java

@@ -1,6 +1,5 @@
 package com.ruoyi.web.service.impl;
 
-import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -16,7 +15,6 @@ import com.ruoyi.web.service.ProjectsService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,27 +26,6 @@ public class ProjectsServiceImpl extends ServiceImpl<ProjectsMapper, Projects>
         implements ProjectsService {
 
     /**
-     * 查询项目信息列表
-     *
-     * @param projectsQueryRequest
-     * @return
-     */
-    @Override
-    public List<ProjectsVO> getProjects(ProjectsQueryRequest projectsQueryRequest) {
-        Projects projectsQuery = new Projects();
-        if (projectsQueryRequest != null) {
-            BeanUtils.copyProperties(projectsQueryRequest, projectsQuery);
-        }
-        QueryWrapper<Projects> queryWrapper = new QueryWrapper<>(projectsQuery);
-        List<Projects> projectsList = this.list(queryWrapper);
-        return projectsList.stream().map(projects -> {
-            ProjectsVO projectsVO = new ProjectsVO();
-            BeanUtils.copyProperties(projects, projectsVO);
-            return projectsVO;
-        }).collect(Collectors.toList());
-    }
-
-    /**
      * 分页获取项目列表
      *
      * @param projectsQueryRequest

+ 114 - 0
app-admin/src/main/java/com/ruoyi/web/service/impl/SubsidyProjectsServiceImpl.java

@@ -0,0 +1,114 @@
+package com.ruoyi.web.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.SecureSensitiveUtils;
+import com.ruoyi.web.domain.dto.SubsidyProjects.SubsidyProjectsQueryRequest;
+import com.ruoyi.web.domain.entity.SubsidyProjects;
+import com.ruoyi.web.mapper.SubsidyProjectsMapper;
+import com.ruoyi.web.service.PersonInfoService;
+import com.ruoyi.web.service.SubsidyProjectsService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ *
+ */
+@Service
+public class SubsidyProjectsServiceImpl extends ServiceImpl<SubsidyProjectsMapper, SubsidyProjects>
+        implements SubsidyProjectsService {
+
+    @Autowired
+    private PersonInfoService personInfoService;
+
+
+    /**
+     * 分页获取补贴-项目列表
+     *
+     * @param subsidyProjectsQueryRequest
+     * @return
+     */
+    @Override
+    public Page<SubsidyProjects> getListSubsidyProjectsByPage(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest) {
+        long current = subsidyProjectsQueryRequest.getCurrent();
+        long size = subsidyProjectsQueryRequest.getPageSize();
+        Page<SubsidyProjects> page = this.page(new Page<>(current, size),
+                getQueryWrapper(subsidyProjectsQueryRequest));
+        // 处理每条记录
+        List<SubsidyProjects> records = page.getRecords();
+        if (records != null) {
+            records.forEach(subsidyProjects -> {
+                // 解密-> 身份证 & 银行号码 -> 脱敏
+                String bankAccount = null;
+                String idCard = null;
+                try {
+                    // 解密
+                    idCard = personInfoService.decryptIdCard(subsidyProjects.getIdCard());
+                    bankAccount = SecureSensitiveUtils.decrypt(subsidyProjects.getBankAccount(), SecureSensitiveUtils.generateAesKey());
+                    // 脱敏
+                    subsidyProjects.setIdCard(SecureSensitiveUtils.maskIdCard(idCard));
+                    subsidyProjects.setBankAccount(SecureSensitiveUtils.maskBankAccount(bankAccount));
+                } catch (Exception e) {
+                    throw new RuntimeException(e.getMessage());
+                }
+            });
+        }
+        return page;
+    }
+
+    /**
+     * 获取查询条件
+     *
+     * @param subsidyProjectsQueryRequest
+     * @return
+     */
+    @Override
+    public QueryWrapper<SubsidyProjects> getQueryWrapper(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest) {
+        QueryWrapper<SubsidyProjects> queryWrapper = new QueryWrapper<>();
+        if (subsidyProjectsQueryRequest == null) {
+            return queryWrapper;
+        }
+
+        // 从对象中取值
+        Integer id = subsidyProjectsQueryRequest.getId();
+        String subsidyType = subsidyProjectsQueryRequest.getSubsidyType();
+        String realname = subsidyProjectsQueryRequest.getRealname();
+        String idCard = subsidyProjectsQueryRequest.getIdCard();
+        Date startDate = subsidyProjectsQueryRequest.getStartDate(); // 开始日期
+        Date endDate = subsidyProjectsQueryRequest.getEndDate();     // 结束日期
+        String status = subsidyProjectsQueryRequest.getStatus();
+        String sortField = subsidyProjectsQueryRequest.getSortField();
+        String sortOrder = subsidyProjectsQueryRequest.getSortOrder();
+
+
+        // 项目名称、项目描述 项目进度
+        queryWrapper.eq(ObjectUtil.isNotEmpty(id), "id", id);
+        queryWrapper.eq(StrUtil.isNotBlank(subsidyType), "subsidy_type", subsidyType);
+        queryWrapper.like(StringUtils.isNotBlank(realname), "realname", realname);
+        queryWrapper.eq(StringUtils.isNotBlank(idCard), "idCard", idCard);
+        // 日期范围查询(优先判断范围)
+        if (startDate != null && endDate != null) {
+            queryWrapper.between("payment_date", startDate, endDate);
+        } else if (startDate != null) {
+            queryWrapper.ge("payment_date", startDate); // >= 开始日期
+        } else if (endDate != null) {
+            queryWrapper.le("payment_date", endDate);   // <= 结束日期
+        }
+        queryWrapper.eq(StringUtils.isNotBlank(status), "status", status);
+
+        // 排序
+        queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), sortOrder.equals("ascend"), sortField);
+        return queryWrapper;
+    }
+}
+
+
+
+

+ 1 - 1
app-admin/src/main/resources/mapper/web/HouseholdInfoMapper.xml

@@ -8,7 +8,7 @@
             <id property="id" column="id" jdbcType="INTEGER"/>
             <result property="householdCode" column="household_code" jdbcType="VARCHAR"/>
             <result property="householdHead" column="household_head" jdbcType="VARCHAR"/>
-            <result property="householdHeadIdCard" column="household_head_id_card" jdbcType="VARCHAR"/>
+            <result property="householdHeadIdCard" column="household_head_id_card" jdbcType="CHAR"/>
             <result property="householdType" column="household_type" jdbcType="TINYINT"/>
             <result property="householdAddress" column="household_address" jdbcType="VARCHAR"/>
             <result property="belongingArea" column="belonging_area" jdbcType="VARCHAR"/>

+ 20 - 0
app-admin/src/main/resources/mapper/web/PersonHouseRelationMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.mapper.PersonHouseRelationMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.PersonHouseRelation">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="personId" column="person_id" jdbcType="INTEGER"/>
+            <result property="houseId" column="house_id" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,person_id,house_id,
+        create_time,update_time,del_flag
+    </sql>
+</mapper>

+ 1 - 1
app-admin/src/main/resources/mapper/web/PersonInfoMapper.xml

@@ -7,7 +7,7 @@
     <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.PersonInfo">
         <id property="id" column="id" jdbcType="INTEGER"/>
         <result property="realname" column="realname" jdbcType="VARCHAR"/>
-        <result property="idCard" column="id_card" jdbcType="VARCHAR"/>
+        <result property="idCard" column="id_card" jdbcType="CHAR"/>
         <result property="ethnic" column="ethnic" jdbcType="VARCHAR"/>
         <result property="age" column="age" jdbcType="TINYINT"/>
         <result property="gender" column="gender" jdbcType="TINYINT"/>

+ 117 - 0
app-common/src/main/java/com/ruoyi/common/utils/SecureSensitiveUtils.java

@@ -0,0 +1,117 @@
+package com.ruoyi.common.utils;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.GCMParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.Base64;
+
+/**
+ * 敏感信息加密工具类(符合国密标准)
+ * - 身份证号:SM3/SHA-256 不可逆哈希
+ * - 银行账号:AES-256-GCM 可逆加密
+ */
+public class SecureSensitiveUtils {
+
+    // ==================== 加密(可逆) ====================
+    private static final int AES_KEY_LENGTH = 32; // 256-bit
+    private static final int GCM_IV_LENGTH = 12; // 12 bytes
+    private static final int GCM_TAG_LENGTH = 16; // 128-bit
+
+    /**
+     * 生成AES密钥(实际应从KMS获取)
+     */
+    public static String generateAesKey() throws NoSuchAlgorithmException {
+        String key = "B1a4z9jXeD7vGmKsPq2t5w8y/A6C0bRf";
+        return Base64.getEncoder().encodeToString(key.getBytes(StandardCharsets.UTF_8));
+//        KeyGenerator keyGen = KeyGenerator.getInstance("AES");
+//        keyGen.init(AES_KEY_LENGTH * 8); // 256-bit
+//        return Base64.getEncoder().encodeToString(keyGen.generateKey().getEncoded());
+    }
+
+    /**
+     * AES-GCM加密银行账号
+     */
+    public static String encrypt(String bankAccount, String base64Key) throws Exception {
+        // 解码密钥
+        byte[] key = Base64.getDecoder().decode(base64Key);
+        SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
+
+        // 生成IV
+        byte[] iv = new byte[GCM_IV_LENGTH];
+        SecureRandom random = new SecureRandom();
+        random.nextBytes(iv);
+
+        // 配置加密器
+        Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
+        GCMParameterSpec parameterSpec = new GCMParameterSpec(GCM_TAG_LENGTH * 8, iv);
+        cipher.init(Cipher.ENCRYPT_MODE, keySpec, parameterSpec);
+
+        // 加密数据
+        byte[] ciphertext = cipher.doFinal(bankAccount.getBytes(StandardCharsets.UTF_8));
+
+        // 组合IV+密文
+        byte[] combined = new byte[iv.length + ciphertext.length];
+        System.arraycopy(iv, 0, combined, 0, iv.length);
+        System.arraycopy(ciphertext, 0, combined, iv.length, ciphertext.length);
+
+        return Base64.getEncoder().encodeToString(combined);
+    }
+
+    /**
+     * AES-GCM解密银行账号
+     */
+    public static String decrypt(String encrypted, String base64Key) throws Exception {
+        // 解码密钥
+        byte[] key = Base64.getDecoder().decode(base64Key);
+        SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
+
+        // 解码数据
+        byte[] combined = Base64.getDecoder().decode(encrypted);
+        byte[] iv = new byte[GCM_IV_LENGTH];
+        System.arraycopy(combined, 0, iv, 0, iv.length);
+
+        // 配置解密器
+        Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
+        GCMParameterSpec parameterSpec = new GCMParameterSpec(GCM_TAG_LENGTH * 8, iv);
+        cipher.init(Cipher.DECRYPT_MODE, keySpec, parameterSpec);
+
+        // 解密数据
+        byte[] ciphertext = new byte[combined.length - GCM_IV_LENGTH];
+        System.arraycopy(combined, GCM_IV_LENGTH, ciphertext, 0, ciphertext.length);
+        return new String(cipher.doFinal(ciphertext), StandardCharsets.UTF_8);
+    }
+
+    // ==================== 辅助方法 ====================
+    /**
+     * 银行账号脱敏显示(如:6217****1234)
+     */
+    public static String maskBankAccount(String fullAccount) {
+        if (fullAccount == null || fullAccount.length() < 8) {
+            return fullAccount;
+        }
+        return fullAccount.substring(0, 4) + "****" + fullAccount.substring(fullAccount.length() - 4);
+    }
+
+    /**
+     * 身份证号脱敏显示(如:500108********71**)
+     */
+    public static String maskIdCard(String idCard) {
+        if (idCard == null || idCard.length() < 15) {
+            return idCard;
+        }
+        return idCard.substring(0, 6) + "********" + idCard.substring(14, 16) + "**";
+    }
+
+    /**
+     * 手机号脱敏显示(如:139****1324)
+     */
+    public static String maskPhone(String phone) {
+        if (phone == null || phone.length() < 11) {
+            return phone;
+        }
+        return phone.substring(0, 3) + "****" + phone.substring(phone.length() - 4);
+    }
+}

+ 5 - 5
app-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java

@@ -35,7 +35,7 @@ import com.ruoyi.system.domain.SysOperLog;
 
 /**
  * 操作日志记录处理
- * 
+ *
  * @author ruoyi
  */
 @Aspect
@@ -72,7 +72,7 @@ public class LogAspect
 
     /**
      * 拦截异常操作
-     * 
+     *
      * @param joinPoint 切点
      * @param e 异常
      */
@@ -134,7 +134,7 @@ public class LogAspect
 
     /**
      * 获取注解中对方法的描述信息 用于Controller层注解
-     * 
+     *
      * @param log 日志
      * @param operLog 操作日志
      * @throws Exception
@@ -162,7 +162,7 @@ public class LogAspect
 
     /**
      * 获取请求的参数,放到log中
-     * 
+     *
      * @param operLog 操作日志
      * @throws Exception 异常
      */
@@ -217,7 +217,7 @@ public class LogAspect
 
     /**
      * 判断是否需要过滤的对象。
-     * 
+     *
      * @param o 对象信息。
      * @return 如果是需要过滤的对象,则返回true;否则返回false。
      */

+ 41 - 6
sql/sql.sql

@@ -2,7 +2,7 @@
 CREATE TABLE person_info (
     id                  INT PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
     realname            VARCHAR(50) NOT NULL        COMMENT '姓名',
-    id_card             VARCHAR(18) UNIQUE          COMMENT '身份证号',
+    id_card             CHAR(64) UNIQUE          COMMENT '身份证号',
     ethnic              VARCHAR(30)                 COMMENT '民族',
     age                 TINYINT                     COMMENT '年龄',
     gender              TINYINT NOT NULL            COMMENT '性别: 1-男, 2-女, 0-未知',
@@ -11,7 +11,7 @@ CREATE TABLE person_info (
     phone               VARCHAR(20)                 COMMENT '电话',
     population_tags     VARCHAR(1024)               COMMENT '人口标签(标签 json 列表)',
     occupation          VARCHAR(50)                 COMMENT '职业',
-    grid                INT                         COMMENT '所属网格',
+    grid                VARCHAR(30)                 COMMENT '所属网格',
     education_level     VARCHAR(20)                 COMMENT '文化程度',
     marital_status      TINYINT                     COMMENT '婚姻状况: 1-未婚, 2-已婚, 3-丧偶, 4-离婚',
     political_status    VARCHAR(20)                 COMMENT '政治面貌',
@@ -37,13 +37,14 @@ CREATE TABLE household_info (
     id                    INT PRIMARY KEY AUTO_INCREMENT    COMMENT '户籍ID',
     household_code        VARCHAR(50) UNIQUE  NOT NULL      COMMENT '户籍编号',
     household_head          VARCHAR(50) NOT NULL            COMMENT '户主姓名',
-    household_head_id_card  VARCHAR(18)                     COMMENT '户主身份证号',
+    household_head_id_card  CHAR(64)                     COMMENT '户主身份证号',
     household_type          TINYINT     NOT NULL            COMMENT '户籍类型: 1-农业户口, 2-非农业户口',
     household_address       VARCHAR(200)                    COMMENT '户籍地址',
     belonging_area          VARCHAR(200)                    COMMENT '归属地区',
     house_code            VARCHAR(50)                       COMMENT '房屋编号',
-    create_time     datetime         null comment '创建时间',
-    update_time     datetime         null comment '修改时间',
+    create_time         datetime         null comment '创建时间',
+    update_time         datetime         null comment '修改时间',
+    del_flag            char default '0' null comment '删除标志',
     del_flag        char default '0' null comment '删除标志',
     INDEX idx_household_number (household_code),
     INDEX idx_household_head (household_head),
@@ -75,6 +76,18 @@ CREATE TABLE house_info (
     INDEX idx_address (house_address)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋信息表';
 
+-- 人员-房屋 关联表
+CREATE TABLE person_house_relation (
+    id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
+    person_id INT NOT NULL COMMENT '人员ID',
+    house_id INT NOT NULL COMMENT '房屋ID',
+    create_time       datetime         null comment '创建时间',
+    update_time       datetime         null comment '修改时间',
+    del_flag          char default '0' null comment '删除标志',
+    -- 联合唯一约束(防止重复关联)
+    UNIQUE KEY uk_person_house (person_id, house_id)
+) ENGINE=InnoDB COMMENT='人员房屋关系表';
+
 -- 项目表
 CREATE TABLE projects (
     id                  INT PRIMARY KEY AUTO_INCREMENT COMMENT '项目ID',
@@ -91,4 +104,26 @@ CREATE TABLE projects (
     INDEX idx_progress (progress),
     INDEX idx_name (project_name),
     INDEX idx_dates (start_date, estimated_completion_date)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目表';
+
+-- 补贴(项目管理)
+CREATE TABLE subsidy_projects (
+    id  INT PRIMARY KEY AUTO_INCREMENT                  COMMENT '序号ID',
+    project_name VARCHAR(100) NOT NULL                  COMMENT '项目名称',
+    subsidy_type VARCHAR(100) NOT NULL                  COMMENT '补贴类别',
+    realname            VARCHAR(50) NOT NULL            COMMENT '姓名',
+    id_card        CHAR(64) UNIQUE                   COMMENT '身份证号',
+    subsidy_amount DECIMAL(20,2)                        COMMENT '实发金额(元)',
+    bank_account_hash CHAR(64) NOT NULL                 COMMENT '银行账号SHA-256哈希(加密存储)',
+    payment_date DATE NOT NULL                          COMMENT '兑现时间',
+    status VARCHAR(20)      NOT NULL                    COMMENT '状态',
+    create_time     datetime         null               comment '创建时间',
+    update_time     datetime         null               comment '修改时间',
+    del_flag        char default '0' null               comment '删除标志',
+    INDEX idx_type (subsidy_type),
+    INDEX idx_name (realname),
+    INDEX idx_payment_date (payment_date),
+    INDEX idx_status (status),
+    INDEX idx_type_status (subsidy_type, status),
+    INDEX idx_type_name_date (subsidy_type, realname, payment_date)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='补贴项目管理表';