Browse Source

Merge remote-tracking branch 'origin/dev/KLBstand' into dev/KLBstand

wangyu 6 years ago
parent
commit
1d9dbed97f
22 changed files with 195 additions and 103 deletions
  1. 3 1
      common/pom.xml
  2. 10 0
      diagbotman-service/pom.xml
  3. 11 0
      icss-service/pom.xml
  4. 11 0
      icssman-service/pom.xml
  5. 0 6
      icssman-service/src/main/java/com/diagbot/dto/QuestionPageDTO.java
  6. 1 5
      icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml
  7. 11 0
      knowledgeman-service/pom.xml
  8. 1 1
      knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  9. 1 1
      knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  10. 8 2
      knowledgeman-service/src/main/java/com/diagbot/dto/GetAllLisConceptDTO.java
  11. 31 15
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  12. 0 11
      knowledgeman-service/src/main/java/com/diagbot/facade/LibraryInfoFacade.java
  13. 5 0
      knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptMapper.java
  14. 1 4
      knowledgeman-service/src/main/java/com/diagbot/mapper/LibraryInfoMapper.java
  15. 8 0
      knowledgeman-service/src/main/java/com/diagbot/vo/GetAllForRelationVO.java
  16. 3 3
      knowledgeman-service/src/main/java/com/diagbot/web/EnumsController.java
  17. 2 0
      knowledgeman-service/src/main/java/com/diagbot/web/RelationController.java
  18. 48 14
      knowledgeman-service/src/main/resources/mapper/ConceptMapper.xml
  19. 0 28
      knowledgeman-service/src/main/resources/mapper/LibraryInfoMapper.xml
  20. 15 12
      knowledgeman-service/src/main/resources/mapper/RelationMapper.xml
  21. 14 0
      pom.xml
  22. 11 0
      user-service/pom.xml

+ 3 - 1
common/pom.xml

@@ -88,12 +88,14 @@
             <groupId>org.apache.poi</groupId>
             <artifactId>poi</artifactId>
             <version>4.0.1</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.poi</groupId>
             <artifactId>poi-ooxml</artifactId>
             <version>4.0.1</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -107,7 +109,7 @@
             <groupId>com.belerweb</groupId>
             <artifactId>pinyin4j</artifactId>
             <version>2.5.1</version>
-            <scope>compile</scope>
+            <scope>provided</scope>
         </dependency>
 
         <!--<dependency>-->

+ 10 - 0
diagbotman-service/pom.xml

@@ -154,6 +154,16 @@
             <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
         </dependency>
 
+        <!--POI-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 11 - 0
icss-service/pom.xml

@@ -164,6 +164,17 @@
 			<artifactId>commons-io</artifactId>
 			<version>2.4</version>
 		</dependency>
+
+        <!--POI-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 11 - 0
icssman-service/pom.xml

@@ -171,6 +171,17 @@
 			<version>2.4</version>
 		</dependency>
 
+        <!--POI-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 0 - 6
icssman-service/src/main/java/com/diagbot/dto/QuestionPageDTO.java

@@ -174,11 +174,5 @@ public class QuestionPageDTO implements Serializable {
      */
     private List<QuestionMapping> questionMappings = new ArrayList<>();
 
-
-    /**
-     * 诊断类型
-     */
-    private Integer disType;
-
     private Boolean exist;
 }

+ 1 - 5
icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -167,12 +167,8 @@
     </select>
 
     <select id="getList" resultType="com.diagbot.dto.QuestionPageDTO">
-        SELECT a.*, b.type dis_type FROM `icss_question_info` a
-            left join icss_dis_type b on a.id = b.dis_id
+        SELECT a.* FROM `icss_question_info` a
         WHERE a.is_deleted = 'N'
-        <if test="disType != null">
-            AND b.type = #{disType}
-        </if>
         <if test="type != null and type != ''">
             AND a.type = #{type}
         </if>

+ 11 - 0
knowledgeman-service/pom.xml

@@ -180,6 +180,17 @@
 			<artifactId>commons-io</artifactId>
 			<version>2.4</version>
 		</dependency>
+
+        <!--POI-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
 		
     </dependencies>
 

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -26,7 +26,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .csrf().disable()
                 .authorizeRequests()
                 .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
-                .antMatchers("/getIcssEnumsData").permitAll()
+                .antMatchers("/getKlmEnumsData").permitAll()
                 .antMatchers("/concept/getConceptMap").permitAll()
                 .antMatchers("/concept/getConceptListByType").permitAll()
                 .antMatchers("/file/uploadImage").permitAll()

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -89,7 +89,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/druid/**", request)
                 || matchers("/actuator/**", request)
                 || matchers("/hystrix/**", request)
-                || matchers("/getIcssEnumsData", request)
+                || matchers("/getKlmEnumsData", request)
                 || matchers("/concept/getConceptMap", request)
                 || matchers("/concept/getConceptListByType", request)
                 || matchers("/file/uploadImage", request)

+ 8 - 2
knowledgeman-service/src/main/java/com/diagbot/dto/GetAllLisConceptDTO.java

@@ -14,9 +14,15 @@ import lombok.Setter;
 public class GetAllLisConceptDTO {
 	
 	/**
-	 * 名称
+	 * 概念id
 	 */
-	@ApiModelProperty(value="名称")
+	@ApiModelProperty(value="概念id")
+	private Long conceptId;
+	
+	/**
+	 * 概念名称
+	 */
+	@ApiModelProperty(value="概念名称")
 	private String conceptName;
 	
 	

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

@@ -38,7 +38,6 @@ import com.diagbot.entity.Concept;
 import com.diagbot.entity.ConceptCommon;
 import com.diagbot.entity.Lexicon;
 import com.diagbot.entity.LibraryInfo;
-import com.diagbot.entity.Medical;
 import com.diagbot.entity.Relation;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.enums.IsDeleteEnum;
@@ -83,8 +82,8 @@ public class ConceptFacade extends ConceptServiceImpl {
     private LibraryInfoFacade libraryinfoFacade;
     //    @Autowired
     //    private LibraryDetailFacade libraryDetailFacade;
-    @Autowired
-    private MedicalFacade medicalFacade;
+//    @Autowired
+//    private MedicalFacade medicalFacade;
     @Autowired
     private RelationFacade relationFacade;
     @Autowired
@@ -104,7 +103,27 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @return
      */
     public List<GetAllLisConceptDTO> getAllLisConcept(GetAllLisConceptVO getAllLisConceptVO) {
-        return this.baseMapper.getAllLisConcept(getAllLisConceptVO);
+    	List<GetAllLisConceptDTO> getAllLisConceptDTOList = new ArrayList<>();
+    	
+    	QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
+    	conceptQe.eq("is_deleted", "N");
+    	conceptQe.eq("lib_type", 46);
+    	conceptQe.like(StringUtil.isNotEmpty(getAllLisConceptVO.getConceptName()),"lib_name", getAllLisConceptVO.getConceptName());
+    	List<Concept> conceptList = list(conceptQe);
+    	
+    	conceptList.forEach(i->{
+    		if(getAllLisConceptVO.getExcludedConceptNames()!=null
+    				&&getAllLisConceptVO.getExcludedConceptNames().contains(i.getLibName())){
+    			return;
+    		}
+    		GetAllLisConceptDTO getAllLisConceptDTO = new GetAllLisConceptDTO();
+    		getAllLisConceptDTO.setConceptId(i.getId());
+    		getAllLisConceptDTO.setConceptName(i.getLibName());
+    		getAllLisConceptDTOList.add(getAllLisConceptDTO);
+    	});
+    	
+        //return this.baseMapper.getAllLisConcept(getAllLisConceptVO);
+    	return getAllLisConceptDTOList;
     }
 
     /**
@@ -116,12 +135,8 @@ public class ConceptFacade extends ConceptServiceImpl {
     public List<GetAllConceptDTO> getAllConcept(GetAllConceptVO getAllConceptVO) {
         QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
         libraryInfoQe.eq("is_deleted", "N");
-        if (getAllConceptVO.getIsConcept() != null) {
-            libraryInfoQe.eq("is_concept", getAllConceptVO.getIsConcept());
-        }
-        if (StringUtil.isNotBlank(getAllConceptVO.getName())) {
-            libraryInfoQe.like("name", getAllConceptVO.getName());
-        }
+        libraryInfoQe.eq(getAllConceptVO.getIsConcept() != null,"is_concept", getAllConceptVO.getIsConcept());
+        libraryInfoQe.like(StringUtil.isNotBlank(getAllConceptVO.getName()),"name", getAllConceptVO.getName());
         List<LibraryInfo> libraryInfoList = libraryinfoFacade.list(libraryInfoQe);
 
         //过滤掉非概念术语
@@ -137,8 +152,8 @@ public class ConceptFacade extends ConceptServiceImpl {
             });
             libraryInfoList = libraryInfoList.stream().filter(i -> i.getIsDeleted().equals("N")).collect(Collectors.toList());
         }
-
-        //添加过术语医学属性的过滤掉
+        
+        /*//添加过术语医学属性的过滤掉
         if (getAllConceptVO.getIsMedical() != null && getAllConceptVO.getIsMedical() == 1) {
             QueryWrapper<Medical> medicalQe = new QueryWrapper<>();
             medicalQe.eq("is_deleted", "N");
@@ -151,7 +166,7 @@ public class ConceptFacade extends ConceptServiceImpl {
                     return false;
                 }
             }).collect(Collectors.toList());
-        }
+        }*/
 
         List<GetAllConceptDTO> getAllConceptDTOList = BeanUtil.listCopyTo(libraryInfoList, GetAllConceptDTO.class);
         getAllConceptDTOList.forEach(i -> {
@@ -197,7 +212,8 @@ public class ConceptFacade extends ConceptServiceImpl {
     	}
     	
     	for(Concept i : conceptList){
-    		if(reCouMap.get(i.getId())!=null){
+    		if(reCouMap.get(i.getId())!=null
+    				||(getAllForRelationVO.getExcludedConceptIds()!=null&&getAllForRelationVO.getExcludedConceptIds().contains(i.getId()))){
     			continue;
     		}
     		GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
@@ -216,7 +232,7 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @return
      */
     public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
-    	IPage<GetAllInformationDTO> ipage = libraryinfoFacade.getAllInformation(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);

+ 0 - 11
knowledgeman-service/src/main/java/com/diagbot/facade/LibraryInfoFacade.java

@@ -2,10 +2,7 @@ package com.diagbot.facade;
 
 import org.springframework.stereotype.Component;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.GetAllInformationDTO;
 import com.diagbot.service.impl.LibraryInfoServiceImpl;
-import com.diagbot.vo.GetAllInformationVO;
 
 /**
  * @Description: 术语基本信息查询业务层
@@ -15,13 +12,5 @@ import com.diagbot.vo.GetAllInformationVO;
 @Component
 public class LibraryInfoFacade extends LibraryInfoServiceImpl {
   
-    /**
-     * 获取医学术语命名列表
-     * @param conceptVo
-     * @return
-     */
-    public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
-        return baseMapper.getAllInformation(getAllInformationVO);
-    }
 
 }

+ 5 - 0
knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptMapper.java

@@ -3,12 +3,15 @@ package com.diagbot.mapper;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.ConceptWithOrderRes;
+import com.diagbot.dto.GetAllInformationDTO;
 import com.diagbot.dto.GetAllLisConceptDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
+import com.diagbot.vo.GetAllInformationVO;
 import com.diagbot.vo.GetAllLisConceptVO;
 import com.diagbot.vo.IndexVO;
 
@@ -21,6 +24,8 @@ import com.diagbot.vo.IndexVO;
  * @since 2019-01-30
  */
 public interface ConceptMapper extends BaseMapper<Concept> {
+	
+	IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO);
 
     /**
      * 获取所有化验公表项

+ 1 - 4
knowledgeman-service/src/main/java/com/diagbot/mapper/LibraryInfoMapper.java

@@ -1,10 +1,7 @@
 package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.GetAllInformationDTO;
 import com.diagbot.entity.LibraryInfo;
-import com.diagbot.vo.GetAllInformationVO;
 
 /**
  * <p>
@@ -16,6 +13,6 @@ import com.diagbot.vo.GetAllInformationVO;
  */
 public interface LibraryInfoMapper extends BaseMapper<LibraryInfo> {
 
-    IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO);
+    
    
 }

+ 8 - 0
knowledgeman-service/src/main/java/com/diagbot/vo/GetAllForRelationVO.java

@@ -1,5 +1,7 @@
 package com.diagbot.vo;
 
+import java.util.List;
+
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
@@ -43,4 +45,10 @@ public class GetAllForRelationVO {
     @ApiModelProperty(value="关系类型id")
     private Long relationId;
     
+    /**
+     * 需要排除的概念id集合
+     */
+    @ApiModelProperty(value="需要排除的概念id集合")
+    private List<Long> excludedConceptIds;
+    
 }

+ 3 - 3
knowledgeman-service/src/main/java/com/diagbot/web/EnumsController.java

@@ -14,7 +14,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @Description: ICSS后台管理枚举数据获取类
+ * @Description: 知识库后台管理枚举数据获取类
  * @author: gaodm
  * @time: 2018/9/19 14:32
  */
@@ -27,8 +27,8 @@ public class EnumsController {
 
     @ApiOperation(value = "知识库标准化-知识库后台管理枚举数据获取[by:gaodm]",
             notes = "知识库后台管理枚举数据获取")
-    @PostMapping("/getIcssEnumsData")
-    @SysLogger("getIcssEnumsData")
+    @PostMapping("/getKlmEnumsData")
+    @SysLogger("getKlmEnumsData")
     public RespDTO<Map<String, List<EnumEntriesBuilder.Entry>>> getEnumsData() {
         return RespDTO.onSuc(enumsDataFacade.getEnumsData());
     }

+ 2 - 0
knowledgeman-service/src/main/java/com/diagbot/web/RelationController.java

@@ -25,6 +25,7 @@ import com.diagbot.vo.RemoveRelationInfoVO;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import springfox.documentation.annotations.ApiIgnore;
 
 /**
  * <p>
@@ -61,6 +62,7 @@ public class RelationController {
     @ApiOperation(value = "知识库标准化-获取医学术语关系详情[by:rengb]")
     @PostMapping("/getRelationInfoDetail")
     @SysLogger("getRelationInfoDetail")
+    @ApiIgnore
     public RespDTO<GetRelationInfoDetailDTO> getRelationInfoDetail(@Valid @RequestBody GetRelationInfoDetailVO getRelationInfoDetailVO) {
         return RespDTO.onSuc(relationFacade.getRelationInfoDetail(getRelationInfoDetailVO));
     }

+ 48 - 14
knowledgeman-service/src/main/resources/mapper/ConceptMapper.xml

@@ -17,24 +17,29 @@
     
     <select id="getAllLisConcept" parameterType="com.diagbot.vo.GetAllLisConceptVO" resultType="com.diagbot.dto.GetAllLisConceptDTO">
     	SELECT
-    		conceptName
-    	FROM
-    	((SELECT
-		lib_name as conceptName
-		FROM kl_concept
+			conceptName
+		FROM
+		((SELECT
+		@rowNo:=@rowNo+1 as taocanNum,
+		lib_name as conceptName,
+		0 AS zixiangNum
+		FROM kl_concept,(select @rowNo:=0) num_tab 
 		WHERE is_deleted='N' AND lib_type=12
 		ORDER BY gmt_modified DESC)
 		UNION
 		(SELECT
-		CONCAT(t1.conceptName,'-',t3.conceptName) as conceptName
+		t1.taocanNum,
+		CONCAT(t1.conceptName,'-',t3.conceptName) as conceptName,
+		@rowNo:=@rowNo+1 as zixiangNum
 		FROM
 		(SELECT
 		id as conceptId,
-		lib_name as conceptName
-		FROM kl_concept
-		WHERE is_deleted='N' AND lib_type=12) t1
-		JOIN
-		kl_relation t2 
+		lib_name as conceptName,
+		@rowNo:=@rowNo+1 as taocanNum
+		FROM kl_concept,(select @rowNo:=0) num_tab 
+		WHERE is_deleted='N' AND lib_type=12
+		ORDER BY gmt_modified DESC) t1
+		JOIN kl_relation t2 
 		ON t1.conceptId=t2.end_id 
 		JOIN
 		(SELECT
@@ -44,9 +49,9 @@
 		WHERE is_deleted='N' AND lib_type=13) t3
 		ON t2.start_id=t3.conceptId
 		LEFT JOIN kl_relation_order t4
-		ON t2.id=t4.t_relation_id
-		WHERE t2.is_deleted='N' AND t2.relation_id=3
-		ORDER BY t4.order_no DESC)) t
+		ON t2.id=t4.t_relation_id,(select @rowNo:=0) num_tab 
+		WHERE t2.is_deleted='N' AND t2.relation_id=18
+		ORDER BY t4.order_no DESC,t2.gmt_modified DESC)) tab
 		WHERE 1=1
 		<if test="conceptName!=null and conceptName!=''">
 			and (conceptName LIKE CONCAT('%',#{conceptName},'%'))
@@ -58,6 +63,35 @@
 			</foreach>
 			)
 		</if>
+		ORDER BY taocanNum ASC,zixiangNum ASC
+    </select>
+    
+    <select id="getAllInformation" resultType="com.diagbot.dto.GetAllInformationDTO">
+    	SELECT
+		*
+		FROM
+		(SELECT
+		a.id as conceptId,
+		a.lib_name AS libName,
+		c.`name` AS libType,
+		GROUP_CONCAT(b.`name` ORDER BY b.id ASC SEPARATOR '、') as otherNames,
+		a.modifier as operName,
+		a.gmt_modified as operTime,
+		a.is_deleted as isDeleted
+		FROM kl_concept a JOIN kl_library_info b ON a.id=b.concept_id
+		LEFT JOIN kl_lexicon c ON a.lib_type=c.id 
+		GROUP BY a.id) t
+		where 1=1
+		<if test="name!=null and name!=''">
+			 AND otherNames like concat('%',#{name},'%')	
+		</if>
+		<if test="type!=null and type!=''">
+            AND libType = #{type}
+        </if>
+        <if test="isDeleted!=null and isDeleted!=''">
+        	AND isDeleted=#{isDeleted}
+        </if>
+		ORDER BY isDeleted ASC,operTime DESC
     </select>
     
 	<select id="getConcept" resultType="com.diagbot.dto.ConceptRes" parameterType="com.diagbot.entity.wrapper.ConceptWrapper">

+ 0 - 28
knowledgeman-service/src/main/resources/mapper/LibraryInfoMapper.xml

@@ -18,32 +18,4 @@
         <result column="remark" property="remark" />
     </resultMap>
 
-    <select id="getAllInformation" resultType="com.diagbot.dto.GetAllInformationDTO">
-    	SELECT
-		*
-		FROM
-		(SELECT
-		a.id as conceptId,
-		a.lib_name AS libName,
-		c.`name` AS libType,
-		GROUP_CONCAT(b.`name` ORDER BY b.id ASC SEPARATOR '、') as otherNames,
-		a.modifier as operName,
-		a.gmt_modified as operTime,
-		a.is_deleted as isDeleted
-		FROM kl_concept a JOIN kl_library_info b ON a.id=b.concept_id
-		LEFT JOIN kl_lexicon c ON a.lib_type=c.id 
-		GROUP BY a.id) t
-		where 1=1
-		<if test="name!=null and name!=''">
-			 AND otherNames like concat('%',#{name},'%')	
-		</if>
-		<if test="type!=null and type!=''">
-            AND libType = #{type}
-        </if>
-        <if test="isDeleted!=null and isDeleted!=''">
-        	AND isDeleted=#{isDeleted}
-        </if>
-		ORDER BY isDeleted ASC,operTime DESC
-    </select>
-
 </mapper>

+ 15 - 12
knowledgeman-service/src/main/resources/mapper/RelationMapper.xml

@@ -19,21 +19,22 @@
     	SELECT * FROM 
 		(SELECT
 		a.id,
-		(SELECT id FROM kl_concept where id=a.start_id and is_deleted='N') as startId,
-		(SELECT name FROM kl_library_info where concept_id=a.start_id and is_concept=1) as startName,
-		(SELECT type FROM kl_library_info where concept_id=a.start_id and is_concept=1) as startType,
-		(SELECT id FROM kl_concept where id=a.end_id and is_deleted='N') as endId,
-		(SELECT name FROM kl_library_info where concept_id=a.end_id and is_concept=1) as endName,
-		(SELECT type FROM kl_library_info where concept_id=a.end_id and is_concept=1) as endType,
+		b.id AS startId,
+		b.lib_name AS startName,
+		(SELECT `name` FROM kl_lexicon WHERE id=b.lib_type) AS startType,
+		c.id AS endId,
+		c.lib_name AS endName,
+		(SELECT `name` FROM kl_lexicon WHERE id=c.lib_type) AS endType,
 		a.relation_id as relationId,
-		(SELECT name FROM lexicon_relationship where id=a.relation_id and is_deleted='N') as relationName,
+		(SELECT name FROM kl_lexicon_relationship where id=a.relation_id and is_deleted='N') as relationName,
 		a.gmt_modified as operTime,
 		a.modifier as operName,
 		a.is_deleted as isDeleted
-		from kl_relation a) t
+		FROM kl_relation a 
+		JOIN kl_concept b on a.start_id=b.id
+		JOIN kl_concept c on a.end_id=c.id
+		WHERE a.relation_id NOT IN(17,18)) t
 		where 1=1 
-		and startId is not null 
-		and endId is not null
 		<if test="isDeleted!=null and isDeleted!=''">
 			and isDeleted=#{isDeleted}
 		</if>
@@ -119,7 +120,7 @@
 		t3.lib_name AS libName,
 		t4.name AS libType,
 		CONCAT(t3.lib_name,'(',t4.name,')') AS libNameType,
-		GROUP_CONCAT(t2.lib_name ORDER BY t1.gmt_modified DESC) AS otherNames,
+		GROUP_CONCAT(t2.lib_name ORDER BY t5.order_no DESC,t1.gmt_modified DESC) AS otherNames,
 		t1.modifier AS operName,
 		MAX(t1.gmt_modified) AS operTime,
 		t1.is_deleted AS isDeleted
@@ -135,6 +136,7 @@
 		JOIN kl_concept t2 ON t1.start_id=t2.id
 		JOIN kl_concept t3 ON t1.end_id=t3.id
 		JOIN kl_lexicon t4 ON t3.lib_type=t4.id
+		LEFT JOIN kl_relation_order t5 ON t1.id=t5.t_relation_id
 		where t2.is_deleted='N' AND t3.is_deleted='N' AND t4.is_deleted='N'
 		GROUP BY t3.id) tab
 		where 1=1
@@ -153,7 +155,7 @@
 		t3.lib_name AS libName,
 		t4.name AS libType,
 		CONCAT(t3.lib_name,'(',t4.name,')') AS libNameType,
-		GROUP_CONCAT(t2.lib_name ORDER BY t1.gmt_modified DESC) AS otherNames,
+		GROUP_CONCAT(t2.lib_name ORDER BY t5.order_no DESC,t1.gmt_modified DESC) AS otherNames,
 		t1.modifier AS operName,
 		MAX(t1.gmt_modified) AS operTime,
 		t1.is_deleted AS isDeleted
@@ -161,6 +163,7 @@
 		JOIN kl_concept t2 ON t1.start_id=t2.id
 		JOIN kl_concept t3 ON t1.end_id=t3.id
 		JOIN kl_lexicon t4 ON t3.lib_type=t4.id
+		LEFT JOIN kl_relation_order t5 ON t1.id=t5.t_relation_id
 		WHERE t2.is_deleted='N' AND t3.is_deleted='N' AND t4.is_deleted='N'
 		AND t1.relation_id=18
 		GROUP BY t3.id) tab

+ 14 - 0
pom.xml

@@ -52,6 +52,7 @@
         <swagger.version>2.9.2</swagger.version>
         <!--<swagger-bootstrap.version>1.9.1</swagger-bootstrap.version>-->
         <logstash.version>5.2</logstash.version>
+        <poi.version>4.0.1</poi.version>
         <docker-maven-plugin.version>1.1.1</docker-maven-plugin.version>
         <docker.image.prefix>192.168.2.236:5000/diagbotcloud</docker.image.prefix>
     </properties>
@@ -148,6 +149,19 @@
                 <artifactId>logstash-logback-encoder</artifactId>
                 <version>${logstash.version}</version>
             </dependency>
+
+            <!--POI-->
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi</artifactId>
+                <version>${poi.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi-ooxml</artifactId>
+                <version>${poi.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 11 - 0
user-service/pom.xml

@@ -182,6 +182,17 @@
             <!--<version>2.6.0</version>-->
         </dependency>
 
+        <!--POI-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>com.aliyun</groupId>
             <artifactId>aliyun-java-sdk-dysmsapi</artifactId>