2 Komitmen 9c9fe00b27 ... 1134bd6ba0

Pembuat SHA1 Pesan Tanggal
  hfxc226 1134bd6ba0 删除标准,不删除任务 2 bulan lalu
  hfxc226 d0c639e7c0 删除标准,不删除任务 2 bulan lalu

+ 11 - 11
platform-rest/src/main/java/com/platform/rest/controller/sb/SbStoreCheckJobController.java

@@ -39,7 +39,7 @@ import java.util.List;
 @RequestMapping("/sb/store/check/jobs")
 public class SbStoreCheckJobController {
 
-  private final SbStoreCheckJobService checkJobService;
+  private final SbStoreCheckJobService sbStoreCheckJobService;
   private final StoreService storeService;
   /**
    * 通过id查询单条任务
@@ -49,7 +49,7 @@ public class SbStoreCheckJobController {
    */
   @GetMapping("/{id}")
   public R<SbStoreCheckJobVO> getById(@PathVariable("id") String id){
-      return new R<>(checkJobService.getDetail(id));
+      return new R<>(sbStoreCheckJobService.getDetail(id));
   }
 
   /**
@@ -61,7 +61,7 @@ public class SbStoreCheckJobController {
   @SysLog("新增盘点任务")
   @PostMapping
   public R save(@Validated({AddGroup.class}) @RequestBody SbStoreCheckJobDTO checkJobDTO) {
-      return new R<>(checkJobService.saveModelByDTO(checkJobDTO));
+      return new R<>(sbStoreCheckJobService.saveModelByDTO(checkJobDTO));
   }
 
   /**
@@ -73,7 +73,7 @@ public class SbStoreCheckJobController {
   @SysLog("修改盘点任务")
   @PutMapping("/{id}")
   public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody SbStoreCheckJobDTO checkJobDTO) {
-      checkJobService.modModelByDTO(checkJobDTO);
+      sbStoreCheckJobService.modModelByDTO(checkJobDTO);
       return new R<>();
   }
 
@@ -86,7 +86,7 @@ public class SbStoreCheckJobController {
   @SysLog("删除盘点任务")
   @DeleteMapping("/{id}")
   public R removeById(@PathVariable String id){
-    checkJobService.deleteByPrimaryKey(id);
+    sbStoreCheckJobService.deleteByPrimaryKey(id);
     return new R<>();
   }
 
@@ -99,7 +99,7 @@ public class SbStoreCheckJobController {
     @SysLog("批量删除盘点任务")
     @DeleteMapping("")
     public R removeIds(@RequestBody List<String> ids){
-        checkJobService.batchDelete(ids);
+        sbStoreCheckJobService.batchDelete(ids);
         return new R<>();
     }
 
@@ -113,7 +113,7 @@ public class SbStoreCheckJobController {
    */
   @GetMapping("/page")
   public R<AbstractPageResultBean<SbStoreCheckJobVO>> query(SbStoreCheckJobDTO checkJobDTO, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
-      return new R<>(checkJobService.selectPageList(checkJobDTO, pageNum, pageSize));
+      return new R<>(sbStoreCheckJobService.selectPageList(checkJobDTO, pageNum, pageSize));
   }
 
 
@@ -125,7 +125,7 @@ public class SbStoreCheckJobController {
    */
   @GetMapping("")
   public R query(SbStoreCheckJobDTO checkJobDTO) {
-      return new R<>(checkJobService.selectList(checkJobDTO));
+      return new R<>(sbStoreCheckJobService.selectList(checkJobDTO));
   }
 
     /**
@@ -136,7 +136,7 @@ public class SbStoreCheckJobController {
      */
     @GetMapping("/num")
     public R getNum(SbStoreCheckJobDTO checkJobDTO) {
-        return new R<>(checkJobService.getCountByDTO(checkJobDTO));
+        return new R<>(sbStoreCheckJobService.getCountByDTO(checkJobDTO));
     }
 
   /**
@@ -155,7 +155,7 @@ public class SbStoreCheckJobController {
       if(store == null ){
           throw new BusinessException("仓库不存在");
       }
-      List<SbStoreCheckJobVO> list = checkJobService.selectList(checkJobDTO);
+      List<SbStoreCheckJobVO> list = sbStoreCheckJobService.selectList(checkJobDTO);
       String date =  DateUtils.dateToString(LocalDate.now(),DateUtils.PATTERN_YMD_ZH_NO );
       ExcelUtil.exportResponseDict(response, ExportSbStoreCheckJobVO.class, BeanConverterUtil.copyListProperties(list, ExportSbStoreCheckJobVO.class), store.getName() + "-" + date);
   }
@@ -169,7 +169,7 @@ public class SbStoreCheckJobController {
   @SysLog("完成盘点任务")
   @PutMapping("/finish")
   public R finishJob(@Validated({UpdateGroup.class}) @RequestBody SbStoreCheckJobDTO checkJobDTO) {
-    int result = checkJobService.finishJob(checkJobDTO);
+    int result = sbStoreCheckJobService.finishJob(checkJobDTO);
     return new R<>(result);
   }
 

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

@@ -102,15 +102,23 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
         weekend.weekendCriteria().andEqualTo(CheckProjectStandardRelation::getStandardId, id);
         relationMapper.deleteByExample(weekend);
 
-        // 删除标准任务:所有和这个标准一样的任务
+        // 删除:未执行、执行中的任务:
+        List<Integer> statusList = new ArrayList<>();
+        statusList.add(CheckJobStatusEnum.NOT_EXECUTE.getValue());
+        statusList.add(CheckJobStatusEnum.EXECUTING.getValue());
         Weekend<CheckJob> checkJobWeekend = new Weekend<>(CheckJob.class);
-        checkJobWeekend.weekendCriteria().andEqualTo(CheckJob::getStandardId, id);
+        checkJobWeekend.weekendCriteria().andEqualTo(CheckJob::getStandardId, id).andIn(CheckJob::getStatus, statusList);
         checkJobMapper.deleteByExample(checkJobWeekend);
 
+        // 删除标准任务:所有和这个标准一样的任务
+        /*Weekend<CheckJob> checkJobWeekend = new Weekend<>(CheckJob.class);
+        checkJobWeekend.weekendCriteria().andEqualTo(CheckJob::getStandardId, id);
+        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;
     }
 

+ 3 - 3
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -176,12 +176,12 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
         }
 
         checkStandardMapper.deleteByExample(weekend1);
+
         //删除保养任务
-        Weekend<CheckJob> weekend2 = new Weekend<>(CheckJob.class);
+        /*Weekend<CheckJob> weekend2 = new Weekend<>(CheckJob.class);
         WeekendCriteria<CheckJob, Object> weekendCriteria2 = weekend2.weekendCriteria();
         weekendCriteria2.andIn(CheckJob::getSbId, ids);
-        checkJobMapper.deleteByExample(weekend2);
-        checkStandardMapper.deleteByExample(weekend1);
+        checkJobMapper.deleteByExample(weekend2);*/
         mapper.deleteByExample(weekend);
         return 1;
     }