|
@@ -524,22 +524,28 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
paramMap.put("modifier", person);
|
|
|
|
|
|
// 映射关系删除校验,如果有父项关联,不能删除
|
|
|
+ List<Long> tagType10Ids = new ArrayList<>();
|
|
|
List<QuestionInfo> questionInfoList = getParentQuestion(Long.parseLong(id));
|
|
|
if (ListUtil.isNotEmpty(questionInfoList)) {
|
|
|
+ boolean flag = false;
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
- sb.append("请先删除上级关联:");
|
|
|
for (QuestionInfo ques : questionInfoList) {
|
|
|
if (ques.getTagType().equals(TagTypeEnum.T10.getKey())) { // 既往史下特殊类型
|
|
|
+ tagType10Ids.add(ques.getId());
|
|
|
List<QuestionInfo> question2 = getParentQuestion(ques.getId());
|
|
|
if (ListUtil.isNotEmpty(question2)) {
|
|
|
sb.append("【" + question2.get(0).getTagName() + "】"); // 有且只有一个
|
|
|
+ flag = true;
|
|
|
}
|
|
|
} else {
|
|
|
sb.append("【" + ques.getTagName() + "】");
|
|
|
+ flag = true;
|
|
|
}
|
|
|
}
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- sb.toString());
|
|
|
+ if (flag) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ sb.toString());
|
|
|
+ }
|
|
|
}
|
|
|
//模板关联
|
|
|
GetQuestiongAndModuleRelationsVO getQuestiongAndModuleRelationsVO = new GetQuestiongAndModuleRelationsVO();
|
|
@@ -577,6 +583,14 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
}
|
|
|
//删除自身
|
|
|
this.deleteByIds(paramMap);
|
|
|
+ //删除tagType=10的无用标签
|
|
|
+ this.update(new UpdateWrapper<QuestionInfo>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("id", tagType10Ids)
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .set("gmt_modified", now)
|
|
|
+ .set("modifier", person)
|
|
|
+ );
|
|
|
//删除明细
|
|
|
questionDetailFacade.deleteByQuestionIdFac(paramMap);
|
|
|
//删除映射关系
|