Browse Source

医院配置信息

wangfeng 6 years ago
parent
commit
168de5fdd1

+ 30 - 0
prec-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -0,0 +1,30 @@
+package com.diagbot.client;
+
+import java.util.List;
+
+import javax.validation.Valid;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.diagbot.client.hystrix.TranServiceHystrix;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.vo.HospitalSetVO;
+
+/**
+ * @Description: 调用信息对接层服务
+ * @author: gaodm
+ * @time: 2019/2/1 17:00
+ */
+@FeignClient(value = "tran-service", fallback = TranServiceHystrix.class)
+public interface TranServiceClient {
+	/**
+	 * 
+	 * @param hospitalSetVO
+	 * @return
+	 */
+	@PostMapping("/sysSet/getSysSetInfoDatas")
+    RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid @RequestBody HospitalSetVO hospitalSetVO);
+}

+ 29 - 0
prec-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -0,0 +1,29 @@
+package com.diagbot.client.hystrix;
+
+import java.util.List;
+
+import javax.validation.Valid;
+
+import org.springframework.stereotype.Component;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.vo.HospitalSetVO;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @Description: 调用信息对接层服务
+ * @author: gaodm
+ * @time: 2019/2/1 17:00
+ */
+@Component
+@Slf4j
+public class TranServiceHystrix implements TranServiceClient {
+	@Override
+	public RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid HospitalSetVO hospitalSetVO) {
+		log.error("【hystrix】调用{}异常", "getSysSetInfoDatas");
+		return null;
+	}
+}

+ 44 - 0
prec-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -0,0 +1,44 @@
+package com.diagbot.dto;
+
+import java.time.LocalDateTime;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月18日 上午10:24:42
+ */
+@Setter
+@Getter
+public class SysSetInfoDTO {
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+    
+    /**
+     * 配置编码
+     */
+    private String code;
+    /**
+     * 配置值
+     */
+    private Integer value;
+}

+ 37 - 0
prec-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -0,0 +1,37 @@
+package com.diagbot.facade;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.HospitalSetVO;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月18日 上午10:24:58
+ */
+@Component
+public class SysSetFacade {
+
+	@Autowired
+	TranServiceClient tranServiceClient;
+
+	/**
+	 * 根据医院code获取配置信息
+	 * 
+	 * @return
+	 */
+	public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
+		RespDTO<List<SysSetInfoDTO>> sysSetInfoLists = tranServiceClient.getSysSetInfoDatas(hospitalSetVO);
+		RespDTOUtil.respNGDeal(sysSetInfoLists, "获取配置数据失败!");
+		return sysSetInfoLists.data;
+	}
+
+}

+ 38 - 0
prec-service/src/main/java/com/diagbot/vo/HospitalSetVO.java

@@ -0,0 +1,38 @@
+package com.diagbot.vo;
+
+import com.diagbot.enums.SysTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月18日 上午10:25:13
+ */
+@Setter
+@Getter
+public class HospitalSetVO {
+
+	private String hospitalCode;
+
+	/**
+	 * 访问的系统类型
+	 * (1, "user-service"),(2, "diagbotman-service"),(3, "uaa-service"),(4, "log-service"),
+	 * (5, "bi-service"),(6, "ltapi-service"),(7, "feedback-service"),(8, "icss-old-service"),
+	 * (9, "triage-service"),(10, "appkey"),(11, "icss-service"),(12, "icssman-service"),(13, "knowledgeman-service"),
+	 * (14, "tran-service"),(15, "aipt-service"),(16, "data-service"),(17, "prec-service");
+	 */
+	@ApiModelProperty(hidden = true)
+	private Integer sysType = SysTypeEnum.PREC_SERVICE.getKey();
+
+	/**
+	 * 配置名称
+	 */
+	private String name;
+	/**
+	 * 配置编码
+	 */
+	private String code;
+}

+ 46 - 0
prec-service/src/main/java/com/diagbot/web/SysSetController.java

@@ -0,0 +1,46 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.facade.SysSetFacade;
+import com.diagbot.vo.HospitalSetVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+import java.util.List;
+
+/**
+ * <p>
+ * 医院所有配置信息 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2019-06-18
+ */
+@RestController
+@RequestMapping("/sysSet")
+@Api(value = "配置信息API", tags = { "配置信息API" })
+@SuppressWarnings("unchecked")
+public class SysSetController {
+
+	@Autowired
+	SysSetFacade sysSetFacade;
+	
+	@ApiOperation(value = "根据医院编码获取配置信息[by:wangfeng]", notes = "hospitalCode :医院code  必填<br> ")
+	@PostMapping("/getSysSetInfoDatas")
+	@SysLogger("getSysSetInfoDatas")
+	public RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid @RequestBody HospitalSetVO hospitalSetVO) {
+
+		 List<SysSetInfoDTO> data = sysSetFacade.getSysSetInfoData(hospitalSetVO);
+
+		return RespDTO.onSuc(data);
+	}
+}