|
@@ -11,7 +11,6 @@ import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
|
|
|
import com.diagbot.dto.GetModuleDetailInfoDTO;
|
|
|
import com.diagbot.dto.GetModuleInfoOneDTO;
|
|
|
import com.diagbot.dto.GetModuleTypeDTO;
|
|
|
-import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
|
|
|
import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.ModuleDetail;
|
|
@@ -20,8 +19,6 @@ import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.ModuleInfoTypeEnum;
|
|
|
import com.diagbot.enums.ModuleTypeEnum;
|
|
|
-import com.diagbot.enums.QuestionTypeEnum;
|
|
|
-import com.diagbot.enums.TagTypeEnum;
|
|
|
import com.diagbot.service.impl.ModuleInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
@@ -33,11 +30,9 @@ import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.AddModuleInfoVO;
|
|
|
import com.diagbot.vo.ConceptTypeVO;
|
|
|
import com.diagbot.vo.GetAllDeptAndDisInfoVO;
|
|
|
-import com.diagbot.vo.GetModuleDetailInfoVO;
|
|
|
import com.diagbot.vo.GetModuleInfoOneVO;
|
|
|
import com.diagbot.vo.GetModuleInfoVO;
|
|
|
import com.diagbot.vo.GetModuleTypeVO;
|
|
|
-import com.diagbot.vo.GetQuestiongAndModuleRelationsVO;
|
|
|
import com.diagbot.vo.UpdateModuleInfoVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -155,7 +150,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
.set("type", updateModuleInfoVO.getType())
|
|
|
.set("module_type",updateModuleInfoVO.getModuleType())
|
|
|
.set("modifier", userId)
|
|
|
- .set("gmt_modified", DateUtil.now());
|
|
|
+ .set("gmt_modified", DateUtil.now())
|
|
|
+ .set("remark",updateModuleInfoVO.getRemark());
|
|
|
if(updateModuleInfoVO.getRelationId() != null){
|
|
|
moduleInfoUpdateWrapper.set("relation_id", updateModuleInfoVO.getRelationId());
|
|
|
}
|
|
@@ -213,35 +209,47 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 模板维护修改获取已添加标签信息
|
|
|
+ * 模板维护页面获取模板列表
|
|
|
*
|
|
|
- * @param getModuleDetailInfoVO
|
|
|
+ * @param getModuleInfoOneVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<GetModuleDetailInfoDTO> getModuleDetailInfo(GetModuleDetailInfoVO getModuleDetailInfoVO) {
|
|
|
+ public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
|
|
|
+ GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
|
|
|
+ List<Long> deptId = new ArrayList<>();
|
|
|
+ //获取模板信息
|
|
|
+ QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("id", getModuleInfoOneVO.getModuleId());
|
|
|
+ ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper);
|
|
|
+ //获取模板类型名称
|
|
|
+ if(moduleInfo.getModuleType().intValue() == 1){
|
|
|
+ deptId.add(moduleInfo.getRelationId());
|
|
|
+ }
|
|
|
+ //获取科室名称
|
|
|
+ ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
|
|
|
+ conceptTypeVO.setType(1);
|
|
|
+ RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
+ RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
|
|
|
+ Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
|
|
|
+ //获取模板类型
|
|
|
+ BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
|
|
|
+ getModuleInfoOneDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfo.getType())));
|
|
|
+ getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
|
|
|
+ if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
|
|
|
+ getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取模板明细
|
|
|
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())
|
|
|
+ .eq("module_id", getModuleInfoOneVO.getModuleId())
|
|
|
.orderByAsc("order_no");
|
|
|
List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
|
|
|
List<Long> questionIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getQuestionId()).collect(Collectors.toList());
|
|
|
List<Long> moduleIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getRelationModule()).collect(Collectors.toList());
|
|
|
-
|
|
|
- if(getModuleDetailInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()){//如果是辅检,调用knowledgeman获取辅检信息
|
|
|
- ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
|
|
|
- conceptTypeVO.setType(2);
|
|
|
- RespDTO<List<ConceptBaseDTO>> pacsCeptInfo = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
- Map<Long,ConceptBaseDTO> pacsCeptMap = pacsCeptInfo.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
|
|
|
- //循环给出参赋值
|
|
|
- for (ModuleDetail moduleDetail : moduleDetailList) {
|
|
|
- getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
|
|
|
- BeanUtil.copyProperties(moduleDetail, getModuleDetailInfoDTO);
|
|
|
- getModuleDetailInfoDTO.setTagName(pacsCeptMap.get(moduleDetail.getQuestionId()).getName());
|
|
|
- }
|
|
|
- }else {
|
|
|
//获取标签信息
|
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -249,11 +257,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
|
|
|
//获取模板信息
|
|
|
- QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<ModuleInfo> getRelationModuleWapper = new QueryWrapper<>();
|
|
|
questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.in("id", moduleIdList);
|
|
|
- List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
|
|
|
- Map<Long, ModuleInfo> moduleInfoMap = moduleInfoList.stream().collect(Collectors.toMap(ModuleInfo::getId, moduleInfo -> moduleInfo));
|
|
|
+ List<ModuleInfo> moduleInfoList = this.list(getRelationModuleWapper);
|
|
|
+ Map<Long, ModuleInfo> moduleInfoMap = moduleInfoList.stream().collect(Collectors.toMap(ModuleInfo::getId, m -> moduleInfo));
|
|
|
//循环给出参赋值
|
|
|
for (ModuleDetail moduleDetail : moduleDetailList) {
|
|
|
getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
|
|
@@ -266,41 +274,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
}
|
|
|
getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
|
|
|
}
|
|
|
- }
|
|
|
- return getModuleDetailInfoDTOList;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 模板维护页面获取模板列表
|
|
|
- *
|
|
|
- * @param getModuleInfoOneVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
|
|
|
- GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
|
|
|
- List<Long> deptId = new ArrayList<>();
|
|
|
- //获取模板信息
|
|
|
- QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("id", getModuleInfoOneVO.getModuleId());
|
|
|
- ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper);
|
|
|
- //获取模板类型名称
|
|
|
- if(moduleInfo.getModuleType().intValue() == 1){
|
|
|
- deptId.add(moduleInfo.getRelationId());
|
|
|
- }
|
|
|
- //获取科室名称
|
|
|
- ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
|
|
|
- conceptTypeVO.setType(1);
|
|
|
- RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
- RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
|
|
|
- Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
|
|
|
- //获取模板类型
|
|
|
- BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
|
|
|
- getModuleInfoOneDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfo.getType())));
|
|
|
- getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
|
|
|
- if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
|
|
|
- getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
|
|
|
- }
|
|
|
+ getModuleInfoOneDTO.setModuleDetial(getModuleDetailInfoDTOList);
|
|
|
return getModuleInfoOneDTO;
|
|
|
}
|
|
|
|
|
@@ -382,44 +356,4 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
.eq("type",type);
|
|
|
return this.list(moduleInfoQueryWrapper);
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 返回标签关联模板信息
|
|
|
- *
|
|
|
- * @param getQuestiongAndModuleRelationsVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelations(GetQuestiongAndModuleRelationsVO getQuestiongAndModuleRelationsVO){
|
|
|
- StringBuffer errMsg = new StringBuffer();
|
|
|
- List<ModuleDetail> moduleDetails = moduleDetailFacade.list(new QueryWrapper<ModuleDetail>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("question_id", getQuestiongAndModuleRelationsVO.getQuestionId()));
|
|
|
- if (ListUtil.isNotEmpty(moduleDetails)) {
|
|
|
- List<Long> moduleIds = moduleDetails.stream().map(row -> row.getModuleId()).collect(Collectors.toList());
|
|
|
- List<String> moduleNames = this.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) {
|
|
|
- errMsg.append("该标签已关联").append("【" + mouduleName + "】").append("<br/>");
|
|
|
- }
|
|
|
- }
|
|
|
- StringBuffer titalMsg = new StringBuffer();
|
|
|
- StringBuffer questionMsg = new StringBuffer();
|
|
|
- List<QuestionInfo> info = questionFacade.getParentQuestion(getQuestiongAndModuleRelationsVO.getQuestionId());
|
|
|
- for (QuestionInfo bean : info) {
|
|
|
- if (bean.getTagType() != null && bean.getTagType() == TagTypeEnum.T10.getKey()) {
|
|
|
- List<QuestionInfo> info2 = questionFacade.getParentQuestion(bean.getId());
|
|
|
- List<String> msg = info2.stream().map(row -> "【" + row.getTagName() + "】").collect(Collectors.toList());
|
|
|
- questionMsg.append(String.join("", msg));
|
|
|
- } else {
|
|
|
- questionMsg.append("【"+bean.getTagName()+"】");
|
|
|
- }
|
|
|
- }
|
|
|
- titalMsg.append("该标签已关联父级:").append(questionMsg).append("<br/>").append(errMsg);
|
|
|
- GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelationsDTO = new GetQuestiongAndModuleRelationsDTO();
|
|
|
- getQuestiongAndModuleRelationsDTO.setRelationInfos(titalMsg.append("是否删除?"));
|
|
|
- return getQuestiongAndModuleRelationsDTO;
|
|
|
- }
|
|
|
-
|
|
|
}
|