Browse Source

修改事项列表查询

conghelong 1 year ago
parent
commit
6be11950e9

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/matter/collectConller.java

@@ -25,7 +25,7 @@ public class collectConller extends BaseController {
 
 
     /**
-     * 是否展示
+     * 查询展示事项列表
      */
     @GetMapping("list")
     public TableDataInfo list( Matter matter)

+ 11 - 0
sooka-jnb/src/main/java/com/sooka/jnb/department/domin/Department.java

@@ -3,6 +3,8 @@ package com.sooka.jnb.department.domin;
 import com.ruoyi.common.core.domain.BaseEntity;
 import lombok.Data;
 
+import java.util.Date;
+
 @Data
 public class Department extends BaseEntity {
     private static final long serialVersionUID = 1L;
@@ -14,4 +16,13 @@ public class Department extends BaseEntity {
     private  String  shows;
     //办理对象
     private  String  application;
+
+    //创建者
+    private  String createBy;
+    //创建时间
+    private Date createTime;
+    //更新者
+    private  String updateBy;
+    //更新时间
+    private  Date updateTime;
 }

+ 9 - 1
sooka-jnb/src/main/java/com/sooka/jnb/department/service/impl/departmentServicempl.java

@@ -1,7 +1,10 @@
 package com.sooka.jnb.department.service.impl;
 
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.sooka.jnb.department.domin.Department;
 import com.sooka.jnb.department.service.DepartmentService;
+import com.sooka.jnb.handleAffairs.domain.GridType;
 import org.springframework.stereotype.Service;
 import com.sooka.jnb.department.mapper.DepartmentMapper;
 
@@ -40,16 +43,21 @@ public class departmentServicempl implements DepartmentService
     @Override
     public int insertSysDept(Department department)
     {
-
+        department.setCreateTime(DateUtils.getNowDate());
+        department.setCreateBy(SecurityUtils.getUserId().toString());
+        department.setDelFlag("0");
         return departmentMapper.insertSysDept(department);
     }
 
+
     /**
      * 修改部门配置
      */
     @Override
     public int updateSysDept(Department department)
     {
+        department.setUpdateTime(DateUtils.getNowDate());
+        department.setUpdateBy(SecurityUtils.getUserId().toString());
         return departmentMapper.updateSysDept(department);
     }
 

+ 12 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/domin/Matter.java

@@ -2,6 +2,9 @@ package com.sooka.jnb.matter.domin;
 
 import com.ruoyi.common.core.domain.BaseEntity;
 import lombok.Data;
+
+import java.util.Date;
+
 @Data
 public class Matter extends BaseEntity {
     private static final long serialVersionUID = 1L;
@@ -32,6 +35,15 @@ public class Matter extends BaseEntity {
 
         //内容
         private  String matterId;
+
+        //创建者
+        private  String createBy;
+        //创建时间
+        private Date createTime;
+        //更新者
+        private  String updateBy;
+        //更新时间
+        private  Date updateTime;
     }
 
 

+ 42 - 1
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/impl/MatterServicempl.java

@@ -1,15 +1,23 @@
 package com.sooka.jnb.matter.service.impl;
 
 
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.sooka.jnb.department.domin.Department;
 import com.sooka.jnb.matter.domin.Matter;
 import com.sooka.jnb.matter.mapper.MatterMapper;
 import com.sooka.jnb.matter.service.MatterService;
+import com.sooka.jnb.my.domain.Announcement;
+import com.sooka.jnb.my.service.IAnnouncementService;
+import com.sooka.jnb.quotations.domain.JnbQuotations;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class MatterServicempl implements MatterService
@@ -17,6 +25,8 @@ public class MatterServicempl implements MatterService
     @Resource
     private MatterMapper matterMapper;
 
+    @Resource
+    private IAnnouncementService announcementService;
     /**
      * 获取事项详细信息
      */
@@ -59,6 +69,9 @@ public class MatterServicempl implements MatterService
     public int insertSysMatter(Matter matter)
     {
 
+        matter.setCreateTime(DateUtils.getNowDate());
+        matter.setCreateBy(SecurityUtils.getUserId().toString());
+        matter.setDelFlag("0");
         return matterMapper.insertSysMatter(matter);
     }
 
@@ -68,6 +81,8 @@ public class MatterServicempl implements MatterService
     @Override
     public int updateSysMatter(Matter matter)
     {
+        matter.setUpdateTime(DateUtils.getNowDate());
+        matter.setUpdateBy(SecurityUtils.getUserId().toString());
         return matterMapper.updateSysMatter(matter);
     }
 
@@ -77,9 +92,35 @@ public class MatterServicempl implements MatterService
     @Override
     public int examine(Matter matter)
     {
-        return matterMapper.examine(matter);
+        int i = matterMapper.examine(matter);
+        if (i>0) {
+            announcementService.insertAnnouncement(fromate(matter.getExamine(), matter.getTitle(), matter.getCreateBy(),matter.getCreateTime()));
+        }
+        return i;
+
     }
 
+
+    public Announcement fromate(String examine, String title, String id, Date createTime) {
+        Announcement announcement = new Announcement();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String data = simpleDateFormat.format(createTime);
+        if (Objects.equals(examine, "1")) {
+            announcement.setAnnouncementTitle("审核通过:" + title);
+            announcement.setAnnouncementBody("您在" + data + "发起的行情信息已审核通过,请查看");
+            announcement.setValidityStartTime(new Date());
+            announcement.setUserId(id);
+            announcement.setCreateBy(SecurityUtils.getUserId().toString());
+            return announcement;
+        } else {
+            announcement.setAnnouncementTitle("审核拒绝:" + title);
+            announcement.setAnnouncementBody("您在" + data + "发起的行情信息已审核被拒绝,请查看");
+            announcement.setValidityStartTime(new Date());
+            announcement.setUserId(String.valueOf(id));
+            announcement.setCreateBy(SecurityUtils.getUserId().toString());
+            return announcement;
+        }
+    }
     /**
      * 删除事项
      */

+ 11 - 4
sooka-jnb/src/main/resources/mapper/department/DepartmentMapper.xml

@@ -9,11 +9,14 @@
         <result property="name"    column="name"    />
         <result property="shows"    column="shows"    />
         <result property="application"    column="application"    />
-
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
     </resultMap>
 
     <select id="selectSysDeptVo"  resultMap="DepartmentResult">
-        select  id,name, shows, application from jnb_department_configuration
+        select  id,name, shows, application ,create_by,create_time,update_by,update_time  from jnb_department_configuration
         <where>
             <if test="name != null and name !=''">
                 AND name LIKE  concat('%', #{name}, '%')
@@ -31,8 +34,8 @@
 
     <insert id="insertSysDept">
         INSERT INTO
-        jnb_department_configuration (name, shows, application)
-        VALUE (#{name},#{shows},#{application})
+        jnb_department_configuration (name, shows, application,create_by,create_time,update_by,update_time)
+        VALUE (#{name},#{shows},#{application},#{createBy},#{createTime},#{updateBy},#{updateTime})
     </insert>
 
     <update id="updateSysDept" parameterType="SysDept">
@@ -41,6 +44,10 @@
             <if test="name != null">name = #{name},</if>
             <if test="shows != null">shows = #{shows},</if>
             <if test="application != null">application = #{application},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 13 - 5
sooka-jnb/src/main/resources/mapper/matter/matterMapper.xml

@@ -15,11 +15,15 @@
         <result property="picture"    column="picture"    />
         <result property="examine"    column="examine"    />
         <result property="content"    column="content"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
     </resultMap>
 
 
     <select id="selectSysMatterVo"  resultMap="MatterResult">
-        select  id,title, type, department,operation,address,phone,picture,examine ,content from jnb_list_of_matters
+        select  id,title, type, department,operation,address,phone,picture,examine ,content ,create_by,create_time,update_by,update_time from jnb_list_of_matters
         <where>
 
             <if test="title != null and title !=''">
@@ -38,20 +42,20 @@
     </select>
 
     <select id="selectSysrecommendVo"  resultMap="MatterResult">
-        select  id,title, type, department,operation,address,phone,picture,examine ,content from jnb_list_of_matters
+         select  id,title, type, department,operation,address,phone,picture,examine ,content ,create_by,create_time,update_by,update_time from jnb_list_of_matters
         where operation=0
     </select>
 
 
     <select id="selectSysMatterById"  resultMap="MatterResult">
-       select  id ,title, type, department,operation,address,phone,picture,examine,content from jnb_list_of_matters
+       select  id ,title, type, department,operation,address,phone,picture,examine,content ,create_by,create_time,update_by,update_time from jnb_list_of_matters
         where id = #{id}
     </select>
 
     <insert id="insertSysMatter">
        INSERT INTO
-           jnb_list_of_matters (title, type, department,operation,address,phone,picture,content )
-        VALUE (#{title},#{type},#{department},#{operation},#{address},#{phone},#{picture},#{content} )
+           jnb_list_of_matters (title, type, department,operation,address,phone,picture,content,create_by,create_time,update_by,update_time )
+        VALUE (#{title},#{type},#{department},#{operation},#{address},#{phone},#{picture},#{content},#{createBy},#{createTime},#{updateBy},#{updateTime} )
     </insert>
 
     <update id="updateSysMatter" parameterType="SysDept">
@@ -65,6 +69,10 @@
             <if test="picture != null">picture = #{picture},</if>
             <if test="phone != null">phone = #{phone},</if>
             <if test="content != null">content = #{content},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>