Kaynağa Gözat

政务信息

Newspaper 4 gün önce
ebeveyn
işleme
516f9fce85
22 değiştirilmiş dosya ile 1066 ekleme ve 48 silme
  1. 159 0
      app-admin/src/main/java/com/ruoyi/web/controller/system/GovernmentInfoController.java
  2. 0 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/VillageServiceController.java
  3. 53 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/government/GovernmentInfoAddRequest.java
  4. 57 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/government/GovernmentInfoEditRequest.java
  5. 47 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/government/GovernmentInfoQueryRequest.java
  6. 87 0
      app-admin/src/main/java/com/ruoyi/web/domain/entity/GovernmentInfo.java
  7. 38 0
      app-admin/src/main/java/com/ruoyi/web/domain/enums/GovernmentInfoEnum.java
  8. 66 0
      app-admin/src/main/java/com/ruoyi/web/domain/vo/GovernmentInfoVO.java
  9. 13 0
      app-admin/src/main/java/com/ruoyi/web/domain/vo/PersonInfoVO.java
  10. 15 0
      app-admin/src/main/java/com/ruoyi/web/mapper/GovernmentInfoMapper.java
  11. 66 0
      app-admin/src/main/java/com/ruoyi/web/service/GovernmentInfoService.java
  12. 1 0
      app-admin/src/main/java/com/ruoyi/web/service/VillageServiceService.java
  13. 8 0
      app-admin/src/main/java/com/ruoyi/web/service/impl/EventAssignServiceImpl.java
  14. 1 1
      app-admin/src/main/java/com/ruoyi/web/service/impl/EventServiceImpl.java
  15. 49 26
      app-admin/src/main/java/com/ruoyi/web/service/impl/EventTypeAssigneeServiceImpl.java
  16. 310 0
      app-admin/src/main/java/com/ruoyi/web/service/impl/GovernmentInfoServiceImpl.java
  17. 26 10
      app-admin/src/main/java/com/ruoyi/web/service/impl/PersonInfoServiceImpl.java
  18. 0 4
      app-admin/src/main/java/com/ruoyi/web/service/impl/VillageServiceServiceImpl.java
  19. 1 1
      app-admin/src/main/resources/application.yml
  20. 30 0
      app-admin/src/main/resources/mapper/web/GovernmentInfoMapper.xml
  21. 1 1
      app-admin/src/main/resources/mapper/web/VillageTraditionMapper.xml
  22. 38 4
      sql/sql.sql

+ 159 - 0
app-admin/src/main/java/com/ruoyi/web/controller/system/GovernmentInfoController.java

@@ -0,0 +1,159 @@
+package com.ruoyi.web.controller.system;
+
+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.web.domain.dto.government.GovernmentInfoAddRequest;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoEditRequest;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoQueryRequest;
+import com.ruoyi.web.domain.vo.GovernmentInfoVO;
+import com.ruoyi.web.service.GovernmentInfoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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(tags ="政府信息")
+@RestController
+@RequestMapping("/system/government")
+public class GovernmentInfoController {
+
+    @Autowired
+    private GovernmentInfoService governmentInfoService;
+
+    /**
+     * 添加政府信息
+     *
+     * @param governmentInfoAddRequest
+     * @return
+     */
+    @ApiOperation("添加政府信息")
+    @PostMapping("/add")
+    public AjaxResult addGovernmentInfo(@RequestBody GovernmentInfoAddRequest governmentInfoAddRequest) {
+        if (governmentInfoAddRequest == null) {
+            return error("请求参数为空");
+        }
+        System.out.println(governmentInfoAddRequest.getContent());
+
+        Integer id = governmentInfoService.addGovernmentInfo(governmentInfoAddRequest);
+        return success(id);
+    }
+
+    /**
+     * 删除政府信息
+     *
+     * @param paramsMap
+     * @return
+     */
+    @ApiOperation("删除政府信息")
+    @PostMapping("/delete")
+    public AjaxResult deleteGovernmentInfo(@RequestBody Map<String, String> paramsMap) {
+        String ids = paramsMap.get("ids");
+        if (StrUtil.isBlank(ids)) {
+            return error("请求参数为空");
+        }
+        boolean b = governmentInfoService.deleteGovernmentInfo(ids);
+        if (b) {
+            return success("删除成功");
+        }
+        return error("删除失败");
+    }
+
+
+    /**
+     * 编辑政府信息
+     *
+     * @param governmentInfoEditRequest
+     * @return
+     */
+    @ApiOperation("编辑政府信息")
+    @PostMapping("/edit")
+    public AjaxResult editGovernmentInfo(@RequestBody GovernmentInfoEditRequest governmentInfoEditRequest) {
+        if (governmentInfoEditRequest == null) {
+            return error("请求参数为空");
+        }
+        governmentInfoService.editGovernmentInfo(governmentInfoEditRequest);
+        return AjaxResult.success();
+    }
+
+    /**
+     * 发布政府信息
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("发布政府信息")
+    @PostMapping("/publish")
+    public AjaxResult publishGovernmentInfo(@RequestBody Map<String, Integer> params) {
+        int id = params.get("id");
+        if (id <= 0) {
+            return error("请求参数为空");
+        }
+        boolean b = governmentInfoService.publishGovernmentInfo(id);
+        if (b) {
+            return AjaxResult.success("发布成功");
+        } else {
+            return AjaxResult.error("发布失败");
+        }
+    }
+
+    /**
+     * 下架政府信息
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("下架政府信息")
+    @PostMapping("/remove")
+    public AjaxResult removeGovernmentInfo(@RequestBody Map<String, Integer> params) {
+        int id = params.get("id");
+        if (id <= 0) {
+            return error("请求参数为空");
+        }
+        boolean b = governmentInfoService.removeGovernmentInfo(id);
+        if (b) {
+            return AjaxResult.success("下架成功");
+        } else {
+            return AjaxResult.error("下架失败");
+        }
+    }
+
+
+    /**
+     * 根据id获取政府信息
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("根据id获取政府信息")
+    @GetMapping("/get")
+    public AjaxResult getGovernmentInfoById(@RequestParam int id) {
+        if (ObjectUtil.isEmpty(id)) {
+            return error("请求参数为空");
+        }
+        GovernmentInfoVO governmentInfoById = governmentInfoService.getGovernmentInfoById(id);
+        return success(governmentInfoById);
+    }
+
+    /**
+     * 分页获取政府信息列表
+     *
+     * @param governmentInfoQueryRequest
+     * @return
+     */
+    @ApiOperation("分页获取政府信息列表")
+    @PostMapping("/list/page")
+    public AjaxResult listGovernmentInfoByPage(@RequestBody GovernmentInfoQueryRequest governmentInfoQueryRequest) {
+        if (governmentInfoQueryRequest == null) {
+            return error("请求参数为空");
+        }
+        Page<GovernmentInfoVO> listGovernmentInfoByPageVO = governmentInfoService.getListGovernmentInfoByPage(governmentInfoQueryRequest);
+        return success(listGovernmentInfoByPageVO);
+    }
+}

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

@@ -3,7 +3,6 @@ package com.ruoyi.web.controller.system;
 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.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.domain.dto.VillageService.VillageServiceAddRequest;
 import com.ruoyi.web.domain.dto.VillageService.VillageServiceEditRequest;

+ 53 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/government/GovernmentInfoAddRequest.java

@@ -0,0 +1,53 @@
+package com.ruoyi.web.domain.dto.government;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 政务信息添加请求
+ *
+ * @TableName
+ */
+@Data
+@ApiModel(value = "GovernmentInfoAddRequest", description = "政务信息添加请求参数")
+public class GovernmentInfoAddRequest implements Serializable {
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 标签
+     */
+    private String tag;
+
+    /**
+     * 类型 1-图文,2-视频
+     */
+    private String type;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 封面图
+     */
+    private String photoUrl;
+
+    /**
+     * 来源
+     */
+    private String source;
+
+    /**
+     * 发布状态 1未发布 2-已发布 3-下架
+     */
+    private Integer status;
+
+    private static final long serialVersionUID = 1L;
+}

+ 57 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/government/GovernmentInfoEditRequest.java

@@ -0,0 +1,57 @@
+package com.ruoyi.web.domain.dto.government;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 政务信息编辑请求
+ *
+ * @TableName
+ */
+@Data
+@ApiModel(value = "GovernmentInfoEditRequest", description = "政务信息编辑请求参数")
+public class GovernmentInfoEditRequest implements Serializable {
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 标签
+     */
+    private String tag;
+
+    /**
+     * 类型 1-图文,2-视频
+     */
+    private String type;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 封面图
+     */
+    private String photoUrl;
+
+    /**
+     * 来源
+     */
+    private String source;
+
+    /**
+     * 发布状态 1未发布 2-已发布 3-下架
+     */
+    private Integer status;
+
+    private static final long serialVersionUID = 1L;
+}

+ 47 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/government/GovernmentInfoQueryRequest.java

@@ -0,0 +1,47 @@
+package com.ruoyi.web.domain.dto.government;
+
+import com.ruoyi.web.common.PageRequest;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 政务信息查询请求
+ *
+ * @TableName
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(value = "GovernmentInfoQueryRequest", description = "政务信息查询请求参数")
+public class GovernmentInfoQueryRequest extends PageRequest implements Serializable {
+
+    /**
+     * 标签
+     */
+    private String tag;
+
+    /**
+     * 关键词(标题或内容)
+     */
+    private String keyword;
+
+    /**
+     * 开始日期
+     */
+    private Date startTime;
+
+    /**
+     * 结束日期
+     */
+    private Date endTime;
+
+    /**
+     * 发布状态 1未发布 2-已发布 3-下架
+     */
+    private Integer status;
+
+    private static final long serialVersionUID = 1L;
+}

+ 87 - 0
app-admin/src/main/java/com/ruoyi/web/domain/entity/GovernmentInfo.java

@@ -0,0 +1,87 @@
+package com.ruoyi.web.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 政务信息管理表
+ * @TableName government_info
+ */
+@TableName(value ="government_info")
+@Data
+public class GovernmentInfo implements Serializable {
+    /**
+     * ID
+     */
+    @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;
+
+    /**
+     * 删除标志
+     */
+    @TableLogic
+    @JsonIgnore
+    private String delFlag;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 38 - 0
app-admin/src/main/java/com/ruoyi/web/domain/enums/GovernmentInfoEnum.java

@@ -0,0 +1,38 @@
+package com.ruoyi.web.domain.enums;
+
+import cn.hutool.core.util.ObjectUtil;
+import lombok.Getter;
+
+/**
+ * 政务信息枚举类
+ */
+@Getter
+public enum GovernmentInfoEnum {
+    NON_PUBLISHED("未发布", 0),
+    PUBLISHED("已发布", 1),
+    REMOVED("下架",2);
+
+    private final String text;
+
+    private final int value;
+
+    GovernmentInfoEnum(String text, int value) {
+        this.text = text;
+        this.value = value;
+    }
+
+    /**
+     * 根据 value 获取枚举
+     */
+    public static GovernmentInfoEnum getEnumByValue(Integer value) {
+        if (ObjectUtil.isEmpty(value)) {
+            return null;
+        }
+        for (GovernmentInfoEnum villageServiceEnum : GovernmentInfoEnum.values()) {
+            if (villageServiceEnum.value == value) {
+                return villageServiceEnum;
+            }
+        }
+        return null;
+    }
+}

+ 66 - 0
app-admin/src/main/java/com/ruoyi/web/domain/vo/GovernmentInfoVO.java

@@ -0,0 +1,66 @@
+package com.ruoyi.web.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * 政务信息VO
+ */
+@Data
+@ApiModel(value = "GovernmentInfoVO", description = "政务信息信息")
+public class GovernmentInfoVO {
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 标签
+     */
+    private String tag;
+
+    /**
+     * 类型 1-图文,2-视频
+     */
+    private String type;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 封面图
+     */
+    private String photoUrl;
+
+    /**
+     * 来源
+     */
+    private String source;
+
+    /**
+     * 发布状态 1未发布 2-已发布 3-下架
+     */
+    private Integer status;
+
+    /**
+     * 发布日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date date;
+
+    /**
+     * 发布人
+     */
+    private Map<String,String> issuer;
+} 

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

@@ -7,6 +7,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 人员信息 视图
@@ -162,6 +163,18 @@ public class PersonInfoVO implements Serializable {
     private String specialIdentity;
 
     /**
+     * 负责人类型
+     */
+    @ApiModelProperty(value = "负责人类型")
+    private List<Integer> type;
+
+    /**
+     * 是否是负责人
+     */
+    @ApiModelProperty(value = "是否是负责人")
+    private boolean isLeader;
+
+    /**
      * 创建时间
      */
     @ApiModelProperty(value = "创建时间")

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

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

+ 66 - 0
app-admin/src/main/java/com/ruoyi/web/service/GovernmentInfoService.java

@@ -0,0 +1,66 @@
+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.government.GovernmentInfoAddRequest;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoEditRequest;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoQueryRequest;
+import com.ruoyi.web.domain.entity.GovernmentInfo;
+import com.ruoyi.web.domain.vo.GovernmentInfoVO;
+
+
+/**
+ *
+ */
+public interface GovernmentInfoService extends IService<GovernmentInfo> {
+
+    Integer addGovernmentInfo(GovernmentInfoAddRequest governmentInfoAddRequest);
+
+    boolean deleteGovernmentInfo(String ids);
+
+    void editGovernmentInfo(GovernmentInfoEditRequest governmentInfoEditRequest);
+
+    /**
+     * 发布
+     *
+     * @param id
+     * @return
+     */
+    boolean publishGovernmentInfo(int id);
+
+    /**
+     * 下架
+     *
+     * @param id
+     * @return
+     */
+    boolean removeGovernmentInfo(int id);
+
+    /**
+     * 根据id查询
+     *
+     * @param id
+     * @return
+     */
+    GovernmentInfoVO getGovernmentInfoById(int id);
+
+    GovernmentInfoVO getGovernmentInfoVO(GovernmentInfo governmentInfo);
+
+    /**
+     * 分页获取列表
+     *
+     * @param governmentInfoQueryRequest
+     * @return
+     */
+    Page<GovernmentInfoVO> getListGovernmentInfoByPage(GovernmentInfoQueryRequest governmentInfoQueryRequest);
+
+
+    /**
+     * 获取查询条件
+     *
+     * @param governmentInfoQueryRequest
+     * @return
+     */
+    QueryWrapper<GovernmentInfo> getQueryWrapper(GovernmentInfoQueryRequest governmentInfoQueryRequest);
+}

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

@@ -63,4 +63,5 @@ public interface VillageServiceService extends IService<VillageService> {
      * @return
      */
     QueryWrapper<VillageService> getQueryWrapper(VillageServiceQueryRequest villageServiceQueryRequest);
+
 }

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

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.web.domain.entity.EventAssign;
 import com.ruoyi.web.mapper.EventAssignMapper;
 import com.ruoyi.web.service.EventAssignService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -16,6 +17,7 @@ import java.util.List;
  *
  */
 @Service
+@Slf4j
 public class EventAssignServiceImpl extends ServiceImpl<EventAssignMapper, EventAssign>
         implements EventAssignService {
 
@@ -36,6 +38,12 @@ public class EventAssignServiceImpl extends ServiceImpl<EventAssignMapper, Event
         queryWrapper.in("event_id", eventIds)
                 .eq("user_id", userId);
 
+        long count = count(queryWrapper);
+        if (count == 0) {
+            log.info("没有找到匹配的事件记录,无需删除,eventIds={}, userId={}", eventIds, userId);
+            return true;
+        }
+
         // 执行删除操作
         return remove(queryWrapper);
     }

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

@@ -421,7 +421,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
 
         // 如果负责人查询,则查询负责人的事件
         if (ObjectUtil.isNotEmpty(userId)) {
-            queryWrapper.exists("SELECT 1 FROM event_assign ea WHERE ea.event_id = event.id AND ea.person_id = " + userId);
+            queryWrapper.exists("SELECT 1 FROM event_assign ea WHERE ea.event_id = event.id AND ea.user_id = " + userId);
         }
 
         // 事发时间范围查询(优先判断范围)

+ 49 - 26
app-admin/src/main/java/com/ruoyi/web/service/impl/EventTypeAssigneeServiceImpl.java

@@ -26,10 +26,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -100,6 +97,7 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
 
     /**
      * userId -> personId
+     *
      * @param personId
      * @return
      */
@@ -124,7 +122,9 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
         if (ObjectUtil.isEmpty(personId)) {
             throw new ServiceException("id不能为空或id异常");
         }
-        List<Integer> userIds = personInfoService.getUserIdListByPersonIds(new ArrayList<>(personId));
+        ArrayList<Integer> personIds = new ArrayList<>();
+        personIds.add(personId);
+        List<Integer> userIds = personInfoService.getUserIdListByPersonIds(personIds);
         if (CollectionUtil.isEmpty(userIds)) {
             throw new ServiceException("未找到用户");
         }
@@ -137,8 +137,8 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
         if (remove) {
             // 5. 同步删除事件分配表记录(未完结的)
             QueryWrapper<EventAssign> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("user_id",userId)
-                    .eq("status",0);
+            queryWrapper.eq("user_id", userId)
+                    .eq("status", 0);
             return eventAssignService.remove(queryWrapper);
         }
         return false;
@@ -195,27 +195,29 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
                 })
                 .collect(Collectors.toList());
 
-        // 获取重复 类型
+        // 获取重复 类型      oldTypes=2     types= 1,2     onlyInOldTypes = 2
         if (CollectionUtil.isNotEmpty(oldTypes)) {
-            // 拥有的旧类型  (修改的类型中不包含的类型,需要将事件分配的数据进行删除)
+            // 找出用户失去的类型(仅在 oldTypes 中存在,不在 types 中)  (修改的类型中不包含的类型,需要将事件分配的数据进行删除)
             List<Integer> onlyInOldTypes = oldTypes.stream()
                     .filter(e -> !types.contains(e))
                     .collect(Collectors.toList());
-            // 删除对于的事件分配数据(该用户失去对应类型未完结的事件)
-            QueryWrapper<Event> eventQueryWrapper = new QueryWrapper<>();
-            eventQueryWrapper.select("id")
-                    .in("type",onlyInOldTypes)
-                    .eq("status", 0);
-
-            List<Event> list = eventService.list(eventQueryWrapper);
-            List<Integer> eventIds = list.stream().map(Event::getId).collect(Collectors.toList());
-
-            boolean b = eventAssignService.deleteEventAssign(eventIds, userId);
-            if (!b){
-                throw new ServiceException("同步事件分配失败,修改失败");
+            // 删除对应的事件分配数据(该用户失去对应类型未完结的事件)
+            if (CollectionUtil.isNotEmpty(onlyInOldTypes)) {
+                QueryWrapper<Event> eventQueryWrapper = new QueryWrapper<>();
+                eventQueryWrapper.select("id")
+                        .in("type", onlyInOldTypes)
+                        .eq("status", 0);
+                List<Event> events = eventService.list(eventQueryWrapper);
+                if (CollectionUtil.isNotEmpty(events)) {
+                    List<Integer> eventIds = events.stream().map(Event::getId).collect(Collectors.toList());
+
+                    boolean b = eventAssignService.deleteEventAssign(eventIds, userId);
+                    if (!b) {
+                        throw new ServiceException("同步事件分配失败,修改失败");
+                    }
+                }
             }
         }
-
         if (!this.saveBatch(assignees)) {
             throw new ServiceException("修改失败");
         }
@@ -238,8 +240,8 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
             throw new ServiceException("数据字段不完整");
         }
 
-        List<Integer> types= eventTypeAssigneeList.stream().map(
-                eventTypeAssignee ->{
+        List<Integer> types = eventTypeAssigneeList.stream().map(
+                eventTypeAssignee -> {
                     return eventTypeAssignee.getType();
                 }).collect(Collectors.toList());
         EventTypeAssigneeVO eventTypeAssigneeVO = new EventTypeAssigneeVO();
@@ -270,7 +272,7 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
         Integer userId = getUserId(personId);
 
         QueryWrapper<EventTypeAssignee> wrapper = new QueryWrapper<>();
-        wrapper.eq("user_id",userId);
+        wrapper.eq("user_id", userId);
         List<EventTypeAssignee> eventTypeAssigneeList = this.list(wrapper);
         return getEventTypeAssigneeVO(eventTypeAssigneeList);
     }
@@ -290,7 +292,7 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
         QueryWrapper<EventTypeAssignee> wrapper = new QueryWrapper<>();
         wrapper.eq("type", type);
         List<EventTypeAssignee> eventTypeAssigneeList = this.list(wrapper);
-        if (eventTypeAssigneeList.isEmpty()){
+        if (eventTypeAssigneeList.isEmpty()) {
             return new ArrayList<>();
         }
         // 从 eventTypeAssigneeList 中 获取 userId 列表
@@ -329,6 +331,27 @@ public class EventTypeAssigneeServiceImpl extends ServiceImpl<EventTypeAssigneeM
         }).collect(Collectors.toList());
         // 获取 负责人列表
         List<PersonInfoVO> eventPersonInfoVOList = personInfoService.getPersonInfoVOListByUserIds(userIds);
+        Map<Integer, List<Integer>> userTypeMap = new HashMap<>();
+        // 如果type为空,查询所有相关的type
+        if (ObjectUtil.isEmpty(type)) {
+            QueryWrapper<EventTypeAssignee> eventTypeAssigneeQueryWrapper = new QueryWrapper<>();
+            List<EventTypeAssignee> assignees = eventTypeAssigneeService.list(eventTypeAssigneeQueryWrapper);
+
+            // 按user_id分组,收集对应的type列表
+            userTypeMap = assignees.stream()
+                    .collect(Collectors.groupingBy(
+                            EventTypeAssignee::getUserId,
+                            Collectors.mapping(EventTypeAssignee::getType, Collectors.toList())
+                    ));
+            // 为每个负责人设置type列表
+            for (PersonInfoVO personInfoVO : eventPersonInfoVOList) {
+                Integer userId = personInfoVO.getUserId();
+                List<Integer> types = userTypeMap.getOrDefault(userId, Collections.emptyList());
+                // 对 types 进行升序排序(从小到大)
+                Collections.sort(types);
+                personInfoVO.setType(types);
+            }
+        }
 
         // 构造分页 计算分页数据
         List<PersonInfoVO> pageData = eventPersonInfoVOList.stream()

+ 310 - 0
app-admin/src/main/java/com/ruoyi/web/service/impl/GovernmentInfoServiceImpl.java

@@ -0,0 +1,310 @@
+package com.ruoyi.web.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+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.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.system.service.ISysUserService;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoAddRequest;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoEditRequest;
+import com.ruoyi.web.domain.dto.government.GovernmentInfoQueryRequest;
+import com.ruoyi.web.domain.entity.GovernmentInfo;
+import com.ruoyi.web.domain.enums.GovernmentInfoEnum;
+import com.ruoyi.web.domain.vo.GovernmentInfoVO;
+import com.ruoyi.web.mapper.GovernmentInfoMapper;
+import com.ruoyi.web.service.GovernmentInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ *
+ */
+@Service
+public class GovernmentInfoServiceImpl extends ServiceImpl<GovernmentInfoMapper, GovernmentInfo>
+    implements GovernmentInfoService {
+    @Autowired
+    private ISysUserService userService;
+
+    @Override
+    public Integer addGovernmentInfo(GovernmentInfoAddRequest governmentInfoAddRequest) {
+        if (governmentInfoAddRequest == null) {
+            throw new ServiceException("请求参数为空");
+        }
+        try {
+            // 转换为实体对象
+            GovernmentInfo governmentInfo = new GovernmentInfo();
+            BeanUtil.copyProperties(governmentInfoAddRequest, governmentInfo);
+            //数据校验
+            validGovernmentInfo(governmentInfo, BusinessType.INSERT);
+            Integer status = governmentInfo.getStatus();
+            if (status.equals(GovernmentInfoEnum.PUBLISHED.getValue())) {
+                // 填充发布日期和发布人
+                governmentInfo.setDate(new Date()); // 设置发布日期为当前时间
+                Long userId = SecurityUtils.getUserId();
+                governmentInfo.setIssuerId(userId.intValue());// 设置发布人ID
+                governmentInfo.setStatus(GovernmentInfoEnum.PUBLISHED.getValue());
+            }
+            // 保存到数据库
+            this.save(governmentInfo);
+            return governmentInfo.getId();
+        } catch (Exception e) {
+            log.error("添加政务信息失败", e);
+            throw new ServiceException("添加政务信息失败");
+        }
+    }
+
+    @Override
+    public boolean deleteGovernmentInfo(String ids) {
+        if (StrUtil.isBlank(ids)) {
+            throw new ServiceException("id不能为空或id异常");
+        }
+
+        // 2. 分割ID字符串为List<Integer>
+        List<Long> idList = Arrays.stream(ids.split(","))
+                .map(String::trim)
+                .filter(StrUtil::isNotBlank)
+                .map(Long::parseLong)
+                .collect(Collectors.toList());
+
+        if (idList.isEmpty()) {
+            throw new ServiceException("ID格式异常");
+        }
+
+        // 3. 构建删除条件
+        QueryWrapper<GovernmentInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("id", idList);
+
+        // 4. 执行删除(返回是否删除成功)
+        return remove(queryWrapper);
+    }
+
+    @Override
+    public void editGovernmentInfo(GovernmentInfoEditRequest governmentInfoEditRequest) {
+        // 判断是否存在
+        Integer id = governmentInfoEditRequest.getId();
+        GovernmentInfo oldGovernmentInfo = this.getById(id);
+        if (oldGovernmentInfo == null) {
+            throw new ServiceException("没有找到政务信息");
+        }
+        GovernmentInfo governmentInfo = new GovernmentInfo();
+        BeanUtil.copyProperties(governmentInfoEditRequest, governmentInfo);
+        governmentInfo.setUpdateTime(new Date());
+
+        //如果修改状态为 发布 时,填充 发布日期 和 发布人
+        if (GovernmentInfoEnum.PUBLISHED.getValue() == governmentInfo.getStatus()) {
+            // 填充发布日期和发布人
+            governmentInfo.setDate(new Date()); // 设置发布日期为当前时间
+            Long userId = SecurityUtils.getUserId();
+            governmentInfo.setIssuerId(userId.intValue());// 设置发布人ID
+        }
+
+        // 数据校验
+        validGovernmentInfo(governmentInfo, BusinessType.UPDATE);
+        // 操作数据库
+        boolean result = this.updateById(governmentInfo);
+        if (!result) {
+            throw new ServiceException("修改政务信息操作失败");
+        }
+    }
+
+    /**
+     * 发布
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean publishGovernmentInfo(int id) {
+        if (id <= 0) {
+            throw new ServiceException("参数错误");
+        }
+        GovernmentInfo governmentInfo = this.getById(id);
+        if (governmentInfo == null) {
+            throw new ServiceException("没有找到政务信息");
+        }
+        Integer status = governmentInfo.getStatus();
+        if (status.equals(GovernmentInfoEnum.NON_PUBLISHED.getValue())) {
+            // 填充发布日期和发布人
+            governmentInfo.setDate(new Date()); // 设置发布日期为当前时间
+            Long userId = SecurityUtils.getUserId();
+            governmentInfo.setIssuerId(userId.intValue());// 设置发布人ID
+            governmentInfo.setStatus(GovernmentInfoEnum.PUBLISHED.getValue());
+            this.updateById(governmentInfo);
+        } else {
+            throw new ServiceException("只有未发布的才能发布");
+        }
+        return true;
+    }
+
+    /**
+     * 下架
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean removeGovernmentInfo(int id) {
+        if (id <= 0) {
+            throw new ServiceException("参数错误");
+        }
+        GovernmentInfo governmentInfo = this.getById(id);
+        if (governmentInfo == null) {
+            throw new ServiceException("没有找到政务信息");
+        }
+        Integer status = governmentInfo.getStatus();
+        if (status.equals(GovernmentInfoEnum.PUBLISHED.getValue())) {
+            governmentInfo.setStatus(GovernmentInfoEnum.REMOVED.getValue());
+        } else {
+            throw new ServiceException("发布的才能下架");
+        }
+        this.updateById(governmentInfo);
+        return true;
+    }
+
+
+    /**
+     * 校验政务信息
+     *
+     * @param governmentInfo
+     */
+    public void validGovernmentInfo(GovernmentInfo governmentInfo, BusinessType type) {
+        if (ObjectUtil.isEmpty(governmentInfo)) {
+            throw new ServiceException("数据为空");
+        }
+        Integer id = governmentInfo.getId();
+        String title = governmentInfo.getTitle();
+        String tag = governmentInfo.getTag();
+        String serviceType = governmentInfo.getType();
+        String content = governmentInfo.getContent();
+
+        // 添加id无需校验,修改时,id 不能为空
+        if (type != BusinessType.INSERT && ObjectUtil.isEmpty(id)) {
+            throw new ServiceException("id不能为空");
+        }
+        if (StrUtil.isBlank(title)) {
+            throw new ServiceException("标题不能为空");
+        }
+        if (StrUtil.isBlank(tag)) {
+            throw new ServiceException("标签不能为空");
+        }
+        if (StrUtil.isBlank(serviceType)) {
+            throw new ServiceException("类型不能为空");
+        }
+        if (StrUtil.isBlank(content)) {
+            throw new ServiceException("内容不能为空");
+        }
+    }
+
+
+    @Override
+    public GovernmentInfoVO getGovernmentInfoById(int id) {
+        if (id <= 0 || ObjectUtil.isEmpty(id)) {
+            throw new ServiceException("id不能为空或id异常");
+        }
+        GovernmentInfo governmentInfo = this.getById(id);
+        if (governmentInfo == null) {
+            return null;
+        }
+        return getGovernmentInfoVO(governmentInfo);
+    }
+
+    @Override
+    public Page<GovernmentInfoVO> getListGovernmentInfoByPage(GovernmentInfoQueryRequest governmentInfoQueryRequest) {
+        long current = governmentInfoQueryRequest.getPageNum();
+        long size = governmentInfoQueryRequest.getPageSize();
+        Page<GovernmentInfo> servicePage = this.page(new Page<>(current, size),
+                getQueryWrapper(governmentInfoQueryRequest));
+
+        // 创建VO分页对象
+        Page<GovernmentInfoVO> voPage = new Page<>(current, size, servicePage.getTotal());
+
+        // 转换为VO列表
+        List<GovernmentInfoVO> voList = new ArrayList<>();
+        for (GovernmentInfo service : servicePage.getRecords()) {
+            voList.add(getGovernmentInfoVO(service));
+        }
+
+        voPage.setRecords(voList);
+        return voPage;
+    }
+
+    /**
+     * 将实体转换为VO,并填充发布人信息
+     */
+    @Override
+    public GovernmentInfoVO getGovernmentInfoVO(GovernmentInfo governmentInfo) {
+        GovernmentInfoVO vo = new GovernmentInfoVO();
+        BeanUtil.copyProperties(governmentInfo, vo);
+
+        // 如果有发布人ID,获取发布人信息
+        Integer issuerId = governmentInfo.getIssuerId();
+        if (issuerId != null) {
+            try {
+                SysUser user = userService.selectUserById(issuerId.longValue());
+                if (user != null) {
+                    Map<String, String> issuer = new HashMap<>();
+                    issuer.put("nickName", user.getNickName());
+                    // 填充其他信息
+                    vo.setIssuer(issuer);
+                }
+            } catch (Exception e) {
+                log.error("获取发布人信息失败", e);
+                throw new ServiceException("获取发布人信息失败");
+            }
+        }
+
+        return vo;
+    }
+
+    @Override
+    public QueryWrapper<GovernmentInfo> getQueryWrapper(GovernmentInfoQueryRequest governmentInfoQueryRequest) {
+        QueryWrapper<GovernmentInfo> queryWrapper = new QueryWrapper<>();
+        if (governmentInfoQueryRequest == null) {
+            return queryWrapper;
+        }
+
+        // 从对象中取值
+        String tag = governmentInfoQueryRequest.getTag();
+        String keyword = governmentInfoQueryRequest.getKeyword();
+        Date startTime = governmentInfoQueryRequest.getStartTime();
+        Date endTime = governmentInfoQueryRequest.getEndTime();
+        Integer status = governmentInfoQueryRequest.getStatus();
+        String sortField = governmentInfoQueryRequest.getSortField();
+        String sortOrder = governmentInfoQueryRequest.getSortOrder();
+
+        queryWrapper.eq(ObjectUtil.isNotEmpty(status), "status", status)
+                .eq(StrUtil.isNotEmpty(tag), "tag", tag);
+
+        // 如果关键字不为空,添加模糊查询条件  标题或内容
+        if (StrUtil.isNotBlank(keyword)) {
+            queryWrapper.like("title", keyword)
+                    .or()
+                    .like("content", keyword);
+        }
+        // 日期范围查询(优先判断范围)
+        if (startTime != null && endTime != null) {
+            queryWrapper.between("date", startTime, endTime);
+        } else if (startTime != null) {
+            queryWrapper.ge("date", startTime); // >= 开始日期
+        } else if (endTime != null) {
+            queryWrapper.le("date", endTime);   // <= 结束日期
+        }
+
+        // 排序
+        queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), "ascend".equals(sortOrder), sortField);
+        return queryWrapper;
+    }
+}
+
+
+
+

+ 26 - 10
app-admin/src/main/java/com/ruoyi/web/service/impl/PersonInfoServiceImpl.java

@@ -16,21 +16,21 @@ 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.EventTypeAssignee;
 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.EventTypeAssigneeService;
 import com.ruoyi.web.service.HouseholdInfoService;
 import com.ruoyi.web.service.PersonInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import javax.annotation.Resource;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -41,11 +41,14 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         implements PersonInfoService {
 
     @Autowired
-    private  HouseInfoMapper houseInfoMapper;
+    private HouseInfoMapper houseInfoMapper;
 
     @Autowired
     private HouseholdInfoService householdInfoService;
 
+    @Resource
+    private EventTypeAssigneeService eventTypeAssigneeService;
+
     @Override
     public Integer addPersonInfo(PersonInfoAddRequest personInfoAddRequest) {
         if (personInfoAddRequest == null) {
@@ -244,9 +247,20 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         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());
+        QueryWrapper<EventTypeAssignee> wrapper = new QueryWrapper<>();
+        wrapper.select("DISTINCT user_id");
+        List<EventTypeAssignee> eventTypeAssigneeList = eventTypeAssigneeService.list(wrapper);
+        // 3. 提取所有存在的 user_id(已去重)
+        Set<Integer> existingUserIds = eventTypeAssigneeList.stream()
+                .map(EventTypeAssignee::getUserId)
+                .collect(Collectors.toSet());
+
+        // 4. 处理每条记录
+        return list.stream().map(personInfo->{
+            PersonInfoVO personInfoVO = getPersonInfoVO(personInfo);
+            personInfoVO.setLeader(existingUserIds.contains(personInfo.getUserId()));
+            return personInfoVO;
+        }).collect(Collectors.toList());
     }
 
 
@@ -340,8 +354,8 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         // 门牌号查询人员列表
         if (StrUtil.isNotBlank(doorplateNumber)) {
             String subQuery = "SELECT hd.id FROM household_info hd " +
-                    "JOIN house_info hi ON hd.house_code = hi.house_code " +
-                    "WHERE hi.doorplate_number = '" + doorplateNumber + "'";
+                              "JOIN house_info hi ON hd.house_code = hi.house_code " +
+                              "WHERE hi.doorplate_number = '" + doorplateNumber + "'";
             queryWrapper.inSql("household_id", subQuery);
         }
 
@@ -359,6 +373,7 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
 
     /**
      * 解密身份证
+     *
      * @param idCard
      * @return
      */
@@ -374,6 +389,7 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
 
     /**
      * 加密身份证
+     *
      * @param idCard
      * @return
      */

+ 0 - 4
app-admin/src/main/java/com/ruoyi/web/service/impl/VillageServiceServiceImpl.java

@@ -18,7 +18,6 @@ import com.ruoyi.web.domain.entity.VillageService;
 import com.ruoyi.web.domain.enums.VillageServiceEnum;
 import com.ruoyi.web.domain.vo.VillageServiceVO;
 import com.ruoyi.web.mapper.VillageServiceMapper;
-import com.ruoyi.web.service.ProductionDataService;
 import com.ruoyi.web.service.VillageServiceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -36,9 +35,6 @@ public class VillageServiceServiceImpl extends ServiceImpl<VillageServiceMapper,
     @Autowired
     private ISysUserService userService;
 
-    @Autowired
-    private ProductionDataService productionDataService;
-
     @Override
     public Integer addVillageService(VillageServiceAddRequest villageServiceAddRequest) {
         if (villageServiceAddRequest == null) {

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

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

+ 30 - 0
app-admin/src/main/resources/mapper/web/GovernmentInfoMapper.xml

@@ -0,0 +1,30 @@
+<?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.GovernmentInfoMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.GovernmentInfo">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="title" column="title" jdbcType="VARCHAR"/>
+            <result property="tag" column="tag" jdbcType="VARCHAR"/>
+            <result property="type" column="type" jdbcType="VARCHAR"/>
+            <result property="content" column="content" jdbcType="VARCHAR"/>
+            <result property="photoUrl" column="photo_url" jdbcType="VARCHAR"/>
+            <result property="source" column="source" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="INTEGER"/>
+            <result property="date" column="date" jdbcType="TIMESTAMP"/>
+            <result property="issuerId" column="issuer_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,title,tag,
+        type,content,photo_url,
+        source,status,date,
+        issuer_id,create_time,update_time,
+        del_flag
+    </sql>
+</mapper>

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

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="generator.mapper.VillageTraditionMapper">
+<mapper namespace="com.ruoyi.web.mapper.VillageTraditionMapper">
 
     <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.VillageTradition">
             <id property="id" column="id" jdbcType="INTEGER"/>

+ 38 - 4
sql/sql.sql

@@ -273,10 +273,10 @@ create table production_data
 create table village_service
 (
     id      int auto_increment primary key,
-    title   varchar(11)   null comment '标题',
-    tag   varchar(10)   null   comment '标签',
+    title   varchar(50)   null comment '标题',
+    tag   varchar(10)   null   comment '标签 0-技术培训/1-产业扶持政策',
     type   varchar(10) default 0 null comment '类型 0-图文,1-视频',
-    content varchar(255)  null comment '内容',
+    content text  null comment '内容',
     photo_url varchar(255)  null comment '封面图',
     source varchar(255)  null   comment '来源',
     status  int default 0 null comment '发布状态 0-未发布 1-已发布 2-下架',
@@ -287,7 +287,6 @@ create table village_service
     del_flag        char default '0' null               comment '删除标志',
     INDEX idx_tag (tag),
     INDEX idx_title (title),
-    INDEX idx_content (content),
     INDEX idx_date (date),
     INDEX idx_status (status)
 )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '乡村振兴产业服务与支持';
@@ -396,6 +395,41 @@ CREATE TABLE event_type_assignee (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件类型负责人配置表';
 
 
+-- 政务信息管理
+create table government_info
+(
+    id      int auto_increment primary key,
+    title   varchar(50)   null comment '标题',
+    tag   varchar(10)   null   comment '标签 0-政务通知/1-政策解读/2-公共服务',
+    type   varchar(10) default 0 null comment '类型 0-图文,1-视频',
+    content text  null comment '内容',
+    photo_url varchar(255)  null comment '封面图',
+    source varchar(255)  null   comment '来源',
+    status  int default 0 null comment '发布状态 0-未发布 1-已发布 2-下架',
+    date datetime      null     comment '发布日期',
+    issuer_id  int  null     comment '发布人id',
+    create_time        datetime     default CURRENT_TIMESTAMP not null comment '创建时间',
+    update_time      datetime     default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
+    del_flag        char default '0' null               comment '删除标志',
+    INDEX idx_tag (tag),
+    INDEX idx_title (title),
+    INDEX idx_date (date),
+    INDEX idx_status (status)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '政务信息管理表';
+
+
+-- 物联网平台产品管理
+create table lot_platform_products
+(
+    id      int auto_increment primary key,
+    category   varchar(20) not null comment '类别',
+    remark   varchar(100)  null comment '备注',
+    create_time        datetime     default CURRENT_TIMESTAMP not null comment '创建时间',
+    update_time      datetime     default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
+    del_flag        char default '0' null               comment '删除标志',
+    INDEX idx_category (category)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '物联网平台产品管理表';
+