|
@@ -7,6 +7,7 @@ import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.QuestionDTO;
|
|
|
import com.diagbot.dto.QuestionPageDTO;
|
|
|
import com.diagbot.entity.CommonParam;
|
|
|
+import com.diagbot.entity.QcModuleInfo;
|
|
|
import com.diagbot.entity.QcQuestionInfo;
|
|
|
import com.diagbot.entity.QcQuestionMapping;
|
|
|
import com.diagbot.entity.wrapper.QuestionInfoWrapper;
|
|
@@ -60,8 +61,8 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
UserServiceClient userServiceClient;
|
|
|
// @Autowired
|
|
|
// ModuleDetailFacade moduleDetailFacade;
|
|
|
-// @Autowired
|
|
|
-// ModuleInfoFacade moduleInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ QcModuleInfoFacade qcModuleInfoFacade;
|
|
|
|
|
|
/**
|
|
|
* 标签保存
|
|
@@ -77,7 +78,6 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
saveQuestionMapping(questionWrapper, param);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 初始化参数
|
|
|
*
|
|
@@ -92,7 +92,6 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
return param;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 保存映射关系
|
|
|
*
|
|
@@ -111,7 +110,6 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 删除映射关系
|
|
|
*
|
|
@@ -128,7 +126,6 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 保存映射关系
|
|
|
*
|
|
@@ -190,7 +187,6 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
this.saveOrUpdate(qcQuestionInfo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 标签列表
|
|
|
*
|
|
@@ -213,7 +209,6 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 根据id删除标签
|
|
|
*
|
|
@@ -246,29 +241,21 @@ public class QcQuestionFacade extends QcQuestionInfoServiceImpl {
|
|
|
sb.toString());
|
|
|
}
|
|
|
|
|
|
- // TODO 从模板中查找是否有关联
|
|
|
-// List<ModuleDetail> moduleDetails = moduleDetailFacade.list(new QueryWrapper<ModuleDetail>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .eq("question_id", Long.parseLong(id)));
|
|
|
-// if (ListUtil.isNotEmpty(moduleDetails)) {
|
|
|
-// StringBuffer errMsg = new StringBuffer();
|
|
|
-// StringBuffer finalMsg = new StringBuffer();
|
|
|
-// List<Long> moduleIds = moduleDetails.stream().map(row -> row.getModuleId()).collect(Collectors.toList());
|
|
|
-// List<String> moduleNames = moduleInfoFacade.list(new QueryWrapper<ModuleInfo>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .in("id", moduleIds))
|
|
|
-// .stream().map(row -> row.getName()).collect(Collectors.toList());
|
|
|
-// for (String mouduleName : moduleNames) {
|
|
|
-// if (moduleNames.get(moduleNames.size() - 1).equals(mouduleName)) {//如果当前元素是最后一个,不追加顿号
|
|
|
-// errMsg.append("【" + mouduleName + "】");
|
|
|
-// } else {
|
|
|
-// errMsg.append("【" + mouduleName + "】").append("、");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// finalMsg.append("该标签已关联模板").append(errMsg);
|
|
|
-// throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
-// finalMsg.toString());
|
|
|
-// }
|
|
|
+ // 从模板中查找是否有关联
|
|
|
+ Map<String, Object> paraMap = new HashMap<>();
|
|
|
+ if (deleteQuestionVO.getHospitalId() != null) {
|
|
|
+ paraMap.put("hospitalId", deleteQuestionVO.getHospitalId());
|
|
|
+ }
|
|
|
+ paraMap.put("questionId", Long.parseLong(id));
|
|
|
+ List<QcModuleInfo> qcModuleInfoList = qcModuleInfoFacade.getModuleNameByQuestionIdFac(paraMap);
|
|
|
+ if (ListUtil.isNotEmpty(qcModuleInfoList)) {
|
|
|
+ StringBuffer errMsg = new StringBuffer();
|
|
|
+ errMsg.append("该标签已关联模板");
|
|
|
+ for (QcModuleInfo bean : qcModuleInfoList) {
|
|
|
+ errMsg.append("【" + bean.getName() + "】");
|
|
|
+ }
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, errMsg.toString());
|
|
|
+ }
|
|
|
|
|
|
//删除自身
|
|
|
this.deleteByIds(paramMap);
|