LIVE_YE 1 vuosi sitten
vanhempi
commit
9ab58efd15

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZxFjController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.ZxFj;
+import com.ruoyi.system.service.IZxFjService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 政协_附件Controller
+ *
+ * @author boman
+ * @date 2024-03-07
+ */
+@RestController
+@RequestMapping("/zx/fj")
+public class ZxFjController extends BaseController
+{
+    @Autowired
+    private IZxFjService zxFjService;
+
+/**
+ * 查询政协_附件列表
+ */
+@PreAuthorize("@ss.hasPermi('system:fj:list')")
+@GetMapping("/list")
+    public TableDataInfo list(ZxFj zxFj)
+    {
+        startPage();
+        List<ZxFj> list = zxFjService.selectZxFjList(zxFj);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出政协_附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:export')")
+    @Log(title = "政协_附件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ZxFj zxFj)
+    {
+        List<ZxFj> list = zxFjService.selectZxFjList(zxFj);
+        ExcelUtil<ZxFj> util = new ExcelUtil<ZxFj>(ZxFj.class);
+        util.exportExcel(response, list, "政协_附件数据");
+    }
+
+    /**
+     * 获取政协_附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(zxFjService.selectZxFjById(id));
+    }
+
+    /**
+     * 新增政协_附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:add')")
+    @Log(title = "政协_附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZxFj zxFj)
+    {
+        return toAjax(zxFjService.insertZxFj(zxFj));
+    }
+
+    /**
+     * 修改政协_附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:edit')")
+    @Log(title = "政协_附件", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ZxFj zxFj)
+    {
+        return toAjax(zxFjService.updateZxFj(zxFj));
+    }
+
+    /**
+     * 删除政协_附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:remove')")
+    @Log(title = "政协_附件", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(zxFjService.deleteZxFjByIds(ids));
+    }
+}

+ 8 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.util.List;
 import java.util.stream.Collectors;
 import com.fasterxml.jackson.annotation.JsonInclude;
+import com.ruoyi.common.core.domain.entity.CategoryProposal;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysMenu;
 
@@ -38,6 +39,13 @@ public class TreeSelect implements Serializable
         this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
     }
 
+    public TreeSelect(CategoryProposal category)
+    {
+        this.id = category.getCategoryId();
+        this.label = category.getCategoryName();
+        this.children = category.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
+    }
+
     public TreeSelect(SysMenu menu)
     {
         this.id = menu.getMenuId();

+ 1 - 0
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -74,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
 		</where>
+		order by create_time desc
 	</select>
 
 	<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">

+ 118 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/ZxFj.java

@@ -0,0 +1,118 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 政协_附件对象 zx_fj
+ * 
+ * @author boman
+ * @date 2024-03-07
+ */
+public class ZxFj extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 附件ID */
+    private Long id;
+
+
+    /** 主体id(提案id或者社情民意id) */
+    private Long mainId;
+
+    /** 数据id */
+    @Excel(name = "数据id")
+    private Long sourceId;
+
+    /** 附件名称 */
+    @Excel(name = "附件名称")
+    private String name;
+
+    /** 附件地址 */
+    @Excel(name = "附件地址")
+    private String url;
+
+    /** 地址类型 1:提案附件,2:社情民意附件 */
+    @Excel(name = "地址类型 1:提案附件,2:社情民意附件")
+    private String type;
+
+
+    /** 附件归属类型 1:填报附件,2:答复附件,3:主办单位答复附件,4:协办单位答复附件 */
+    @Excel(name = "地址类型 1:答复附件,2:主办单位答复附件,3:协办单位答复附件,4:填报附件")
+    private String stytle;
+
+    public Long getMainId() {
+        return mainId;
+    }
+
+    public void setMainId(Long mainId) {
+        this.mainId = mainId;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setSourceId(Long sourceId) 
+    {
+        this.sourceId = sourceId;
+    }
+
+    public Long getSourceId() 
+    {
+        return sourceId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+
+    public String getStytle() {
+        return stytle;
+    }
+
+    public void setStytle(String stytle) {
+        this.stytle = stytle;
+    }
+
+    @Override
+    public String toString() {
+        return "ZxFj{" +
+                "id=" + id +
+                ", sourceId=" + sourceId +
+                ", name='" + name + '\'' +
+                ", url='" + url + '\'' +
+                ", type='" + type + '\'' +
+                ", stytle='" + stytle + '\'' +
+                '}';
+    }
+}

+ 27 - 17
ruoyi-system/src/main/java/com/ruoyi/system/domain/member/MemberInfo.java

@@ -24,11 +24,11 @@ public class MemberInfo extends BaseEntity
 
     /** 委员姓名 */
     @Excel(name = "委员姓名")
-    private String memberName;
+    private String name;
 
     /** 委员身份证号 */
     @Excel(name = "委员身份证号")
-    private String memberCard;
+    private String card;
 
     /** 界别 */
     @Excel(name = "界别")
@@ -57,6 +57,9 @@ public class MemberInfo extends BaseEntity
     /** 删除标志(0代表存在 2代表删除) */
     private String delFlag;
 
+    /** 地址类型 1:领衔,2:附议 */
+    private String type;
+
     public void setMemberId(Long memberId) 
     {
         this.memberId = memberId;
@@ -75,25 +78,24 @@ public class MemberInfo extends BaseEntity
     {
         return userId;
     }
-    public void setMemberName(String memberName) 
-    {
-        this.memberName = memberName;
+
+    public String getName() {
+        return name;
     }
 
-    public String getMemberName() 
-    {
-        return memberName;
+    public void setName(String name) {
+        this.name = name;
     }
-    public void setMemberCard(String memberCard) 
-    {
-        this.memberCard = memberCard;
+
+    public String getCard() {
+        return card;
     }
 
-    public String getMemberCard() 
-    {
-        return memberCard;
+    public void setCard(String card) {
+        this.card = card;
     }
-    public void setBoundary(String boundary) 
+
+    public void setBoundary(String boundary)
     {
         this.boundary = boundary;
     }
@@ -157,13 +159,21 @@ public class MemberInfo extends BaseEntity
         return delFlag;
     }
 
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("memberId", getMemberId())
             .append("userId", getUserId())
-            .append("memberName", getMemberName())
-            .append("memberCard", getMemberCard())
+            .append("name", getName())
+            .append("card", getCard())
             .append("boundary", getBoundary())
             .append("partyAffiliation", getPartyAffiliation())
             .append("phonenumber", getPhonenumber())

+ 65 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZxFjMapper.java

@@ -0,0 +1,65 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.ProposalInfo;
+import com.ruoyi.system.domain.ZxFj;
+
+/**
+ * 政协_附件Mapper接口
+ * 
+ * @author boman
+ * @date 2024-03-07
+ */
+public interface ZxFjMapper 
+{
+    /**
+     * 查询政协_附件
+     * 
+     * @param id 政协_附件主键
+     * @return 政协_附件
+     */
+    public ZxFj selectZxFjById(Long id);
+
+    /**
+     * 查询政协_附件列表
+     * 
+     * @param zxFj 政协_附件
+     * @return 政协_附件集合
+     */
+    public List<ZxFj> selectZxFjList(ZxFj zxFj);
+
+    /**
+     * 新增政协_附件
+     * 
+     * @param zxFj 政协_附件
+     * @return 结果
+     */
+    public int insertZxFj(ZxFj zxFj);
+
+    /**
+     * 修改政协_附件
+     * 
+     * @param zxFj 政协_附件
+     * @return 结果
+     */
+    public int updateZxFj(ZxFj zxFj);
+
+    /**
+     * 删除政协_附件
+     * 
+     * @param id 政协_附件主键
+     * @return 结果
+     */
+    public int deleteZxFjById(Long id);
+
+    /**
+     * 批量删除政协_附件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteZxFjByIds(Long[] ids);
+
+    void deleteZxFjBySourceId(Long sourceId);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IZxFjService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.ZxFj;
+
+/**
+ * 政协_附件Service接口
+ * 
+ * @author boman
+ * @date 2024-03-07
+ */
+public interface IZxFjService 
+{
+    /**
+     * 查询政协_附件
+     * 
+     * @param id 政协_附件主键
+     * @return 政协_附件
+     */
+    public ZxFj selectZxFjById(Long id);
+
+    /**
+     * 查询政协_附件列表
+     * 
+     * @param zxFj 政协_附件
+     * @return 政协_附件集合
+     */
+    public List<ZxFj> selectZxFjList(ZxFj zxFj);
+
+    /**
+     * 新增政协_附件
+     * 
+     * @param zxFj 政协_附件
+     * @return 结果
+     */
+    public int insertZxFj(ZxFj zxFj);
+
+    /**
+     * 修改政协_附件
+     * 
+     * @param zxFj 政协_附件
+     * @return 结果
+     */
+    public int updateZxFj(ZxFj zxFj);
+
+    /**
+     * 批量删除政协_附件
+     * 
+     * @param ids 需要删除的政协_附件主键集合
+     * @return 结果
+     */
+    public int deleteZxFjByIds(Long[] ids);
+
+    /**
+     * 删除政协_附件信息
+     * 
+     * @param id 政协_附件主键
+     * @return 结果
+     */
+    public int deleteZxFjById(Long id);
+}

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZxFjServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.ZxFjMapper;
+import com.ruoyi.system.domain.ZxFj;
+import com.ruoyi.system.service.IZxFjService;
+
+/**
+ * 政协_附件Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-03-07
+ */
+@Service
+public class ZxFjServiceImpl implements IZxFjService 
+{
+    @Autowired
+    private ZxFjMapper zxFjMapper;
+
+    /**
+     * 查询政协_附件
+     * 
+     * @param id 政协_附件主键
+     * @return 政协_附件
+     */
+    @Override
+    public ZxFj selectZxFjById(Long id)
+    {
+        return zxFjMapper.selectZxFjById(id);
+    }
+
+    /**
+     * 查询政协_附件列表
+     * 
+     * @param zxFj 政协_附件
+     * @return 政协_附件
+     */
+    @Override
+    public List<ZxFj> selectZxFjList(ZxFj zxFj)
+    {
+        return zxFjMapper.selectZxFjList(zxFj);
+    }
+
+    /**
+     * 新增政协_附件
+     * 
+     * @param zxFj 政协_附件
+     * @return 结果
+     */
+    @Override
+    public int insertZxFj(ZxFj zxFj)
+    {
+        return zxFjMapper.insertZxFj(zxFj);
+    }
+
+    /**
+     * 修改政协_附件
+     * 
+     * @param zxFj 政协_附件
+     * @return 结果
+     */
+    @Override
+    public int updateZxFj(ZxFj zxFj)
+    {
+        return zxFjMapper.updateZxFj(zxFj);
+    }
+
+    /**
+     * 批量删除政协_附件
+     * 
+     * @param ids 需要删除的政协_附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteZxFjByIds(Long[] ids)
+    {
+        return zxFjMapper.deleteZxFjByIds(ids);
+    }
+
+    /**
+     * 删除政协_附件信息
+     * 
+     * @param id 政协_附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteZxFjById(Long id)
+    {
+        return zxFjMapper.deleteZxFjById(id);
+    }
+}

+ 11 - 11
ruoyi-system/src/main/resources/mapper/system/MemberInfoMapper.xml

@@ -7,8 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="MemberInfo" id="MemberInfoResult">
         <result property="memberId"    column="member_id"    />
         <result property="userId"    column="user_id"    />
-        <result property="memberName"    column="member_name"    />
-        <result property="memberCard"    column="member_card"    />
+        <result property="name"    column="name"    />
+        <result property="card"    column="card"    />
         <result property="boundary"    column="boundary"    />
         <result property="partyAffiliation"    column="party_affiliation"    />
         <result property="phonenumber"    column="phonenumber"    />
@@ -24,15 +24,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMemberInfoVo">
-        select member_id, user_id, member_name, member_card, boundary, party_affiliation, phonenumber, avatar, unit, studio, del_flag, create_by, create_time, update_by, update_time, remark from member_info
+        select member_id, user_id, name, card, boundary, party_affiliation, phonenumber, avatar, unit, studio, del_flag, create_by, create_time, update_by, update_time, remark from member_info
     </sql>
 
     <select id="selectMemberInfoList" parameterType="MemberInfo" resultMap="MemberInfoResult">
         <include refid="selectMemberInfoVo"/>
         <where>  
             <if test="userId != null "> and user_id = #{userId}</if>
-            <if test="memberName != null  and memberName != ''"> and member_name like concat('%', #{memberName}, '%')</if>
-            <if test="memberCard != null  and memberCard != ''"> and member_card = #{memberCard}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="card != null  and card != ''"> and card = #{card}</if>
             <if test="boundary != null  and boundary != ''"> and boundary = #{boundary}</if>
             <if test="partyAffiliation != null  and partyAffiliation != ''"> and party_affiliation = #{partyAffiliation}</if>
             <if test="phonenumber != null  and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
@@ -51,8 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into member_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null">user_id,</if>
-            <if test="memberName != null and memberName != ''">member_name,</if>
-            <if test="memberCard != null and memberCard != ''">member_card,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="card != null and card != ''">card,</if>
             <if test="boundary != null">boundary,</if>
             <if test="partyAffiliation != null">party_affiliation,</if>
             <if test="phonenumber != null">phonenumber,</if>
@@ -68,8 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
-            <if test="memberName != null and memberName != ''">#{memberName},</if>
-            <if test="memberCard != null and memberCard != ''">#{memberCard},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="card != null and card != ''">#{card},</if>
             <if test="boundary != null">#{boundary},</if>
             <if test="partyAffiliation != null">#{partyAffiliation},</if>
             <if test="phonenumber != null">#{phonenumber},</if>
@@ -89,8 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update member_info
         <trim prefix="SET" suffixOverrides=",">
             <if test="userId != null">user_id = #{userId},</if>
-            <if test="memberName != null and memberName != ''">member_name = #{memberName},</if>
-            <if test="memberCard != null and memberCard != ''">member_card = #{memberCard},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="card != null and card != ''">card = #{card},</if>
             <if test="boundary != null">boundary = #{boundary},</if>
             <if test="partyAffiliation != null">party_affiliation = #{partyAffiliation},</if>
             <if test="phonenumber != null">phonenumber = #{phonenumber},</if>

+ 88 - 0
ruoyi-system/src/main/resources/mapper/system/ZxFjMapper.xml

@@ -0,0 +1,88 @@
+<?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.system.mapper.ZxFjMapper">
+    
+    <resultMap type="ZxFj" id="ZxFjResult">
+        <result property="id"    column="id"    />
+        <result property="mainId"    column="main_id"    />
+        <result property="sourceId"    column="source_id"    />
+        <result property="name"    column="name"    />
+        <result property="url"    column="url"    />
+        <result property="type"    column="type"    />
+        <result property="stytle"    column="stytle"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectZxFjVo">
+        select id,main_id, source_id, name, url, type,stytle, remark from zx_fj
+    </sql>
+
+    <select id="selectZxFjList" parameterType="ZxFj" resultMap="ZxFjResult">
+        <include refid="selectZxFjVo"/>
+        <where>
+            <if test="mainId != null "> and main_id = #{mainId}</if>
+            <if test="sourceId != null "> and source_id = #{sourceId}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="url != null  and url != ''"> and url = #{url}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="stytle != null  and stytle != ''"> and stytle = #{stytle}</if>
+        </where>
+    </select>
+    
+    <select id="selectZxFjById" parameterType="Long" resultMap="ZxFjResult">
+        <include refid="selectZxFjVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertZxFj" parameterType="ZxFj" useGeneratedKeys="true" keyProperty="id">
+        insert into zx_fj
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="mainId != null "> main_id </if>
+            <if test="sourceId != null">source_id,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="url != null">url,</if>
+            <if test="type != null">type,</if>
+            <if test="stytle != null">stytle,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="mainId != null "> #{mainId}</if>
+            <if test="sourceId != null">#{sourceId},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="url != null">#{url},</if>
+            <if test="type != null">#{type},</if>
+            <if test="stytle != null">#{stytle},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateZxFj" parameterType="ZxFj">
+        update zx_fj
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="mainId != null ">main_id = #{mainId}</if>
+            <if test="sourceId != null">source_id = #{sourceId},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="url != null">url = #{url},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="stytle != null">stytle = #{stytle},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteZxFjById" parameterType="Long">
+        delete from zx_fj where id = #{id}
+    </delete>
+
+    <delete id="deleteZxFjByIds" parameterType="String">
+        delete from zx_fj where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <delete id="deleteZxFjBySourceId" parameterType="Long">
+        delete from zx_fj where source_id = #{sourceId}
+    </delete>
+</mapper>