Kaynağa Gözat

Merge branch 'dev' of http://192.168.1.220:10080/jiwei/wlyy2.0 into dev

# Conflicts:
#	common/common-rest-model/pom.xml
liuwenbin 6 yıl önce
ebeveyn
işleme
96974f28ee
58 değiştirilmiş dosya ile 582 ekleme ve 286 silme
  1. 12 7
      app/app-iot-server/pom.xml
  2. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/third/wlyy/MonitoringHealthPlatformController.java
  3. 2 2
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/third/wlyy/MonitoringHealthService.java
  4. 2 2
      app/public-health-server/pom.xml
  5. 4 6
      common-lib-parent-pom/pom.xml
  6. 1 1
      common/common-entity/pom.xml
  7. 1 5
      common/common-exception/pom.xml
  8. 52 52
      common/common-exception/src/main/java/com/yihu/jw/exception/advice/MyControllerAdvice.java
  9. 9 3
      common/common-fegin/pom.xml
  10. 1 1
      common/common-fegin/src/main/java/com/yihu/jw/fegin/DemoFeign.java
  11. 1 1
      common/common-fegin/src/main/java/com/yihu/jw/fegin/fallbackfactory/iot/device/IotPatientDeviceFallbackFactory.java
  12. 1 1
      common/common-fegin/src/main/java/com/yihu/jw/fegin/iot/device/IotPatientDeviceFeign.java
  13. 1 1
      common/common-request-mapping/pom.xml
  14. 40 0
      common/common-rest-model-es/pom.xml
  15. 1 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/common/SaveModel.java
  16. 1 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/FigureLabelDataModelVO.java
  17. 2 2
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/LocationDataVO.java
  18. 5 14
      common/common-rest-model/pom.xml
  19. 7 5
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/EnvelopRestController.java
  20. 64 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/PatientRelationVO.java
  21. 1 1
      common/common-util/pom.xml
  22. 4 4
      server/svr-configuration/pom.xml
  23. 5 5
      server/svr-configuration/src/main/resources/bootstrap.yml
  24. 9 10
      server/svr-yihu-admin-server/pom.xml
  25. 19 1
      server/svr-yihu-admin-server/src/main/java/com.yihu.admin/YihuAdminServer.java
  26. 20 14
      server/svr-yihu-admin-server/src/main/resources/application.yml
  27. 0 14
      server/svr-yihu-admin-server/src/main/resources/bootstrap.yml
  28. 56 22
      svr-lib-parent-pom/pom.xml
  29. 15 16
      svr/svr-base/pom.xml
  30. 7 2
      svr/svr-base/src/main/java/com/yihu/jw/SvrBaseApplication.java
  31. 41 0
      svr/svr-base/src/main/java/com/yihu/jw/business/demo/DemoController.java
  32. 10 4
      svr/svr-base/src/main/java/com/yihu/jw/config/jpa/HibernateProperties.java
  33. 11 1
      svr/svr-base/src/main/resources/application.yml
  34. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  35. 2 2
      svr/svr-demo/pom.xml
  36. 6 2
      svr/svr-iot/pom.xml
  37. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java
  38. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/FigureLabelSearchController.java
  39. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
  40. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/label/FigureLabelSerachService.java
  41. 2 2
      svr/svr-manage/pom.xml
  42. 2 2
      svr/svr-rehabilitation/pom.xml
  43. 2 2
      svr/svr-wlyy-archives/pom.xml
  44. 2 2
      svr/svr-wlyy-health-bank/pom.xml
  45. 2 2
      svr/svr-wlyy-health-bank/src/main/resources/bootstrap.yml
  46. 2 2
      svr/svr-wlyy-specialist/pom.xml
  47. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java
  48. 28 3
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java
  49. 2 0
      svr/svr-wlyy-specialist/src/main/resources/application.yml
  50. 2 2
      svr/svr-wlyy/pom.xml
  51. 40 42
      web-gateway/pom.xml
  52. 16 3
      web-gateway/src/main/java/com/yihu/jw/WebGateWayAppliaction.java
  53. 32 0
      web-gateway/src/main/java/com/yihu/jw/config/SwaggerConfig.java
  54. 10 0
      web-gateway/src/main/java/com/yihu/jw/config/mvc/MvcConfig.java
  55. 2 6
      web-gateway/src/main/java/com/yihu/jw/controller/DemoController.java
  56. 6 4
      web-gateway/src/main/java/com/yihu/jw/controller/base/login/LoginContorller.java
  57. 1 1
      web-gateway/src/main/java/com/yihu/jw/controller/iot/device/IotPatientDeviceController.java
  58. 10 2
      web-gateway/src/main/resources/application.yml

+ 12 - 7
app/app-iot-server/pom.xml

@ -1,18 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.yihu.ehr.iot</groupId>
    <artifactId>app-iot-server</artifactId>
    <packaging>war</packaging>
    <version>1.0.0</version>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.ehr.iot</groupId>
    <artifactId>app-iot-server</artifactId>
    <packaging>war</packaging>
    <version>${parent.version}</version>
    <!-- 依赖包 -->
    <dependencies>
        <dependency>
@ -230,12 +233,10 @@
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
@ -246,6 +247,10 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model-es</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/third/wlyy/MonitoringHealthPlatformController.java

@ -3,11 +3,11 @@ package com.yihu.ehr.iot.controller.third.wlyy;
import com.yihu.ehr.iot.controller.common.BaseController;
import com.yihu.ehr.iot.service.third.wlyy.MonitoringHealthService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import iot.device.LocationDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

+ 2 - 2
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/third/wlyy/MonitoringHealthService.java

@ -8,9 +8,9 @@ import com.yihu.ehr.iot.service.common.BaseService;
import com.yihu.ehr.iot.util.http.HttpHelper;
import com.yihu.ehr.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.ApiOperation;
import iot.device.LocationDataVO;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -44,7 +44,7 @@ public class MonitoringHealthService extends BaseService{
     * @param diseaseCondition
     * @return
     */
    public Envelop<LocationDataVO> findDeviceLocations(Integer diseaseCondition,Integer page,Integer size,String type) throws IOException {
    public Envelop<LocationDataVO> findDeviceLocations(Integer diseaseCondition, Integer page, Integer size, String type) throws IOException {
        Envelop<LocationDataVO> envelop = new Envelop<>();
        Envelop<LocationDataVO> envelopTmp = null;
        JSONArray jsonArray = new JSONArray();

+ 2 - 2
app/public-health-server/pom.xml

@ -4,12 +4,12 @@
    <groupId>com.yihu.ehr.iot</groupId>
    <artifactId>public-health-server</artifactId>
    <packaging>war</packaging>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>

+ 4 - 6
common-lib-parent-pom/pom.xml

@ -6,22 +6,20 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <properties>
        <!--common 的统一控制版本配置-->
        <common.verion>1.0.2</common.verion>
    </properties>
    <groupId>com.yihu.base</groupId>
    <artifactId>common-lib-parent-pom</artifactId>
    <version>${common.verion}</version>
    <version>1.0.2</version>
    <packaging>pom</packaging>
    <modules>
        <module>../common/common-entity</module>
        <module>../common/common-rest-model</module>
        <module>../common/common-rest-model-es</module>
        <module>../common/common-exception</module>
        <module>../common/common-request-mapping</module>
        <module>../common/common-util</module>

+ 1 - 1
common/common-entity/pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>${common.verion}</version>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>

+ 1 - 5
common/common-exception/pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>${common.verion}</version>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
@ -39,10 +39,6 @@
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>

+ 52 - 52
common/common-exception/src/main/java/com/yihu/jw/exception/advice/MyControllerAdvice.java

@ -1,52 +1,52 @@
package com.yihu.jw.exception.advice;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.restmodel.common.base.BaseEnvelop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.cloud.sleuth.Tracer;
import org.json.JSONObject;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
 * 统一异常处理器
 * Created by 刘文彬 on 2018/5/9.
 */
@ControllerAdvice
public class MyControllerAdvice {
    @Autowired
    private Tracer tracer;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @ResponseBody
    @ExceptionHandler(value = ApiException.class)
    public BaseEnvelop myErrorHandler(ApiException ex) {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        tracer.getCurrentSpan().tag("ApiExcepiton.Tag",new JSONObject(request.getParameterMap()).toString());
        tracer.getCurrentSpan().logEvent(ex.getMessage());
        logger.error(ex.getMessage());
        return BaseEnvelop.getError(ex.getMessage(),ex.getErrorCode());
    }
    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public BaseEnvelop myErrorHandler2(Exception ex) {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        tracer.getCurrentSpan().tag("Excepiton.Tag",new JSONObject(request.getParameterMap()).toString());
        tracer.getCurrentSpan().logEvent(ex.getMessage());
        logger.error(ex.getMessage());
        return BaseEnvelop.getError(ex.getMessage());
    }
}
//package com.yihu.jw.exception.advice;
//
//import com.yihu.jw.exception.ApiException;
//import com.yihu.jw.restmodel.common.base.BaseEnvelop;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.ControllerAdvice;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.cloud.sleuth.Tracer;
//import org.json.JSONObject;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * 统一异常处理器
// * Created by 刘文彬 on 2018/5/9.
// */
//@ControllerAdvice
//public class MyControllerAdvice {
//    @Autowired
//    private Tracer tracer;
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());
//
//
//    @ResponseBody
//    @ExceptionHandler(value = ApiException.class)
//    public BaseEnvelop myErrorHandler(ApiException ex) {
//        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//        tracer.getCurrentSpan().tag("ApiExcepiton.Tag",new JSONObject(request.getParameterMap()).toString());
//        tracer.getCurrentSpan().logEvent(ex.getMessage());
//        logger.error(ex.getMessage());
//        return BaseEnvelop.getError(ex.getMessage(),ex.getErrorCode());
//    }
//
//    @ResponseBody
//    @ExceptionHandler(value = Exception.class)
//    public BaseEnvelop myErrorHandler2(Exception ex) {
//        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//        tracer.getCurrentSpan().tag("Excepiton.Tag",new JSONObject(request.getParameterMap()).toString());
//        tracer.getCurrentSpan().logEvent(ex.getMessage());
//        logger.error(ex.getMessage());
//        return BaseEnvelop.getError(ex.getMessage());
//    }
//
//
//}

+ 9 - 3
common/common-fegin/pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>${common.verion}</version>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
@ -18,15 +18,21 @@
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-exception</artifactId>
            <version>${parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <version>${parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
            <version>${parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <version>1.0.2</version>
            <artifactId>common-rest-model-es</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>

+ 1 - 1
common/common-fegin/src/main/java/com/yihu/jw/fegin/DemoFeign.java

@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam;
)
public interface DemoFeign {
    @RequestMapping(value = Contants.patient.findByCode, method = RequestMethod.GET)
    @RequestMapping(value = "/demo/findByCode", method = RequestMethod.GET)
    String findByCode(@RequestParam(value = "code", required = true) String code);
}

+ 1 - 1
common/common-fegin/src/main/java/com/yihu/jw/fegin/fallbackfactory/iot/device/IotPatientDeviceFallbackFactory.java

@ -4,8 +4,8 @@ import com.yihu.jw.fegin.iot.device.IotPatientDeviceFeign;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import feign.hystrix.FallbackFactory;
import iot.device.LocationDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.stereotype.Component;

+ 1 - 1
common/common-fegin/src/main/java/com/yihu/jw/fegin/iot/device/IotPatientDeviceFeign.java

@ -5,8 +5,8 @@ import com.yihu.jw.restmodel.CommonContants;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import iot.device.LocationDataVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

+ 1 - 1
common/common-request-mapping/pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>${common.verion}</version>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>

+ 40 - 0
common/common-rest-model-es/pom.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>common-rest-model-es</artifactId>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>
            <groupId>io.searchbox</groupId>
            <artifactId>jest-common</artifactId>
            <version>2.4.0</version>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>1.5.13</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.8.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
            <version>2.1.3.RELEASE</version>
        </dependency>
    </dependencies>
</project>

+ 1 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/common/SaveModel.java

@ -1,4 +1,4 @@
package com.yihu.jw.restmodel.iot.common;
package common;
import io.searchbox.annotations.JestId;

+ 1 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/FigureLabelDataModelVO.java

@ -1,4 +1,4 @@
package com.yihu.jw.restmodel.iot.device;
package iot.device;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.searchbox.annotations.JestId;

+ 2 - 2
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/LocationDataVO.java

@ -1,7 +1,7 @@
package com.yihu.jw.restmodel.iot.device;
package iot.device;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yihu.jw.restmodel.iot.common.SaveModel;
import common.SaveModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;

+ 5 - 14
common/common-rest-model/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>common-rest-model</artifactId>
    <version>1.0.2</version>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>
@ -22,15 +22,16 @@
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
            <version>${parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-log</artifactId>
        </dependency>
        <!--<dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-exception</artifactId>
        </dependency>-->
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
@ -51,15 +52,5 @@
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
            <version>2.1.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>io.searchbox</groupId>
            <artifactId>jest</artifactId>
            <version>2.4.0</version>
        </dependency>
    </dependencies>
</project>

+ 7 - 5
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/EnvelopRestController.java

@ -4,6 +4,8 @@ package com.yihu.jw.restmodel.common;
import com.fasterxml.jackson.databind.ObjectMapper;
//import com.yihu.jw.exception.ApiException;
//import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.util.date.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -61,15 +63,15 @@ public class EnvelopRestController {
    }
    //Json转实体类
    public <T> T toEntity(String json, Class<T> entityCls) throws Exception{
//        try {
    public <T> T toEntity(String json, Class<T> entityCls) {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.setDateFormat(new SimpleDateFormat(DateUtil.yyyy_MM_dd_HH_mm_ss));
            T entity = objectMapper.readValue(json, entityCls);
            return entity;
//        } catch (IOException ex) {
//            throw new ApiException("Unable to parse json, " + ex.getMessage(), ExceptionCode.common_error_params_code);
//        }
        } catch (IOException ex) {
            throw new ApiException("Unable to parse json, " + ex.getMessage(), ExceptionCode.common_error_params_code);
        }
    }
    /**

+ 64 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/PatientRelationVO.java

@ -0,0 +1,64 @@
package com.yihu.jw.restmodel.specialist;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by Trick on 2018/5/30.
 */
@JsonInclude(JsonInclude.Include.ALWAYS)
@ApiModel(value = "居民信息", description = "居民信息")
public class PatientRelationVO {
    @ApiModelProperty("居民code")
    private String patient;
    @ApiModelProperty("居民姓名")
    private String patientName;
    @ApiModelProperty("年龄")
    private String age;
    @ApiModelProperty("头像")
    private String photo;
    @ApiModelProperty("出院时间")
    private String createTime;
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getAge() {
        return age;
    }
    public void setAge(String age) {
        this.age = age;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}

+ 1 - 1
common/common-util/pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.base</groupId>
        <artifactId>common-lib-parent-pom</artifactId>
        <version>${common.verion}</version>
        <version>1.0.2</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>

+ 4 - 4
server/svr-configuration/pom.xml

@ -29,10 +29,10 @@
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.springframework.boot</groupId>-->
            <!--<artifactId>spring-boot-starter-security</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>

+ 5 - 5
server/svr-configuration/src/main/resources/bootstrap.yml

@ -6,10 +6,10 @@ spring:
security:
  user:
    name: jw
    password:  jkzl
#security:
#  user:
#    name: jw
#    password:  jkzl
eureka:
  client:
@ -39,7 +39,7 @@ spring:
      server:
        git:
          uri: http://192.168.1.220:10080/jiwei/wlyy2.0.config.git
        default-label: master
        default-label: jwdev
---

+ 9 - 10
server/svr-yihu-admin-server/pom.xml

@ -3,29 +3,27 @@
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <artifactId>jkzl-start</artifactId>
        <groupId>com.yihu</groupId>
        <version>1.0.0</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>svr-yihu-admin-server</artifactId>
    <properties>
        <version.yihu.admin>1.2.0</version.yihu.admin>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>admin-server-starter</artifactId>
            <version>1.1.0</version>
            <version>${version.yihu.admin}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>admin-server-ui-starter</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${version.yihu.admin}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
@ -37,8 +35,9 @@
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 19 - 1
server/svr-yihu-admin-server/src/main/java/com.yihu.admin/YihuAdminServer.java

@ -1,12 +1,30 @@
package com.yihu.admin;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Configuration;
/**
 * Created by chenweida on 2017/8/15.
 */
@SpringBootApplication
@SpringBootApplication(exclude = {
        JestAutoConfiguration.class,
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class,
        DataSourceAutoConfiguration.class,
        JdbcTemplateAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class
})
public class YihuAdminServer {
    public static void main(String[] args) {

+ 20 - 14
server/svr-yihu-admin-server/src/main/resources/application.yml

@ -8,33 +8,36 @@ spring:
    elasticsearch:
      cluster-name: jkzl #es集群的名字
      cluster-nodes: 172.19.103.68:9300  #多个逗号分割
      cluster-nodes-jest: http://172.19.103.68:9200  #多个逗号分割
      repositories:
        enabled: true
      properties:
        client:
          transport:
            sniff: true  #开启嗅探集群  用nginx代理一层过后会出现ip解析失败问题
      cluster-nodes-jest:  http://172.19.103.68:9200 #多个逗号分割
      jest:
        discovery-enabled: true #开启嗅探
      uris: ${spring.data.elasticsearch.cluster-nodes-jest}
        discovery-enabled: false #开启嗅探
        conn-timeout: 60 # 连接时间单位是秒
        read-timeout: 60 # 读取时间单位是秒
        multith-readed: true #开启多线程
        max-total-connection: 50 ##最大连接
        max-connection-idle-time: 50 #最大等待时间
  elasticsearch:
    jest:
      read-timeout: ${spring.data.elasticsearch.jest.read-timeout}
      multith-readed: ${spring.data.elasticsearch.jest.multith-readed}
#logging:
#  file: ${logging.path}demo-eureka.log
#  path: G:\idea_workspace\jkzl_git\jkzl-start\logs\
#  level:
#    root: INFO
logging:
  file: ${logging.path}svr-yihu-admin-server.log
  path: G:\idea_workspace\jkzl_git\jkzl-start\logs\
  level:
    root: INFO
management:
  health:
    db:
      enabled: false
---
spring:
  profiles: jwdev
@ -42,7 +45,10 @@ spring:
    elasticsearch:
      cluster-name: jkzl #es集群的名字
      cluster-nodes: 172.19.103.68:9300  #多个逗号分割
      cluster-nodes-jest: http://172.19.103.68:9200  #多个逗号分割
      cluster-nodes-jest:  http://172.19.103.68:9200 #多个逗号分割
  elasticsearch:
    jest:
      uris: ${spring.data.elasticsearch.cluster-nodes-jest}
---

+ 0 - 14
server/svr-yihu-admin-server/src/main/resources/bootstrap.yml

@ -1,17 +1,3 @@
##优先读取 boostarap配置 然后在读取application。yml的配置
#spring:
#  #从发现服务里面取配置服务的信息
#  cloud:
#    config:
#      username: jw
#      password: jkzl
#      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
#      discovery:
#        enabled: true ##使用发现服务
#        service-id: svr-configurations ##配置服务的名字
#
##发现服务的地址
eureka:
  client:

+ 56 - 22
svr-lib-parent-pom/pom.xml

@ -11,7 +11,7 @@
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-lib-parent-pom</artifactId>
    <version>1.0.0</version>
    <version>1.0.2</version>
    <packaging>pom</packaging>
    <developers>
        <developer>
@ -54,12 +54,10 @@
    <properties>
        <version.mysql>5.1.38</version.mysql>
        <version.jackson>2.8.1</version.jackson>
        <version.myCommon>1.0.0</version.myCommon>
        <version.myCommon>1.0.2</version.myCommon>
        <version.spring-data-hadoop>2.3.0.RELEASE</version.spring-data-hadoop>
        <version.springside>4.2.3-GA</version.springside>
        <version.zipkin>1.24.0</version.zipkin>
        <version.hibernate>5.0.12.Final</version.hibernate>
        <version.hibernate-jpa>1.0.0.Final</version.hibernate-jpa>
        <version.servlet-api>3.1.0</version.servlet-api>
        <version.swagger>2.7.0</version.swagger>
        <version.swagger-ui>2.7.0</version.swagger-ui>
@ -88,10 +86,26 @@
        <asciidoctor.maven.plugin.version>1.5.5</asciidoctor.maven.plugin.version>
        <asciidoctorj.version>1.5.5</asciidoctorj.version>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
        <version.yihu.admin>1.2.0</version.yihu.admin>
    </properties>
    <!--dependencyManagement作用子配置不写版本默认继承父配置-->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.yihu</groupId>
                <artifactId>admin-client-starter</artifactId>
                <version>${version.yihu.admin}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu</groupId>
                <artifactId>admin-server-starter</artifactId>
                <version>${version.yihu.admin}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu</groupId>
                <artifactId>admin-server-ui-starter</artifactId>
                <version>${version.yihu.admin}</version>
            </dependency>
            <!--服务器监监听-->
            <dependency>
                <groupId>de.codecentric</groupId>
@ -124,11 +138,11 @@
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-async</artifactId>
                <version>${version.myCommon}</version>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-security</artifactId>
                <groupId>com.yihu.jw</groupId>
                <artifactId>common-fegin</artifactId>
                <version>${version.myCommon}</version>
            </dependency>
            <dependency>
@ -151,6 +165,11 @@
                <artifactId>common-rest-model</artifactId>
                <version>${version.myCommon}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.jw</groupId>
                <artifactId>common-rest-model-es</artifactId>
                <version>${version.myCommon}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.jw</groupId>
                <artifactId>svr-base</artifactId>
@ -164,22 +183,22 @@
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-swagger</artifactId>
                <version>${version.myCommon}</version>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-data-mysql</artifactId>
                <version>${version.myCommon}</version>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-log</artifactId>
                <version>${version.myCommon}</version>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-quartz</artifactId>
                <version>${version.myCommon}</version>
                <version>1.0.0</version>
            </dependency>
            <!--数据库驱动 start-->
            <dependency>
@ -237,23 +256,23 @@
                <classifier>GA</classifier>
            </dependency>
            <!--hibernate start-->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${version.hibernate}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.1-api</artifactId>
                <version>${version.hibernate-jpa}</version>
            </dependency>
            <!--<dependency>-->
                <!--<groupId>org.hibernate</groupId>-->
                <!--<artifactId>hibernate-core</artifactId>-->
                <!--<version>${version.hibernate}</version>-->
            <!--</dependency>-->
            <!--<dependency>-->
                <!--<groupId>org.hibernate.javax.persistence</groupId>-->
                <!--<artifactId>hibernate-jpa-2.1-api</artifactId>-->
                <!--<version>${version.hibernate-jpa}</version>-->
            <!--</dependency>-->
            <!--hibernate end-->
            <!--fastdfs start-->
            <dependency>
                <groupId>com.yihu.base</groupId>
                <artifactId>common-data-fastdfs</artifactId>
                <version>${version.myCommon}</version>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.csource</groupId>
@ -488,6 +507,21 @@
                </configuration>
                <version>3.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--编译插件 end-->
            <plugin>
                <groupId>org.asciidoctor</groupId>

+ 15 - 16
svr/svr-base/pom.xml

@ -6,21 +6,31 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-base</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>admin-client-starter</artifactId>
            <version>1.1.0</version>
            <version>${version.yihu.admin}</version>
        </dependency>
        <!--公共的 start-->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-elasticsearch</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
@ -35,12 +45,6 @@
                </exclusion>
            </exclusions>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>com.yihu</groupId>-->
        <!--<artifactId>common-data-es-starter</artifactId>-->
        <!--<version>1.1.0</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
@ -53,10 +57,6 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-swagger</artifactId>
@ -181,9 +181,8 @@
        <!--<artifactId>spring-boot-starter-data-redis</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <version>1.0.0</version>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 7 - 2
svr/svr-base/src/main/java/com/yihu/jw/SvrBaseApplication.java

@ -6,9 +6,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@ -26,11 +26,16 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@ComponentScan(basePackages={"com"})
@EnableJpaAuditing
@EnableAutoConfiguration(exclude = {
        ElasticsearchRepositoriesAutoConfiguration.class
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class,
        JestAutoConfiguration.class
})
public class SvrBaseApplication {
    public static void main(String[] args) {
        SpringApplication.run(SvrBaseApplication.class, args);
    }
}

+ 41 - 0
svr/svr-base/src/main/java/com/yihu/jw/business/demo/DemoController.java

@ -0,0 +1,41 @@
package com.yihu.jw.business.demo;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.business.user.dao.BaseRoleDao;
import com.yihu.jw.exception.SystemException;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.fegin.DemoFeign;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
 * Created by chenweida on 2017/5/10.
 */
@RestController
@RequestMapping("/demo")
@Api(description = "demo例子")
@RefreshScope
public class DemoController {
    @Autowired
    private BaseRoleDao baseRoleDao;
    @ApiOperation(value = "根据code查找患者")
    @GetMapping(value = "findByCode")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "患者code", required = false) @RequestParam(value = "code", required = false) String code) {
        baseRoleDao.findAllByName("管理员");
        return  Envelop.getSuccess("成功");
    }
}

+ 10 - 4
svr/svr-base/src/main/java/com/yihu/jw/config/jpa/HibernateProperties.java

@ -1,9 +1,13 @@
package com.yihu.jw.config.jpa;
import org.hibernate.EmptyInterceptor;
import org.hibernate.Interceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Properties;
/**
@ -20,17 +24,19 @@ public class HibernateProperties {
//    private String naming_strategy;
    @Value("${hibernate.physical_naming_strategy}")
    private String  physical_naming_strategy;
    private String physical_naming_strategy;
    @Value("${hibernate.implicit_naming_strategy}")
    private String implicit_naming_strategy;
    @Autowired
    private List<Interceptor> interceptors;
    public  Properties hibProperties() {
    public Properties hibProperties() {
        Properties properties = new Properties();
        properties.put("hibernate.dialect",dialect);
        properties.put("hibernate.dialect", dialect);
        properties.put("hibernate.show_sql", show_sql);
        properties.put("hibernate.physical_naming_strategy", physical_naming_strategy);
        properties.put("hibernate.implicit_naming_strategy", implicit_naming_strategy);
        properties.put("hibernate.ejb.interceptor", interceptors.get(0));
        return properties;
    }
}

+ 11 - 1
svr/svr-base/src/main/resources/application.yml

@ -33,7 +33,17 @@ endpoints:
  info:
    enabled: true
yihu:
  admin:
    client:
      advice:
        http: true #默认true
        sql:
          hibernate: true ##默认false
          springJDBC: true ##默认true
      server:
        ip: 192.168.131.102
        port: 8082
---
spring:

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -28,7 +28,7 @@ eureka:
    serviceUrl:
      #http://账号:密码@127.0.0.1:8761/eureka/
#      defaultZone: http://jw:jkzl@172.19.103.33:8761//eureka/
      defaultZone: http://jw:jkzl@192.168.131.131:8761/eureka/
      defaultZone: http://jw:jkzl@192.168.131.102:8761/eureka/
---
spring:

+ 2 - 2
svr/svr-demo/pom.xml

@ -6,12 +6,12 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <artifactId>svr-demo</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>

+ 6 - 2
svr/svr-iot/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.iot</groupId>
    <artifactId>svr-iot</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <packaging>war</packaging>
    <dependencies>
@ -36,6 +36,10 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model-es</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java

@ -7,11 +7,11 @@ import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import iot.device.LocationDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.*;

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/FigureLabelSearchController.java

@ -3,11 +3,11 @@ package com.yihu.iot.controller.label;
import com.yihu.iot.service.label.FigureLabelSerachService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.iot.device.FigureLabelDataModelVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import iot.device.FigureLabelDataModelVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -10,10 +10,10 @@ import com.yihu.iot.service.common.ElasticSearchQueryGenerator;
import com.yihu.jw.iot.device.IotPatientDeviceDO;
import com.yihu.jw.iot.device.LocationDataDO;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import io.searchbox.client.JestResult;
import iot.device.LocationDataVO;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/label/FigureLabelSerachService.java

@ -6,11 +6,11 @@ import com.yihu.base.es.config.ElasticFactory;
import com.yihu.base.es.config.ElastricSearchHelper;
import com.yihu.iot.datainput.util.ConstantUtils;
import com.yihu.iot.service.common.ElasticSearchQueryGenerator;
import com.yihu.jw.restmodel.iot.device.FigureLabelDataModelVO;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import io.searchbox.client.JestClient;
import io.searchbox.client.JestResult;
import io.searchbox.core.Search;
import iot.device.FigureLabelDataModelVO;
import iot.device.LocationDataVO;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

+ 2 - 2
svr/svr-manage/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <artifactId>svr-manage</artifactId>
    <packaging>war</packaging>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <dependencies>

+ 2 - 2
svr/svr-rehabilitation/pom.xml

@ -5,13 +5,13 @@
	<parent>
		<groupId>com.yihu.jw</groupId>
		<artifactId>svr-lib-parent-pom</artifactId>
		<version>1.0.0</version>
		<version>1.0.2</version>
		<relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
	</parent>
	<groupId>com.yihu.rehabilitation</groupId>
	<artifactId>svr-rehabilitation</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<version>${parent.version}</version>
	<packaging>jar</packaging>
	<dependencies>

+ 2 - 2
svr/svr-wlyy-archives/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.archives</groupId>
    <artifactId>svr-wlyy-archives</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>

+ 2 - 2
svr/svr-wlyy-health-bank/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.health.bank</groupId>
    <artifactId>svr-wlyy-health-bank</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <packaging>war</packaging>
    <dependencies>

+ 2 - 2
svr/svr-wlyy-health-bank/src/main/resources/bootstrap.yml

@ -28,8 +28,8 @@ spring:
eureka:
  client:
    serviceUrl:
      #http://账号:密码@127.0.0.1:8761/eureka/
      defaultZone: http://jw:jkzl@172.19.103.33:8761/eureka/
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka
#      defaultZone: http://jw:jkzl@172.19.103.33:8761/eureka/
---
spring:

+ 2 - 2
svr/svr-wlyy-specialist/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.specialist</groupId>
    <artifactId>svr-wlyy-specialist</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java

@ -11,5 +11,5 @@ import java.util.List;
 */
public interface SpecialistPatientRelationDao extends PagingAndSortingRepository<SpecialistPatientRelationDO, String>,
        JpaSpecificationExecutor<SpecialistPatientRelationDO> {
    public List<SpecialistPatientRelationDO> findByDoctor(String doctor);
    public List<SpecialistPatientRelationDO> findByDoctorAndStatus(String doctor,String status);
}

+ 28 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -1,15 +1,15 @@
package com.yihu.jw.service;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.jw.dao.*;
import com.yihu.jw.entity.specialist.SpecialistArticleDO;
import com.yihu.jw.entity.specialist.SpecialistConsultDO;
import com.yihu.jw.entity.specialist.SpecialistDO;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.specialist.SpecialistPatientRelationVO;
import com.yihu.jw.restmodel.specialist.*;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -18,7 +18,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.function.BooleanSupplier;
/**
 * Created by Trick on 2018/4/25.
@ -39,6 +38,8 @@ public class SpecialistService{
    private PatientHospitalRecordDao patientHospitalRecordDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${basedb.name}")
    private String basedb;
    public Envelop<Boolean> createSpecialists(List<SpecialistDO> info){
        specialistDao.save(info);
@ -95,5 +96,29 @@ public class SpecialistService{
        return Envelop.getSuccessListWithPage(SpecialistMapping.api_success,specialistPatientRelationVOs,page,size,count);
    }
    public Envelop<Long> findSpecialistPatientRelationCout(String doctor){
        String sql = "SELECT " +
                " count(1) AS total " +
                " FROM " +
                " wlyy_specialist_patient_relation r " +
                " WHERE " +
                " r.patient " +
                " NOT IN ( " +
                " SELECT " +
                " patient " +
                " FROM " +
                " "+basedb+".wlyy_sign_patient_label_info i " +
                " WHERE " +
                " i.label_type = '5' " +
                " )";
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
            count = (Long) rstotal.get(0).get("total");
        }
        return Envelop.getSuccess(SpecialistMapping.api_success,count);
    }
//    public Envelop<PatientRelationVO>
}

+ 2 - 0
svr/svr-wlyy-specialist/src/main/resources/application.yml

@ -64,6 +64,8 @@ fast-dfs:
    max-size: 20
    wait-time: 500
basedb: #base数据基础数据数据源,用于跨库查询
  name: wlyy
---
spring:
  profiles: jwdev

+ 2 - 2
svr/svr-wlyy/pom.xml

@ -6,13 +6,13 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-wlyy</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>

+ 40 - 42
web-gateway/pom.xml

@ -6,25 +6,24 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <version>1.0.2</version>
        <relativePath>../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>web-gateway</artifactId>
    <version>1.0.0</version>
    <version>${parent.version}</version>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>admin-client-starter</artifactId>
            <version>1.1.0</version>
            <version>${version.yihu.admin}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-fegin</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
@ -34,19 +33,43 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-elasticsearch</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.yihu.base</groupId>
                    <artifactId>common-data-es</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-elasticsearch</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-swagger</artifactId>
        </dependency>
        <dependency>
        <groupId>com.yihu</groupId>
        <artifactId>common-security-starter</artifactId>
        <version>1.0.7</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-security-starter</artifactId>
            <version>1.0.7</version>
            <artifactId>common-router-starter</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
@ -86,24 +109,10 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <!--  <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-actuator</artifactId>
          </dependency>-->
        <!--<dependency>-->
        <!--<groupId>org.springframework.boot</groupId>-->
        <!--<artifactId>spring-boot-starter-security</artifactId>-->
        <!--</dependency>-->
        <!--   <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-data-redis</artifactId>
           </dependency>-->
        <!--  <dependency>
              <groupId>org.springframework.cloud</groupId>
              <artifactId>spring-cloud-starter-oauth2</artifactId>
          </dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
@ -131,6 +140,10 @@
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-ribbon</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
@ -151,11 +164,6 @@
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <!--    <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-core</artifactId>
                <version>RELEASE</version>
            </dependency>-->
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
@ -170,18 +178,8 @@
            <version>3.0.9</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-elasticsearch</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.yihu.base</groupId>
                    <artifactId>common-data-es</artifactId>
                </exclusion>
            </exclusions>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 16 - 3
web-gateway/src/main/java/com/yihu/jw/WebGateWayAppliaction.java

@ -1,7 +1,13 @@
package com.yihu.jw;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
@ -13,9 +19,7 @@ import org.springframework.context.annotation.ComponentScan;
/**
 * Created by chenweida on 2017/5/10.
 */
@SpringBootApplication(
        exclude = {DataSourceAutoConfiguration.class,
                HibernateJpaAutoConfiguration.class})
@SpringBootApplication
//@SpringBootApplication
@EnableDiscoveryClient//服务注册到发现服务
@EnableHystrix //启动断路器
@ -25,6 +29,15 @@ import org.springframework.context.annotation.ComponentScan;
) //声名式的客户端
@EnableCircuitBreaker
@ComponentScan(basePackages = {"com"})
@EnableAutoConfiguration(exclude = {
        DataSourceAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class,
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class,
        RedisRepositoriesAutoConfiguration.class,
        JestAutoConfiguration.class
})
public class WebGateWayAppliaction {
    public static void main(String[] args) {

+ 32 - 0
web-gateway/src/main/java/com/yihu/jw/config/SwaggerConfig.java

@ -16,6 +16,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
@ComponentScan("com.yihu.jw.controller.**")
@ -143,4 +146,33 @@ public class SwaggerConfig {
        return apiInfo;
    }
    @Bean
    public Docket allAPL() {
        List<Parameter> pars = addToken();
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("all")
                .useDefaultResponseMessages(false)
                .apiInfo(wlyyApiInfo())
                .select()
                .apis(RequestHandlerSelectors.any()) // 对所有api进行监控
                .paths(or(
                        regex("/.*")
                ))
                .paths(PathSelectors.any())
                .build().globalOperationParameters(pars);
    }
    private ApiInfo appApiInfo() {
        ApiInfo apiInfo = new ApiInfo("基卫2.0API",
                "基卫2.0API,提供基础卫生相关服务。",
                "1.0",
                "No terms of service",
                "wenfujian@jkzl.com",
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return apiInfo;
    }
}

+ 10 - 0
web-gateway/src/main/java/com/yihu/jw/config/mvc/MvcConfig.java

@ -1,7 +1,11 @@
package com.yihu.jw.config.mvc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
@ -28,4 +32,10 @@ public class MvcConfig extends WebMvcConfigurationSupport {
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
    @Bean
    @LoadBalanced
    // 添加负载均衡支持,很简单,只需要在RestTemplate上添加@LoadBalanced注解,那么RestTemplate即具有负载均衡的功能,如果不加@LoadBalanced注解的话,会报java.net.UnknownHostException:springboot-h2异常,此时无法通过注册到Eureka Server上的服务名来调用服务,因为RestTemplate是无法从服务名映射到ip:port的,映射的功能是由LoadBalancerClient来实现的。
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}

+ 2 - 6
web-gateway/src/main/java/com/yihu/jw/controller/DemoController.java

@ -35,7 +35,6 @@ public class DemoController {
    private String aaaa;
    @GetMapping("/hello")
    @ResponseBody
    public Envelop hello1(@RequestParam(name = "id") Integer id,
                          @RequestParam(name = "name") String name,
                          HttpServletRequest request
@ -60,14 +59,11 @@ public class DemoController {
    }
    @GetMapping("/hello2")
    @ResponseBody
    public String hello2(String id) throws Exception {
        System.out.println("haha2.........");
        return "hello2";
    public Envelop hello2(String id) throws Exception {
        return Envelop.getSuccess("hahaha");
    }
    @GetMapping("/refresh")
    @ResponseBody
    public String refresh(HttpServletRequest request) throws Exception {
        return aaaa;
    }

+ 6 - 4
web-gateway/src/main/java/com/yihu/jw/controller/base/login/LoginContorller.java

@ -59,6 +59,10 @@ public class LoginContorller {
    private EmployFeign employFeign;
    @Value("${server.web-gateway-port}")
    private String port;
    @Autowired
    private RestTemplate restTemplate ;
    @Value("${spring.application.name}")
    private String appName;
    @PostMapping(value = BaseLoginRequestMapping.BaseLoginAccount.api_checkoutInfo, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "注册校验信息", notes = "注册校验姓名、身份证、医保卡号信息")
@ -155,15 +159,13 @@ public class LoginContorller {
            params.add("password", MD5.GetMD5Code(password+employMap.get("salt")));
            //设置http请求实体
            HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(params, headers);
            RestTemplate restTemplate = new RestTemplate();
            token = restTemplate.postForObject("http://localhost:"+port+"/authentication/form", requestEntity, String.class);
            token = restTemplate.postForObject("http://"+appName.toUpperCase()+"/authentication/form", requestEntity, String.class);
        }else{
            params.add("mobile", mobilePhone+","+saasId);
            params.add("sms", captcha);
            //设置http请求实体
            HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(params, headers);
            RestTemplate restTemplate = new RestTemplate();
            token = restTemplate.postForObject("http://localhost:"+port+"/authentication/mobile", requestEntity, String.class);
            token = restTemplate.postForObject("http://"+appName.toUpperCase()+"/authentication/mobile", requestEntity, String.class);
        }
        if(!StringUtils.isEmpty(token)){

+ 1 - 1
web-gateway/src/main/java/com/yihu/jw/controller/iot/device/IotPatientDeviceController.java

@ -6,11 +6,11 @@ import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import iot.device.LocationDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

+ 10 - 2
web-gateway/src/main/resources/application.yml

@ -28,7 +28,7 @@ spring:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    database: 0
    database: 10
##开启feign断路器
feign:
@ -85,7 +85,15 @@ ribbon:
yihu:
  admin:
    client:
      advice:
        sql: false
        http: true
        zuul:
          pre: true
          post: true
---