|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
+import com.diagbot.dto.GetModuleDetailInfoDTO;
|
|
|
import com.diagbot.dto.GetQuestionInfoDTO;
|
|
|
import com.diagbot.dto.ModuleInfoDTO;
|
|
|
import com.diagbot.dto.ModuleInfoListDTO;
|
|
@@ -11,6 +12,7 @@ import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.DictionaryInfo;
|
|
|
import com.diagbot.entity.ModuleDetail;
|
|
|
import com.diagbot.entity.ModuleInfo;
|
|
|
+import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -222,8 +224,48 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
return moduleInfoDTOIPage;
|
|
|
}
|
|
|
|
|
|
- public List<GetQuestionInfoDTO> getModuleDetailInfo(GetModuleDetailInfoVO getModuleDetailInfoVO){
|
|
|
- List<GetQuestionInfoDTO> getQuestionInfoDTOList = questionFacade.getQuestionByModuleId(getModuleDetailInfoVO.getModuleId());
|
|
|
- return getQuestionInfoDTOList;
|
|
|
+ /**
|
|
|
+ * 模板维护修改获取已添加标签信息
|
|
|
+ *
|
|
|
+ * @param getModuleDetailInfoVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<GetModuleDetailInfoDTO> getModuleDetailInfo(GetModuleDetailInfoVO getModuleDetailInfoVO){
|
|
|
+ List<GetModuleDetailInfoDTO> getModuleDetailInfoDTOList = new ArrayList<>();
|
|
|
+ GetModuleDetailInfoDTO getModuleDetailInfoDTO = null;
|
|
|
+ //获取模板明细
|
|
|
+ QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
|
|
|
+ moduleDetailQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
+ .eq("module_id",getModuleDetailInfoVO.getModuleId());
|
|
|
+ List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
|
|
|
+ //获取标签信息
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
|
|
|
+ List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
+ Map<Long,QuestionInfo> questionInfoMap = new HashMap<>();
|
|
|
+ for (QuestionInfo questionInfo : questionInfoList) {
|
|
|
+ questionInfoMap.put(questionInfo.getId(),questionInfo);
|
|
|
+ }
|
|
|
+ //获取模板信息
|
|
|
+ QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
|
|
|
+ List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
|
|
|
+ Map<Long,ModuleInfo> moduleInfoMap = new HashMap<>();
|
|
|
+ for (ModuleInfo moduleInfo : moduleInfoList) {
|
|
|
+ moduleInfoMap.put(moduleInfo.getId(),moduleInfo);
|
|
|
+ }
|
|
|
+ //循环放入实体
|
|
|
+ for (ModuleDetail moduleDetail: moduleDetailList) {
|
|
|
+ getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
|
|
|
+ BeanUtil.copyProperties(moduleDetail,getModuleDetailInfoDTO);
|
|
|
+ if(moduleDetail.getQuestionId() != null){
|
|
|
+ getModuleDetailInfoDTO.setTagName(questionInfoMap.get(moduleDetail.getQuestionId()).getTagName());
|
|
|
+ }else {
|
|
|
+ getModuleDetailInfoDTO.setRelationModuleName(moduleInfoMap.get(moduleDetail.getModuleId()).getName());
|
|
|
+ }
|
|
|
+ getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ return getModuleDetailInfoDTOList;
|
|
|
}
|
|
|
}
|