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