瀏覽代碼

社情民意补充

LIVE_YE 1 年之前
父節點
當前提交
9bffffcf76

+ 19 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/sqmy/SqmyUnitReplyController.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.sqmy;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.system.domain.ProposalUnitReply;
 import com.ruoyi.system.domain.sqmy.SqmyUnitReply;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,7 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @date 2024-03-15
  */
 @RestController
-@RequestMapping("/system/reply")
+@RequestMapping("/sqmy/unit")
 public class SqmyUnitReplyController extends BaseController
 {
     @Autowired
@@ -38,7 +39,7 @@ public class SqmyUnitReplyController extends BaseController
 /**
  * 查询社情民意单位答复列表
  */
-@PreAuthorize("@ss.hasPermi('system:reply:list')")
+@PreAuthorize("@ss.hasPermi('sqmy:unit:list')")
 @GetMapping("/list")
     public TableDataInfo list(SqmyUnitReply sqmyUnitReply)
     {
@@ -50,7 +51,7 @@ public class SqmyUnitReplyController extends BaseController
     /**
      * 导出社情民意单位答复列表
      */
-    @PreAuthorize("@ss.hasPermi('system:reply:export')")
+    @PreAuthorize("@ss.hasPermi('sqmy:unit:export')")
     @Log(title = "社情民意单位答复", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, SqmyUnitReply sqmyUnitReply)
@@ -63,7 +64,7 @@ public class SqmyUnitReplyController extends BaseController
     /**
      * 获取社情民意单位答复详细信息
      */
-    @PreAuthorize("@ss.hasPermi('system:reply:query')")
+    @PreAuthorize("@ss.hasPermi('sqmy:unit:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -73,7 +74,7 @@ public class SqmyUnitReplyController extends BaseController
     /**
      * 新增社情民意单位答复
      */
-    @PreAuthorize("@ss.hasPermi('system:reply:add')")
+    @PreAuthorize("@ss.hasPermi('sqmy:unit:add')")
     @Log(title = "社情民意单位答复", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody SqmyUnitReply sqmyUnitReply)
@@ -84,7 +85,7 @@ public class SqmyUnitReplyController extends BaseController
     /**
      * 修改社情民意单位答复
      */
-    @PreAuthorize("@ss.hasPermi('system:reply:edit')")
+    @PreAuthorize("@ss.hasPermi('sqmy:unit:edit')")
     @Log(title = "社情民意单位答复", businessType = BusinessType.UPDATE)
     @PostMapping("/put")
     public AjaxResult edit(@RequestBody SqmyUnitReply sqmyUnitReply)
@@ -95,11 +96,22 @@ public class SqmyUnitReplyController extends BaseController
     /**
      * 删除社情民意单位答复
      */
-    @PreAuthorize("@ss.hasPermi('system:reply:remove')")
+    @PreAuthorize("@ss.hasPermi('sqmy:unit:remove')")
     @Log(title = "社情民意单位答复", businessType = BusinessType.DELETE)
     @GetMapping("/delete/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
         return toAjax(sqmyUnitReplyService.deleteSqmyUnitReplyByIds(ids));
     }
+
+    /***
+     * 社情民意答复
+     */
+    @PreAuthorize("@ss.hasPermi('sqmy:unit:reply')")
+    @Log(title = "提案信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/reply")
+    public AjaxResult reply(@RequestBody SqmyUnitReply sqmyUnitReply)
+    {
+        return sqmyUnitReplyService.reply(sqmyUnitReply);
+    }
 }

+ 13 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/sqmy/SqmyInfo.java

@@ -19,7 +19,7 @@ public class SqmyInfo extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    /** 提案ID */
+    /** 社情民意ID */
     private Long sqmyId;
 
     /** 上报人ID */
@@ -34,6 +34,10 @@ public class SqmyInfo extends BaseEntity
     @Excel(name = "标题")
     private String title;
 
+    /** 主题类型1:经济建设类,2:政治建设类,3:文化建设类,4:社会建设类,5:生态文明建设类,6:其他 */
+    @Excel(name = "主题类型1:经济建设类,2:政治建设类,3:文化建设类,4:社会建设类,5:生态文明建设类,6:其他")
+    private String topicType;
+
     /** 联系人姓名 */
     @Excel(name = "联系人姓名")
     private String lxrName;
@@ -424,6 +428,14 @@ public class SqmyInfo extends BaseEntity
         return outstandingArgument;
     }
 
+    public String getTopicType() {
+        return topicType;
+    }
+
+    public void setTopicType(String topicType) {
+        this.topicType = topicType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISqmyUnitReplyService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.service;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.sqmy.SqmyUnitReply;
 
 import java.util.List;
@@ -59,4 +60,6 @@ public interface ISqmyUnitReplyService
      * @return 结果
      */
     public int deleteSqmyUnitReplyById(Long id);
+
+    AjaxResult reply(SqmyUnitReply sqmyUnitReply);
 }

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SqmyInfoServiceImpl.java

@@ -104,7 +104,7 @@ public class SqmyInfoServiceImpl implements ISqmyInfoService
             for (ZxFj zxFj : sqmyInfo.getZxFjList()) {
                 zxFj.setMainId(sqmyInfo.getSqmyId());
                 zxFj.setSourceId(sqmyInfo.getSqmyId());
-                zxFj.setType("1");
+                zxFj.setType("2");
                 zxFj.setStytle("4");
                 zxFjMapper.insertZxFj(zxFj);
             }
@@ -128,7 +128,7 @@ public class SqmyInfoServiceImpl implements ISqmyInfoService
             for (ZxFj zxFj : sqmyInfo.getZxFjList()) {
                 zxFj.setMainId(sqmyInfo.getSqmyId());
                 zxFj.setSourceId(sqmyInfo.getSqmyId());
-                zxFj.setType("1");
+                zxFj.setType("2");
                 zxFj.setStytle("4");
                 zxFjMapper.insertZxFj(zxFj);
             }

+ 46 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SqmyUnitReplyServiceImpl.java

@@ -2,7 +2,16 @@ package com.ruoyi.system.service.impl;
 
 import java.util.List;
 
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.ProposalInfo;
+import com.ruoyi.system.domain.ProposalUnitReply;
+import com.ruoyi.system.domain.ZxFj;
+import com.ruoyi.system.domain.sqmy.SqmyInfo;
 import com.ruoyi.system.domain.sqmy.SqmyUnitReply;
+import com.ruoyi.system.mapper.SqmyInfoMapper;
+import com.ruoyi.system.mapper.ZxFjMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.SqmyUnitReplyMapper;
@@ -19,6 +28,10 @@ public class SqmyUnitReplyServiceImpl implements ISqmyUnitReplyService
 {
     @Autowired
     private SqmyUnitReplyMapper sqmyUnitReplyMapper;
+    @Autowired
+    private SqmyInfoMapper sqmyInfoMapper;
+    @Autowired
+    private ZxFjMapper zxFjMapper;
 
     /**
      * 查询社情民意单位答复
@@ -91,4 +104,37 @@ public class SqmyUnitReplyServiceImpl implements ISqmyUnitReplyService
     {
         return sqmyUnitReplyMapper.deleteSqmyUnitReplyById(id);
     }
+
+    @Override
+    public AjaxResult reply(SqmyUnitReply sqmyUnitReply) {
+        //查询当前账号部门
+        Long deptId = SecurityUtils.getDeptId();
+        sqmyUnitReply.setDeptId(deptId);
+        sqmyUnitReply.setEndTime(DateUtils.getNowDate());
+        List<SqmyUnitReply> list = sqmyUnitReplyMapper.selectSqmyUnitReplyList(sqmyUnitReply);
+        for (SqmyUnitReply unitReply : list) {
+            unitReply.setContent(sqmyUnitReply.getContent());
+            unitReply.setIsReply("0");
+            sqmyUnitReplyMapper.updateSqmyUnitReply(unitReply);
+        }
+        if(list.get(0).getType().equals("2")){
+            SqmyInfo sqmyInfo = new SqmyInfo();
+            sqmyInfo.setSqmyId(sqmyUnitReply.getSqmyId());
+            sqmyInfo.setSqmyProgress("4");
+            sqmyInfo.setUpdateTime(DateUtils.getNowDate());
+            sqmyInfoMapper.updateSqmyInfo(sqmyInfo);
+        }
+
+        if(sqmyUnitReply.getZxFjList()!=null && sqmyUnitReply.getZxFjList().size()>0){
+            for (ZxFj zxFj : sqmyUnitReply.getZxFjList()) {
+                zxFj.setMainId(sqmyUnitReply.getSqmyId());
+                zxFj.setSourceId(sqmyUnitReply.getId());
+                zxFj.setType("1");
+                zxFj.setStytle(list.get(0).getType());
+                zxFjMapper.insertZxFj(zxFj);
+            }
+        }
+
+        return  AjaxResult.success();
+    }
 }

+ 8 - 2
ruoyi-system/src/main/resources/mapper/system/SqmyInfoMapper.xml

@@ -9,6 +9,7 @@
         <result property="sqmyUserId"    column="sqmy_user_id"    />
         <result property="sqmyNumber"    column="sqmy_number"    />
         <result property="title"    column="title"    />
+        <result property="topicType"    column="topic_type"    />
         <result property="lxrName"    column="lxr_name"    />
         <result property="lxrPhone"    column="lxr_phone"    />
         <result property="sqmyName"    column="sqmy_name"    />
@@ -43,7 +44,7 @@
     </resultMap>
 
     <sql id="selectSqmyInfoVo">
-        select sqmy_id, sqmy_user_id, sqmy_number, title, lxr_name, lxr_phone, sqmy_name, sqmy_phone, sqmy_content, is_publicity, is_secret, unit, is_record, sqmy_progress, rolling_process, complex_type, is_cases_together, unite_sqmy_id, cbdwdfwy, satisfaction, members_opinion, zx_satisfaction, zx_opinion, is_key_point, key_point_argument, is_outstanding, outstanding_argument, create_by, create_time, update_by, update_time, remark from sqmy_info
+        select sqmy_id, sqmy_user_id, sqmy_number, title,topic_type, lxr_name, lxr_phone, sqmy_name, sqmy_phone, sqmy_content, is_publicity, is_secret, unit, is_record, sqmy_progress, rolling_process, complex_type, is_cases_together, unite_sqmy_id, cbdwdfwy, satisfaction, members_opinion, zx_satisfaction, zx_opinion, is_key_point, key_point_argument, is_outstanding, outstanding_argument, create_by, create_time, update_by, update_time, remark from sqmy_info
     </sql>
 
     <select id="selectSqmyInfoList" parameterType="SqmyInfo" resultMap="SqmyInfoResult">
@@ -52,6 +53,7 @@
             <if test="sqmyUserId != null "> and sqmy_user_id = #{sqmyUserId}</if>
             <if test="sqmyNumber != null  and sqmyNumber != ''"> and sqmy_number = #{sqmyNumber}</if>
             <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="topicType != null  and topicType != ''"> and topic_type = #{topicType}</if>
             <if test="lxrName != null  and lxrName != ''"> and lxr_name like concat('%', #{lxrName}, '%')</if>
             <if test="lxrPhone != null  and lxrPhone != ''"> and lxr_phone = #{lxrPhone}</if>
             <if test="sqmyName != null  and sqmyName != ''"> and sqmy_name like concat('%', #{sqmyName}, '%')</if>
@@ -89,11 +91,12 @@
                s.sqmy_content, s.is_publicity, s.is_secret, s.unit, s.is_record, s.sqmy_progress, s.rolling_process,
                s.complex_type, s.is_cases_together, s.unite_sqmy_id, s.cbdwdfwy, s.satisfaction, s.members_opinion,
                s.zx_satisfaction, s.zx_opinion, s.is_key_point, s.key_point_argument, s.is_outstanding, s.outstanding_argument,
-               s.create_by, s.create_time, s.update_by, s.update_time, s.remark
+               s.create_by, s.create_time, s.update_by, s.update_time, s.remark,s.topic_type,u.type as dwType
         from sqmy_info s
         left join sqmy_unit_reply u on p.sqmy_id = u.sqmy_id
         where u.dept_id = #{deptId}
         <if test="dwType != null  and dwType != ''"> and u.type = #{dwType}</if>
+        <if test="topicType != null  and topicType != ''"> and topic_type = #{topicType}</if>
         <if test="sqmyUserId != null "> and s.sqmy_user_id = #{sqmyUserId}</if>
         <if test="sqmyNumber != null  and sqmyNumber != ''"> and s.sqmy_number = #{sqmyNumber}</if>
         <if test="title != null  and title != ''"> and s.title = #{title}</if>
@@ -129,6 +132,7 @@
             <if test="sqmyUserId != null">sqmy_user_id,</if>
             <if test="sqmyNumber != null">sqmy_number,</if>
             <if test="title != null and title != ''">title,</if>
+            <if test="topicType != null  and topicType != ''"> topic_type,</if>
             <if test="lxrName != null and lxrName != ''">lxr_name,</if>
             <if test="lxrPhone != null and lxrPhone != ''">lxr_phone,</if>
             <if test="sqmyName != null and sqmyName != ''">sqmy_name,</if>
@@ -162,6 +166,7 @@
             <if test="sqmyUserId != null">#{sqmyUserId},</if>
             <if test="sqmyNumber != null">#{sqmyNumber},</if>
             <if test="title != null and title != ''">#{title},</if>
+            <if test="topicType != null  and topicType != ''"> #{topicType},</if>
             <if test="lxrName != null and lxrName != ''">#{lxrName},</if>
             <if test="lxrPhone != null and lxrPhone != ''">#{lxrPhone},</if>
             <if test="sqmyName != null and sqmyName != ''">#{sqmyName},</if>
@@ -199,6 +204,7 @@
             <if test="sqmyUserId != null">sqmy_user_id = #{sqmyUserId},</if>
             <if test="sqmyNumber != null">sqmy_number = #{sqmyNumber},</if>
             <if test="title != null and title != ''">title = #{title},</if>
+            <if test="topicType != null  and topicType != ''">topic_type = #{topicType},</if>
             <if test="lxrName != null and lxrName != ''">lxr_name = #{lxrName},</if>
             <if test="lxrPhone != null and lxrPhone != ''">lxr_phone = #{lxrPhone},</if>
             <if test="sqmyName != null and sqmyName != ''">sqmy_name = #{sqmyName},</if>