From 4b9d4a5622997ca8bfbdae42f5a39adb9b36ac55 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Wed, 8 Jan 2025 14:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=90=8C=E6=AD=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/tc/controller/AssetCurrentController.java | 2 ++ .../ruoyi/tc/service/impl/AssetAppServiceImpl.java | 12 ++++++++++++ .../ruoyi/tc/service/impl/AssetEmailServiceImpl.java | 12 ++++++++++++ .../service/impl/AssetMiniProgramsServiceImpl.java | 6 ++++++ .../impl/AssetOfficialAccountServiceImpl.java | 6 ++++++ 5 files changed, 38 insertions(+) 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 5b12da2..3cb3e9c 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 @@ -50,6 +50,7 @@ public class AssetCurrentController extends BaseController { @Resource private AssetSupplyChainService assetSupplyChainService; + @Resource private AssetBasicNetworkService assetBasicNetworkService; @@ -569,6 +570,7 @@ public class AssetCurrentController extends BaseController { } //================================ + //根据未修改之前的单位名称去寻找正在进行中的任务,报废的任务,单位自编辑的任务 List list1 = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getId, assetCurrent.getId()).list(); list1.forEach(x -> { 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 2ab71a8..6ec3708 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 @@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.tc.entity.AssetApp; +import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.request.AssetAppPageRequest; import com.ruoyi.tc.mapper.AssetAppMapper; import com.ruoyi.tc.service.AssetAppCpService; import com.ruoyi.tc.service.AssetAppService; +import com.ruoyi.tc.service.AssetTaskService; import com.ruoyi.tc.service.UnitService; import org.springframework.stereotype.Service; @@ -32,6 +34,8 @@ public class AssetAppServiceImpl extends ServiceImpl i @Resource private AssetAppCpService assetAppCpService; + @Resource + private AssetTaskService assetTaskService; /** * 分页查询所有数据 * @@ -112,7 +116,15 @@ public class AssetAppServiceImpl extends ServiceImpl i */ @Override public Boolean edit(AssetApp assetApp) { + AssetApp byId = getById(assetApp.getId()); + + List list1 = unitService.lambdaQuery().eq(Unit::getNickName, assetApp.getSsdw()).eq(Unit::getDelFlag, 0).list(); + if (list1 == null || list1.isEmpty()) { + throw new ServiceException("请选择已有单位!"); + } updateById(assetApp); + + List list = assetAppCpService.lambdaQuery() .eq(AssetAppCpPo::getAssetId, assetApp.getId()).list(); list.forEach(x -> { 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 e6f28af..45d9c45 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 @@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.tc.entity.AssetEmail; +import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.po.AssetEmailCpPo; import com.ruoyi.tc.entity.request.AssetEmailPageRequest; import com.ruoyi.tc.mapper.AssetEmailMapper; import com.ruoyi.tc.service.AssetEmailCpService; import com.ruoyi.tc.service.AssetEmailService; +import com.ruoyi.tc.service.AssetTaskService; import com.ruoyi.tc.service.UnitService; import org.springframework.stereotype.Service; @@ -32,6 +34,8 @@ public class AssetEmailServiceImpl extends ServiceImpl list1 = unitService.lambdaQuery().eq(Unit::getNickName, assetEmail.getSsdw()).eq(Unit::getDelFlag, 0).list(); + if (list1 == null || list1.isEmpty()) { + throw new ServiceException("请选择已有单位!"); + } + updateById(assetEmail); + + List list = assetEmailCpService.lambdaQuery() .eq(AssetEmailCpPo::getAssetId, assetEmail.getId()).list(); list.forEach(x -> { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsServiceImpl.java index f3a921f..e8f859e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsServiceImpl.java @@ -106,6 +106,12 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl list1 = unitService.lambdaQuery().eq(Unit::getNickName, assetMiniPrograms.getSsdw()).eq(Unit::getDelFlag, 0).list(); + if (list1 == null || list1.isEmpty()) { + throw new ServiceException("请选择已有单位!"); + } + updateById(assetMiniPrograms); List list = assetMiniProgramsCpService.lambdaQuery() .eq(AssetMiniProgramsCpPo::getAssetId, assetMiniPrograms.getId()).list(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java index 1b1a119..69c86a6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java @@ -108,6 +108,12 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl list1 = unitService.lambdaQuery().eq(Unit::getNickName, assetOfficialAccount.getSsdw()).eq(Unit::getDelFlag, 0).list(); + if (list1 == null || list1.isEmpty()) { + throw new ServiceException("请选择已有单位!"); + } + updateById(assetOfficialAccount); List list = assetOfficialAccountCpService.lambdaQuery() .eq(AssetOfficialAccountCpPo::getAssetId, assetOfficialAccount.getId()).list();