Browse Source

辅检项目维护

wangfeng 5 years ago
parent
commit
09213b8072

+ 66 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/PacsSonContactListDTO.java

@@ -0,0 +1,66 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-10-25 14:05
+ */
+@Getter
+@Setter
+public class PacsSonContactListDTO {
+
+    /**
+     * 医学标准术语id
+     */
+    @ApiModelProperty(value="医学标准术语id")
+    private Long conceptId;
+
+    /**
+     * 医学标准术语名称
+     */
+    @ApiModelProperty(value="医学标准术语名称")
+    private String libName;
+
+    /**
+     * 医学标准术语类型
+     */
+    @ApiModelProperty(value="医学标准术语类型")
+    private String libType;
+
+    /**
+     * 医学标准术语名称(医学标准术语类型)
+     */
+    private String libNameType;
+
+    /**
+     * 关联术语
+     */
+    @ApiModelProperty(value="关联术语")
+    private String otherNames;
+
+    /**
+     * 操作人
+     */
+    @ApiModelProperty(value="操作人")
+    private String operName;
+
+    /**
+     * 操作时间
+     */
+    @JsonFormat(timezone="GMT+8",pattern ="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value="操作时间")
+    private Date operTime;
+
+    /**
+     * 状态:Y-已删除,N-启用中
+     */
+    @ApiModelProperty(value="状态:Y-已删除,N-启用中")
+    private String isDeleted;
+}

+ 48 - 0
knowledgeman-service/src/main/java/com/diagbot/facade/PacsSonContactFacade.java

@@ -0,0 +1,48 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.PacsSonContactListDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.service.impl.RelationServiceImpl;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.PacsSonContactListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description: 医学术语关联业务层
+ * @date 2019-10-25 14:07
+ */
+@Component
+public class PacsSonContactFacade extends RelationServiceImpl {
+
+    @Autowired
+    private UserServiceClient userServiceClient;
+
+    /**
+     * 辅检项目维护-列表
+     *
+     * @param pacsSonContactListVO
+     * @return
+     */
+    public IPage<PacsSonContactListDTO> pacsSonContactList(PacsSonContactListVO pacsSonContactListVO) {
+        IPage<PacsSonContactListDTO> ipage = this.baseMapper.pacsSonContactList(pacsSonContactListVO);
+        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;
+    }
+
+}

+ 9 - 1
knowledgeman-service/src/main/java/com/diagbot/mapper/RelationMapper.java

@@ -2,6 +2,8 @@ package com.diagbot.mapper;
 
 import java.util.List;
 
+import com.diagbot.dto.PacsSonContactListDTO;
+import com.diagbot.vo.PacsSonContactListVO;
 import org.apache.ibatis.annotations.Param;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -51,5 +53,11 @@ public interface RelationMapper extends BaseMapper<Relation> {
 	 * @return
 	 */
 	IPage<OnlyByRootListDTO> onlyByRootList(OnlyByRootListVO onlyByRootListVO);
-	
+
+	/**
+	 * 辅检分页查询
+	 * @param pacsSonContactListVO
+	 * @return
+	 */
+	IPage<PacsSonContactListDTO> pacsSonContactList(PacsSonContactListVO pacsSonContactListVO);
 }

+ 34 - 0
knowledgeman-service/src/main/java/com/diagbot/vo/PacsSonContactListVO.java

@@ -0,0 +1,34 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-10-25 14:10
+ */
+@Getter
+@Setter
+public class PacsSonContactListVO  extends Page {
+
+    /**
+     * 术语名称
+     */
+    @ApiModelProperty(value="术语名称")
+    private String name;
+
+    /**
+     * 术语类型
+     */
+    @ApiModelProperty(value="术语类型")
+    private String type;
+
+    /**
+     * 状态:Y-已删除,N-启用中
+     */
+    @ApiModelProperty(value="状态:Y-已删除,N-启用中")
+    private String isDeleted;
+}

+ 73 - 0
knowledgeman-service/src/main/java/com/diagbot/web/PacsSonContactController.java

@@ -0,0 +1,73 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.PacsSonContactListDTO;
+import com.diagbot.dto.RelationNodeDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PacsSonContactFacade;
+import com.diagbot.facade.RelationContactFacade;
+import com.diagbot.vo.PacsSonContactListVO;
+import com.diagbot.vo.RelationContactDetailVO;
+import com.diagbot.vo.RelationNodeVO;
+import com.diagbot.vo.RemoveRelationContactVO;
+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.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @Description:
+ * @author wangfeng
+ * @date 2019-10-25
+ */
+
+@RestController
+@RequestMapping("/pacsSonContact")
+@SuppressWarnings("unchecked")
+@Api(value = "辅检项目维护相关API", tags = { "知识库标准化-辅检项目维护相关API" })
+public class PacsSonContactController {
+    @Autowired
+    private RelationContactFacade relationContactFacade;
+    @Autowired
+    private PacsSonContactFacade pacsSonContactFacade;
+
+    @ApiOperation(value = "知识库标准化-辅检项目维护-列表[by:wangfeng]")
+    @PostMapping("/pacsSonContactList")
+    @SysLogger("pacsSonContactList")
+    public RespDTO<IPage<PacsSonContactListDTO>> pacsSonContactList(@RequestBody PacsSonContactListVO pacsSonContactListVO) {
+        return RespDTO.onSuc(pacsSonContactFacade.pacsSonContactList(pacsSonContactListVO));
+    }
+
+    @ApiOperation(value = "知识库标准化-辅检项目维护-添加或者编辑[by:wangfeng]")
+    @PostMapping("/addPacsRelation")
+    @SysLogger("addPacsRelation")
+    @Transactional
+    public RespDTO<Boolean> addPacsRelation(@Valid @RequestBody RelationNodeVO relationNodeVO) {
+        return RespDTO.onSuc(relationContactFacade.addRelation(relationNodeVO));
+    }
+
+    @ApiOperation(value = "知识库标准化-辅检项目维护-详情[by:wangfeng]")
+    @PostMapping("/getPacsContactDetail")
+    @SysLogger("getPacsContactDetail")
+    public RespDTO<RelationNodeDTO> getPacsContactDetail(@Valid @RequestBody RelationContactDetailVO relationContactDetailVO) {
+        return RespDTO.onSuc(relationContactFacade.relationContactDetail(relationContactDetailVO));
+    }
+
+    @ApiOperation(value = "知识库标准化-辅检项目维护-删除或者恢复[by:wangfeng]")
+    @PostMapping("/removeRelationPacs")
+    @SysLogger("removeRelationPacs")
+    @Transactional
+    public RespDTO<Boolean> removeRelationPacs(@Valid @RequestBody RemoveRelationContactVO removeRelationContactVO) {
+        return RespDTO.onSuc(relationContactFacade.removeRelationContact(removeRelationContactVO));
+    }
+
+
+
+}

+ 32 - 2
knowledgeman-service/src/main/resources/mapper/RelationMapper.xml

@@ -100,6 +100,8 @@
 		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
+		AND t2.lib_type = 12
+		AND t3.lib_type = 13
 		GROUP BY t2.id) tab
 		where 1=1
 		<if test="name!=null and name!=''">
@@ -217,7 +219,35 @@
 		GROUP BY t2.id
 		ORDER BY t1.gmt_modified DESC,t2.id DESC
     </select>
-    
-    
+
+	<select id="pacsSonContactList" resultType="com.diagbot.dto.PacsSonContactListDTO">
+		SELECT
+		*
+		FROM
+		(SELECT
+		t2.id AS conceptId,
+		t2.lib_name AS libName,
+		t4.name AS libType,
+		CONCAT(t2.lib_name,'(',t4.name,')') AS libNameType,
+		GROUP_CONCAT(t3.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
+		FROM kl_relation t1
+		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
+		AND t2.lib_type = 16
+		AND t3.lib_type = 16
+		GROUP BY t2.id) tab
+		where 1=1
+		<if test="name!=null and name!=''">
+			and libName like concat('%',#{name},'%')
+		</if>
+		ORDER BY isDeleted ASC,operTime DESC
+	</select>
 
 </mapper>