luowei 2 жил өмнө
parent
commit
69c59d846d

+ 2 - 0
project_data/sql/0.0.2/quartz/quartz.sql

@@ -1 +1,3 @@
 INSERT INTO `sys_job`(`job_id`, `job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (129, '恶劣天气预警', 'DEFAULT', 'WeatherTask.getDataFromApi', '0 0 7,10,14,17 * * ? *', '1', '1', '0', '超级管理员', '2023-09-25 11:46:50', '', NULL);
+INSERT INTO `sys_job` VALUES (128, '履职临期提醒(除了每日的)', 'DEFAULT', 'CoreMessageSendTask.resumptionRemind', '0 0 0 * * ?', '1', '1', '0', '超级管理员', '2023-09-22 17:03:31', '', '2023-09-22 20:29:13');
+INSERT INTO `sys_job` VALUES (125, '消息发送管理(每日凌晨零点)', 'DEFAULT', 'CoreMessageSendTask.messageSendTask', '0 0 0 * * ? *', '1', '1', '0', '超级管理员', '2023-09-21 12:30:22', '超级管理员', '2023-09-22 19:04:39');

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/mapper/TMonitoringRetrievalPlanMapper.java

@@ -4,6 +4,7 @@ package com.xunmei.core.access.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.xunmei.core.access.domain.TMonitoringRetrievalPlan;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -53,6 +54,14 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @return
      */
     int updatePlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 根据父id修改状态
+     * @param status
+     * @param parentId
+     * @return
+     */
+    int updatePlanStatus(@Param("status") Integer status,@Param("parentId") Long parentId);
     /**
      * 删除监控调阅计划
      *

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -321,9 +321,18 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         TMonitoringRetrievalPlan plan = baseMapper.selectById(tMonitoringRetrievalPlan.getId());
         if (plan.getPlanStatus() != tMonitoringRetrievalPlan.getPlanStatus()) {
             if (tMonitoringRetrievalPlan.getPlanStatus() == 1) {
+                //删除任务
                 iCoreMonitoringRetrievalTaskService.updateDeleteTaskByPlanId(tMonitoringRetrievalPlan.getId(), 1);
+                //禁用子任务
+                if(null==plan.getParentId()){
+                    baseMapper.updatePlanStatus(1,tMonitoringRetrievalPlan.getId());
+                }
             } else {
+                //还原任务
                 iCoreMonitoringRetrievalTaskService.updateDeleteTaskByPlanId(tMonitoringRetrievalPlan.getId(), 0);
+                if(null==plan.getParentId()){
+                    baseMapper.updatePlanStatus(0,tMonitoringRetrievalPlan.getId());
+                }
             }
         }
         if (tMonitoringRetrievalPlan.getOrgType().equals("1")) {

+ 6 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml

@@ -231,6 +231,12 @@
                                              OR parent_id = #{id})b
             )
     </update>
+    <update id="updatePlanStatus">
+        UPDATE core_monitoring_retrieval_plan
+set plan_status=#{status}
+        WHERE
+                parent_id=#{parentId}
+    </update>
 
     <delete id="deleteTMonitoringRetrievalPlanById" parameterType="Long">
         delete

+ 1 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -138,6 +138,7 @@
         <if test="request.moth !=null">
             and ymd_date like concat('%', #{request.moth}, '%')
         </if>
+        ORDER BY create_time DESC ,status
     </select>
     <select id="selectTaskDataVoListByRetrievalTaskId"
             resultType="com.xunmei.common.core.domain.retrieval.vo.TaskDataVo">