From dd2ae384adb6205a41e7d33e159c4ec832900aba Mon Sep 17 00:00:00 2001 From: LGH <1746689524@qq.com> Date: Tue, 12 Jul 2022 22:50:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87id=E5=88=A0=E9=99=A4=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E5=8D=95=E4=B8=8D=E4=B8=8A=E6=8A=A5apms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/controller/CurrTaskController.java | 6 +++++ .../mt/wms/empty/service/CurrTaskService.java | 2 +- .../service/impl/CurrTaskServiceImpl.java | 23 +++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java index 3b5e235..84e4467 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java @@ -278,6 +278,12 @@ public class CurrTaskController extends BaseController { public R deleteBySheetNo(@Validated @RequestBody CurrTaskQueryParam param) { return currTaskService.deleteBySheetNo(param.getSheetNo()); } + + @PostMapping(value = "deleteById") + @ApiOperation(value = "人工id删除未正式开始的生产单") + public R deleteById(@Validated @RequestBody IdParam param) { + return currTaskService.deleteById(param); + } @PostMapping(value = "runTask") @ApiOperation(value = "执行任务") public R runTask(@Validated @RequestBody IdParam param) throws InterruptedException, IOException { diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index b632b5d..d4d39a8 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -84,7 +84,7 @@ public interface CurrTaskService { * @param * @return 结果 */ - R deleteBySheetNo(IdParam idParam); + R deleteById(IdParam idParam); /** * 首页 获取当前执行的任务 diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index ad18925..ad484a9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -80,6 +80,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService KilnInfoServiceBiz kilnInfoServiceBiz; @Autowired LocationServiceBiz locationServiceBiz; + @Autowired + CurrTaskDetServiceBiz currTaskDetServiceBiz; @Override public CurrTaskVo getCurrTask(IdParam idParam) { @@ -230,8 +232,25 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService } @Override - public R deleteBySheetNo(IdParam idParam) { - return null; + public R deleteById(IdParam idParam) { + CurrTask currTask = currTaskServiceBiz.getById(idParam.getId()); + if (currTask.getIsAuto()==1){ + List currTaskList = currTaskServiceBiz.list(new QueryWrapper().eq(CurrTask.AUTO_EXE_TASK_ID, currTask.getAutoExeTaskId())); + for (CurrTask currTask1:currTaskList + ) { + if (currTask1.getStatus()!=0){ + return R.failed("该自动任务已有步骤在执行中或执行完成,不能删除!"); + } + } + //能删除 + autoExeTaskServiceBiz.removeById(currTask.getAutoExeTaskId()); + for (CurrTask currTask1:currTaskList + ) { + currTaskDetServiceBiz.remove(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID,currTask1.getId())); + } + } + currTaskServiceBiz.removeById(idParam); + return R.ok(idParam.getId().toString()); } @Override