Преглед на файлове

Merge remote-tracking branch 'origin/master'

user5 преди 2 години
родител
ревизия
f7bd2bb9e1

+ 6 - 0
jeeplus-plugins/jeeplus-notify/pom.xml

@@ -34,5 +34,11 @@
             <version>9.0</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-quartz</artifactId>
+            <version>9.0</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 </project>

+ 6 - 0
jeeplus-plugins/jeeplus-notify/src/main/java/com/jeeplus/notify/domain/Notify.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -87,5 +89,9 @@ public class Notify extends BaseEntity {
      */
     protected String processDefinitionId;
 
+    /**
+     * 关闭状态
+     */
+    private String isClose;
 
 }

+ 5 - 0
jeeplus-plugins/jeeplus-notify/src/main/java/com/jeeplus/notify/mapper/NotifyMapper.java

@@ -54,4 +54,9 @@ public interface NotifyMapper extends BaseMapper <Notify> {
      * @param id
      */
     void closeById(String id);
+
+    /**
+     * 将时间结束的通知关闭
+     */
+    void updateNotifyClose();
 }

+ 9 - 1
jeeplus-plugins/jeeplus-notify/src/main/java/com/jeeplus/notify/mapper/xml/NotifyMapper.xml

@@ -23,6 +23,7 @@
         <result property="createBy.name" column="name" jdbcType="VARCHAR"/>
         <result property="createBy.photo" column="photo" jdbcType="VARCHAR"/>
         <result property="readFlag" column="read_flag" jdbcType="VARCHAR"/>
+        <result property="isClose" column="is_close" jdbcType="VARCHAR"/>
         <collection property="workAttachmentDtoList" ofType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
         <collection property="pluginNotifyOfficesDTOList" ofType="com.jeeplus.notify.service.dto.PluginNotifyOfficesDTO" column="id" select="getOfficeList"></collection>
         <collection property="pluginNotifyUserDTOList" ofType="com.jeeplus.notify.service.dto.PluginNotifyUserDTO" column="id" select="getUserList"></collection>
@@ -63,7 +64,8 @@
         u.name,
         u.photo,
         b.read_num,
-        b.un_read_num
+        b.un_read_num,
+        a.is_close
     </sql>
     <sql id="File_Column_List">
         wa.id,
@@ -221,4 +223,10 @@
         update plugin_notify set is_close = "1" where id = #{id}
     </update>
 
+    <update id="updateNotifyClose">
+        update plugin_notify set is_close = "1"
+        where
+        notify_type = 0 and NOW() > end_date and del_flag = 0
+    </update>
+
 </mapper>

+ 0 - 3
jeeplus-plugins/jeeplus-notify/src/main/java/com/jeeplus/notify/service/NotifyService.java

@@ -96,9 +96,6 @@ public class NotifyService extends ServiceImpl <NotifyMapper, Notify> {
      */
     public IPage <NotifyDTO> findPage(Page <NotifyDTO> page, String currentUserId, boolean isSelf, String readFlag, QueryWrapper queryWrapper) {
         queryWrapper.eq ( "a.del_flag", 0 ); // 排除已经删除
-        queryWrapper.eq ( "a.is_close", 0 ); // 排除已经关闭的通告
-        //员工展示员工的
-        //部门主任展示部门所以的
         return baseMapper.findList ( page, currentUserId, isSelf, readFlag, queryWrapper );
     }
 

+ 22 - 0
jeeplus-plugins/jeeplus-notify/src/main/java/com/jeeplus/notify/service/NotifyTimeTask.java

@@ -0,0 +1,22 @@
+package com.jeeplus.notify.service;
+
+import com.jeeplus.notify.mapper.NotifyMapper;
+import com.jeeplus.sys.utils.SpringContextHolder;
+import org.quartz.DisallowConcurrentExecution;
+import com.jeeplus.quartz.domain.Task;
+
+/**
+ * 通告定时任务
+ */
+@DisallowConcurrentExecution
+public class NotifyTimeTask extends Task{
+
+    private NotifyMapper mapper = SpringContextHolder.getBean(NotifyMapper.class);
+
+
+    @Override
+    public void run() {
+        // 定时将时间结束的通告改为结束状态
+        mapper.updateNotifyClose();
+    }
+}

+ 6 - 0
jeeplus-plugins/jeeplus-notify/src/main/java/com/jeeplus/notify/service/dto/NotifyDTO.java

@@ -108,6 +108,12 @@ public class NotifyDTO extends BaseDTO {
     private String readFlag;
 
     /**
+     * 关闭状态
+     */
+    @Query(type = QueryType.EQ)
+    private String isClose;
+
+    /**
      * 附件
      */
     private List<WorkAttachmentDto> workAttachmentDtoList;