fix: 80755 删除标准后,文档拆分的相关数据没被删除,但点击无法进入详情也没提示
This commit is contained in:
+2
@@ -84,4 +84,6 @@ public interface ISarFileCompareInfoService extends IService<SarFileCompareInfo>
|
||||
* @param ids
|
||||
*/
|
||||
void isHorizontalOverstep(String ids);
|
||||
|
||||
void deleteByStandardId(String ids);
|
||||
}
|
||||
|
||||
+33
@@ -15,6 +15,10 @@ import com.jero.modules.compare.service.ISarFileCompareMenuService;
|
||||
import com.jero.modules.compare.utils.CompHanLPUtils;
|
||||
import com.jero.modules.compare.utils.CompareConst;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
@@ -26,6 +30,7 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -60,6 +65,12 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
@Resource
|
||||
private ILawsEnterpriseStandardService esService;
|
||||
|
||||
@Resource
|
||||
private ILawsDomesticStandardService gbService;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -357,6 +368,28 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByStandardId(String ids) {
|
||||
List<LawsEnterpriseStandard> lawsEnterpriseStandards = esService.listByIds(Arrays.asList(ids.split(",")));
|
||||
List<LawsDomesticStandard> lawsDomesticStandards = gbService.listByIds(Arrays.asList(ids.split(",")));
|
||||
List<String> standardNos = new ArrayList<>();
|
||||
for (LawsEnterpriseStandard lawsEnterpriseStandard : lawsEnterpriseStandards) {
|
||||
standardNos.add(lawsEnterpriseStandard.getStandardNumber());
|
||||
}
|
||||
for (LawsDomesticStandard lawsDomesticStandard : lawsDomesticStandards) {
|
||||
standardNos.add(lawsDomesticStandard.getStandardNumber());
|
||||
}
|
||||
LambdaQueryWrapper<SarFileCompareInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(SarFileCompareInfo::getSerialNumberLeft, standardNos);
|
||||
queryWrapper.or().in(SarFileCompareInfo::getSerialNumberRight, standardNos);
|
||||
List<SarFileCompareInfo> sarFileCompareInfos = sarFileCompareInfoService.list(queryWrapper);
|
||||
List<String> idsList = new ArrayList<>();
|
||||
for (SarFileCompareInfo sarFileCompareInfo : sarFileCompareInfos) {
|
||||
idsList.add(sarFileCompareInfo.getId());
|
||||
}
|
||||
this.deleteByIds(idsList);
|
||||
}
|
||||
|
||||
private List<SarFileCompareMenuVo> tree(List<SarFileCompareMenuVo> list) {
|
||||
List<SarFileCompareMenuVo> compareMenuVos = new ArrayList<>();
|
||||
//先删除name是总目录的数据
|
||||
|
||||
+12
@@ -9,6 +9,7 @@ import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||
import com.jero.modules.laws.common.service.ILawsCommonService;
|
||||
import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
|
||||
@@ -16,6 +17,7 @@ import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
|
||||
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
|
||||
import com.jero.modules.personal.service.ILawsStandardCollectionService;
|
||||
import com.jero.modules.personal.service.ILawsStandardSharingService;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -26,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -54,6 +57,12 @@ public class LawsDomesticController {
|
||||
@Autowired
|
||||
private IProcessFbEntryChangeService processFbEntryChangeService;
|
||||
|
||||
@Resource
|
||||
private ISarFileSplitInfoService splitInfoService;
|
||||
|
||||
@Resource
|
||||
private ISarFileCompareInfoService compareInfoService;
|
||||
|
||||
private static final String MODULE_VALUE = TableNameEnum.DOMESTIC_REGULATIONS.getValue();
|
||||
|
||||
@AutoLog(value = "国内法规标准-分页列表查询")
|
||||
@@ -151,6 +160,9 @@ public class LawsDomesticController {
|
||||
//删除标准时同步删除这个标准的收藏数据
|
||||
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
// 删除标准时同步删除比对和拆分的相关数据
|
||||
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
|
||||
}
|
||||
|
||||
|
||||
+15
-1
@@ -8,6 +8,7 @@ import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.modules.laws.common.service.ILawsCommonService;
|
||||
@@ -23,6 +24,7 @@ import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
|
||||
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
|
||||
import com.jero.modules.personal.service.ILawsStandardCollectionService;
|
||||
import com.jero.modules.personal.service.ILawsStandardSharingService;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
@@ -68,6 +70,12 @@ public class LawsEnterpriseController {
|
||||
@Resource
|
||||
private EnterpriseStandardReviewMeetingRecordService esReviewMeetingService;
|
||||
|
||||
@Resource
|
||||
private ISarFileSplitInfoService splitInfoService;
|
||||
|
||||
@Resource
|
||||
private ISarFileCompareInfoService compareInfoService;
|
||||
|
||||
private static final String MODULE_VALUE = TableNameEnum.ENTERPRISE_STANDARDS.getValue();
|
||||
|
||||
@AutoLog(value = "企业法规标准-分页列表查询")
|
||||
@@ -172,6 +180,9 @@ public class LawsEnterpriseController {
|
||||
//删除标准时同步删除这个标准的收藏数据
|
||||
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
// 删除标准时同步删除比对和拆分的相关数据
|
||||
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
|
||||
}
|
||||
|
||||
@@ -181,9 +192,12 @@ public class LawsEnterpriseController {
|
||||
@ApiOperationSupport(order = 9)
|
||||
@RequiresPermissions("enterpriseStandard:delete")
|
||||
public Result<String> singleDelete(@RequestBody @ApiParam(name = "ids", value = "主键(多个用逗号分隔)") Map<String,Object> parameterMap) {
|
||||
//删除标准时同步删除这个标准的收藏数据
|
||||
// 删除标准时同步删除这个标准的收藏数据
|
||||
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
// 删除标准时同步删除比对和拆分的相关数据
|
||||
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
|
||||
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -79,4 +79,7 @@ public interface ISarFileSplitInfoService extends IService<SarFileSplitInfoEO> {
|
||||
|
||||
// 同步更新文档拆分标准名称
|
||||
void updateTitleByStandardId(String standardId, String title);
|
||||
|
||||
// 根据企标Id删除数据
|
||||
void deleteByStandardId(String ids);
|
||||
}
|
||||
|
||||
+10
@@ -455,5 +455,15 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
.eq(SarFileSplitInfoEO::getStandardId, standardId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByStandardId(String ids) {
|
||||
LambdaQueryWrapper<SarFileSplitInfoEO> splitWrapper = new LambdaQueryWrapper<>();
|
||||
splitWrapper.in(SarFileSplitInfoEO::getStandardId, Arrays.asList(ids.split(",")));
|
||||
List<SarFileSplitInfoEO> splitInfoEOList = list(splitWrapper);
|
||||
if (CollectionUtil.isNotEmpty(splitInfoEOList)){
|
||||
this.deleteByIds(splitInfoEOList.stream().map(SarFileSplitInfoEO::getId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user