Newspaper 1 周之前
父节点
当前提交
4041312d5f
共有 65 个文件被更改,包括 739 次插入332 次删除
  1. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/DisasterReliefController.java
  2. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/EmploymentController.java
  3. 33 14
      app-admin/src/main/java/com/ruoyi/web/controller/system/EthnicActivitiesController.java
  4. 38 18
      app-admin/src/main/java/com/ruoyi/web/controller/system/EventController.java
  5. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/FacilityManagementController.java
  6. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java
  7. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/IndustryController.java
  8. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/LocalPolicyController.java
  9. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/MediaPropagandaController.java
  10. 20 2
      app-admin/src/main/java/com/ruoyi/web/controller/system/PersonInfoController.java
  11. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/ProjectsController.java
  12. 6 6
      app-admin/src/main/java/com/ruoyi/web/controller/system/SubsidyProjectsController.java
  13. 2 2
      app-admin/src/main/java/com/ruoyi/web/controller/system/VillageProfileController.java
  14. 42 2
      app-admin/src/main/java/com/ruoyi/web/controller/system/VillageServiceController.java
  15. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/VillageSpecialController.java
  16. 1 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/VillageTraditionController.java
  17. 2 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/ethnicActivities/EthnicActivitiesAddRequest.java
  18. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/ethnicActivities/EthnicActivitiesEditRequest.java
  19. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/ethnicActivities/EthnicActivitiesQueryRequest.java
  20. 0 5
      app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventAddRequest.java
  21. 0 5
      app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventEditRequest.java
  22. 7 4
      app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventHandleRequest.java
  23. 5 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventQueryRequest.java
  24. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoAddRequest.java
  25. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoEditRequest.java
  26. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoQueryRequest.java
  27. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/mediaPropaganda/MediaPropagandaAddRequest.java
  28. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/dto/mediaPropaganda/MediaPropagandaEditRequest.java
  29. 35 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/person/PersonInfoListQueryRequest.java
  30. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/entity/EthnicActivities.java
  31. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/entity/Event.java
  32. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/entity/HouseInfo.java
  33. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/entity/MediaPropaganda.java
  34. 5 0
      app-admin/src/main/java/com/ruoyi/web/domain/entity/PersonInfo.java
  35. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/vo/DisasterReliefVO.java
  36. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/vo/EthnicActivitiesVO.java
  37. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/vo/HouseInfoVO.java
  38. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/vo/MediaPropagandaVO.java
  39. 76 0
      app-admin/src/main/java/com/ruoyi/web/domain/vo/SubsidyProjectsVO.java
  40. 9 6
      app-admin/src/main/java/com/ruoyi/web/domain/vo/event/EventVO.java
  41. 2 0
      app-admin/src/main/java/com/ruoyi/web/service/EthnicActivitiesService.java
  42. 10 1
      app-admin/src/main/java/com/ruoyi/web/service/EventService.java
  43. 28 0
      app-admin/src/main/java/com/ruoyi/web/service/PersonInfoService.java
  44. 3 2
      app-admin/src/main/java/com/ruoyi/web/service/SubsidyProjectsService.java
  45. 16 0
      app-admin/src/main/java/com/ruoyi/web/service/VillageServiceService.java
  46. 2 1
      app-admin/src/main/java/com/ruoyi/web/service/impl/DisasterReliefServiceImpl.java
  47. 24 5
      app-admin/src/main/java/com/ruoyi/web/service/impl/EthnicActivitiesServiceImpl.java
  48. 110 32
      app-admin/src/main/java/com/ruoyi/web/service/impl/EventServiceImpl.java
  49. 3 3
      app-admin/src/main/java/com/ruoyi/web/service/impl/HouseInfoServiceImpl.java
  50. 2 5
      app-admin/src/main/java/com/ruoyi/web/service/impl/MediaPropagandaServiceImpl.java
  51. 83 8
      app-admin/src/main/java/com/ruoyi/web/service/impl/PersonInfoServiceImpl.java
  52. 51 34
      app-admin/src/main/java/com/ruoyi/web/service/impl/SubsidyProjectsServiceImpl.java
  53. 72 11
      app-admin/src/main/java/com/ruoyi/web/service/impl/VillageServiceServiceImpl.java
  54. 0 86
      app-admin/src/main/java/generator/domain/VillageService.java
  55. 0 15
      app-admin/src/main/java/generator/mapper/VillageServiceMapper.java
  56. 0 11
      app-admin/src/main/java/generator/service/VillageServiceService.java
  57. 0 20
      app-admin/src/main/java/generator/service/impl/VillageServiceServiceImpl.java
  58. 1 1
      app-admin/src/main/resources/application.yml
  59. 1 1
      app-admin/src/main/resources/mapper/web/EthnicActivitiesMapper.xml
  60. 1 1
      app-admin/src/main/resources/mapper/web/HouseInfoMapper.xml
  61. 1 1
      app-admin/src/main/resources/mapper/web/MediaPropagandaMapper.xml
  62. 2 1
      app-admin/src/main/resources/mapper/web/PersonInfoMapper.xml
  63. 7 0
      app-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
  64. 13 0
      app-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  65. 2 2
      sql/sql.sql

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/DisasterReliefController.java

@@ -20,7 +20,7 @@ import java.util.Map;
 /**
  * 灾情共度管理控制器
  */
-@Api("灾情共度管理")
+@Api(tags ="灾情共度管理")
 @RestController
 @RequestMapping("/system/disaster/relief")
 public class DisasterReliefController extends BaseController {

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/EmploymentController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("就业数据管理")
+@Api(tags ="就业数据管理")
 @RestController
 @RequestMapping("/system/employment")
 public class EmploymentController {

+ 33 - 14
app-admin/src/main/java/com/ruoyi/web/controller/system/EthnicActivitiesController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.web.domain.dto.ethnicActivities.EthnicActivitiesAddRequest;
 import com.ruoyi.web.domain.dto.ethnicActivities.EthnicActivitiesEditRequest;
 import com.ruoyi.web.domain.dto.ethnicActivities.EthnicActivitiesQueryRequest;
@@ -16,10 +17,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
-import static com.ruoyi.common.core.domain.AjaxResult.error;
-import static com.ruoyi.common.core.domain.AjaxResult.success;
-
-@Api("民族团结活动管理")
+@Api(tags ="民族团结活动管理")
 @RestController
 @RequestMapping("/system/ethnic/activities")
 public class EthnicActivitiesController {
@@ -37,10 +35,10 @@ public class EthnicActivitiesController {
     @PostMapping("/add")
     public AjaxResult addEthnicActivities(@RequestBody EthnicActivitiesAddRequest ethnicActivitiesAddRequest) {
         if (ethnicActivitiesAddRequest == null) {
-            return error("请求参数为空");
+            throw new ServiceException("参数为空");
         }
         Integer id = ethnicActivitiesService.addEthnicActivities(ethnicActivitiesAddRequest);
-        return success(id);
+        return AjaxResult.success(id);
     }
 
     /**
@@ -54,13 +52,13 @@ public class EthnicActivitiesController {
     public AjaxResult deleteEthnicActivities(@RequestBody Map<String, String> paramsMap) {
         String ids = paramsMap.get("ids");
         if (StrUtil.isBlank(ids)) {
-            return error("请求参数为空");
+            throw new ServiceException("参数为空");
         }
         boolean b = ethnicActivitiesService.deleteEthnicActivities(ids);
         if (b) {
-            return success("删除成功");
+            return AjaxResult.success("删除成功");
         }
-        return error("删除失败");
+        return AjaxResult.error("删除失败");
     }
 
 
@@ -74,7 +72,7 @@ public class EthnicActivitiesController {
     @PostMapping("/edit")
     public AjaxResult editFacility(@RequestBody EthnicActivitiesEditRequest ethnicActivitiesEditRequest) {
         if (ethnicActivitiesEditRequest == null) {
-            return error("请求参数为空");
+            throw new ServiceException("参数为空");
         }
         ethnicActivitiesService.editEthnicActivities(ethnicActivitiesEditRequest);
         return AjaxResult.success();
@@ -90,10 +88,10 @@ public class EthnicActivitiesController {
     @GetMapping("/get")
     public AjaxResult getEthnicActivitiesById(@RequestParam int id) {
         if (ObjectUtil.isEmpty(id)) {
-            return error("请求参数为空");
+            throw new ServiceException("参数为空");
         }
         EthnicActivitiesVO ethnicActivitiesVO = ethnicActivitiesService.getEthnicActivitiesById(id);
-        return success(ethnicActivitiesVO);
+        return AjaxResult.success(ethnicActivitiesVO);
     }
 
     /**
@@ -106,9 +104,30 @@ public class EthnicActivitiesController {
     @PostMapping("/list/page")
     public AjaxResult listEthnicActivitiesByPage(@RequestBody EthnicActivitiesQueryRequest ethnicActivitiesQueryRequest) {
         if (ethnicActivitiesQueryRequest == null) {
-            return error("请求参数为空");
+            throw new ServiceException("参数为空");
         }
         Page<EthnicActivitiesVO> listEthnicActivitiesByPageVO = ethnicActivitiesService.getListEthnicActivitiesByPage(ethnicActivitiesQueryRequest);
-        return success(listEthnicActivitiesByPageVO);
+        return AjaxResult.success(listEthnicActivitiesByPageVO);
+    }
+
+    /**
+     * 完成
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("完成民族团结活动")
+    @GetMapping("/complete")
+    public AjaxResult completeEthnicActivities(@RequestParam int id) {
+        if (id <= 0) {
+            throw new ServiceException("参数为空");
+        }
+        boolean b = ethnicActivitiesService.completeEthnicActivities(id);
+        if (b) {
+            return AjaxResult.success("完成成功");
+        }else{
+            return AjaxResult.error("完成失败");
+        }
     }
+
 }

+ 38 - 18
app-admin/src/main/java/com/ruoyi/web/controller/system/EventController.java

@@ -5,8 +5,12 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.web.domain.dto.event.*;
+import com.ruoyi.web.domain.dto.event.EventAddRequest;
+import com.ruoyi.web.domain.dto.event.EventHandleRequest;
+import com.ruoyi.web.domain.dto.event.EventQueryRequest;
+import com.ruoyi.web.domain.dto.event.EventReassignRequest;
 import com.ruoyi.web.domain.entity.Event;
+import com.ruoyi.web.domain.vo.PersonInfoVO;
 import com.ruoyi.web.domain.vo.event.EventVO;
 import com.ruoyi.web.service.EventService;
 import io.swagger.annotations.Api;
@@ -15,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -32,7 +37,7 @@ public class EventController extends BaseController {
     /**
      * 添加事件
      */
-    @ApiOperation("添加事件")
+    @ApiOperation("添加事件(村民提交事件)")
     @PostMapping("/add")
     public AjaxResult addEvent(@RequestBody EventAddRequest eventAddRequest) {
         if (eventAddRequest == null) {
@@ -59,23 +64,23 @@ public class EventController extends BaseController {
         return error("删除失败");
     }
 
-    /**
-     * 编辑事件
-     */
-    @ApiOperation("编辑事件")
-    @PutMapping("/edit")
-    public AjaxResult editEvent(@RequestBody EventEditRequest eventEditRequest) {
-        if (eventEditRequest == null) {
-            return error("请求参数为空");
-        }
-        eventService.editEvent(eventEditRequest);
-        return AjaxResult.success();
-    }
+//    /**
+//     * 编辑事件
+//     */
+//    @ApiOperation("编辑事件")
+//    @PostMapping("/edit")
+//    public AjaxResult editEvent(@RequestBody EventEditRequest eventEditRequest) {
+//        if (eventEditRequest == null) {
+//            return error("请求参数为空");
+//        }
+//        eventService.editEvent(eventEditRequest);
+//        return AjaxResult.success();
+//    }
 
     /**
      * 根据ID查询事件详情(支持管理员和负责人查询)
      */
-    @ApiOperation("查询事件详情")
+    @ApiOperation("根据ID查询事件详情(支持管理员和负责人查询)")
     @GetMapping("/get")
     public AjaxResult getEventById(@RequestParam int id) {
         if (ObjectUtil.isEmpty(id)) {
@@ -95,10 +100,25 @@ public class EventController extends BaseController {
             return error("请求参数为空");
         }
         Page<EventVO> listEventVOByPage = eventService.getListEventByPage(eventQueryRequest);
-        return success(listEventVOByPage);
+        return AjaxResult.success(listEventVOByPage);
     }
 
     /**
+     * 根据事件类型获取负责人列表(管理员)
+     */
+    @ApiOperation("根据事件类型获取负责人列表(管理员)")
+    @GetMapping("/list/user")
+    @PreAuthorize("@ss.hasPermi('system:role:admin')")
+    public AjaxResult listSysUserByType(@RequestParam Integer type) {
+        if (type == null) {
+            return error("请求参数为空");
+        }
+        List<PersonInfoVO> personInfoVOByEventType = eventService.getPersonInfoVOByEventType(type);
+        return AjaxResult.success(personInfoVOByEventType);
+    }
+
+
+    /**
      * 处理事件
      */
     @ApiOperation("处理事件")
@@ -106,13 +126,13 @@ public class EventController extends BaseController {
     public AjaxResult handleEvent(@RequestBody EventHandleRequest eventHandleRequest) {
         try {
             Integer eventId = eventHandleRequest.getEventId();
-            Integer personId = eventHandleRequest.getPersonId();
             String processResult = eventHandleRequest.getProcessResult();
+            Date processTime = eventHandleRequest.getProcessTime();
             Event event = eventService.getById(eventId);
             if(ObjectUtil.isEmpty(event)){
                 return error("事件不存在");
             }
-            boolean result = eventService.handleEvent(eventId, personId, processResult);
+            boolean result = eventService.handleEvent(eventId, processResult,processTime);
             if (result) {
                 return success("事件处理成功");
             } else {

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/FacilityManagementController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("设施信息管理")
+@Api(tags ="设施信息管理")
 @RestController
 @RequestMapping("/system/facility")
 public class FacilityManagementController {

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

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("房屋信息管理")
+@Api(tags ="房屋信息管理")
 @RestController
 @RequestMapping("/system/houseinfo")
 public class HouseInfoController {

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/IndustryController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("产业数据管理")
+@Api(tags ="产业数据管理")
 @RestController
 @RequestMapping("/system/industry")
 public class IndustryController {

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/LocalPolicyController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("当地政策信息管理")
+@Api(tags ="当地政策信息管理")
 @RestController
 @RequestMapping("/system/local/policy")
 public class LocalPolicyController {

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/MediaPropagandaController.java

@@ -20,7 +20,7 @@ import java.util.Map;
 /**
  * 媒体宣传内容收集控制器
  */
-@Api("媒体宣传内容收集")
+@Api(tags ="媒体宣传内容收集")
 @RestController
 @RequestMapping("/system/media/propaganda")
 public class MediaPropagandaController extends BaseController {

+ 20 - 2
app-admin/src/main/java/com/ruoyi/web/controller/system/PersonInfoController.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.domain.dto.person.PersonInfoAddRequest;
 import com.ruoyi.web.domain.dto.person.PersonInfoEditRequest;
+import com.ruoyi.web.domain.dto.person.PersonInfoListQueryRequest;
 import com.ruoyi.web.domain.dto.person.PersonInfoQueryRequest;
 import com.ruoyi.web.domain.vo.PersonInfoVO;
 import com.ruoyi.web.service.PersonInfoService;
@@ -14,12 +15,13 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Map;
 
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("人员信息管理")
+@Api(tags ="人员信息管理")
 @RestController
 @RequestMapping("/system/personinfo")
 public class PersonInfoController{
@@ -72,7 +74,7 @@ public class PersonInfoController{
      */
     @ApiOperation("编辑人员")
     @PostMapping("/edit")
-    public AjaxResult editFacility(@RequestBody PersonInfoEditRequest personInfoEditRequest) {
+    public AjaxResult editPersonInfo(@RequestBody PersonInfoEditRequest personInfoEditRequest) {
         if (personInfoEditRequest == null) {
             return error("请求参数为空");
         }
@@ -97,6 +99,22 @@ public class PersonInfoController{
     }
 
     /**
+     * 根据id获取人员
+     *
+     * @param personInfoListQueryRequest
+     * @return
+     */
+    @ApiOperation("获取人员列表")
+    @PostMapping("/list")
+    public AjaxResult getPersonInfoVOList(@RequestBody PersonInfoListQueryRequest personInfoListQueryRequest) {
+        if (ObjectUtil.isEmpty(personInfoListQueryRequest)) {
+            return error("请求参数为空");
+        }
+        List<PersonInfoVO> personInfoVOList = personInfoService.getPersonInfoVOList(personInfoListQueryRequest);
+        return success(personInfoVOList);
+    }
+
+    /**
      * 分页获取人员列表  mybatis-plus
      *
      * @param personInfoQueryRequest

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

@@ -21,7 +21,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("项目信息管理")
+@Api(tags ="项目信息管理")
 @RestController
 @RequestMapping("/system/projects")
 public class ProjectsController {

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

@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsAddRequest;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsEditRequest;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsQueryRequest;
-import com.ruoyi.web.domain.entity.SubsidyProjects;
+import com.ruoyi.web.domain.vo.SubsidyProjectsVO;
 import com.ruoyi.web.service.SubsidyProjectsService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("补贴-项目信息管理")
+@Api(tags ="补贴-项目信息管理")
 @RestController
 @RequestMapping("/system/subsidy/projects")
 public class SubsidyProjectsController {
@@ -93,8 +93,8 @@ public class SubsidyProjectsController {
         if (ObjectUtil.isEmpty(id)) {
             return error("请求参数为空");
         }
-        SubsidyProjects subsidyProjects = subsidyProjectsService.getSubsidyProjectsById(id);
-        return success(subsidyProjects);
+        SubsidyProjectsVO subsidyProjectsVO = subsidyProjectsService.getSubsidyProjectsById(id);
+        return success(subsidyProjectsVO);
     }
 
     /**
@@ -109,8 +109,8 @@ public class SubsidyProjectsController {
         if (subsidyProjectsQueryRequest == null) {
             return error("请求参数为空");
         }
-        Page<SubsidyProjects> listSubsidyProjectsByPage = subsidyProjectsService.getListSubsidyProjectsByPage(subsidyProjectsQueryRequest);
-        return success(listSubsidyProjectsByPage);
+        Page<SubsidyProjectsVO> listSubsidyProjectsByPageVO = subsidyProjectsService.getListSubsidyProjectsByPage(subsidyProjectsQueryRequest);
+        return success(listSubsidyProjectsByPageVO);
     }
 
 }

+ 2 - 2
app-admin/src/main/java/com/ruoyi/web/controller/system/VillageProfileController.java

@@ -10,9 +10,9 @@ import com.ruoyi.web.domain.dto.VillageProfile.VillageProfileEditRequest;
 import com.ruoyi.web.domain.dto.VillageProfile.VillageProfileQueryRequest;
 import com.ruoyi.web.domain.vo.VillageProfileVO;
 import com.ruoyi.web.service.VillageProfileService;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
@@ -22,7 +22,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/system/village/profile")
-@Validated
+@Api(tags ="村庄概况信息管理")
 public class VillageProfileController extends BaseController {
 
     @Autowired

+ 42 - 2
app-admin/src/main/java/com/ruoyi/web/controller/system/VillageServiceController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("服务与支持管理")
+@Api(tags ="服务与支持管理")
 @RestController
 @RequestMapping("/system/village/service")
 public class VillageServiceController {
@@ -72,7 +72,7 @@ public class VillageServiceController {
      */
     @ApiOperation("编辑服务与支持")
     @PostMapping("/edit")
-    public AjaxResult editFacility(@RequestBody VillageServiceEditRequest villageServiceEditRequest) {
+    public AjaxResult editVillageService(@RequestBody VillageServiceEditRequest villageServiceEditRequest) {
         if (villageServiceEditRequest == null) {
             return error("请求参数为空");
         }
@@ -80,6 +80,46 @@ public class VillageServiceController {
         return AjaxResult.success();
     }
 
+    /**
+     * 发布服务与支持
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("发布服务与支持")
+    @GetMapping("/publish")
+    public AjaxResult publishVillageService(@RequestParam int id) {
+        if (id <= 0) {
+            return error("请求参数为空");
+        }
+        boolean b = villageServiceService.publishVillageService(id);
+        if (b) {
+            return AjaxResult.success("发布成功");
+        } else {
+            return AjaxResult.error("发布失败");
+        }
+    }
+
+    /**
+     * 下架服务与支持
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("下架服务与支持")
+    @GetMapping("/remove")
+    public AjaxResult removeVillageService(@RequestParam int id) {
+        if (id <= 0) {
+            return error("请求参数为空");
+        }
+        boolean b = villageServiceService.removeVillageService(id);
+        if (b) {
+            return AjaxResult.success("下架成功");
+        } else {
+            return AjaxResult.error("下架失败");
+        }
+    }
+
 
     /**
      * 根据id获取服务与支持

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/VillageSpecialController.java

@@ -21,7 +21,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("特色产业管理")
+@Api(tags = "特色产业管理")
 @RestController
 @RequestMapping("/system/village/special")
 public class VillageSpecialController {

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/VillageTraditionController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
 import static com.ruoyi.common.core.domain.AjaxResult.success;
 
-@Api("传统产业管理")
+@Api(tags ="传统产业管理")
 @RestController
 @RequestMapping("/system/village/tradition")
 public class VillageTraditionController {

+ 2 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/ethnicActivities/EthnicActivitiesAddRequest.java

@@ -32,7 +32,7 @@ public class EthnicActivitiesAddRequest implements Serializable {
     /**
      * 活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他
      */
-    private Integer category;
+    private String category;
 
     /**
      * 参与民族
@@ -48,4 +48,5 @@ public class EthnicActivitiesAddRequest implements Serializable {
      * 参与人数
      */
     private Integer count;
+
 }

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/ethnicActivities/EthnicActivitiesEditRequest.java

@@ -34,7 +34,7 @@ public class EthnicActivitiesEditRequest implements Serializable {
     /**
      * 活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他
      */
-    private Integer category;
+    private String category;
 
     /**
      * 参与民族

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/ethnicActivities/EthnicActivitiesQueryRequest.java

@@ -29,7 +29,7 @@ public class EthnicActivitiesQueryRequest extends PageRequest implements Seriali
     /**
      * 活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他
      */
-    private Integer category;
+    private String category;
 
     /**
      * 参与民族

+ 0 - 5
app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventAddRequest.java

@@ -40,10 +40,5 @@ public class EventAddRequest implements Serializable {
      */
     private String photoUrl;
 
-    /**
-     * 填报人ID(村民id)
-     */
-    private Integer submitterId;
-
     private static final long serialVersionUID = 1L;
 }

+ 0 - 5
app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventEditRequest.java

@@ -45,11 +45,6 @@ public class EventEditRequest implements Serializable {
     private String photoUrl;
 
     /**
-     * 状态(0-未完结 1-已完结)
-     */
-    private String status;
-
-    /**
      * 填报人ID(村民id)
      */
     private Integer submitterId;

+ 7 - 4
app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventHandleRequest.java

@@ -1,9 +1,11 @@
 package com.ruoyi.web.domain.dto.event;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * 事件处理请求
@@ -20,14 +22,15 @@ public class EventHandleRequest implements Serializable {
     private Integer eventId;
 
     /**
-     * 负责人id
+     * 处理结果
      */
-    private Integer personId;
+    private String processResult;
 
     /**
-     * 处理结果
+     * 处理时间
      */
-    private String processResult;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date processTime;
 
     private static final long serialVersionUID = 1L;
 }

+ 5 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/event/EventQueryRequest.java

@@ -17,6 +17,11 @@ import java.util.Date;
 public class EventQueryRequest extends PageRequest implements Serializable {
 
     /**
+     * 事件描述
+     */
+    private String description;
+
+    /**
      * 事发开始时间
      */
     private Date startTime;
@@ -46,6 +51,5 @@ public class EventQueryRequest extends PageRequest implements Serializable {
      */
     private Integer submitterId;
 
-
     private static final long serialVersionUID = 1L;
 }

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoAddRequest.java

@@ -49,7 +49,7 @@ public class HouseInfoAddRequest implements Serializable {
     /**
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
-    private Integer houseCategory;
+    private String houseCategory;
 
     /**
      * 宅基地面积(㎡)

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoEditRequest.java

@@ -54,7 +54,7 @@ public class HouseInfoEditRequest implements Serializable {
     /**
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
-    private Integer houseCategory;
+    private String houseCategory;
 
     /**
      * 宅基地面积(㎡)

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

@@ -46,7 +46,7 @@ public class HouseInfoQueryRequest extends PageRequest implements Serializable {
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
     @ApiModelProperty(value = "房屋类别:1-修缮,2-原址重建,3-集中安置")
-    private Integer houseCategory;
+    private String houseCategory;
 
     /**
      * 所属网格

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/mediaPropaganda/MediaPropagandaAddRequest.java

@@ -24,7 +24,7 @@ public class MediaPropagandaAddRequest implements Serializable {
      * 类型 0-图文,1-视频
      */
     @ApiModelProperty(value = "类型 0-图文,1-视频", required = true)
-    private Integer type;
+    private String type;
 
     /**
      * 内容

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/dto/mediaPropaganda/MediaPropagandaEditRequest.java

@@ -30,7 +30,7 @@ public class MediaPropagandaEditRequest implements Serializable {
      * 类型 0-图文,1-视频
      */
     @ApiModelProperty(value = "类型 0-图文,1-视频", required = true)
-    private Integer type;
+    private String type;
 
     /**
      * 内容

+ 35 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/person/PersonInfoListQueryRequest.java

@@ -0,0 +1,35 @@
+package com.ruoyi.web.domain.dto.person;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 用户查询列表请求
+ */
+@ApiModel(value = "PersonInfoListQueryRequest", description = "用户查询列表请求参数")
+@Data
+public class PersonInfoListQueryRequest implements Serializable {
+
+    /**
+     * 姓名
+     */
+    @ApiModelProperty(value = "真实姓名")
+    private String realname;
+
+    /**
+     * 身份证号
+     */
+    @ApiModelProperty(value = "身份证号")
+    private String idCard;
+
+    /**
+     * 电话
+     */
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+    private static final long serialVersionUID = 1L;
+}

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

@@ -39,7 +39,7 @@ public class EthnicActivities implements Serializable {
     /**
      * 活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他
      */
-    private Integer category;
+    private String category;
 
     /**
      * 参与民族,0-汉族/1-撒拉族/2-保安族/3-东乡族/4-回族/5-藏族/6-土族/7-羌族

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

@@ -52,7 +52,7 @@ public class Event implements Serializable{
     private String status;
 
     /**
-     * 填报人ID(村民id)
+     * 填报人ID(人口表 村民id)
      */
     private Integer submitterId;
 

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

@@ -54,7 +54,7 @@ public class HouseInfo implements Serializable {
     /**
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
-    private Integer houseCategory;
+    private String houseCategory;
 
     /**
      * 宅基地面积(㎡)

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

@@ -29,7 +29,7 @@ public class MediaPropaganda implements Serializable {
     /**
      * 类型 0-图文,1-视频
      */
-    private Integer type;
+    private String type;
 
     /**
      * 内容

+ 5 - 0
app-admin/src/main/java/com/ruoyi/web/domain/entity/PersonInfo.java

@@ -22,6 +22,11 @@ public class PersonInfo implements Serializable {
     private Integer id;
 
     /**
+     * 用户ID(关联SysUser表)
+     */
+    private Integer userId;
+
+    /**
      * 姓名
      */
     private String realname;

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/vo/DisasterReliefVO.java

@@ -48,7 +48,7 @@ public class DisasterReliefVO implements Serializable {
     /**
      * 发生日期
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "发生日期")
     private Date date;
 

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/vo/EthnicActivitiesVO.java

@@ -39,7 +39,7 @@ public class EthnicActivitiesVO implements Serializable {
     /**
      * 活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他
      */
-    private Integer category;
+    private String category;
 
     /**
      * 参与民族,

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

@@ -62,7 +62,7 @@ public class HouseInfoVO implements Serializable {
      * 房屋类别:1-修缮,2-原址重建,3-集中安置
      */
     @ApiModelProperty(value = "房屋类别:1-修缮,2-原址重建,3-集中安置")
-    private Integer houseCategory;
+    private String houseCategory;
 
     /**
      * 宅基地面积(㎡)

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/vo/MediaPropagandaVO.java

@@ -31,7 +31,7 @@ public class MediaPropagandaVO implements Serializable {
      * 类型 0-图文,1-视频
      */
     @ApiModelProperty(value = "类型 0-图文,1-视频")
-    private Integer type;
+    private String type;
 
     /**
      * 内容

+ 76 - 0
app-admin/src/main/java/com/ruoyi/web/domain/vo/SubsidyProjectsVO.java

@@ -0,0 +1,76 @@
+package com.ruoyi.web.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 惠农项目信息视图
+ *
+ * @TableName subsidy_projects
+ */
+@Data
+@ApiModel(value = "SubsidyProjectsVO", description = "惠农项目信息视图")
+public class SubsidyProjectsVO implements Serializable {
+    /**
+     * 序号ID
+     */
+    private Integer id;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 补贴类别
+     */
+    private String category;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 实发金额(元)
+     */
+    private BigDecimal money;
+
+    /**
+     * 银行账号
+     */
+    private String bankCard;
+
+    /**
+     * 兑现时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date date;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+}

+ 9 - 6
app-admin/src/main/java/com/ruoyi/web/domain/vo/event/EventVO.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.domain.vo.event;
 
-import com.ruoyi.common.core.domain.entity.SysUser;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.web.domain.vo.PersonInfoVO;
 import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
@@ -24,6 +25,7 @@ public class EventVO implements Serializable {
     /**
      * 事发时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date occurTime;
 
     /**
@@ -52,9 +54,9 @@ public class EventVO implements Serializable {
     private String status;
 
     /**
-     * 填报人ID(村民id)
+     * 填报人姓名(村民)
      */
-    private Integer submitterId;
+    private String submitterName;
 
     /**
      * 处理结果
@@ -64,17 +66,18 @@ public class EventVO implements Serializable {
     /**
      * 处理时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date processTime;
 
     /**
      * 负责人 列表
      */
-    private List<SysUser> chargeUserList;
+    private List<PersonInfoVO> chargeUserList;
 
     /**
-     * 处理人
+     * 处理人姓名
      */
-    private SysUser processUser;
+    private String processUserName;
 
     /**
      * 创建时间

+ 2 - 0
app-admin/src/main/java/com/ruoyi/web/service/EthnicActivitiesService.java

@@ -19,6 +19,8 @@ public interface EthnicActivitiesService extends IService<EthnicActivities> {
 
     void editEthnicActivities(EthnicActivitiesEditRequest ethnicActivitiesEditRequest);
 
+    boolean completeEthnicActivities(int id);
+
     EthnicActivitiesVO getEthnicActivitiesVO(EthnicActivities ethnicActivities);
 
     EthnicActivitiesVO getEthnicActivitiesById(int id);

+ 10 - 1
app-admin/src/main/java/com/ruoyi/web/service/EventService.java

@@ -7,8 +7,10 @@ import com.ruoyi.web.domain.dto.event.EventAddRequest;
 import com.ruoyi.web.domain.dto.event.EventEditRequest;
 import com.ruoyi.web.domain.dto.event.EventQueryRequest;
 import com.ruoyi.web.domain.entity.Event;
+import com.ruoyi.web.domain.vo.PersonInfoVO;
 import com.ruoyi.web.domain.vo.event.EventVO;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -30,8 +32,15 @@ public interface EventService extends IService<Event> {
 
     QueryWrapper<Event> getQueryWrapper(EventQueryRequest eventQueryRequest, Integer userId);
 
+    /**
+     * 根据事件类型获取负责人列表
+     * @param eventType
+     * @return
+     */
+    List<PersonInfoVO> getPersonInfoVOByEventType(Integer eventType);
+
     // 处理事件:返回是否成功抢占并完成(true 表示当前负责人成为处理人)
-    boolean handleEvent(Integer eventId, Integer personId, String processResult);
+    boolean handleEvent(Integer eventId, String processResult, Date processTime);
 
     // 再次派发:将给定负责人设为未完结(存在则更新,不存在则插入);仅当事件未完结时允许
     void reassignEvent(Integer eventId, List<Integer> personIds);

+ 28 - 0
app-admin/src/main/java/com/ruoyi/web/service/PersonInfoService.java

@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.web.domain.dto.person.PersonInfoAddRequest;
 import com.ruoyi.web.domain.dto.person.PersonInfoEditRequest;
+import com.ruoyi.web.domain.dto.person.PersonInfoListQueryRequest;
 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;
+
 /**
  * 人员信息接口
  */
@@ -28,6 +31,14 @@ public interface PersonInfoService extends IService<PersonInfo> {
     PersonInfoVO getPersonInfoById(int id);
 
     /**
+     * 根据系统用户 id列表 获取人员vo类列表
+     *
+     * @param userIds
+     * @return
+     */
+    List<PersonInfoVO> getPersonInfoVOListByUserIds(List<Integer> userIds);
+
+    /**
      * 通过人员获取人员包装类
      *
      * @param personInfo
@@ -35,6 +46,15 @@ public interface PersonInfoService extends IService<PersonInfo> {
      */
     PersonInfoVO getPersonInfoVO(PersonInfo personInfo);
 
+
+    /**
+     * 获取人员列表
+     *
+     * @param personInfoListQueryRequest
+     * @return
+     */
+    List<PersonInfoVO> getPersonInfoVOList(PersonInfoListQueryRequest personInfoListQueryRequest);
+
     /**
      * 分页获取人员列表
      * @param personInfoQueryRequest
@@ -63,4 +83,12 @@ public interface PersonInfoService extends IService<PersonInfo> {
      * @return
      */
     String encryptIdCard(String idCard);
+
+    /**
+     * 根据人口id列表 获取 系统用户 id列表
+     *
+     * @param personIds
+     * @return
+     */
+    List<Integer> getUserIdListByPersonIds(List<Integer> personIds);
 }

+ 3 - 2
app-admin/src/main/java/com/ruoyi/web/service/SubsidyProjectsService.java

@@ -8,6 +8,7 @@ import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsAddRequest;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsEditRequest;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsQueryRequest;
 import com.ruoyi.web.domain.entity.SubsidyProjects;
+import com.ruoyi.web.domain.vo.SubsidyProjectsVO;
 
 
 /**
@@ -27,7 +28,7 @@ public interface SubsidyProjectsService extends IService<SubsidyProjects> {
      * @param id
      * @return
      */
-    SubsidyProjects getSubsidyProjectsById(int id);
+    SubsidyProjectsVO getSubsidyProjectsById(int id);
 
     /**
      * 分页获取补贴-项目列表
@@ -35,7 +36,7 @@ public interface SubsidyProjectsService extends IService<SubsidyProjects> {
      * @param subsidyProjectsQueryRequest
      * @return
      */
-    Page<SubsidyProjects> getListSubsidyProjectsByPage(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest);
+    Page<SubsidyProjectsVO> getListSubsidyProjectsByPage(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest);
 
 
     /**

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/service/VillageServiceService.java

@@ -22,6 +22,22 @@ public interface VillageServiceService extends IService<VillageService> {
     void editVillageService(VillageServiceEditRequest villageServiceEditRequest);
 
     /**
+     * 发布
+     *
+     * @param id
+     * @return
+     */
+    boolean publishVillageService(int id);
+
+    /**
+     * 下架
+     *
+     * @param id
+     * @return
+     */
+    boolean removeVillageService(int id);
+
+    /**
      * 根据id查询
      *
      * @param id

+ 2 - 1
app-admin/src/main/java/com/ruoyi/web/service/impl/DisasterReliefServiceImpl.java

@@ -181,7 +181,8 @@ public class DisasterReliefServiceImpl extends ServiceImpl<DisasterReliefMapper,
                 // 设置村民姓名
                 disasterReliefVO.setName(personInfo.getRealname());
                 // 设置村民身份证号
-                disasterReliefVO.setIdCard(personInfoService.decryptIdCard(personInfo.getIdCard()));
+                //disasterReliefVO.setIdCard(personInfoService.decryptIdCard(personInfo.getIdCard()));
+                disasterReliefVO.setIdCard(personInfo.getIdCard());
                 // 设置村民联系方式
                 disasterReliefVO.setPhone(personInfo.getPhone());
             }

+ 24 - 5
app-admin/src/main/java/com/ruoyi/web/service/impl/EthnicActivitiesServiceImpl.java

@@ -44,6 +44,7 @@ public class EthnicActivitiesServiceImpl extends ServiceImpl<EthnicActivitiesMap
             newEthnicActivities.setEthnic(JSONUtil.toJsonStr(ethnicActivitiesAddRequest.getEthnic()));
             // 数据校验
             validEthnicActivities(newEthnicActivities, BusinessType.INSERT);
+
             // 保存到数据库
             this.save(newEthnicActivities);
             return newEthnicActivities.getId();
@@ -102,7 +103,25 @@ public class EthnicActivitiesServiceImpl extends ServiceImpl<EthnicActivitiesMap
     }
 
     /**
-     * 校验就业数据
+     * 完成
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean completeEthnicActivities(int id) {
+        if (id <= 0) {
+            throw new ServiceException("参数错误");
+        }
+        EthnicActivities ethnicActivities = this.getById(id);
+        if (ethnicActivities == null){
+            throw new ServiceException("未找到民族团结活动");
+        }
+        ethnicActivities.setStatus(1);
+        return this.updateById(ethnicActivities);
+    }
+
+    /**
+     * 校验数据
      *
      * @param ethnicActivities
      */
@@ -114,7 +133,7 @@ public class EthnicActivitiesServiceImpl extends ServiceImpl<EthnicActivitiesMap
         String name = ethnicActivities.getName();
         Date date = ethnicActivities.getDate();
         String location = ethnicActivities.getLocation();
-        Integer category = ethnicActivities.getCategory();
+        String category = ethnicActivities.getCategory();
         String ethnic = ethnicActivities.getEthnic();
 
         // 修改数据时,id 不能为空
@@ -130,7 +149,7 @@ public class EthnicActivitiesServiceImpl extends ServiceImpl<EthnicActivitiesMap
         if (StrUtil.isEmpty(location)) {
             throw new ServiceException("地点不能为空");
         }
-        if (ObjectUtil.isEmpty(category)) {
+        if (StrUtil.isEmpty(category)) {
             throw new ServiceException("活动类别不能为空");
         }
         if (StrUtil.isBlank(ethnic)) {
@@ -170,7 +189,7 @@ public class EthnicActivitiesServiceImpl extends ServiceImpl<EthnicActivitiesMap
         QueryWrapper<EthnicActivities> queryWrapper = new QueryWrapper<>();
         Date startTime = ethnicActivitiesQueryRequest.getStartTime();
         Date endTime = ethnicActivitiesQueryRequest.getEndTime();
-        Integer category = ethnicActivitiesQueryRequest.getCategory();
+        String category = ethnicActivitiesQueryRequest.getCategory();
         List<String> ethnic = ethnicActivitiesQueryRequest.getEthnic();
         Integer status = ethnicActivitiesQueryRequest.getStatus();
         long pageNum = ethnicActivitiesQueryRequest.getPageNum();
@@ -178,7 +197,7 @@ public class EthnicActivitiesServiceImpl extends ServiceImpl<EthnicActivitiesMap
         String sortField = ethnicActivitiesQueryRequest.getSortField();
         String sortOrder = ethnicActivitiesQueryRequest.getSortOrder();
 
-        queryWrapper.eq(ObjectUtil.isNotEmpty(category), "category", category)
+        queryWrapper.eq(StrUtil.isNotEmpty(category), "category", category)
                 .eq(ObjectUtil.isNotEmpty(status), "status", status)
                 .orderBy(StrUtil.isNotEmpty(sortField), "ascend".equals(sortOrder), sortField);
 

+ 110 - 32
app-admin/src/main/java/com/ruoyi/web/service/impl/EventServiceImpl.java

@@ -7,31 +7,31 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.system.mapper.SysUserMapper;
-import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.web.domain.dto.event.EventAddRequest;
 import com.ruoyi.web.domain.dto.event.EventEditRequest;
 import com.ruoyi.web.domain.dto.event.EventQueryRequest;
 import com.ruoyi.web.domain.entity.Event;
 import com.ruoyi.web.domain.entity.EventAssign;
+import com.ruoyi.web.domain.entity.PersonInfo;
+import com.ruoyi.web.domain.vo.PersonInfoVO;
 import com.ruoyi.web.domain.vo.event.EventVO;
 import com.ruoyi.web.mapper.EventAssignMapper;
 import com.ruoyi.web.mapper.EventMapper;
+import com.ruoyi.web.service.EventAssignService;
 import com.ruoyi.web.service.EventService;
+import com.ruoyi.web.service.PersonInfoService;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -50,11 +50,14 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
     private ISysUserService sysUserService;
 
     @Resource
-    private ISysRoleService sysRoleService;
-
-    @Autowired
     private SysUserMapper sysUserMapper;
 
+    @Resource
+    private PersonInfoService personInfoService;
+
+    @Resource
+    private EventAssignService eventAssignService;
+
     /**
      * 添加事件并分配给对应负责人
      *
@@ -71,13 +74,25 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
             // 转换为实体对象
             Event event = new Event();
             BeanUtil.copyProperties(eventAddRequest, event);
+
+            // 通过系统用户id 获取对应 人口表id
+            Long userId = SecurityUtils.getUserId();
+            QueryWrapper<PersonInfo> wrapper = new QueryWrapper<>();
+            wrapper.select("id")
+                    .eq("user_id",userId);
+            List<PersonInfo> personInfoList = personInfoService.list(wrapper);
+            if (!personInfoList.isEmpty()) {
+                PersonInfo personInfo = personInfoList.get(0);
+                event.setSubmitterId(personInfo.getId());
+            } else {
+                event.setSubmitterId(null);
+            }
+
             //数据校验
             validEvent(event, BusinessType.INSERT);
-
             // 保存到事件表
             this.save(event);
-
-            // 根据事件类型分配负责人
+            // 根据事件类型自动分配负责人
             assignEventToPersons(event.getId(), event.getType());
             return event.getId();
         } catch (Exception e) {
@@ -93,7 +108,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
      * @param eventType 事件类型
      */
     private void assignEventToPersons(Integer eventId, Integer eventType) {
-        // 根据事件类型查找对应的负责人
+        // 根据事件类型查找对应的负责人 id 集合
         List<Integer> personIds = getPersonIdsByEventType(eventType);
 
         if (personIds.isEmpty()) {
@@ -113,8 +128,32 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         }
     }
 
+
     /**
-     * 根据事件类型获取负责人ID列表
+     * 根据事件类型获取负责人列表
+     * @param eventType
+     * @return
+     */
+    @Override
+    public List<PersonInfoVO> getPersonInfoVOByEventType(Integer eventType) {
+        List<Integer> userIdsByEventType = getPersonIdsByEventType(eventType);
+        List<PersonInfoVO> personInfoVOListByUserIds = personInfoService.getPersonInfoVOListByUserIds(userIdsByEventType);
+        return personInfoVOListByUserIds;
+    }
+
+
+//    /**
+//     * 通过 id 获取负责人列表
+//     * @param personIds
+//     * @return
+//     */
+//    //todo
+//    private List<SysUser> getSysUserByIdList(List<Integer> personIds) {
+//        return sysUserMapper.selectUserListForEvent(personIds);
+//    }
+
+    /**
+     * 根据事件类型获取负责人系统用户ID列表
      *
      * @param eventType 事件类型
      * @return 负责人ID列表
@@ -140,6 +179,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         return matchedUserIds;
     }
 
+
     /**
      * 删除
      *
@@ -169,7 +209,6 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
 
         // 4. 执行删除(返回是否删除成功)
         return remove(queryWrapper);
-
     }
 
     /**
@@ -285,22 +324,55 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         queryWrapper.eq("event_id", event.getId());
         // 获取事件分配信息列表
         List<EventAssign> eventAssigns = eventAssignMapper.selectList(queryWrapper);
-        // 3. 提取负责人ID列表
+        // 3. 提取负责人 系统用户ID列表
         List<Integer> userIds = eventAssigns.stream()
                 .map(EventAssign::getPersonId)
                 .collect(Collectors.toList());
 
-        // 4. 批量查询有效的用户信息
-        List<SysUser> chargeUserList = userIds.isEmpty() ?
-                Collections.emptyList() :
-                sysUserMapper.selectUserListForEvent(userIds);
-
-        // 实际项目中需要根据personId查询用户信息
+        // 4. 批量查询有效的负责人信息
+        List<PersonInfoVO> chargeUserList ;
+        if (ObjectUtil.isNotEmpty(userIds)){
+            chargeUserList = personInfoService.getPersonInfoVOListByUserIds(userIds);
+        }else{
+            chargeUserList=null;
+        }
         eventVO.setChargeUserList(chargeUserList);
 
-        // 5. 查询处理人
-//        queryWrapper.eq()
+        // 5. 通过填报人id 查询村民姓名
+        Integer submitterId = event.getSubmitterId();
+
+
+        PersonInfo personInfo = personInfoService.getById(submitterId);
+        eventVO.setSubmitterName(personInfo.getRealname());
+
+        // 6. 查询处理人
+        QueryWrapper<EventAssign> wrapper = new QueryWrapper<>();
+        wrapper.select("person_id")
+                .eq("event_id", event.getId())
+                .eq("status", 1);
+        EventAssign eventAssign = eventAssignService.getOne(wrapper);
+        if (ObjectUtil.isNotEmpty(eventAssign)){
+            Integer personId = eventAssign.getPersonId();
+            if(personId == 1){
+                eventVO.setProcessUserName("超级管理员");
+            }else{
+                QueryWrapper<PersonInfo> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.select("id", "realname")
+                        .eq("user_id", personId);
+
+                List<PersonInfo> personInfoList = personInfoService.list(queryWrapper2);
+
+                if (!personInfoList.isEmpty()) {
+                    PersonInfo personInfo2 = personInfoList.get(0);
+                    eventVO.setProcessUserName(personInfo2.getRealname());
+                } else {
+                    eventVO.setProcessUserName(null);
+                }
+            }
 
+        } else {
+            eventVO.setProcessUserName(null);
+        }
         return eventVO;
     }
 
@@ -354,6 +426,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         }
 
         // 从对象中取值
+        String description = eventQueryRequest.getDescription();
         Date startTime = eventQueryRequest.getStartTime();
         Date endTime = eventQueryRequest.getEndTime();
         Integer type = eventQueryRequest.getType();
@@ -363,7 +436,8 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         String sortField = eventQueryRequest.getSortField();
         String sortOrder = eventQueryRequest.getSortOrder();
 
-        // 事件类别、事发地点、填报人、状态
+        // 事件描述、事件类别、事发地点、填报人id(人口表id)、状态
+        queryWrapper.like(StrUtil.isNotBlank(description), "description", description);
         queryWrapper.eq(ObjectUtil.isNotEmpty(type), "type", type);
         queryWrapper.eq(StrUtil.isNotBlank(location), "location", location);
         queryWrapper.eq(StringUtils.isNotBlank(status), "status", status);
@@ -389,22 +463,27 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         return queryWrapper;
     }
 
+
     /**
      * 任一负责人处理事件:主表CAS(状态) + 分配表同步
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean handleEvent(Integer eventId, Integer personId, String processResult) {
+    public boolean handleEvent(Integer eventId, String processResult,Date processTime) {
+        Long personId = SecurityUtils.getUserId();
         if (eventId == null || personId == null) {
             throw new ServiceException("参数不能为空");
         }
         // 1. 事件主表CAS:尝试抢占锁,只能修改状态为 0 的事件
         UpdateWrapper<Event> casUpdate = new UpdateWrapper<>();
+        if (ObjectUtil.isEmpty(processTime)){
+            processTime = new Date();
+        }
         casUpdate.eq("id", eventId)
                 .eq("status", "0")
                 .set("status", "1")
                 .set("process_result", processResult)
-                .set("process_time", new Date())
+                .set("process_time", processTime)
                 .set("update_time", new Date());
         int w = this.baseMapper.update(null, casUpdate);
 
@@ -427,7 +506,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
             eventAssignMapper.update(null, othersDone);
             return true;
         } else {
-            // 抢锁失败:将当前负责人状态-> 2
+            // 抢锁失败:当前事件已经被其他负责人处理,将当前负责人状态 -> 2
             UpdateWrapper<EventAssign> meLose = new UpdateWrapper<>();
             meLose.eq("event_id", eventId)
                     .eq("person_id", personId)
@@ -442,6 +521,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
     /**
      * 再次派发:仅在事件未完结时允许;存在则重置为未完结并标记再派发,不存在则插入
      */
+    // todo 校验事件类型 与 负责人类型 是否匹配  personIds 为人口表  需要转换
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void reassignEvent(Integer eventId, List<Integer> personIds) {
@@ -458,7 +538,9 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
         }
 
         Date now = new Date();
-        for (Integer uid : personIds) {
+        // 通过人口id 获取 系统用户id
+        List<Integer> userIds = personInfoService.getUserIdListByPersonIds(personIds);
+        for (Integer uid : userIds) {
             // 先尝试更新存在的数据
             UpdateWrapper<EventAssign> reset = new UpdateWrapper<>();
             reset.eq("event_id", eventId)
@@ -481,8 +563,4 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
             }
         }
     }
-}
-
-
-
-
+}

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

@@ -133,7 +133,7 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
         Integer houseOwnerId = houseInfo.getHouseOwnerId();
         Integer totalPoints = houseInfo.getTotalPoints();
         Integer remainingPoints = houseInfo.getRemainingPoints();
-        Integer houseCategory = houseInfo.getHouseCategory();
+        String houseCategory = houseInfo.getHouseCategory();
         BigDecimal buildingArea = houseInfo.getBuildingArea();
         String grid = houseInfo.getGrid();
         String photoUrl = houseInfo.getPhotoUrl();
@@ -245,7 +245,7 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
         String doorplateNumber = houseInfoQueryRequest.getDoorplateNumber();
         Integer houseOwnerId = houseInfoQueryRequest.getHouseOwnerId();
         String houseOwnerName = houseInfoQueryRequest.getHouseOwnerName();
-        Integer houseCategory = houseInfoQueryRequest.getHouseCategory();
+        String houseCategory = houseInfoQueryRequest.getHouseCategory();
         Integer grid = houseInfoQueryRequest.getGrid();
         List<String> houseTags = houseInfoQueryRequest.getHouseTags();
         String sortField = houseInfoQueryRequest.getSortField();
@@ -256,7 +256,7 @@ public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo
         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);
+        queryWrapper.eq(StrUtil.isNotBlank(houseCategory), "house_category", houseCategory);
 
         // 优先使用 房主id 查询  没有房主id 再根据 房主姓名查询
         if (ObjectUtil.isNotEmpty(houseOwnerId)) {

+ 2 - 5
app-admin/src/main/java/com/ruoyi/web/service/impl/MediaPropagandaServiceImpl.java

@@ -245,7 +245,7 @@ public class MediaPropagandaServiceImpl extends ServiceImpl<MediaPropagandaMappe
         }
         Integer id = mediaPropaganda.getId();
         String title = mediaPropaganda.getTitle();
-        Integer mediaPropagandaType = mediaPropaganda.getType();
+        String mediaPropagandaType = mediaPropaganda.getType();
         String content = mediaPropaganda.getContent();
         Date extractDate = mediaPropaganda.getExtractDate();
         Date publishDate = mediaPropaganda.getPublishDate();
@@ -258,12 +258,9 @@ public class MediaPropagandaServiceImpl extends ServiceImpl<MediaPropagandaMappe
         if (StrUtil.isBlank(title)) {
             throw new ServiceException("标题不能为空");
         }
-        if (ObjectUtil.isEmpty(mediaPropagandaType)) {
+        if (StrUtil.isBlank(mediaPropagandaType)) {
             throw new ServiceException("类型不能为空");
         }
-        if (mediaPropagandaType != 0 && mediaPropagandaType != 1) {
-            throw new ServiceException("类型值无效,只能是0(图文)或1(视频)");
-        }
         if (StrUtil.isBlank(content)) {
             throw new ServiceException("内容不能为空");
         }

+ 83 - 8
app-admin/src/main/java/com/ruoyi/web/service/impl/PersonInfoServiceImpl.java

@@ -14,6 +14,7 @@ import com.ruoyi.common.utils.SecureSensitiveUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.web.domain.dto.person.PersonInfoAddRequest;
 import com.ruoyi.web.domain.dto.person.PersonInfoEditRequest;
+import com.ruoyi.web.domain.dto.person.PersonInfoListQueryRequest;
 import com.ruoyi.web.domain.dto.person.PersonInfoQueryRequest;
 import com.ruoyi.web.domain.entity.HouseInfo;
 import com.ruoyi.web.domain.entity.HouseholdInfo;
@@ -29,6 +30,7 @@ import org.springframework.stereotype.Service;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -56,9 +58,9 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
             personInfo.setPopulationTags(JSONUtil.toJsonStr(personInfoAddRequest.getPopulationTags()));
             // 数据校验 todo
             validPersonInfo(personInfo, BusinessType.INSERT);
-            // 身份证加密
-            String idCard = personInfo.getIdCard();
-            personInfo.setIdCard(this.encryptIdCard(idCard));
+//            // 身份证加密
+//            String idCard = personInfo.getIdCard();
+//            personInfo.setIdCard(this.encryptIdCard(idCard));
             // 保存到数据库
             this.save(personInfo);
             return personInfo.getId();
@@ -176,6 +178,29 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
     }
 
     /**
+     * 根据 系统用户id 获取人员包装类列表
+     *
+     * @param userIds
+     * @return
+     */
+    @Override
+    public List<PersonInfoVO> getPersonInfoVOListByUserIds(List<Integer> userIds) {
+        if (ObjectUtil.isEmpty(userIds)) {
+            throw new ServiceException("系统用户id不能为空或id异常");
+        }
+        // 1. 批量查询 PersonInfo
+        QueryWrapper<PersonInfo> wrapper = new QueryWrapper<>();
+        wrapper.in("user_id", userIds);
+        List<PersonInfo> personInfoList = this.list(wrapper);
+
+        // 2. 转换为 VO 列表
+        return personInfoList.stream()
+                .map(this::getPersonInfoVO)
+                .collect(Collectors.toList());
+    }
+
+
+    /**
      * 分页获取人员列表
      *
      * @param personInfoQueryRequest
@@ -198,9 +223,33 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         }).collect(Collectors.toList());
         resultPage.setRecords(viewList);
         return resultPage;
+    }
+
+    /**
+     * 获取人员列表
+     *
+     * @param personInfoListQueryRequest
+     * @return
+     */
+    @Override
+    public List<PersonInfoVO> getPersonInfoVOList(PersonInfoListQueryRequest personInfoListQueryRequest) {
+
+        QueryWrapper<PersonInfo> queryWrapper = new QueryWrapper<>();
+        String realname = personInfoListQueryRequest.getRealname();
+        String idCard = personInfoListQueryRequest.getIdCard();
+        String phone = personInfoListQueryRequest.getPhone();
+
+        // 姓名、身份证、电话 模糊查询
+        queryWrapper.like(StrUtil.isNotBlank(realname), "realname", realname);
+        queryWrapper.like(StrUtil.isNotBlank(idCard), "idCard", idCard);
+        queryWrapper.like(StrUtil.isNotBlank(phone), "phone", phone);
+        List<PersonInfo> list = this.list(queryWrapper);
 
+        // 3. 处理每条记录
+        return list.stream().map(this::getPersonInfoVO).collect(Collectors.toList());
     }
 
+
     /**
      * 获取人员包装类
      *
@@ -214,10 +263,10 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         }
         PersonInfoVO personInfoVO = new PersonInfoVO();
         BeanUtils.copyProperties(personInfo, personInfoVO);
-        // 获取身份证号 解密
-        String idCard = personInfoVO.getIdCard();
-        idCard = this.decryptIdCard(idCard);
-        personInfoVO.setIdCard(idCard);
+//        // 获取身份证号 解密
+//        String idCard = personInfoVO.getIdCard();
+//        idCard = this.decryptIdCard(idCard);
+//        personInfoVO.setIdCard(idCard);
 
         // 联表查询补充数据
         if (personInfo.getHouseholdId() != null) {
@@ -259,7 +308,6 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         return personInfoVO;
     }
 
-
     /**
      * 获取查询条件
      *
@@ -338,6 +386,33 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         }
         return idCard;
     }
+
+    /**
+     * 根据人口id列表 获取 系统用户 id列表
+     *
+     * @param personIds
+     * @return
+     */
+    @Override
+    public List<Integer> getUserIdListByPersonIds(List<Integer> personIds) {
+        if (ObjectUtil.isEmpty(personIds)) {
+            throw new ServiceException("参数为空");
+        }
+        // 2. 查询数据库获取user_id列表
+        QueryWrapper<PersonInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("user_id")
+                .in("id", personIds)
+                .isNotNull("user_id");
+
+        List<PersonInfo> personInfoList = this.list(queryWrapper);
+
+        // 3. 提取user_id并去重
+        return personInfoList.stream()
+                .map(PersonInfo::getUserId)
+                .filter(Objects::nonNull) // 过滤掉null值
+                .distinct() // 去重
+                .collect(Collectors.toList());
+    }
 }
 
 

+ 51 - 34
app-admin/src/main/java/com/ruoyi/web/service/impl/SubsidyProjectsServiceImpl.java

@@ -13,6 +13,7 @@ import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsAddRequest;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsEditRequest;
 import com.ruoyi.web.domain.dto.subsidyProjects.SubsidyProjectsQueryRequest;
 import com.ruoyi.web.domain.entity.SubsidyProjects;
+import com.ruoyi.web.domain.vo.SubsidyProjectsVO;
 import com.ruoyi.web.mapper.SubsidyProjectsMapper;
 import com.ruoyi.web.service.PersonInfoService;
 import com.ruoyi.web.service.SubsidyProjectsService;
@@ -112,9 +113,9 @@ public class SubsidyProjectsServiceImpl extends ServiceImpl<SubsidyProjectsMappe
         BeanUtil.copyProperties(subsidyProjectsEditRequest, subsidyProjects);
         subsidyProjects.setUpdateTime(new Date());
         // 对身份证 和 银行账户 进行加密
-        String idCard = subsidyProjects.getIdCard();
+        //String idCard = subsidyProjects.getIdCard();
         String bankCard = subsidyProjects.getBankCard();
-        subsidyProjects.setIdCard(personInfoService.encryptIdCard(idCard));
+        //subsidyProjects.setIdCard(personInfoService.encryptIdCard(idCard));
         try {
             bankCard = SecureSensitiveUtils.encrypt(bankCard, SecureSensitiveUtils.generateAesKey());
         } catch (Exception e) {
@@ -188,24 +189,30 @@ public class SubsidyProjectsServiceImpl extends ServiceImpl<SubsidyProjectsMappe
      * @return
      */
     @Override
-    public SubsidyProjects getSubsidyProjectsById(int id) {
+    public SubsidyProjectsVO getSubsidyProjectsById(int id) {
         if (id <= 0 || ObjectUtil.isEmpty(id)) {
             throw new ServiceException("id不能为空或id异常");
         }
-        SubsidyProjects subsidyProject = this.getById(id);
-        String bankCard = null;
-        String idCard = null;
-        // 解密
-        idCard = personInfoService.decryptIdCard(subsidyProject.getIdCard());
-        try {
-            bankCard = SecureSensitiveUtils.decrypt(subsidyProject.getBankCard(), SecureSensitiveUtils.generateAesKey());
-        } catch (Exception e) {
-            log.error("银行号码解密异常" + e.getMessage());
-            throw new ServiceException("银行号码解密异常");
+        SubsidyProjects subsidyProjects = this.getById(id);
+//        String bankCard = null;
+//        String idCard = null;
+//        // 解密
+//        //idCard = personInfoService.decryptIdCard(subsidyProject.getIdCard());
+//        idCard = subsidyProject.getIdCard();
+//        try {
+//            bankCard = SecureSensitiveUtils.decrypt(subsidyProject.getBankCard(), SecureSensitiveUtils.generateAesKey());
+//        } catch (Exception e) {
+//            log.error("银行号码解密异常" + e.getMessage());
+//            throw new ServiceException("银行号码解密异常");
+//        }
+//        subsidyProject.setIdCard(idCard);
+//        subsidyProject.setBankCard(bankCard);
+        if (subsidyProjects==null){
+            throw new ServiceException("未找到补贴");
         }
-        subsidyProject.setIdCard(idCard);
-        subsidyProject.setBankCard(bankCard);
-        return subsidyProject;
+        SubsidyProjectsVO subsidyProjectsVO = new SubsidyProjectsVO();
+        BeanUtil.copyProperties(subsidyProjects,subsidyProjectsVO);
+        return subsidyProjectsVO;
     }
 
     /**
@@ -215,30 +222,40 @@ public class SubsidyProjectsServiceImpl extends ServiceImpl<SubsidyProjectsMappe
      * @return
      */
     @Override
-    public Page<SubsidyProjects> getListSubsidyProjectsByPage(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest) {
+    public Page<SubsidyProjectsVO> getListSubsidyProjectsByPage(SubsidyProjectsQueryRequest subsidyProjectsQueryRequest) {
         long current = subsidyProjectsQueryRequest.getPageNum();
         long size = subsidyProjectsQueryRequest.getPageSize();
         Page<SubsidyProjects> page = this.page(new Page<>(current, size),
                 getQueryWrapper(subsidyProjectsQueryRequest));
+
+        Page<SubsidyProjectsVO> voPage = new Page<>(current, size);
+        voPage.setTotal(page.getTotal());
+
+
         // 处理每条记录
-        List<SubsidyProjects> records = page.getRecords();
-        if (records != null) {
-            records.forEach(subsidyProjects -> {
-                // 解密-> 身份证 & 银行号码
-                String bankCard = null;
-                String idCard = null;
-                try {
-                    // 解密
-                    idCard = personInfoService.decryptIdCard(subsidyProjects.getIdCard());
-                    bankCard = SecureSensitiveUtils.decrypt(subsidyProjects.getBankCard(), SecureSensitiveUtils.generateAesKey());
-                    subsidyProjects.setIdCard(idCard);
-                    subsidyProjects.setBankCard(bankCard);
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage());
-                }
-            });
+        if (page.getRecords() != null && !page.getRecords().isEmpty()) {
+            List<SubsidyProjectsVO> voRecords = page.getRecords().stream()
+                    .map(subsidyProjects -> {
+                        SubsidyProjectsVO vo = new SubsidyProjectsVO();
+                        BeanUtil.copyProperties(subsidyProjects, vo);
+//                // 解密-> 身份证 & 银行号码
+//                String bankCard = null;
+//                String idCard = null;
+//                try {
+//                    // 解密
+//                    //idCard = personInfoService.decryptIdCard(subsidyProjects.getIdCard());
+//                    idCard = subsidyProjects.getIdCard();
+//                    bankCard = SecureSensitiveUtils.decrypt(subsidyProjects.getBankCard(), SecureSensitiveUtils.generateAesKey());
+//                    subsidyProjects.setIdCard(idCard);
+//                    subsidyProjects.setBankCard(bankCard);
+//                } catch (Exception e) {
+//                    throw new RuntimeException(e.getMessage());
+//                }
+                return vo;
+            }).collect(Collectors.toList());
+            voPage.setRecords(voRecords);
         }
-        return page;
+        return voPage;
     }
 
     /**

+ 72 - 11
app-admin/src/main/java/com/ruoyi/web/service/impl/VillageServiceServiceImpl.java

@@ -32,13 +32,13 @@ import java.util.stream.Collectors;
 @Service
 public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper, VillageService>
         implements VillageServiceService {
-    
+
     @Autowired
     private ISysUserService userService;
-    
+
     @Autowired
     private ProductionDataService productionDataService;
-    
+
     @Override
     public Integer addVillageService(VillageServiceAddRequest villageServiceAddRequest) {
         if (villageServiceAddRequest == null) {
@@ -50,7 +50,14 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
             BeanUtil.copyProperties(villageServiceAddRequest, villageService);
             //数据校验
             validVillageService(villageService, BusinessType.INSERT);
-
+            Integer status = villageService.getStatus();
+            if (status.equals(VillageServiceEnum.PUBLISHED.getValue())) {
+                // 填充发布日期和发布人
+                villageService.setDate(new Date()); // 设置发布日期为当前时间
+                Long userId = SecurityUtils.getUserId();
+                villageService.setIssuerId(userId.intValue());// 设置发布人ID
+                villageService.setStatus(VillageServiceEnum.PUBLISHED.getValue());
+            }
             // 保存到数据库
             this.save(villageService);
             return villageService.getId();
@@ -114,6 +121,60 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
         }
     }
 
+    /**
+     * 发布
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean publishVillageService(int id) {
+        if (id <= 0) {
+            throw new ServiceException("参数错误");
+        }
+        VillageService villageService = this.getById(id);
+        if (villageService == null) {
+            throw new ServiceException("没有找到服务与支持");
+        }
+        Integer status = villageService.getStatus();
+        if (status.equals(VillageServiceEnum.NON_PUBLISHED.getValue())) {
+            // 填充发布日期和发布人
+            villageService.setDate(new Date()); // 设置发布日期为当前时间
+            Long userId = SecurityUtils.getUserId();
+            villageService.setIssuerId(userId.intValue());// 设置发布人ID
+            villageService.setStatus(VillageServiceEnum.PUBLISHED.getValue());
+            this.updateById(villageService);
+        } else {
+            throw new ServiceException("只有未发布的才能发布");
+        }
+        return true;
+    }
+
+    /**
+     * 下架
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean removeVillageService(int id) {
+        if (id <= 0) {
+            throw new ServiceException("参数错误");
+        }
+        VillageService villageService = this.getById(id);
+        if (villageService == null) {
+            throw new ServiceException("没有找到服务与支持");
+        }
+        Integer status = villageService.getStatus();
+        if (status.equals(VillageServiceEnum.PUBLISHED.getValue())) {
+            villageService.setStatus(VillageServiceEnum.REMOVED.getValue());
+        } else {
+            throw new ServiceException("发布的才能下架");
+        }
+        this.updateById(villageService);
+        return true;
+    }
+
 
     /**
      * 校验服务与支持
@@ -167,20 +228,20 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
         long size = villageServiceQueryRequest.getPageSize();
         Page<VillageService> servicePage = this.page(new Page<>(current, size),
                 getQueryWrapper(villageServiceQueryRequest));
-        
+
         // 创建VO分页对象
         Page<VillageServiceVO> voPage = new Page<>(current, size, servicePage.getTotal());
-        
+
         // 转换为VO列表
         List<VillageServiceVO> voList = new ArrayList<>();
         for (VillageService service : servicePage.getRecords()) {
             voList.add(getVillageServiceVO(service));
         }
-        
+
         voPage.setRecords(voList);
         return voPage;
     }
-    
+
     /**
      * 将实体转换为VO,并填充发布人信息
      */
@@ -188,7 +249,7 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
     public VillageServiceVO getVillageServiceVO(VillageService villageService) {
         VillageServiceVO vo = new VillageServiceVO();
         BeanUtil.copyProperties(villageService, vo);
-        
+
         // 如果有发布人ID,获取发布人信息
         Integer issuerId = villageService.getIssuerId();
         if (issuerId != null) {
@@ -205,7 +266,7 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
                 throw new ServiceException("获取发布人信息失败");
             }
         }
-        
+
         return vo;
     }
 
@@ -232,7 +293,7 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
         if (StrUtil.isNotBlank(keyword)) {
             queryWrapper.like("title", keyword)
                     .or()
-                    .like("content",keyword);
+                    .like("content", keyword);
         }
         // 日期范围查询(优先判断范围)
         if (startTime != null && endTime != null) {

+ 0 - 86
app-admin/src/main/java/generator/domain/VillageService.java

@@ -1,86 +0,0 @@
-package generator.domain;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import java.io.Serializable;
-import java.util.Date;
-import lombok.Data;
-
-/**
- * 乡村振兴产业服务与支持
- * @TableName village_service
- */
-@TableName(value ="village_service")
-@Data
-public class VillageService implements Serializable {
-    /**
-     * 
-     */
-    @TableId(type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 标题
-     */
-    private String title;
-
-    /**
-     * 标签
-     */
-    private String tag;
-
-    /**
-     * 类型 0-图文,1-视频
-     */
-    private String type;
-
-    /**
-     * 内容
-     */
-    private String content;
-
-    /**
-     * 封面图
-     */
-    private String photoUrl;
-
-    /**
-     * 来源
-     */
-    private String source;
-
-    /**
-     * 发布状态 0-未发布 1-已发布 2-下架
-     */
-    private Integer status;
-
-    /**
-     * 发布日期
-     */
-    private Date date;
-
-    /**
-     * 发布人id
-     */
-    private Integer issuerId;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    /**
-     * 修改时间
-     */
-    private Date updateTime;
-
-    /**
-     * 删除标志
-     */
-    private String delFlag;
-
-    @TableField(exist = false)
-    private static final long serialVersionUID = 1L;
-}

+ 0 - 15
app-admin/src/main/java/generator/mapper/VillageServiceMapper.java

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

+ 0 - 11
app-admin/src/main/java/generator/service/VillageServiceService.java

@@ -1,11 +0,0 @@
-package generator.service;
-
-import generator.domain.VillageService;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- *
- */
-public interface VillageServiceService extends IService<VillageService> {
-
-}

+ 0 - 20
app-admin/src/main/java/generator/service/impl/VillageServiceServiceImpl.java

@@ -1,20 +0,0 @@
-package generator.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import generator.domain.VillageService;
-import generator.service.VillageServiceService;
-import generator.mapper.VillageServiceMapper;
-import org.springframework.stereotype.Service;
-
-/**
- *
- */
-@Service
-public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper, VillageService>
-    implements VillageServiceService{
-
-}
-
-
-
-

+ 1 - 1
app-admin/src/main/resources/application.yml

@@ -145,7 +145,7 @@ xss:
   # 过滤开关
   enabled: true
   # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
+  excludes: /system/notice,/system/village/service/edit,/system/village/service/add,/system/media/propaganda/edit,/system/media/propaganda/add
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
 

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

@@ -9,7 +9,7 @@
             <result property="name" column="name" jdbcType="VARCHAR"/>
             <result property="date" column="date" jdbcType="DATE"/>
             <result property="location" column="location" jdbcType="VARCHAR"/>
-            <result property="category" column="category" jdbcType="INTEGER"/>
+        <result property="category" column="category" jdbcType="VARCHAR"/>
             <result property="ethnic" column="ethnic" jdbcType="VARCHAR"/>
             <result property="content" column="content" jdbcType="VARCHAR"/>
             <result property="count" column="count" jdbcType="INTEGER"/>

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

@@ -12,7 +12,7 @@
             <result property="houseOwnerId" column="house_owner_id" jdbcType="INTEGER"/>
             <result property="totalPoints" column="total_points" jdbcType="INTEGER"/>
             <result property="remainingPoints" column="remaining_points" jdbcType="INTEGER"/>
-            <result property="houseCategory" column="house_category" jdbcType="TINYINT"/>
+            <result property="houseCategory" column="house_category" jdbcType="VARCHAR"/>
             <result property="buildingArea" column="building_area" jdbcType="DECIMAL"/>
             <result property="grid" column="grid" jdbcType="INTEGER"/>
             <result property="photoUrl" column="photo_url" jdbcType="VARCHAR"/>

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

@@ -7,7 +7,7 @@
     <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.MediaPropaganda">
             <id property="id" column="id" jdbcType="INTEGER"/>
             <result property="title" column="title" jdbcType="VARCHAR"/>
-            <result property="type" column="type" jdbcType="INTEGER"/>
+            <result property="type" column="type" jdbcType="VARCHAR"/>
             <result property="content" column="content" jdbcType="VARCHAR"/>
             <result property="image" column="image" jdbcType="VARCHAR"/>
             <result property="extractDate" column="extract_date" jdbcType="DATE"/>

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

@@ -6,6 +6,7 @@
 
     <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.PersonInfo">
         <id property="id" column="id" jdbcType="INTEGER"/>
+        <result property="userId" column="user_id" jdbcType="BIGINT"/>
         <result property="realname" column="realname" jdbcType="VARCHAR"/>
         <result property="idCard" column="id_card" jdbcType="CHAR"/>
         <result property="ethnic" column="ethnic" jdbcType="VARCHAR"/>
@@ -33,7 +34,7 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id
+        id,user_id
         ,realname,id_card,
         ethnic,age,gender,
         birth_date,population_category,phone,

+ 7 - 0
app-system/src/main/java/com/ruoyi/system/service/ISysUserService.java

@@ -213,5 +213,12 @@ public interface ISysUserService
      */
     List<Long> selectUserIdsByRoleKeysForEvent(List<String> roleKeys);
 
+    /**
+     * 根据人口id列表 获取 系统用户 id列表
+     *
+     * @param personIds
+     * @return
+     */
+    List<Integer> getUserIdListByPersonIds(List<Integer> personIds);
 
 }

+ 13 - 0
app-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -26,6 +26,7 @@ import org.springframework.util.CollectionUtils;
 
 import javax.validation.Validator;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -519,5 +520,17 @@ public class SysUserServiceImpl implements ISysUserService
         return userMapper.selectUserIdsByRoleKeys(roleKeys);
     }
 
+    /**
+     * 根据人口id列表 获取 系统用户 id列表
+     *
+     * @param personIds
+     * @return
+     */
+    @Override
+    public List<Integer> getUserIdListByPersonIds(List<Integer> personIds) {
+
+        return Collections.emptyList();
+    }
+
 
 }

+ 2 - 2
sql/sql.sql

@@ -299,7 +299,7 @@ CREATE TABLE ethnic_activities (
     name VARCHAR(100) NOT NULL COMMENT '活动名称',
     date DATE NOT NULL COMMENT '活动日期',
     location VARCHAR(100) NOT NULL COMMENT '活动地点',
-    category int NOT NULL COMMENT '活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他',
+    category varchar(10) NOT NULL COMMENT '活动类别 0-传统节日 1-风俗习惯 2-语言文字 3-服饰艺术 4-其他',
     ethnic VARCHAR(255) NOT NULL COMMENT '参与民族',
     content VARCHAR(1024) COMMENT '活动内容',
     count INT DEFAULT 0 COMMENT '参与人数',
@@ -331,7 +331,7 @@ CREATE TABLE disaster_relief (
 CREATE TABLE media_propaganda (
   id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
   title varchar(255) NOT NULL COMMENT '标题',
-  type   int default 0 NOT NULL comment '类型 0-图文,1-视频',
+  type   varchar(10) default "0" NOT NULL comment '类型 0-图文,1-视频',
   content varchar(512) NOT NULL COMMENT '内容',
   image varchar(512)  COMMENT '封面图URL',
   extract_date date NOT NULL COMMENT '摘录日期(默认当天)',