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 360744f..a60a79d 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 @@ -153,6 +153,20 @@ public class AssetAppController extends BaseController { aa.setId(byId.getAssetId()); //修改主表 assetAppService.updateById(aa); + //如果有任务也修改任务这边 + AssetAppJyPo one = assetAppJyService.lambdaQuery() + .isNotNull(AssetAppJyPo::getTaskId) + .eq(AssetAppJyPo::getAssetId, byId.getAssetId()).one(); + if(one!=null){ + Integer taskId = one.getTaskId(); + Long appId = one.getAppId(); + BeanUtil.copyProperties(byId, one); + one.setAppId(appId); + one.setTaskId(taskId); + one.setAuditState(null); + one.setAuditYy(null); + assetAppJyService.updateById(one); + } } return success(); } 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 aedb734..b39f7fd 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 @@ -258,14 +258,18 @@ public class AssetCurrentController extends BaseController { QueryWrapper queryWrapper2 = new QueryWrapper<>(); queryWrapper2.eq("asset_id", assetCurrentJyPo.getId()); + queryWrapper2.isNull("task_id"); assetSupplyChainJyService.remove(queryWrapper2); QueryWrapper queryWrapper3 = new QueryWrapper<>(); queryWrapper3.eq("asset_id", assetCurrentJyPo.getId()); + queryWrapper3.isNull("task_id"); assetBasicNetworkJyService.remove(queryWrapper3); QueryWrapper queryWrapper4 = new QueryWrapper<>(); queryWrapper4.eq("asset_id", assetCurrentJyPo.getId()); + queryWrapper4.isNull("task_id"); assetBusinessFormJyService.remove(queryWrapper4); QueryWrapper queryWrapper5 = new QueryWrapper<>(); + queryWrapper5.isNull("task_id"); queryWrapper5.eq("asset_id", assetCurrentJyPo.getId()); unitOtherConcatJyservice.remove(queryWrapper5); if (assetCurrentJyPo.getXjgywxt() != null) { @@ -435,6 +439,55 @@ public class AssetCurrentController extends BaseController { BeanUtil.copyProperties(x, a4); unitOtherConcatService.save(a4); }); + //如果有任务也修改任务这边 + AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery() + .isNotNull(AssetCurrentCpPo::getTaskId) + .eq(AssetCurrentCpPo::getId, byId.getId()).one(); + if(one!=null){ + Integer taskId = one.getTaskId(); + Long appId = one.getCurrentId(); + BeanUtil.copyProperties(byId, one); + one.setCurrentId(appId); + one.setTaskId(taskId); + one.setAuditState(null); + one.setAuditYy(null); + assetCurrentCpService.updateById(one); + + + + QueryWrapper queryWrapper2 = new QueryWrapper<>(); + queryWrapper2.eq("asset_id", one.getId()); + queryWrapper2.isNull("task_id"); + assetSupplyChainCpService.remove(queryWrapper2); + QueryWrapper queryWrapper3 = new QueryWrapper<>(); + queryWrapper3.eq("asset_id", one.getId()); + queryWrapper3.isNull("task_id"); + assetBasicNetworkCpService.remove(queryWrapper3); + QueryWrapper queryWrapper4 = new QueryWrapper<>(); + queryWrapper4.eq("asset_id", one.getId()); + queryWrapper4.isNull("task_id"); + assetBusinessFormCpService.remove(queryWrapper4); + QueryWrapper queryWrapper5 = new QueryWrapper<>(); + queryWrapper5.isNull("task_id"); + queryWrapper5.eq("asset_id", one.getId()); + unitOtherConcatCpService.remove(queryWrapper5); + list.forEach(x -> { + x.setTaskId(taskId); + assetSupplyChainCpService.save(x); + }); + list1.forEach(x -> { + x.setTaskId(taskId); + assetBasicNetworkCpService.save(x); + }); + list2.forEach(x -> { + x.setTaskId(taskId); + assetBusinessFormCpService.save(x); + }); + list3.forEach(x -> { + x.setTaskId(taskId); + unitOtherConcatCpService.save(x); + }); + } } return success(); } @@ -519,15 +572,19 @@ public class AssetCurrentController extends BaseController { QueryWrapper queryWrapper2 = new QueryWrapper<>(); queryWrapper2.eq("asset_id", assetCurrent.getId()); + queryWrapper2.isNotNull("task_id"); assetSupplyChainCpService.remove(queryWrapper2); QueryWrapper queryWrapper3 = new QueryWrapper<>(); + queryWrapper3.isNotNull("task_id"); queryWrapper3.eq("asset_id", assetCurrent.getId()); assetBasicNetworkCpService.remove(queryWrapper3); QueryWrapper queryWrapper4 = new QueryWrapper<>(); + queryWrapper4.isNotNull("task_id"); queryWrapper4.eq("asset_id", assetCurrent.getId()); assetBusinessFormCpService.remove(queryWrapper4); QueryWrapper queryWrapper5 = new QueryWrapper<>(); queryWrapper5.eq("asset_id", assetCurrent.getId()); + queryWrapper5.isNotNull("task_id"); unitOtherConcatCpService.remove(queryWrapper5); if (assetCurrent.getXjgywxt() != null) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetEmailController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetEmailController.java index 18aabcd..2420a88 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetEmailController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetEmailController.java @@ -147,6 +147,20 @@ public class AssetEmailController extends BaseController { aa.setId(byId.getAssetId()); //修改主表 assetEmailService.updateById(aa); + //如果有任务也修改任务这边 + AssetEmailJyPo one = assetEmailJyService.lambdaQuery() + .isNotNull(AssetEmailJyPo::getTaskId) + .eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one(); + if(one!=null){ + Integer taskId = one.getTaskId(); + Long appId = one.getEmailId(); + BeanUtil.copyProperties(byId, one); + one.setEmailId(appId); + one.setTaskId(taskId); + one.setAuditState(null); + one.setAuditYy(null); + assetEmailJyService.updateById(one); + } } return success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetMiniProgramsController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetMiniProgramsController.java index d3dd819..6360e09 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetMiniProgramsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetMiniProgramsController.java @@ -148,6 +148,20 @@ public class AssetMiniProgramsController extends BaseController { aa.setId(byId.getAssetId()); //修改主表 assetMiniProgramsService.updateById(aa); + //如果有任务也修改任务这边 + AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery() + .isNotNull(AssetMiniProgramsJyPo::getTaskId) + .eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one(); + if(one!=null){ + Integer taskId = one.getTaskId(); + Long appId = one.getMiniId(); + BeanUtil.copyProperties(byId, one); + one.setMiniId(appId); + one.setTaskId(taskId); + one.setAuditState(null); + one.setAuditYy(null); + assetMiniProgramsJyService.updateById(one); + } } return success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java index 5907c17..f8e6616 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java @@ -162,6 +162,20 @@ public class AssetOfficialAccountController { aa.setId(byId.getAssetId()); //修改主表 assetOfficialAccountService.updateById(aa); + //如果有任务也修改任务这边 + AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery() + .isNotNull(AssetOfficialAccountJyPo::getTaskId) + .eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one(); + if(one!=null){ + Integer taskId = one.getTaskId(); + Long appId = one.getAccountId(); + BeanUtil.copyProperties(byId, one); + one.setAccountId(appId); + one.setTaskId(taskId); + one.setAuditState(null); + one.setAuditYy(null); + assetOfficialAccountJyService.updateById(one); + } } return success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentJyPo.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentJyPo.java index c8dc85d..cb7a5a4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentJyPo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentJyPo.java @@ -31,7 +31,7 @@ public class AssetCurrentJyPo extends BaseClass implements Serializable { private static final long serialVersionUID = 1L; - /** + AssetCurrentCpPo * 主键id */ @TableId(type = IdType.AUTO,value = "current_id")