|
@@ -1,6 +1,7 @@
|
|
|
// Copyright(c) 2021 ReliaQube. All rights reserved.
|
|
|
package com.nationrel.modules.fta.service;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -10,6 +11,7 @@ import com.nationrel.modules.fta.entity.FtaProject;
|
|
|
import com.nationrel.modules.fta.general.domain.auth.HeaderUserInfo;
|
|
|
import com.nationrel.modules.fta.general.domain.enums.fta.FtaParamDataExceptionEnum;
|
|
|
import com.nationrel.modules.fta.general.util.common.BasicDataUtil;
|
|
|
+import com.nationrel.modules.fta.mapper.FtaAnalysisMapper;
|
|
|
import com.nationrel.modules.fta.mapper.FtaProjectMapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -19,7 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
@Slf4j
|
|
@@ -29,6 +33,7 @@ public class FtaProjectService {
|
|
|
|
|
|
private final FtaProjectMapper ftaProjectMapper;
|
|
|
private final FtaAnalysisService analysisService;
|
|
|
+ private final FtaAnalysisMapper analysisMapper;
|
|
|
|
|
|
/**
|
|
|
* 分页查询
|
|
@@ -134,5 +139,22 @@ public class FtaProjectService {
|
|
|
}
|
|
|
return Result.ok();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量逻辑删除逻辑
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @param userInfo
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void deleteBatch(String ids, HeaderUserInfo userInfo) {
|
|
|
+ List<String> idList = Arrays.asList(ids.split(","));
|
|
|
+
|
|
|
+ // 逻辑删除子表
|
|
|
+ List<FtaAnalysis> analysisList = analysisMapper.selectList(new LambdaQueryWrapper<FtaAnalysis>().in(FtaAnalysis::getProjectId, idList));
|
|
|
+ analysisList.forEach(analysis -> analysisService.deleteAnalysis(analysis.getAnalysisId(), userInfo));
|
|
|
+ // 逻辑删除主表
|
|
|
+ ftaProjectMapper.deleteBatchIds(idList);
|
|
|
+ }
|
|
|
}
|
|
|
|