diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetAppController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetAppController.java index 77dfb41..736ebcc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetAppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetAppController.java @@ -222,22 +222,7 @@ public class AssetAppController extends BaseController { @Log(title = "编辑app数据", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody AssetApp assetApp) { - //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态 - AssetAppCpPo assetAppCpPo = assetAppCpService.findDwmc(assetApp.getId()); - if (assetAppCpPo != null) { - //查询任务是否为进行中 - AssetTask assetTask = assetTaskService.findByTaskId(assetAppCpPo.getTaskId()); - if (assetTask.getTaskStatus().equals(1)) { - if (assetAppCpPo.getStatus()==5 ) { - //修改任务中资产状态 - assetAppCpPo.setStatus(0); - assetAppCpPo.setBtgyy(null); - assetTask.setTaskStatus(1); - assetTaskService.update(assetTask); - assetAppCpService.updateById(assetAppCpPo); - } - } - } + return success(assetAppService.edit(assetApp)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index 64896ad..fed4a26 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -682,7 +682,7 @@ public class AssetCurrentController extends BaseController { }); //根据修改的单位名称查询任务表中是否有此单位的任务,如果有修改资产中的任务id,如果没有删除 AssetTask assetTask = assetTaskService.findByDwmc(assetCurrent.getDwmc()); - if (assetTask != null) { + if (assetTask == null) { delete(assetCurrent); } else { //根据资产id查询旧资产 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java index ef3b3ce..1aa1416 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java @@ -125,7 +125,6 @@ public class AssetAppServiceImpl extends ServiceImpl i */ @Override public Boolean edit(AssetApp assetApp) { - AssetApp byId = getById(assetApp.getId()); List list2 = unitService.lambdaQuery().eq(Unit::getNickName, assetApp.getSsdw()).eq(Unit::getDelFlag, 0).list(); if (list2 == null || list2.isEmpty()) { @@ -156,7 +155,7 @@ public class AssetAppServiceImpl extends ServiceImpl i //根据修改的单位名称查询任务表中是否有此单位的任务,如果有修改资产中的任务id,如果没有删除 AssetTask assetTask = assetTaskService.findByDwmc(assetApp.getAppName()); - if (assetTask != null) { + if (assetTask == null) { assetAppCpService.deletByAssetId(assetApp.getId()); } else { //根据资产id查询旧资产 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java index 959a0f2..c0d9f55 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java @@ -155,7 +155,7 @@ public class AssetEmailServiceImpl extends ServiceImpl