Browse Source

命名列表优化

rgb 6 years ago
parent
commit
ab869ce5a4

+ 0 - 301
knowledgeman-service/src/main/java/com/diagbot/entity/Medical.java

@@ -1,301 +0,0 @@
-package com.diagbot.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author gaodm
- * @since 2019-03-26
- */
-public class Medical implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreated;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 术语概念id
-     */
-    private Long conceptId;
-
-    /**
-     * 术语名称
-     */
-    private String name;
-
-    /**
-     * 术语标准名
-     */
-    private String stdName;
-
-    /**
-     * 术语小类名称
-     */
-    private String cateName;
-
-    /**
-     * 术语类组
-     */
-    private String grp;
-
-    /**
-     * 效用名称
-     */
-    private String function;
-
-    /**
-     * 性别:1:男, 2:女, 3:通用
-     */
-    private String gender;
-
-    /**
-     * 症状发生的最小年龄
-     */
-    private Integer minAge;
-
-    /**
-     * 症状发生的最大年龄
-     */
-    private Integer maxAge;
-
-    /**
-     * 一级部位
-     */
-    private String bodypart;
-
-    /**
-     * 二级部位
-     */
-    private String subBodypart;
-
-    /**
-     * 显示顺序
-     */
-    private String displayOrder;
-
-    /**
-     * 科室
-     */
-    private String dept;
-
-    /**
-     * 术语身份编码
-     */
-    private String code;
-
-    /**
-     * 备注
-     */
-    private String note;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-    public Date getGmtCreated() {
-        return gmtCreated;
-    }
-
-    public void setGmtCreated(Date gmtCreated) {
-        this.gmtCreated = gmtCreated;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-    public Long getConceptId() {
-        return conceptId;
-    }
-
-    public void setConceptId(Long conceptId) {
-        this.conceptId = conceptId;
-    }
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-    public String getStdName() {
-        return stdName;
-    }
-
-    public void setStdName(String stdName) {
-        this.stdName = stdName;
-    }
-    public String getCateName() {
-        return cateName;
-    }
-
-    public void setCateName(String cateName) {
-        this.cateName = cateName;
-    }
-    public String getGrp() {
-        return grp;
-    }
-
-    public void setGrp(String grp) {
-        this.grp = grp;
-    }
-    public String getFunction() {
-        return function;
-    }
-
-    public void setFunction(String function) {
-        this.function = function;
-    }
-    public String getGender() {
-        return gender;
-    }
-
-    public void setGender(String gender) {
-        this.gender = gender;
-    }
-    public Integer getMinAge() {
-        return minAge;
-    }
-
-    public void setMinAge(Integer minAge) {
-        this.minAge = minAge;
-    }
-    public Integer getMaxAge() {
-        return maxAge;
-    }
-
-    public void setMaxAge(Integer maxAge) {
-        this.maxAge = maxAge;
-    }
-    public String getBodypart() {
-        return bodypart;
-    }
-
-    public void setBodypart(String bodypart) {
-        this.bodypart = bodypart;
-    }
-    public String getSubBodypart() {
-        return subBodypart;
-    }
-
-    public void setSubBodypart(String subBodypart) {
-        this.subBodypart = subBodypart;
-    }
-    public String getDisplayOrder() {
-        return displayOrder;
-    }
-
-    public void setDisplayOrder(String displayOrder) {
-        this.displayOrder = displayOrder;
-    }
-    public String getDept() {
-        return dept;
-    }
-
-    public void setDept(String dept) {
-        this.dept = dept;
-    }
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-    public String getNote() {
-        return note;
-    }
-
-    public void setNote(String note) {
-        this.note = note;
-    }
-
-    @Override
-    public String toString() {
-        return "Medical{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreated=" + gmtCreated +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", conceptId=" + conceptId +
-        ", name=" + name +
-        ", stdName=" + stdName +
-        ", cateName=" + cateName +
-        ", grp=" + grp +
-        ", function=" + function +
-        ", gender=" + gender +
-        ", minAge=" + minAge +
-        ", maxAge=" + maxAge +
-        ", bodypart=" + bodypart +
-        ", subBodypart=" + subBodypart +
-        ", displayOrder=" + displayOrder +
-        ", dept=" + dept +
-        ", code=" + code +
-        ", note=" + note +
-        "}";
-    }
-}

+ 62 - 31
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -1,7 +1,30 @@
 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.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
@@ -49,27 +72,7 @@ import com.diagbot.vo.GetConceptInfoDetailVO;
 import com.diagbot.vo.IndexLexiconVO;
 import com.diagbot.vo.IndexVO;
 import com.diagbot.vo.RemoveConceptInfoVO;
-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;
+import com.google.common.collect.Lists;
 
 /**
  * @Description: 术语查询业务层
@@ -233,16 +236,44 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @return
      */
     public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
-        IPage<GetAllInformationDTO> ipage = this.baseMapper.getAllInformation(getAllInformationVO);
-        if (ipage.getRecords().size() > 0) {
-            List<String> ids = ipage.getRecords().stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
-            RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-            RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
-            ipage.getRecords().forEach(i -> {
-                i.setOperName(respDTO.data.get(i.getOperName()));
-            });
-        }
-        return ipage;
+    	Page<GetAllInformationDTO> getAllInformationDTOPage = new Page<>();
+    	
+    	Page<Concept> conceptPage = new Page<>(getAllInformationVO.getCurrent(),getAllInformationVO.getSize());
+    	QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
+    	conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getName()),"lib_name", getAllInformationVO.getName());
+    	conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
+    	conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),"is_deleted", getAllInformationVO.getIsDeleted());
+    	IPage<Concept> iPage = this.page(conceptPage, conceptQe);
+    	BeanUtil.copyProperties(iPage, getAllInformationDTOPage);
+    	
+    	if(ListUtil.isNotEmpty(iPage.getRecords())){
+    		List<GetAllInformationDTO> getAllInformationDTOList = Lists.newArrayList();
+    		
+    		List<Long> conceptIds = iPage.getRecords().stream().map(i->i.getId()).collect(Collectors.toList());
+    		QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
+    		libraryInfoQe.eq("is_deleted", "N");
+    		libraryInfoQe.in("concept_id", conceptIds);
+    		Map<Long,List<LibraryInfo>> libraryInfoListMap = libraryinfoFacade.list(libraryInfoQe).stream().collect(Collectors.groupingBy(LibraryInfo::getConceptId));
+    		
+    		List<String> userIds = iPage.getRecords().stream().map(i ->i.getModifier()).distinct().collect(Collectors.toList());
+    		RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
+    		RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
+    		iPage.getRecords().forEach(i -> {
+    			GetAllInformationDTO getAllInformationDTO = new GetAllInformationDTO();
+    			getAllInformationDTO.setConceptId(i.getId());
+    			getAllInformationDTO.setLibName(i.getLibName());
+    			getAllInformationDTO.setLibType(LexiconTypeEnum.getName(i.getLibType().intValue()));
+    			getAllInformationDTO.setIsDeleted(i.getIsDeleted());
+    			getAllInformationDTO.setOperName(respDTO.data.get(i.getModifier()));
+    			getAllInformationDTO.setOperTime(i.getGmtModified());
+    			getAllInformationDTO.setOtherNames(libraryInfoListMap.get(i.getId()).stream().map(k->k.getName()).collect(Collectors.joining(" ")));
+    			getAllInformationDTOList.add(getAllInformationDTO);
+    		 });
+    		
+    		getAllInformationDTOPage.setRecords(getAllInformationDTOList);
+    	}
+    	
+        return getAllInformationDTOPage;
     }
 
     /**

+ 0 - 449
knowledgeman-service/src/main/java/com/diagbot/facade/MedicalFacade.java

@@ -1,449 +0,0 @@
-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.metadata.IPage;
-import com.diagbot.client.DeptInfoServiceClient;
-import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.GetAllDeptsDTO;
-import com.diagbot.dto.GetMedicalInfoDetailDTO;
-import com.diagbot.dto.GetMedicalInfoListDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.Bodypart;
-import com.diagbot.entity.Concept;
-import com.diagbot.entity.LibraryInfo;
-import com.diagbot.entity.Medical;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.MedicalService;
-import com.diagbot.service.impl.MedicalServiceImpl;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.util.UserUtils;
-import com.diagbot.vo.AddMedicalInfoVO;
-import com.diagbot.vo.GetAllDeptsVO;
-import com.diagbot.vo.GetMedicalInfoDetailVO;
-import com.diagbot.vo.GetMedicalInfoListVO;
-import com.diagbot.vo.RemoveMedicalInfoVO;
-
-/**
- * @Description: 术语临床信息查询业务层
- * @author: Weixuan Huang
- * @time: 2019/1/16 16:07
- */
-@Component
-public class MedicalFacade extends MedicalServiceImpl {
-
-    @Autowired
-    private ConceptFacade conceptFacade;
-    @Autowired
-    private LibraryInfoFacade libraryInfoFacade;
-    @Autowired
-    @Qualifier("medicalServiceImpl")
-    private MedicalService medicalService;
-    @Autowired
-    private UserServiceClient userServiceClient;
-    @Autowired
-    private DeptInfoServiceClient deptInfoServiceClient;
-    @Autowired
-    private BodypartFacade bodypartFacade;
-    
-    /**
-     * 获取医学术语命名列表
-     * @param getMedicalInfoListVO
-     * @return
-     */
-    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)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取用户信息失败");
-        }
-    	ipage.getRecords().forEach(i->{
-    		i.setOperName(respDTO.data.get(i.getOperName()));
-    	});
-        return ipage;
-    }
-    
-    /**
-     * 医学术语命名删除
-     * @param removeMedicalInfoVO
-     * @return
-     */
-    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());
-        return updateById(medical);
-    }
-    
-    /**
-     * 获取术语医学属性详情
-     * @param getMedicalInfoDetailVO
-     * @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(libraryInfo.getType());
-    	
-    	return getMedicalInfoDetailDTO;
-    }
-    
-    /**
-     * 术语医学属性添加或者编辑
-     * @param addMedicalInfoVO
-     * @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")));
-    }
-	
-	/**
-	 * 校验即将添加的数据
-	 * @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文件导入
-     * @param file
-     * @return
-     */
-	public Boolean medicalInfoExcelIm(MultipartFile file) {
-        List<AddMedicalInfoVO> addMedicalInfoVOList = new ArrayList<>();
-        StringBuffer sbf = new StringBuffer();
-        InputStream inputStream = null;
-        Workbook wb = null;
-        try {
-            if (!file.isEmpty()) {
-                inputStream = file.getInputStream();
-                if (inputStream.available() > 512000) {
-                    sbf.append("文件最大支持500KB!").append("<br/>");
-                } else {
-                    String fileName = file.getOriginalFilename();
-                    if (fileName.lastIndexOf(".") != -1) {
-                        String type = fileName.substring(fileName.lastIndexOf("."));
-                        if (type.equals(".xls")) {
-                            wb = new HSSFWorkbook(inputStream);
-                        } else if (type.equals(".xlsx")) {
-                            wb = new XSSFWorkbook(inputStream);
-                        }
-                        if (wb != null) {
-                            
-                            Sheet sheet = wb.getSheetAt(0);
-                            int count = 0;
-                            String conceptName, conceptType, name, stdName, cateName, grp, gender, minAge, maxAge, bodypart, subBodypart, displayOrder, dept, code, note;
-                            Integer minAge_, maxAge_;
-                            for (Row row : sheet) {
-                                count++;
-                                if (count == 1 || row == null) {
-                                    continue;
-                                }
-                                conceptName = getValue(row.getCell(0)).trim().replace(" ", "");
-                                conceptType = getValue(row.getCell(1)).trim().replace(" ", "");
-                                name = getValue(row.getCell(2)).trim().replace(" ", "");
-                                stdName = getValue(row.getCell(3)).trim().replace(" ", "");
-                                cateName = getValue(row.getCell(4)).trim().replace(" ", "");
-                                grp = getValue(row.getCell(5)).trim().replace(" ", "");
-                                gender = getValue(row.getCell(6)).trim().replace(" ", "");
-                                minAge = getValue(row.getCell(7)).trim().replace(" ", "");
-                                maxAge = getValue(row.getCell(8)).trim().replace(" ", "");
-                                bodypart = getValue(row.getCell(9)).trim().replace(" ", "");
-                                subBodypart = getValue(row.getCell(10)).trim().replace(" ", "");
-                                displayOrder = getValue(row.getCell(11)).trim().replace(" ", "");
-                                dept = getValue(row.getCell(12)).trim().replace(" ", "");
-                                code = getValue(row.getCell(13)).trim().replace(" ", "");
-                                note = getValue(row.getCell(14)).trim().replace(" ", "");
-                                if(StringUtil.isEmpty(conceptName) && StringUtil.isEmpty(name)
-                                        && StringUtil.isEmpty(stdName) && StringUtil.isEmpty(cateName)
-                                        && StringUtil.isEmpty(grp) && StringUtil.isEmpty(gender)
-                                        && StringUtil.isEmpty(minAge) && StringUtil.isEmpty(maxAge)
-                                        && StringUtil.isEmpty(bodypart) && StringUtil.isEmpty(subBodypart)
-                                        && StringUtil.isEmpty(displayOrder)&& StringUtil.isEmpty(dept) 
-                                        && StringUtil.isEmpty(code)&& StringUtil.isEmpty(note) 
-                                        && StringUtil.isEmpty(conceptType)){
-                                	continue;
-                                }
-                                if (StringUtil.isEmpty(conceptName) || StringUtil.isEmpty(name)
-                                        || StringUtil.isEmpty(stdName) || StringUtil.isEmpty(cateName)
-                                        || StringUtil.isEmpty(grp) || StringUtil.isEmpty(gender)
-                                        || StringUtil.isEmpty(minAge) || StringUtil.isEmpty(maxAge)
-                                        || StringUtil.isEmpty(bodypart) || StringUtil.isEmpty(subBodypart)
-                                        || StringUtil.isEmpty(dept) || StringUtil.isEmpty(conceptType)) {
-                                    sbf.append("第" + count + "行数据不完整;").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.setConceptName(conceptName);
-                                addMedicalInfoVO.setConceptType(conceptType);
-                                addMedicalInfoVO.setName(name);
-                                addMedicalInfoVO.setStdName(stdName);
-                                addMedicalInfoVO.setCateName(cateName);
-                                addMedicalInfoVO.setGrp(grp);
-                                addMedicalInfoVO.setGender(gender);
-                                addMedicalInfoVO.setBodypart(bodypart);
-                                addMedicalInfoVO.setSubBodypart(subBodypart);
-                                addMedicalInfoVO.setDisplayOrder(displayOrder);
-                                addMedicalInfoVO.setDept(dept);
-                                addMedicalInfoVO.setCode(code);
-                                addMedicalInfoVO.setNote(note);
-                                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;
-                                }
-                                addMedicalInfoVO.setMinAge(minAge_);
-                            	addMedicalInfoVO.setMaxAge(maxAge_);
-                                addMedicalInfoVOList.add(addMedicalInfoVO);
-                            }
-                        } else {
-                            sbf.append("非excel文件无法解析!").append("<br/>");
-                        }
-                    } else {
-                        sbf.append("未知文件无法解析!").append("<br/>");
-                    }
-                }
-            } else {
-                sbf.append("无文件上传!").append("<br/>");
-            }
-        } catch (Exception e) {
-            sbf.append("解析失败!").append("<br/>");
-        } finally {
-            try {
-                if (wb != null) {
-                    wb.close();
-                }
-                if (inputStream != null) {
-                    inputStream.close();
-                }
-            } catch (Exception e) {
-            }
-        }
-        
-        /*****************excel文件本身问题提醒************************/
-        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(" ");
-        	}
-        }
-        if(sbf.length()>0){
-        	sbf.append("(术语概念名称存在重复)");
-        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
-        }
-        
-        /**************校验每一组数据,同时组装*************************/
-        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());
-        }
-        
-        return medicalService.saveOrUpdateBatch(saveOrUpdateMedicalList);
-    }
-    
-    @SuppressWarnings("deprecation")
-    private String getValue(Cell cell) {
-        try {
-            Object obj = null;
-            switch (cell.getCellTypeEnum()) {
-                case BOOLEAN:
-                    obj = cell.getBooleanCellValue();
-                    break;
-                case ERROR:
-                    obj = cell.getErrorCellValue();
-                    break;
-                case NUMERIC:
-                    if (HSSFDateUtil.isCellDateFormatted(cell)) {
-                        Date date = cell.getDateCellValue();
-                        obj = DateFormatUtils.format(date, "yyyy-MM-dd");
-                    } else {
-                        obj = cell.getNumericCellValue();
-                        DecimalFormat df = new DecimalFormat("0");
-                        obj = df.format(obj);
-                    }
-
-                    break;
-                case STRING:
-                    obj = cell.getStringCellValue();
-                    break;
-                default:
-                    break;
-            }
-            return obj.toString();
-        } catch (Exception e) {
-            return "";
-        }
-    }
-    
-    /**
-     * 获取术语医学属性所需全部科室
-     * @param getAllDeptsVO
-     * @return
-     */
-    public List<GetAllDeptsDTO> getAllDepts(GetAllDeptsVO getAllDeptsVO){
-    	 return deptInfoServiceClient.getAllDepts(getAllDeptsVO).data;
-    }
-    
-}

+ 0 - 23
knowledgeman-service/src/main/java/com/diagbot/mapper/MedicalMapper.java

@@ -1,23 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.GetMedicalInfoListDTO;
-import com.diagbot.entity.Medical;
-import com.diagbot.vo.GetMedicalInfoListVO;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Weixuan Huang
- * @since 2019-01-16
- */
-public interface MedicalMapper extends BaseMapper<Medical> {
-	
-	
-	IPage<GetMedicalInfoListDTO> getMedicalInfoList(GetMedicalInfoListVO getMedicalInfoListVO);
-	
-
-}

+ 0 - 17
knowledgeman-service/src/main/java/com/diagbot/service/MedicalService.java

@@ -1,17 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.Medical;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Weixuan Huang
- * @since 2019-01-16
- */
-public interface MedicalService extends IService<Medical> {
-
-	
-}

+ 0 - 21
knowledgeman-service/src/main/java/com/diagbot/service/impl/MedicalServiceImpl.java

@@ -1,21 +0,0 @@
-package com.diagbot.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.Medical;
-import com.diagbot.mapper.MedicalMapper;
-import com.diagbot.service.MedicalService;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Weixuan Huang
- * @since 2019-01-16
- */
-@Service
-public class MedicalServiceImpl extends ServiceImpl<MedicalMapper, Medical> implements MedicalService {
-   
-}

+ 11 - 4
knowledgeman-service/src/main/java/com/diagbot/vo/GetAllInformationVO.java

@@ -1,7 +1,5 @@
 package com.diagbot.vo;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
@@ -11,10 +9,19 @@ import lombok.Setter;
  * @author: Weixuan Huang
  * @time: 2019/3/14 16:03
  */
-@SuppressWarnings({ "serial", "rawtypes" })
 @Getter
 @Setter
-public class GetAllInformationVO extends Page {
+public class GetAllInformationVO {
+	
+    /**
+     * 每页显示条数,默认 10
+     */
+    private long size = 10;
+    
+    /**
+     * 当前页
+     */
+    private long current = 1;
     
     /**
      * 术语名称

+ 0 - 84
knowledgeman-service/src/main/java/com/diagbot/web/MedicalController.java

@@ -1,84 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.GetMedicalInfoDetailDTO;
-import com.diagbot.dto.GetMedicalInfoListDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.MedicalFacade;
-import com.diagbot.vo.AddMedicalInfoVO;
-import com.diagbot.vo.GetMedicalInfoDetailVO;
-import com.diagbot.vo.GetMedicalInfoListVO;
-import com.diagbot.vo.RemoveMedicalInfoVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-import springfox.documentation.annotations.ApiIgnore;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author Weixuan Huang
- * @since 2019-01-16
- */
-@RestController
-@RequestMapping("/medical")
-@SuppressWarnings("unchecked")
-@Api(value = "术语医学属性维护相关API", tags = { "术语医学属性维护相关API" })
-@ApiIgnore
-@Deprecated
-public class MedicalController {
-
-    @Autowired
-    private MedicalFacade medicalFacade;
-
-    @ApiOperation(value = "获取术语医学属性列表[by:rengb]")
-    @PostMapping("/getMedicalInfoList")
-    @SysLogger("getMedicalInfoList")
-    public RespDTO<IPage<GetMedicalInfoListDTO>> getMedicalInfoList(@RequestBody GetMedicalInfoListVO getMedicalInfoListVO) {
-        return RespDTO.onSuc(medicalFacade.getMedicalInfoList(getMedicalInfoListVO));
-    }
-
-    @ApiOperation(value = "术语医学属性删除[by:rengb]")
-    @PostMapping("/removeMedicalInfo")
-    @SysLogger("removeMedicalInfo")
-    @Transactional
-    public RespDTO<Boolean> removeMedicalInfo(@Valid @RequestBody RemoveMedicalInfoVO removeMedicalInfoVO) {
-        return RespDTO.onSuc(medicalFacade.removeMedicalInfo(removeMedicalInfoVO));
-    }
-
-    @ApiOperation(value = "获取术语医学属性详情[by:rengb]")
-    @PostMapping("/getMedicalInfoDetail")
-    @SysLogger("getMedicalInfoDetail")
-    public RespDTO<GetMedicalInfoDetailDTO> getMedicalInfoDetail(@Valid @RequestBody GetMedicalInfoDetailVO getMedicalInfoDetailVO) {
-        return RespDTO.onSuc(medicalFacade.getMedicalInfoDetail(getMedicalInfoDetailVO));
-    }
-
-    @ApiOperation(value = "术语医学属性添加或者编辑[by:rengb]")
-    @PostMapping("/addMedicalInfo")
-    @SysLogger("addMedicalInfo")
-    @Transactional
-    public RespDTO<Boolean> addMedicalInfo(@Valid @RequestBody AddMedicalInfoVO addMedicalInfoVO) {
-        return RespDTO.onSuc(medicalFacade.addMedicalInfo(addMedicalInfoVO));
-    }
-
-    @ApiOperation(value = "术语医学属性excel文件导入[by:rengb]")
-    @PostMapping("/medicalInfoExcelIm")
-    @Transactional
-    public RespDTO<Boolean> medicalInfoExcelIm(@RequestParam("uploadfile") MultipartFile file, HttpServletRequest request) {
-        return RespDTO.onSuc(medicalFacade.medicalInfoExcelIm(file));
-    }
-}

+ 0 - 54
knowledgeman-service/src/main/resources/mapper/MedicalMapper.xml

@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.diagbot.mapper.MedicalMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.Medical">
-        <id column="id" property="id" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_created" property="gmtCreated" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
-        <result column="concept_id" property="conceptId" />
-        <result column="name" property="name" />
-        <result column="std_name" property="stdName" />
-        <result column="cate_name" property="cateName" />
-        <result column="grp" property="grp" />
-        <result column="function" property="function" />
-        <result column="gender" property="gender" />
-        <result column="min_age" property="minAge" />
-        <result column="max_age" property="maxAge" />
-        <result column="bodypart" property="bodypart" />
-        <result column="sub_bodypart" property="subBodypart" />
-        <result column="display_order" property="displayOrder" />
-        <result column="dept" property="dept" />
-        <result column="code" property="code" />
-        <result column="note" property="note" />
-    </resultMap>
-    
-    <select id="getMedicalInfoList" resultType="com.diagbot.dto.GetMedicalInfoListDTO">
-    	SELECT * FROM 
-		(SELECT
-		a.id as medicalId,
-		b.id as conceptId,
-		a.gmt_modified as operTime,
-		a.modifier as operName,
-		GROUP_CONCAT(CASE WHEN b.lib_id=c.id THEN c.`name` ELSE NULL END) AS libName,
-		c.type AS libType,
-		GROUP_CONCAT(c.`name` ORDER BY c.id ASC SEPARATOR '、') as otherNames
-		FROM medical a JOIN concept b ON a.concept_id=b.id
-		JOIN library_info c on b.id=c.concept_id
-		WHERE a.is_deleted='N' AND b.is_deleted='N' AND c.is_deleted='N'
-		GROUP BY a.id) t
-		where 1=1
-		<if test="name!=null">
-			 AND otherNames like concat('%',#{name},'%')	
-		</if>
-		<if test="type!=null and type!=''">
-            AND libType = #{type}
-        </if>
-		ORDER BY operTime desc
-    </select>
-
-</mapper>