瀏覽代碼

Merge branch 'dev/KLBstand' of C:\Users\MarkHuang\IdeaProjects\diagbotcloud with conflicts.

MarkHuang 6 年之前
父節點
當前提交
27f44f957d
共有 1 個文件被更改,包括 230 次插入218 次删除
  1. 230 218
      knowledgeman-service/src/main/java/com/diagbot/facade/MedicalFacade.java

+ 230 - 218
knowledgeman-service/src/main/java/com/diagbot/facade/MedicalFacade.java

@@ -1,15 +1,39 @@
 package com.diagbot.facade;
 package com.diagbot.facade;
 
 
+import java.io.InputStream;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang.time.DateFormatUtils;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.DeptInfoServiceClient;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.GetAllDeptsDTO;
 import com.diagbot.dto.GetMedicalInfoDetailDTO;
 import com.diagbot.dto.GetMedicalInfoDetailDTO;
 import com.diagbot.dto.GetMedicalInfoListDTO;
 import com.diagbot.dto.GetMedicalInfoListDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Bodypart;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.LibraryInfo;
 import com.diagbot.entity.LibraryInfo;
 import com.diagbot.entity.Medical;
 import com.diagbot.entity.Medical;
-import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.MedicalService;
 import com.diagbot.service.MedicalService;
@@ -19,30 +43,10 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddMedicalInfoVO;
 import com.diagbot.vo.AddMedicalInfoVO;
+import com.diagbot.vo.GetAllDeptsVO;
 import com.diagbot.vo.GetMedicalInfoDetailVO;
 import com.diagbot.vo.GetMedicalInfoDetailVO;
 import com.diagbot.vo.GetMedicalInfoListVO;
 import com.diagbot.vo.GetMedicalInfoListVO;
 import com.diagbot.vo.RemoveMedicalInfoVO;
 import com.diagbot.vo.RemoveMedicalInfoVO;
-import org.apache.commons.lang.time.DateFormatUtils;
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.stereotype.Component;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.InputStream;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 
 /**
 /**
  * @Description: 术语临床信息查询业务层
  * @Description: 术语临床信息查询业务层
@@ -61,187 +65,185 @@ public class MedicalFacade extends MedicalServiceImpl {
     private MedicalService medicalService;
     private MedicalService medicalService;
     @Autowired
     @Autowired
     private UserServiceClient userServiceClient;
     private UserServiceClient userServiceClient;
-
+    @Autowired
+    private DeptInfoServiceClient deptInfoServiceClient;
+    @Autowired
+    private BodypartFacade bodypartFacade;
+    
     /**
     /**
      * 获取医学术语命名列表
      * 获取医学术语命名列表
-     *
      * @param getMedicalInfoListVO
      * @param getMedicalInfoListVO
      * @return
      * @return
      */
      */
     public IPage<GetMedicalInfoListDTO> getMedicalInfoList(GetMedicalInfoListVO getMedicalInfoListVO) {
     public IPage<GetMedicalInfoListDTO> getMedicalInfoList(GetMedicalInfoListVO getMedicalInfoListVO) {
-        IPage<GetMedicalInfoListDTO> ipage = this.baseMapper.getMedicalInfoList(getMedicalInfoListVO);
-        if (ipage.getRecords().size() == 0) {
-            return ipage;
-        }
-        List<String> ids = ipage.getRecords().stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
-        RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-        if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
+    	IPage<GetMedicalInfoListDTO> ipage = this.baseMapper.getMedicalInfoList(getMedicalInfoListVO);
+    	if(ipage.getRecords().size()==0){
+    		return ipage;
+    	}
+    	List<String> ids = ipage.getRecords().stream().map(i->i.getOperName()).distinct().collect(Collectors.toList());
+    	RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
+    	if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户信息失败");
                     "获取用户信息失败");
         }
         }
-        ipage.getRecords().forEach(i -> {
-            i.setOperName(respDTO.data.get(i.getOperName()));
-        });
+    	ipage.getRecords().forEach(i->{
+    		i.setOperName(respDTO.data.get(i.getOperName()));
+    	});
         return ipage;
         return ipage;
     }
     }
-
+    
     /**
     /**
      * 医学术语命名删除
      * 医学术语命名删除
-     *
      * @param removeMedicalInfoVO
      * @param removeMedicalInfoVO
      * @return
      * @return
      */
      */
     public Boolean removeMedicalInfo(RemoveMedicalInfoVO removeMedicalInfoVO) {
     public Boolean removeMedicalInfo(RemoveMedicalInfoVO removeMedicalInfoVO) {
-        Medical medical = this.getById(removeMedicalInfoVO.getMedicalId());
-        if (medical == null || medical.getIsDeleted().equals("Y")) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS);
-        }
-
-        medical.setIsDeleted("Y");
-        medical.setModifier(UserUtils.getCurrentPrincipleID());
-        medical.setGmtModified(DateUtil.now());
+    	Medical medical = this.getById(removeMedicalInfoVO.getMedicalId());
+    	if(medical==null||medical.getIsDeleted().equals("Y")){
+    		throw new CommonException(CommonErrorCode.NOT_EXISTS);
+    	}
+    	
+    	medical.setIsDeleted("Y");
+    	medical.setModifier(UserUtils.getCurrentPrincipleID());
+    	medical.setGmtModified(DateUtil.now());
         return updateById(medical);
         return updateById(medical);
     }
     }
-
+    
     /**
     /**
      * 获取术语医学属性详情
      * 获取术语医学属性详情
-     *
      * @param getMedicalInfoDetailVO
      * @param getMedicalInfoDetailVO
      * @return
      * @return
      */
      */
-    public GetMedicalInfoDetailDTO getMedicalInfoDetail(GetMedicalInfoDetailVO getMedicalInfoDetailVO) {
-        Medical medical = this.getById(getMedicalInfoDetailVO.getMedicalId());
-        if (medical == null || medical.getIsDeleted().equals("Y")) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS);
-        }
-
-        QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
-        libraryInfoQe.eq("is_deleted", "N");
-        libraryInfoQe.eq("is_concept", "1");
-        libraryInfoQe.eq("concept_id", medical.getConceptId());
-        LibraryInfo libraryInfo = libraryInfoFacade.getOne(libraryInfoQe);
-        if (libraryInfo == null) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR, "术语医学属性所属概念不存在!");
-        }
-
-        GetMedicalInfoDetailDTO getMedicalInfoDetailDTO = new GetMedicalInfoDetailDTO();
-        BeanUtil.copyProperties(medical, getMedicalInfoDetailDTO);
-        getMedicalInfoDetailDTO.setConceptName(libraryInfo.getName());
-        getMedicalInfoDetailDTO.setConceptType(LexiconTypeEnum.getName(libraryInfo.getTypeId().intValue()));
-
-        return getMedicalInfoDetailDTO;
+    public GetMedicalInfoDetailDTO getMedicalInfoDetail(GetMedicalInfoDetailVO getMedicalInfoDetailVO){
+    	Medical medical = this.getById(getMedicalInfoDetailVO.getMedicalId());
+    	if(medical==null||medical.getIsDeleted().equals("Y")){
+    		throw new CommonException(CommonErrorCode.NOT_EXISTS);
+    	}
+    	
+    	QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
+		libraryInfoQe.eq("is_deleted", "N");
+		libraryInfoQe.eq("is_concept", "1");
+		libraryInfoQe.eq("concept_id", medical.getConceptId());
+		LibraryInfo libraryInfo = libraryInfoFacade.getOne(libraryInfoQe);
+		if(libraryInfo==null){
+			throw new CommonException(CommonErrorCode.RPC_ERROR,"术语医学属性所属概念不存在!");
+		}
+    	
+    	GetMedicalInfoDetailDTO getMedicalInfoDetailDTO = new GetMedicalInfoDetailDTO();
+    	BeanUtil.copyProperties(medical, getMedicalInfoDetailDTO);
+    	getMedicalInfoDetailDTO.setConceptName(libraryInfo.getName());
+    	getMedicalInfoDetailDTO.setConceptType(libraryInfo.getType());
+    	
+    	return getMedicalInfoDetailDTO;
     }
     }
-
+    
     /**
     /**
      * 术语医学属性添加或者编辑
      * 术语医学属性添加或者编辑
-     *
      * @param addMedicalInfoVO
      * @param addMedicalInfoVO
      * @return
      * @return
      */
      */
-    public Boolean addMedicalInfo(AddMedicalInfoVO addMedicalInfoVO) {
-        Map<String, Object> ckMap = checkAddMedicalInfoVO(addMedicalInfoVO);
-        Object message = ckMap.get("message");
-        if (message != null) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR, message.toString());
-        }
-        return saveOrUpdate((Medical) (ckMap.get("medical")));
+	public Boolean addMedicalInfo(AddMedicalInfoVO addMedicalInfoVO){
+		Map<String,Object> ckMap = checkAddMedicalInfoVO(addMedicalInfoVO);
+		Object message = ckMap.get("message");
+		if(message!=null){
+			throw new CommonException(CommonErrorCode.RPC_ERROR,message.toString());
+		}
+		return saveOrUpdate((Medical)(ckMap.get("medical")));
     }
     }
-
-    /**
-     * 校验即将添加的数据
-     *
-     * @param addMedicalInfoVO
-     * @return 返回map中,包含2个字段:message和medical,message-为空时,表示正常,取medical
-     */
-    private Map<String, Object> checkAddMedicalInfoVO(AddMedicalInfoVO addMedicalInfoVO) {
-        Map<String, Object> retMap = new HashMap<>();
-
-        QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
-        libraryInfoQe.eq("is_deleted", "N");
-        libraryInfoQe.eq("is_concept", "1");
-        libraryInfoQe.eq("name", addMedicalInfoVO.getConceptName());
-        libraryInfoQe.eq("type", addMedicalInfoVO.getConceptType());
-
-        LibraryInfo libraryInfo = libraryInfoFacade.getOne(libraryInfoQe);
-        if (libraryInfo == null) {
-            retMap.put("message", "术语概念名称不存在");
-            return retMap;
-        }
-
-        Concept concept = conceptFacade.getById(libraryInfo.getConceptId());
-        if (concept == null || concept.getIsDeleted().equals("Y")) {
-            retMap.put("message", "术语概念名称不存在");
-            return retMap;
-        }
-
-        List<String> infoNames = new ArrayList<>();
-        infoNames.add(addMedicalInfoVO.getName());
-        infoNames.add(addMedicalInfoVO.getStdName());
-        infoNames.add(addMedicalInfoVO.getCateName());
-        infoNames.add(addMedicalInfoVO.getGrp());
-        QueryWrapper<LibraryInfo> libraryInfoQe1 = new QueryWrapper<LibraryInfo>();
-        libraryInfoQe1.in("name", infoNames);
-        libraryInfoQe1.eq("is_concept", "1");
-        libraryInfoQe1.eq("is_deleted", "N");
-        Map<String, List<LibraryInfo>> libraryInfoListMap = libraryInfoFacade.list(libraryInfoQe1).stream().collect(Collectors.groupingBy(LibraryInfo::getName));
-        if (libraryInfoListMap.get(addMedicalInfoVO.getName()).size() == 0) {
-            retMap.put("message", "术语名称不存在");
-            return retMap;
-        }
-        if (libraryInfoListMap.get(addMedicalInfoVO.getStdName()).size() == 0) {
-            retMap.put("message", "术语标准名不存在");
-            return retMap;
-        }
-        if (libraryInfoListMap.get(addMedicalInfoVO.getCateName()).size() == 0) {
-            retMap.put("message", "术语小类名称不存在");
-            return retMap;
-        }
-        if (libraryInfoListMap.get(addMedicalInfoVO.getGrp()).size() == 0) {
-            retMap.put("message", "术语类组不存在");
-            return retMap;
-        }
-
-        //		QueryWrapper<Bodypart> bodypartQe = new QueryWrapper<>();
-        //		bodypartQe.eq("is_deleted", "N");
-        //		bodypartQe.eq("bodypart", addMedicalInfoVO.getBodypart());
-        //		if(bodypartFacade.list(bodypartQe).size()==0){
-        //			retMap.put("message", "一级部位不存在");
-        //			return retMap;
-        //		}
-        //		bodypartQe.eq("sub_bodypart", addMedicalInfoVO.getSubBodypart());
-        //		if(bodypartFacade.list(bodypartQe).size()==0){
-        //			retMap.put("message", "二级部位不存在");
-        //			return retMap;
-        //		}
-
-        String currentUser = UserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        QueryWrapper<Medical> medicalQe = new QueryWrapper<>();
-        medicalQe.eq("concept_id", libraryInfo.getConceptId());
-        Medical medical = this.getOne(medicalQe);
-        if (medical == null) {
-            medical = new Medical();
-            medical.setCreator(currentUser);
-            medical.setGmtCreated(now);
-        }
-        medical.setIsDeleted("N");
-        medical.setModifier(currentUser);
-        medical.setGmtModified(now);
-        medical.setConceptId(libraryInfo.getConceptId());
-        BeanUtil.copyProperties(addMedicalInfoVO, medical);
-
-        retMap.put("medical", medical);
-
-        return retMap;
-    }
-
-    /**
+	
+	/**
+	 * 校验即将添加的数据
+	 * @param addMedicalInfoVO
+	 * @return 返回map中,包含2个字段:message和medical,message-为空时,表示正常,取medical
+	 */
+	private Map<String,Object> checkAddMedicalInfoVO(AddMedicalInfoVO addMedicalInfoVO){
+		Map<String,Object> retMap = new HashMap<>();
+		
+		QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
+		libraryInfoQe.eq("is_deleted", "N");
+		libraryInfoQe.eq("is_concept", "1");
+		libraryInfoQe.eq("name", addMedicalInfoVO.getConceptName());
+		libraryInfoQe.eq("type", addMedicalInfoVO.getConceptType());
+		
+		LibraryInfo libraryInfo = libraryInfoFacade.getOne(libraryInfoQe);
+		if(libraryInfo==null){
+			retMap.put("message", "术语概念名称不存在");
+			return retMap;
+		}
+		
+		Concept concept = conceptFacade.getById(libraryInfo.getConceptId());
+		if(concept==null||concept.getIsDeleted().equals("Y")){
+			retMap.put("message", "术语概念名称不存在");
+			return retMap;
+		}
+		
+		List<String> infoNames = new ArrayList<>();
+		infoNames.add(addMedicalInfoVO.getName());
+		infoNames.add(addMedicalInfoVO.getStdName());
+		infoNames.add(addMedicalInfoVO.getCateName());
+		infoNames.add(addMedicalInfoVO.getGrp());
+		QueryWrapper<LibraryInfo> libraryInfoQe1 = new QueryWrapper<LibraryInfo>();
+		libraryInfoQe1.in("name", infoNames);
+		libraryInfoQe1.eq("is_concept", "1");
+		libraryInfoQe1.eq("is_deleted", "N");
+		Map<String,List<LibraryInfo>> libraryInfoListMap = libraryInfoFacade.list(libraryInfoQe1).stream().collect(Collectors.groupingBy(LibraryInfo::getName));
+		if(libraryInfoListMap.get(addMedicalInfoVO.getName()).size()==0){
+			retMap.put("message", "术语名称不存在");
+			return retMap;
+		}
+		if(libraryInfoListMap.get(addMedicalInfoVO.getStdName()).size()==0){
+			retMap.put("message", "术语标准名不存在");
+			return retMap;
+		}
+		if(libraryInfoListMap.get(addMedicalInfoVO.getCateName()).size()==0){
+			retMap.put("message", "术语小类名称不存在");
+			return retMap;
+		}
+		if(libraryInfoListMap.get(addMedicalInfoVO.getGrp()).size()==0){
+			retMap.put("message", "术语类组不存在");
+			return retMap;
+		}
+		
+		QueryWrapper<Bodypart> bodypartQe = new QueryWrapper<>();
+		bodypartQe.eq("is_deleted", "N");
+		bodypartQe.eq("bodypart", addMedicalInfoVO.getBodypart());
+		if(bodypartFacade.list(bodypartQe).size()==0){
+			retMap.put("message", "一级部位不存在");
+			return retMap;
+		}
+		bodypartQe.eq("sub_bodypart", addMedicalInfoVO.getSubBodypart());
+		if(bodypartFacade.list(bodypartQe).size()==0){
+			retMap.put("message", "二级部位不存在");
+			return retMap;
+		}
+		
+		String currentUser = UserUtils.getCurrentPrincipleID();
+		Date now = DateUtil.now();
+		QueryWrapper<Medical> medicalQe = new QueryWrapper<>();
+		medicalQe.eq("concept_id", libraryInfo.getConceptId());
+		Medical medical = this.getOne(medicalQe);
+		if(medical==null){
+			medical = new Medical();
+			medical.setCreator(currentUser);
+			medical.setGmtCreated(now);
+		}
+		medical.setIsDeleted("N");
+		medical.setModifier(currentUser);
+		medical.setGmtModified(now);
+		medical.setConceptId(libraryInfo.getConceptId());
+		BeanUtil.copyProperties(addMedicalInfoVO, medical);
+		
+		retMap.put("medical", medical);
+		
+		return retMap;
+	}
+    
+	/**
      * 术语医学属性excel文件导入
      * 术语医学属性excel文件导入
-     *
      * @param file
      * @param file
      * @return
      * @return
      */
      */
-    public Boolean medicalInfoExcelIm(MultipartFile file) {
+	public Boolean medicalInfoExcelIm(MultipartFile file) {
         List<AddMedicalInfoVO> addMedicalInfoVOList = new ArrayList<>();
         List<AddMedicalInfoVO> addMedicalInfoVOList = new ArrayList<>();
         StringBuffer sbf = new StringBuffer();
         StringBuffer sbf = new StringBuffer();
         InputStream inputStream = null;
         InputStream inputStream = null;
@@ -261,7 +263,7 @@ public class MedicalFacade extends MedicalServiceImpl {
                             wb = new XSSFWorkbook(inputStream);
                             wb = new XSSFWorkbook(inputStream);
                         }
                         }
                         if (wb != null) {
                         if (wb != null) {
-
+                            
                             Sheet sheet = wb.getSheetAt(0);
                             Sheet sheet = wb.getSheetAt(0);
                             int count = 0;
                             int count = 0;
                             String conceptName, conceptType, name, stdName, cateName, grp, gender, minAge, maxAge, bodypart, subBodypart, displayOrder, dept, code, note;
                             String conceptName, conceptType, name, stdName, cateName, grp, gender, minAge, maxAge, bodypart, subBodypart, displayOrder, dept, code, note;
@@ -286,15 +288,15 @@ public class MedicalFacade extends MedicalServiceImpl {
                                 dept = getValue(row.getCell(12)).trim().replace(" ", "");
                                 dept = getValue(row.getCell(12)).trim().replace(" ", "");
                                 code = getValue(row.getCell(13)).trim().replace(" ", "");
                                 code = getValue(row.getCell(13)).trim().replace(" ", "");
                                 note = getValue(row.getCell(14)).trim().replace(" ", "");
                                 note = getValue(row.getCell(14)).trim().replace(" ", "");
-                                if (StringUtil.isEmpty(conceptName) && StringUtil.isEmpty(name)
+                                if(StringUtil.isEmpty(conceptName) && StringUtil.isEmpty(name)
                                         && StringUtil.isEmpty(stdName) && StringUtil.isEmpty(cateName)
                                         && StringUtil.isEmpty(stdName) && StringUtil.isEmpty(cateName)
                                         && StringUtil.isEmpty(grp) && StringUtil.isEmpty(gender)
                                         && StringUtil.isEmpty(grp) && StringUtil.isEmpty(gender)
                                         && StringUtil.isEmpty(minAge) && StringUtil.isEmpty(maxAge)
                                         && StringUtil.isEmpty(minAge) && StringUtil.isEmpty(maxAge)
                                         && StringUtil.isEmpty(bodypart) && StringUtil.isEmpty(subBodypart)
                                         && StringUtil.isEmpty(bodypart) && StringUtil.isEmpty(subBodypart)
-                                        && StringUtil.isEmpty(displayOrder) && StringUtil.isEmpty(dept)
-                                        && StringUtil.isEmpty(code) && StringUtil.isEmpty(note)
-                                        && StringUtil.isEmpty(conceptType)) {
-                                    continue;
+                                        && StringUtil.isEmpty(displayOrder)&& StringUtil.isEmpty(dept) 
+                                        && StringUtil.isEmpty(code)&& StringUtil.isEmpty(note) 
+                                        && StringUtil.isEmpty(conceptType)){
+                                	continue;
                                 }
                                 }
                                 if (StringUtil.isEmpty(conceptName) || StringUtil.isEmpty(name)
                                 if (StringUtil.isEmpty(conceptName) || StringUtil.isEmpty(name)
                                         || StringUtil.isEmpty(stdName) || StringUtil.isEmpty(cateName)
                                         || StringUtil.isEmpty(stdName) || StringUtil.isEmpty(cateName)
@@ -305,12 +307,12 @@ public class MedicalFacade extends MedicalServiceImpl {
                                     sbf.append("第" + count + "行数据不完整;").append("<br/>");
                                     sbf.append("第" + count + "行数据不完整;").append("<br/>");
                                     continue;
                                     continue;
                                 }
                                 }
-
-                                if (!gender.equals("1") && !gender.equals("2") && !gender.equals("3")) {
-                                    sbf.append("第" + count + "行数据中性别非1、2、3;").append("<br/>");
-                                    continue;
+                                
+                                if(!gender.equals("1")&&!gender.equals("2")&&!gender.equals("3")){
+                                	sbf.append("第" + count + "行数据中性别非1、2、3;").append("<br/>");
+                                	continue;
                                 }
                                 }
-
+                                
                                 AddMedicalInfoVO addMedicalInfoVO = new AddMedicalInfoVO();
                                 AddMedicalInfoVO addMedicalInfoVO = new AddMedicalInfoVO();
                                 addMedicalInfoVO.setConceptName(conceptName);
                                 addMedicalInfoVO.setConceptName(conceptName);
                                 addMedicalInfoVO.setConceptType(conceptType);
                                 addMedicalInfoVO.setConceptType(conceptType);
@@ -325,19 +327,19 @@ public class MedicalFacade extends MedicalServiceImpl {
                                 addMedicalInfoVO.setDept(dept);
                                 addMedicalInfoVO.setDept(dept);
                                 addMedicalInfoVO.setCode(code);
                                 addMedicalInfoVO.setCode(code);
                                 addMedicalInfoVO.setNote(note);
                                 addMedicalInfoVO.setNote(note);
-                                try {
-                                    minAge_ = Integer.parseInt(minAge);
-                                    maxAge_ = Integer.parseInt(maxAge);
-                                } catch (Exception e) {
-                                    minAge_ = null;
-                                    maxAge_ = null;
+                                try{
+                                	minAge_ = Integer.parseInt(minAge);
+                                	maxAge_ = Integer.parseInt(maxAge);
+                                }catch(Exception e){
+                                	minAge_ = null;
+                                	maxAge_ = null;
                                 }
                                 }
-                                if (minAge_ == null || maxAge_ == null) {
-                                    sbf.append("第" + count + "行数据中年龄非整数;").append("<br/>");
-                                    continue;
+                                if(minAge_==null||maxAge_==null){
+                                	sbf.append("第" + count + "行数据中年龄非整数;").append("<br/>");
+                                	continue;
                                 }
                                 }
                                 addMedicalInfoVO.setMinAge(minAge_);
                                 addMedicalInfoVO.setMinAge(minAge_);
-                                addMedicalInfoVO.setMaxAge(maxAge_);
+                            	addMedicalInfoVO.setMaxAge(maxAge_);
                                 addMedicalInfoVOList.add(addMedicalInfoVO);
                                 addMedicalInfoVOList.add(addMedicalInfoVO);
                             }
                             }
                         } else {
                         } else {
@@ -363,44 +365,44 @@ public class MedicalFacade extends MedicalServiceImpl {
             } catch (Exception e) {
             } catch (Exception e) {
             }
             }
         }
         }
-
+        
         /*****************excel文件本身问题提醒************************/
         /*****************excel文件本身问题提醒************************/
-        if (sbf.length() > 0) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
+        if(sbf.length()>0){
+        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
         }
         }
-
-        /****************excel文件中所有术语概念存在重复提示---术语概念名称和类型一样即重复***********************/
-        Map<String, List<AddMedicalInfoVO>> addMedicalInfoVOListMap = addMedicalInfoVOList.stream().collect(Collectors.groupingBy(AddMedicalInfoVO::getConceptName));
-        for (String key : addMedicalInfoVOListMap.keySet()) {
-            if (addMedicalInfoVOListMap.get(key).size() > 1 && addMedicalInfoVOListMap.get(key).stream().map(i -> i.getConceptType()).distinct().count() == 1) {
-                sbf.append(key).append(" ");
-            }
+        
+        /****************excel文件中所有术语概念存在重复提示---术语概念名称和类型一样 即重复***********************/
+        Map<String,List<AddMedicalInfoVO>> addMedicalInfoVOListMap = addMedicalInfoVOList.stream().collect(Collectors.groupingBy(AddMedicalInfoVO::getConceptName));
+        for(String key : addMedicalInfoVOListMap.keySet()){
+        	if(addMedicalInfoVOListMap.get(key).size()>1&&addMedicalInfoVOListMap.get(key).stream().map(i->i.getConceptType()).distinct().count()==1){
+        		sbf.append(key).append(" ");
+        	}
         }
         }
-        if (sbf.length() > 0) {
-            sbf.append("(术语概念名称存在重复)");
-            throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
+        if(sbf.length()>0){
+        	sbf.append("(术语概念名称存在重复)");
+        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
         }
         }
-
+        
         /**************校验每一组数据,同时组装*************************/
         /**************校验每一组数据,同时组装*************************/
         List<Medical> saveOrUpdateMedicalList = new ArrayList<>();
         List<Medical> saveOrUpdateMedicalList = new ArrayList<>();
-        Map<String, Object> ckMap = null;
-        Object message = null;
-        for (AddMedicalInfoVO i : addMedicalInfoVOList) {
-            ckMap = checkAddMedicalInfoVO(i);
-            message = ckMap.get("message");
-            if (message != null) {
-                sbf.append(message.toString()).append("(").append(i.getConceptName()).append(")").append("<br/>");
-            } else {
-                saveOrUpdateMedicalList.add((Medical) (ckMap.get("medical")));
-            }
-        }
-        if (sbf.length() > 0) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
+        Map<String,Object> ckMap = null;
+    	Object message = null;
+    	for(AddMedicalInfoVO i : addMedicalInfoVOList){
+    		ckMap = checkAddMedicalInfoVO(i); 
+    		message = ckMap.get("message");
+    		if(message!=null){
+    			sbf.append(message.toString()).append("(").append(i.getConceptName()).append(")").append("<br/>");
+    		}else{
+    			saveOrUpdateMedicalList.add((Medical)(ckMap.get("medical")));
+    		}
+    	}
+        if(sbf.length()>0){
+        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
         }
         }
-
+        
         return medicalService.saveOrUpdateBatch(saveOrUpdateMedicalList);
         return medicalService.saveOrUpdateBatch(saveOrUpdateMedicalList);
     }
     }
-
+    
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private String getValue(Cell cell) {
     private String getValue(Cell cell) {
         try {
         try {
@@ -434,4 +436,14 @@ public class MedicalFacade extends MedicalServiceImpl {
             return "";
             return "";
         }
         }
     }
     }
+    
+    /**
+     * 获取术语医学属性所需全部科室
+     * @param getAllDeptsVO
+     * @return
+     */
+    public List<GetAllDeptsDTO> getAllDepts(GetAllDeptsVO getAllDeptsVO){
+    	 return deptInfoServiceClient.getAllDepts(getAllDeptsVO).data;
+    }
+    
 }
 }