From eb539c561b0f4036aacc0933e2bfbdb737e42ebc Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Wed, 8 Jan 2025 16:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=E5=8F=AF=E5=9C=A8?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=B5=84=E4=BA=A7=E6=89=80=E5=B1=9E=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=B9=B6=E5=90=8C=E6=AD=A5=E8=87=B3?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tc/controller/AssetCurrentController.java | 19 +++++++++++++++++++ .../tc/mapper/AssetBusinessFormCpMapper.java | 2 +- .../ruoyi/tc/mapper/AssetCurrentCpMapper.java | 2 +- .../tc/mapper/AssetSupplyChainCpMapper.java | 2 +- .../com/ruoyi/tc/mapper/AssetTaskMapper.java | 12 ++++++++++++ .../tc/mapper/UnitOtherConcatCpMapper.java | 2 +- .../service/AssetBasicNetworkCpService.java | 2 +- .../service/AssetBusinessFormCpService.java | 2 +- .../tc/service/AssetCurrentCpService.java | 10 +++++++++- .../tc/service/AssetSupplyChainCpService.java | 2 +- .../ruoyi/tc/service/AssetTaskService.java | 11 ++++++++++- .../tc/service/UnitOtherConcatCpService.java | 2 +- .../impl/AssetBasicNetworkCpServiceImpl.java | 2 +- .../impl/AssetBusinessFormCpServiceImpl.java | 2 +- .../impl/AssetCurrentCpServiceImpl.java | 2 +- .../impl/AssetSupplyChainCpServiceImpl.java | 2 +- .../tc/service/impl/AssetTaskServiceImpl.java | 5 +++++ .../impl/UnitOtherConcatCpServiceImpl.java | 2 +- .../main/resources/mapper/AssetTaskDao.xml | 3 +++ 19 files changed, 71 insertions(+), 15 deletions(-) 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 3cb3e9c..de3159b 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 @@ -651,9 +651,28 @@ public class AssetCurrentController extends BaseController { unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat()); } }); + //根据修改的单位名称查询任务表中是否有此单位的任务,如果有修改资产中的任务id,如果没有删除 + List dwmcList = assetTaskService.findByDwmc(assetCurrent.getDwmc()); + if (dwmcList.isEmpty()) { + delete(assetCurrent); + }else{ + delete(assetCurrent); + for (AssetTask s:dwmcList){ + + } + } + return success(); } + private void delete(AssetCurrent assetCurrent) { + assetCurrentCpService.deletByAssetIdandTaskId(assetCurrent.getId(), null); + assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), null); + assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), null); + unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), null); + assetBusinessFormCpService.deletByAssetIdandTaskId(assetCurrent.getId(), null); + } + /** * 删除数据 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java index 3b2b96e..8f29c34 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java @@ -35,7 +35,7 @@ public interface AssetBusinessFormCpMapper extends BaseMapper { * @param taskId */ @Delete("delete from asset_current_cp where id=#{assetId} and task_id =#{taskId} ") - void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId); + void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") Integer taskId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java index a600789..c98b9e8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java @@ -35,7 +35,7 @@ public interface AssetSupplyChainCpMapper extends BaseMapper { * @return */ List dwHcBl(@Param("req") AssetdwHcRequest req); + + + + + + /** + * 根据单位名称查询在进行中的任务 + * + * @param dwmc 单位名称 + * @return + */ + List findByDwmc(@Param("dwmc") String dwmc); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java index 56382dc..d22d5f6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java @@ -33,7 +33,7 @@ public interface UnitOtherConcatCpMapper extends BaseMapper * @param taskId 任务id */ @Delete("delete from unit_other_contact_cp where asset_id=#{assetId} and task_id =#{taskId} ") - void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId")int taskId); + void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId")Integer taskId); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java index 44f952a..f1b6fee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java @@ -30,7 +30,7 @@ public interface AssetBasicNetworkCpService extends IService { * @param assetId 资产id * @param taskId 任务id */ - void deletByAssetIdandTaskId(Long assetId, int taskId); + void deletByAssetIdandTaskId(Long assetId, Integer taskId); /** @@ -54,5 +54,13 @@ public interface AssetCurrentCpService extends IService { */ AssetCurrentCpPo findByassetIdandTaskId(Integer assetId, Integer taskId); + + /** + * 根据资产id查询 + * @param id + * @return + */ + Integer findByAssetId(Long id); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java index 1aa8cab..eeee629 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java @@ -40,6 +40,6 @@ public interface AssetSupplyChainCpService extends IService { * * @return */ - List dwHcBl(AssetdwHcRequest req); + List dwHcBl(AssetdwHcRequest req); + + + /** + * 根据单位名称查询在进行中的任务 + * + * @param dwmc 单位名称 + * @return + */ + List findByDwmc(String dwmc); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java index 267b52f..d429be3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java @@ -29,7 +29,7 @@ public interface UnitOtherConcatCpService extends IService * @param assetId 资产id * @param taskId 任务id */ - void deletByAssetIdandTaskId(Long assetId, int taskId); + void deletByAssetIdandTaskId(Long assetId, Integer taskId); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java index 58ca5fd..dc14d57 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java @@ -27,7 +27,7 @@ public class AssetBasicNetworkCpServiceImpl extends ServiceImpl findByDwmc(String dwmc) { + return assetTaskDao.findByDwmc(dwmc); + } + //创建任务流程 private void getTaskStatus(AssetCurrentShRequest req) { AssetLc assetLc = new AssetLc(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java index 5f9ac2c..d88e1b5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java @@ -26,7 +26,7 @@ public class UnitOtherConcatCpServiceImpl extends ServiceImpl + update asset_mini_programs_cp