通过id删除生产单不上报apms

This commit is contained in:
李广豪 2022-07-12 22:50:28 +08:00
parent 1cb26378a1
commit dd2ae384ad
3 changed files with 28 additions and 3 deletions

View File

@ -278,6 +278,12 @@ public class CurrTaskController extends BaseController {
public R<String> deleteBySheetNo(@Validated @RequestBody CurrTaskQueryParam param) { public R<String> deleteBySheetNo(@Validated @RequestBody CurrTaskQueryParam param) {
return currTaskService.deleteBySheetNo(param.getSheetNo()); return currTaskService.deleteBySheetNo(param.getSheetNo());
} }
@PostMapping(value = "deleteById")
@ApiOperation(value = "人工id删除未正式开始的生产单")
public R<String> deleteById(@Validated @RequestBody IdParam param) {
return currTaskService.deleteById(param);
}
@PostMapping(value = "runTask") @PostMapping(value = "runTask")
@ApiOperation(value = "执行任务") @ApiOperation(value = "执行任务")
public R<String> runTask(@Validated @RequestBody IdParam param) throws InterruptedException, IOException { public R<String> runTask(@Validated @RequestBody IdParam param) throws InterruptedException, IOException {

View File

@ -84,7 +84,7 @@ public interface CurrTaskService {
* @param * @param
* @return 结果 * @return 结果
*/ */
R<String> deleteBySheetNo(IdParam idParam); R<String> deleteById(IdParam idParam);
/** /**
* 首页 获取当前执行的任务 * 首页 获取当前执行的任务

View File

@ -80,6 +80,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
KilnInfoServiceBiz kilnInfoServiceBiz; KilnInfoServiceBiz kilnInfoServiceBiz;
@Autowired @Autowired
LocationServiceBiz locationServiceBiz; LocationServiceBiz locationServiceBiz;
@Autowired
CurrTaskDetServiceBiz currTaskDetServiceBiz;
@Override @Override
public CurrTaskVo getCurrTask(IdParam idParam) { public CurrTaskVo getCurrTask(IdParam idParam) {
@ -230,8 +232,25 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
} }
@Override @Override
public R<String> deleteBySheetNo(IdParam idParam) { public R<String> deleteById(IdParam idParam) {
return null; CurrTask currTask = currTaskServiceBiz.getById(idParam.getId());
if (currTask.getIsAuto()==1){
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().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<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID,currTask1.getId()));
}
}
currTaskServiceBiz.removeById(idParam);
return R.ok(idParam.getId().toString());
} }
@Override @Override