فهرست منبع

删除标准,不删除已完成任务

hfxc226 2 روز پیش
والد
کامیت
055891eae0

+ 3 - 0
platform-dao/src/main/resources/mapper/check/CheckJobMapper.xml

@@ -154,6 +154,9 @@
         <if test="sbLevel != null and sbLevel != ''">
             and sbinfo.level = #{sbLevel}
         </if>
+        <if test="sbNo != null and sbNo != ''">
+            and sbInfo.no like concat('%',#{sbNo},'%')
+        </if>
         <if test="periodType != null and periodType != ''">
             and standard.period_type = #{periodType}
         </if>

+ 2 - 1
platform-rest/src/main/java/com/platform/rest/controller/check/CheckStandardController.java

@@ -150,6 +150,7 @@ public class CheckStandardController {
 
   /**
    * 通过id删除一条记录
+   * 同时删除未执行完毕的任务,历史任务不删除
    *
    * @param id 主键
    * @return R
@@ -158,7 +159,7 @@ public class CheckStandardController {
   @DeleteMapping("/{id}")
   @PreAuthorize("@pms.hasPermission('check-spot-standards-del') or @pms.hasPermission('check-spot-standards-del')")
   public R removeById(@PathVariable String id){
-    checkStandardService.deleteByPrimaryKey(id);
+    checkStandardService.cascadingDeleteByKey(id);
     return new R<>();
   }
 

+ 2 - 2
platform-service/src/main/java/com/platform/service/check/impl/CheckStandardServiceImpl.java

@@ -116,9 +116,9 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
         checkJobMapper.deleteByExample(checkJobWeekend);*/
 
         // 删除标准参数
-       /* Weekend<CheckStandardParam> checkStandardParamWeekend = new Weekend<>(CheckStandardParam.class);
+       Weekend<CheckStandardParam> checkStandardParamWeekend = new Weekend<>(CheckStandardParam.class);
         checkStandardParamWeekend.weekendCriteria().andEqualTo(CheckStandardParam::getStandardId, id);
-        paramMapper.deleteByExample(weekend);*/
+        paramMapper.deleteByExample(weekend);
         return true;
     }