Browse Source

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

LiTaohong 6 years ago
parent
commit
3de17306dd
100 changed files with 640 additions and 884 deletions
  1. 3 1
      .gitignore
  2. 52 147
      app/app-iot-server/pom.xml
  3. 21 0
      app/app-iot-server/src/main/java/com/yihu/AppIotServer.java
  4. 0 35
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/AppIotServer.java
  5. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/SwaggerConfig.java
  6. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/AuthorityKey.java
  7. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/Constants.java
  8. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/ServiceApi.java
  9. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/BaseController.java
  10. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/controller/common/ErrorController.java
  11. 40 40
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/FileUploadController.java
  12. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/IndexController.java
  13. 4 4
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/IotSystemDictController.java
  14. 5 5
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/LoginController.java
  15. 33 33
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/company/IotCompanyController.java
  16. 37 37
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/device/IotDeviceController.java
  17. 24 24
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/device/IotDeviceOrderController.java
  18. 18 18
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/device/IotDeviceQualityController.java
  19. 26 26
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/product/IotProductController.java
  20. 6 6
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/third/wlyy/MonitoringHealthPlatformController.java
  21. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/AccessToken.java
  22. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ListResult.java
  23. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/model/MenuResult.java
  24. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/model/ObjectResult.java
  25. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/Result.java
  26. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ehr/MRsMetadata.java
  27. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ehr/MStdDataSet.java
  28. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/model/user/UserModel.java
  29. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/config/EhrWebHttpSessionConfiguration.java
  30. 3 3
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/config/EhrWebSecurityConfiguration.java
  31. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAccessDecisionManager.java
  32. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationFailureHandler.java
  33. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationProvider.java
  34. 1 3
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationSuccessHandler.java
  35. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationToken.java
  36. 1 16
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebContextLogoutHandler.java
  37. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebUserDetails.java
  38. 3 6
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebUserDetailsService.java
  39. 3 3
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebUsernamePasswordAuthenticationFilter.java
  40. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/entryPoint/LoginEntryPoint.java
  41. 10 10
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/BaseService.java
  42. 2 2
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/FileUploadService.java
  43. 7 7
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/LoginService.java
  44. 11 11
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/SystemDictService.java
  45. 38 38
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/company/CompanyService.java
  46. 26 26
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/device/DeviceOrderService.java
  47. 41 41
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/device/DeviceService.java
  48. 20 20
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/device/IotDeviceQualityService.java
  49. 25 25
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/product/ProductService.java
  50. 14 14
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/third/wlyy/MonitoringHealthService.java
  51. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/ControllerTools.java
  52. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/CurrentRequest.java
  53. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/ObjectMapperUtil.java
  54. 4 4
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/AES.java
  55. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/Base64.java
  56. 3 3
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/DES.java
  57. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/HexEncode.java
  58. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/RSA.java
  59. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/excel/AExcelReader.java
  60. 2 2
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/excel/reader/IotDeviceImportVOReader.java
  61. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/file/FileUtil.java
  62. 3 3
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpClientUtil.java
  63. 2 2
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpHelper.java
  64. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/http/HttpResponse.java
  65. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpUtil.java
  66. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/operator/CollectionUtil.java
  67. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/DateUtil.java
  68. 2 2
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/operator/MD5.java
  69. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/StringUtil.java
  70. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/util/spring/SpringContextHolder.java
  71. 10 9
      app/app-iot-server/src/main/resources/application.yml
  72. 0 0
      app/app-iot-server/src/main/resources/logback.xml.bak
  73. 41 136
      app/public-health-server/pom.xml
  74. 20 0
      app/public-health-server/src/main/java/com/yihu/AppHealthServer.java
  75. 0 34
      app/public-health-server/src/main/java/com/yihu/ehr/health/AppHealthServer.java
  76. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/config/SwaggerConfig.java
  77. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/constant/Constants.java
  78. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/constant/ServiceApi.java
  79. 17 21
      app/public-health-server/src/main/java/com/yihu/ehr/health/controller/archives/ArchivesController.java
  80. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/controller/common/BaseController.java
  81. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/ErrorController.java
  82. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/controller/common/IndexController.java
  83. 3 4
      app/public-health-server/src/main/java/com/yihu/ehr/health/controller/dictionary/SystemDictController.java
  84. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/model/AccessToken.java
  85. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/model/ListResult.java
  86. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/MenuResult.java
  87. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ObjectResult.java
  88. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/model/Result.java
  89. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/user/UserModel.java
  90. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/config/EhrWebHttpSessionConfiguration.java
  91. 0 0
      app/public-health-server/src/main/java/com/yihu/health/security/config/EhrWebSecurityConfiguration.java
  92. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAccessDecisionManager.java
  93. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationFailureHandler.java
  94. 1 5
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationProvider.java
  95. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationSuccessHandler.java
  96. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationToken.java
  97. 1 1
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebContextLogoutHandler.java
  98. 1 1
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebUserDetails.java
  99. 3 3
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebUserDetailsService.java
  100. 0 0
      app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebUsernamePasswordAuthenticationFilter.java

+ 3 - 1
.gitignore

@ -8,8 +8,8 @@
*.pyc
*.pyo
.idea/
data/*
.idea_modules/
build/*.jar
.settings
.cache
.generated-mima*
@ -78,3 +78,5 @@ sql/hive-thriftserver/test_warehouses
# For R session data
.RHistory
.RData
build/
docs/

+ 52 - 147
app/app-iot-server/pom.xml

@ -4,9 +4,9 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
        <artifactId>wlyy-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.ehr.iot</groupId>
@ -14,53 +14,36 @@
    <packaging>war</packaging>
    <version>${parent.version}</version>
    <!-- 依赖包 -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>log4j-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>us.codecraft</groupId>
            <artifactId>webmagic-core</artifactId>
            <version>0.4.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>us.codecraft</groupId>
            <artifactId>webmagic-extension</artifactId>
            <version>0.4.2</version>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>1.3.3</version>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <!-- 使用intellij作为集成开发环境 -->
        <!--<dependency>-->
        <!--<groupId>org.springframework.session</groupId>-->
        <!--<artifactId>spring-session-data-redis</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
@ -71,185 +54,108 @@
            <artifactId>jstl</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!--<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-extras</artifactId>
            <version>3.0.5</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.4.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>classmate</artifactId>
                    <groupId>com.fasterxml</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.0</version>
        </dependency>
        <dependency>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.sun.jna</groupId>
            <artifactId>jna</artifactId>
            <version>3.0.9</version>
            <groupId>io.searchbox</groupId>
            <artifactId>jest</artifactId>
            <version>2.4.0</version>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.springframework.session</groupId>-->
            <!--<artifactId>spring-session-data-redis</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>net.lingala.zip4j</groupId>
            <artifactId>zip4j</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20151123</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jna</groupId>
            <artifactId>jna</artifactId>
            <version>3.0.9</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-admin-gateway-model</artifactId>
            <version>1.1.0</version>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-util</artifactId>
            <version>1.1.0</version>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>log4j-core</artifactId>
                    <groupId>org.apache.logging.log4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j-api</artifactId>
                    <groupId>org.apache.logging.log4j</groupId>
                    <groupId>org.slf4j</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model-es</artifactId>
        </dependency>
        <!-- ehr -->
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-rest-model</artifactId>
            <artifactId>commons-admin-gateway-model</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-util</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-rest-model</artifactId>
            <version>1.1.0</version>
        </dependency>
        <!-- jkzl starter -->
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-data-fastdfs</artifactId>
            <version>1.0.0</version>
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model-es</artifactId>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
        </dependency>
    </dependencies>
@ -268,7 +174,6 @@
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <!--打包的时候把resources下的资源移到classpath下-->

+ 21 - 0
app/app-iot-server/src/main/java/com/yihu/AppIotServer.java

@ -0,0 +1,21 @@
package com.yihu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
@SpringBootApplication
public class AppIotServer extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(AppIotServer.class);
        app.run(args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AppIotServer.class);
    }
}

+ 0 - 35
app/app-iot-server/src/main/java/com/yihu/ehr/iot/AppIotServer.java

@ -1,35 +0,0 @@
package com.yihu.ehr.iot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@EnableAutoConfiguration(exclude = {
        SecurityAutoConfiguration.class,
        ManagementWebSecurityAutoConfiguration.class,
        DataSourceAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class,
        DataSourceTransactionManagerAutoConfiguration.class})
@ComponentScan(basePackages={"com.yihu.base","com.yihu.ehr.iot"})
//@EnableRedisHttpSession
public class AppIotServer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AppIotServer.class);
    }
	public static void main(String[] args) {
        SpringApplication app = new SpringApplication(AppIotServer.class);
        app.run(args);
	}
}

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/SwaggerConfig.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.config;
package com.yihu.iot.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/AuthorityKey.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.constant;
package com.yihu.iot.constant;
/**
 * Created by janseny on 2017/9/30.

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/Constants.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.constant;
package com.yihu.iot.constant;
/**
 * Created by lingfeng on 2015/6/23.

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/ServiceApi.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.constant;
package com.yihu.iot.constant;
/**
 * @author yeshijie on 2018/1/22.

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/BaseController.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.controller.common;
package com.yihu.iot.controller.common;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.util.rest.Envelop;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/controller/common/ErrorController.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.controller.common;
package com.yihu.iot.controller.common;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

+ 40 - 40
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/FileUploadController.java

@ -1,9 +1,9 @@
package com.yihu.ehr.iot.controller.common;
package com.yihu.iot.controller.common;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.base.fastdfs.FastDFSHelper;
import com.yihu.ehr.iot.service.common.FileUploadService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.iot.service.common.FileUploadService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
@ -31,7 +31,7 @@ import java.util.Map;
public class FileUploadController extends BaseController {
    @Autowired
    private FastDFSHelper fastDFSHelper;
    private FastDFSUtil fastDFSHelper;
    @Value("${fast-dfs.public-server}")
    private String fastdfs_file_url;
    @Autowired
@ -41,24 +41,24 @@ public class FileUploadController extends BaseController {
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_stream_img)
    @ApiOperation(value = "文件流上传图片", notes = "文件流上传图片")
    public Envelop<UploadVO> uploadImg(@ApiParam(value = "文件", required = true)
    public MixEnvelop<UploadVO, UploadVO> uploadImg(@ApiParam(value = "文件", required = true)
                                       @RequestParam(value = "file", required = true) MultipartFile file){
        try {
            // 得到文件的完整名称  xxx.txt
            String fullName = file.getOriginalFilename();
            if(StringUtils.isBlank(fullName)){
                return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            //得到文件类型
            String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
            if(StringUtils.isBlank(fileType)||!"jpg,jpeg,png".contains(fileType)){
                return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            long size = file.getSize();
            long max = 5*1024*1024;
            if(size>max){
                return Envelop.getError("文件大小不超过5M",IotRequestMapping.api_iot_fail);
                return MixEnvelop.getError("文件大小不超过5M",IotRequestMapping.api_iot_fail);
            }
            String fileName = fullName.substring(0, fullName.lastIndexOf("."));
@ -71,42 +71,42 @@ public class FileUploadController extends BaseController {
                uploadVO = new UploadVO();
                uploadVO.setFileName(fileName);
                uploadVO.setFileType(fileType);
                uploadVO.setFullUri(objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
                if(uploadVO==null){
                    return Envelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            return Envelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_stream_attachment)
    @ApiOperation(value = "文件流上传附件", notes = "文件流上传附件")
    public Envelop<UploadVO> uploadAttachment(@ApiParam(value = "文件", required = true)
    public MixEnvelop<UploadVO, UploadVO> uploadAttachment(@ApiParam(value = "文件", required = true)
                                              @RequestParam(value = "file", required = true) MultipartFile file){
        try {
            // 得到文件的完整名称  xxx.txt
            String fullName = file.getOriginalFilename();
            if(StringUtils.isBlank(fullName)){
                return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            //得到文件类型
            String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
            if(StringUtils.isBlank(fileType)||!"doc、docx、pdf、xls、xlsx、jpg、jpeg、png".contains(fileType)){
                return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            long size = file.getSize();
            long max = 5*1024*1024;
            if(size>max){
                return Envelop.getError("文件大小不超过5M",IotRequestMapping.api_iot_fail);
                return MixEnvelop.getError("文件大小不超过5M",IotRequestMapping.api_iot_fail);
            }
            String fileName = fullName.substring(0, fullName.lastIndexOf("."));
@ -119,25 +119,25 @@ public class FileUploadController extends BaseController {
                uploadVO = new UploadVO();
                uploadVO.setFileName(fileName);
                uploadVO.setFileType(fileType);
                uploadVO.setFullUri(objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
                if(uploadVO==null){
                    return Envelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            return Envelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_stream)
    @ApiOperation(value = "文件流上传文件", notes = "文件流上传文件")
    public Envelop<UploadVO> uploadStream(@ApiParam(value = "文件", required = true) @RequestParam(value = "file", required = true) MultipartFile file) {
    public MixEnvelop<UploadVO, UploadVO> uploadStream(@ApiParam(value = "文件", required = true) @RequestParam(value = "file", required = true) MultipartFile file) {
        try {
            // 得到文件的完整名称  xxx.txt
            String fullName = file.getOriginalFilename();
@ -153,25 +153,25 @@ public class FileUploadController extends BaseController {
                uploadVO = new UploadVO();
                uploadVO.setFileName(fileName);
                uploadVO.setFileType(fileType);
                uploadVO.setFullUri(objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
                if(uploadVO==null){
                    return Envelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            return Envelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_string)
    @ApiOperation(value = "base64上传图片",notes = "base64上传图片")
    public Envelop<UploadVO> uploadImages(@ApiParam(name = "jsonData", value = "头像转化后的输入流") @RequestBody String jsonData) throws Exception {
    public MixEnvelop<UploadVO, UploadVO> uploadImages(@ApiParam(name = "jsonData", value = "头像转化后的输入流") @RequestBody String jsonData) throws Exception {
        try {
            String date = URLDecoder.decode(jsonData,"UTF-8");
@ -192,27 +192,27 @@ public class FileUploadController extends BaseController {
                uploadVO = new UploadVO();
                uploadVO.setFileName(remoteFileName);
                uploadVO.setFileType(groupName);
                uploadVO.setFullUri(objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fid").toString().replaceAll("\"", ""));
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,inputStream,"");
                if(uploadVO ==null){
                    return Envelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            //返回文件路径
            return Envelop.getSuccess(IotRequestMapping.FileUpload.message_success_upload, uploadVO);
            return MixEnvelop.getSuccess(IotRequestMapping.FileUpload.message_success_upload, uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @RequestMapping(value = "commonUpload", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("公共的文件上传")
    public Envelop<UploadVO> commonUpload(HttpServletRequest request) {
    public MixEnvelop<UploadVO, UploadVO> commonUpload(HttpServletRequest request) {
        InputStream in = null;
        try {
            String paths = request.getParameter("filePaths");
@ -245,12 +245,12 @@ public class FileUploadController extends BaseController {
            }
            //解析返回的objectNode
            UploadVO uploadVO = new UploadVO();
            uploadVO.setFullUri(result.get("fid").toString().replaceAll("\"", ""));
            uploadVO.setFullUrl(fastdfs_file_url + result.get("fid").toString().replaceAll("\"", ""));
            return Envelop.getSuccess(IotRequestMapping.FileUpload.message_success_upload, result);
            uploadVO.setFullUri(result.get("fileId").toString().replaceAll("\"", ""));
            uploadVO.setFullUrl(fastdfs_file_url + result.get("fileId").toString().replaceAll("\"", ""));
            return MixEnvelop.getSuccess(IotRequestMapping.FileUpload.message_success_upload, result);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }finally {
            if(in!=null){
                try {

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/IndexController.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.controller.common;
package com.yihu.iot.controller.common;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

+ 4 - 4
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/IotSystemDictController.java

@ -1,7 +1,7 @@
package com.yihu.ehr.iot.controller.common;
package com.yihu.iot.controller.common;
import com.yihu.ehr.iot.service.common.SystemDictService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.iot.service.common.SystemDictService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
@ -26,7 +26,7 @@ public class IotSystemDictController  extends BaseController{
    @GetMapping(value = IotRequestMapping.System.findDictByCode)
    @ApiOperation(value = "获取字典列表(不分页)")
    public Envelop<IotSystemDictVO> getList(
    public MixEnvelop<IotSystemDictVO, IotSystemDictVO> getList(
            @ApiParam(name = "dictName", value = "字典名称", defaultValue = "COMPANY_TYPE")
            @RequestParam(value = "dictName", required = true) String dictName) throws Exception {
        return systemDictService.getList(dictName);

+ 5 - 5
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/LoginController.java

@ -1,7 +1,7 @@
package com.yihu.ehr.iot.controller.common;
package com.yihu.iot.controller.common;
import com.yihu.ehr.iot.model.Result;
import com.yihu.ehr.iot.service.common.LoginService;
import com.yihu.iot.model.Result;
import com.yihu.iot.service.common.LoginService;
import com.yihu.ehr.util.rest.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -51,9 +51,9 @@ public class LoginController extends BaseController{
    @ResponseBody
    @ApiOperation(value = "登录验证")
    public Result login(HttpServletRequest request,
            @ApiParam(name = "userName", value = "登录账号")
                        @ApiParam(name = "userName", value = "登录账号")
            @RequestParam(value = "userName") String userName,
            @ApiParam(name = "password", value = "密码")
                        @ApiParam(name = "password", value = "密码")
            @RequestParam(value = "password") String password) {
            return loginService.login(request, userName, password);
    }

+ 33 - 33
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/company/IotCompanyController.java

@ -1,8 +1,8 @@
package com.yihu.ehr.iot.controller.company;
package com.yihu.iot.controller.company;
import com.yihu.ehr.iot.controller.common.BaseController;
import com.yihu.ehr.iot.service.company.CompanyService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.iot.controller.common.BaseController;
import com.yihu.iot.service.company.CompanyService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.company.IotCompanyCertificateVO;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -25,87 +25,87 @@ public class IotCompanyController extends BaseController {
    @GetMapping(value = IotRequestMapping.Company.findCompanyPage)
    @ApiOperation(value = "分页查找企业", notes = "分页查找企业")
    public Envelop<IotCompanyVO> findCompanyPage(@ApiParam(name = "name", value = "供应商名称或联系人姓名", defaultValue = "")
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findCompanyPage(@ApiParam(name = "name", value = "供应商名称或联系人姓名", defaultValue = "")
                                                 @RequestParam(value = "name", required = false) String name,
                                                 @ApiParam(name = "status", value = "审核状态", defaultValue = "")
                                                    @ApiParam(name = "status", value = "审核状态", defaultValue = "")
                                                 @RequestParam(value = "status", required = false) String status,
                                                 @ApiParam(name = "type", value = "企业类型", defaultValue = "")
                                                    @ApiParam(name = "type", value = "企业类型", defaultValue = "")
                                                 @RequestParam(value = "type", required = false) String type,
                                                 @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                    @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                 @RequestParam(value = "page", required = false) Integer page,
                                                 @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                    @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                 @RequestParam(value = "size", required = false) Integer size){
        try {
            return companyService.findCompanyPage(name,status,type,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.addCompany)
    @ApiOperation(value = "创建企业", notes = "创建企业")
    public Envelop<IotCompanyVO> addCompany(@ApiParam(name = "jsonData", value = "json串", defaultValue = "")
    public MixEnvelop<IotCompanyVO, IotCompanyVO> addCompany(@ApiParam(name = "jsonData", value = "json串", defaultValue = "")
                                            @RequestParam(value = "jsonData", required = true)String jsonData) {
        try {
            return companyService.addCompany(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findCompanyById)
    @ApiOperation(value = "根据id查找企业", notes = "根据id查找企业")
    public Envelop<IotCompanyVO> findByCode(@ApiParam(name = "id", value = "企业id")
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findByCode(@ApiParam(name = "id", value = "企业id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return companyService.findByCode(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findByBusinessLicense)
    @ApiOperation(value = "根据营业执照号查找企业", notes = "根据营业执照号查找企业")
    public Envelop<IotCompanyVO> findByBusinessLicense(@ApiParam(name = "businessLicense", value = "营业执照号")
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findByBusinessLicense(@ApiParam(name = "businessLicense", value = "营业执照号")
                                                       @RequestParam(value = "businessLicense", required = true) String businessLicense) {
        try {
            return companyService.findByBusinessLicense(businessLicense);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.delCompany)
    @ApiOperation(value = "删除企业", notes = "删除企业")
    public Envelop<IotCompanyVO> delCompany(@ApiParam(name = "id", value = "企业id")
    public MixEnvelop<IotCompanyVO, IotCompanyVO> delCompany(@ApiParam(name = "id", value = "企业id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return companyService.delCompany(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.updCompany)
    @ApiOperation(value = "修改企业信息", notes = "修改企业信息")
    public Envelop<IotCompanyVO> updCompany(@ApiParam(name = "jsonData", value = "json串", defaultValue = "")
    public MixEnvelop<IotCompanyVO, IotCompanyVO> updCompany(@ApiParam(name = "jsonData", value = "json串", defaultValue = "")
                                            @RequestParam(value = "jsonData", required = true)String jsonData) {
        try {
            return companyService.updCompany(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findCompanyCertPage)
    @ApiOperation(value = "分页获取企业证书", notes = "分页获取企业证书")
    public Envelop<IotCompanyCertificateVO> findCompanyCertPage
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> findCompanyCertPage
            (@ApiParam(name = "name", value = "证书名称", defaultValue = "")
             @RequestParam(value = "name", required = false) String name,
             @ApiParam(name = "companyId", value = "企业id", defaultValue = "")
@ -124,69 +124,69 @@ public class IotCompanyController extends BaseController {
            return companyService.findCompanyCertPage(name,page,size,companyId);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findCompanyCertById)
    @ApiOperation(value = "根据id查找企业证书", notes = "根据id查找企业证书")
    public Envelop<IotCompanyCertificateVO> findCompanyCertById(@ApiParam(name = "id", value = "企业证书id")
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> findCompanyCertById(@ApiParam(name = "id", value = "企业证书id")
                                                                @RequestParam(value = "id", required = true) String id) {
        try {
            return companyService.findCompanyCertById(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findCompanyCertByCompanyId)
    @ApiOperation(value = "根据企业id查找企业证书", notes = "根据企业id查找企业证书")
    public Envelop<IotCompanyCertificateVO> findCompanyCertByCompanyId(@ApiParam(name = "companyId", value = "企业id")
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> findCompanyCertByCompanyId(@ApiParam(name = "companyId", value = "企业id")
                                                                       @RequestParam(value = "companyId", required = true) String companyId) {
        try {
            return companyService.findCompanyCertByCompanyId(companyId);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.addCompanyCert)
    @ApiOperation(value = "创建企业证书", notes = "创建企业证书")
    public Envelop<IotCompanyCertificateVO> addCompanyCert(@ApiParam(name = "jsonData", value = "json串", defaultValue = "")
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> addCompanyCert(@ApiParam(name = "jsonData", value = "json串", defaultValue = "")
                                                           @RequestParam(value = "jsonData", required = true)String jsonData) {
        try {
            return companyService.addCompanyCert(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.changePassWord)
    @ApiOperation(value = "修改用户密码", notes = "修改用户密码")
    public Envelop changePassWord(@ApiParam(name = "userId", value = "用户id", defaultValue = "")
    public MixEnvelop changePassWord(@ApiParam(name = "userId", value = "用户id", defaultValue = "")
                                  @RequestParam(value = "userId", required = true)String userId,
                                  @ApiParam(name = "passWord", value = "密码", defaultValue = "")
                                     @ApiParam(name = "passWord", value = "密码", defaultValue = "")
                                  @RequestParam(value = "passWord", required = true)String passWord){
        try {
            return companyService.changePassWord(userId,passWord);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.delCompanyCert)
    @ApiOperation(value = "删除企业证书", notes = "删除企业证书")
    public Envelop<IotCompanyCertificateVO> delCompanyCert(@ApiParam(name = "id", value = "id", defaultValue = "")
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> delCompanyCert(@ApiParam(name = "id", value = "id", defaultValue = "")
                                                           @RequestParam(value = "id", required = true)String id) {
        try {
            return companyService.delCompanyCert(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

+ 37 - 37
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/device/IotDeviceController.java

@ -1,9 +1,9 @@
package com.yihu.ehr.iot.controller.device;
package com.yihu.iot.controller.device;
import com.yihu.ehr.iot.controller.common.BaseController;
import com.yihu.ehr.iot.service.device.DeviceService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.base.BaseEnvelop;
import com.yihu.iot.controller.common.BaseController;
import com.yihu.iot.service.device.DeviceService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.iot.common.ExistVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportRecordVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
@ -28,107 +28,107 @@ public class IotDeviceController extends BaseController{
    @PostMapping(value = IotRequestMapping.Device.api_create)
    @ApiOperation(value = "创建设备", notes = "创建设备")
    public Envelop<IotDeviceVO> create(@ApiParam(name = "json_data", value = "", defaultValue = "")
    public MixEnvelop<IotDeviceVO, IotDeviceVO> create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestParam String jsonData) {
        try {
            return deviceService.create(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Device.api_getById)
    @ApiOperation(value = "根据code查找设备", notes = "根据code查找设备")
    public Envelop<IotDeviceVO> findByCode(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findByCode(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id ) {
        try {
            return deviceService.findByCode(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Device.isSnExist)
    @ApiOperation(value = "sn码是否存在", notes = "sn码是否存在")
    public Envelop<ExistVO> isSnExist(@ApiParam(name = "sn", value = "sn")
    public MixEnvelop<ExistVO, ExistVO> isSnExist(@ApiParam(name = "sn", value = "sn")
                                      @RequestParam(value = "sn", required = true) String sn) {
        try {
            return deviceService.isSnExist(sn);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Device.isSimExist)
    @ApiOperation(value = "sim卡号是否存在", notes = "sim卡号是否存在")
    public Envelop<ExistVO> isSimExist(@ApiParam(name = "sim", value = "sim")
    public MixEnvelop<ExistVO, ExistVO> isSimExist(@ApiParam(name = "sim", value = "sim")
                                           @RequestParam(value = "sim", required = true) String sim) {
        try {
            return deviceService.isSimExist(sim);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Device.api_delete)
    @ApiOperation(value = "删除设备", notes = "删除设备")
    public Envelop<IotDeviceVO> delDevice(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotDeviceVO, IotDeviceVO> delDevice(@ApiParam(name = "id", value = "id")
                                          @RequestParam(value = "id", required = true) String id
    ) {
        try {
            return deviceService.delDevice(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Device.api_update)
    @ApiOperation(value = "修改设备", notes = "修改设备")
    public BaseEnvelop updDevice(@ApiParam(name = "jsonData", value = "", defaultValue = "")
    public Envelop updDevice(@ApiParam(name = "jsonData", value = "", defaultValue = "")
                                 @RequestParam String jsonData) {
        try {
            return deviceService.updDevice(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseEnvelop.getError(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Device.updSim)
    @ApiOperation(value = "修改sim卡号", notes = "修改sim卡号")
    public BaseEnvelop updSim(@ApiParam(name = "sim", value = "sim")
    public Envelop updSim(@ApiParam(name = "sim", value = "sim")
                              @RequestParam(value = "sim", required = true) String sim,
                              @ApiParam(name = "id", value = "设备id")
                          @ApiParam(name = "id", value = "设备id")
                              @RequestParam(value = "id", required = true) String id) {
        try {
            return deviceService.updSim(sim,id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Device.api_queryPage)
    @ApiOperation(value = "分页查找设备", notes = "分页查找设备")
    public Envelop<IotDeviceVO> findProductPageByCompanyId(@ApiParam(name = "sn", value = "SN码或SIM卡号", defaultValue = "")
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findProductPageByCompanyId(@ApiParam(name = "sn", value = "SN码或SIM卡号", defaultValue = "")
                                                           @RequestParam(value = "sn", required = false) String sn,
                                                           @ApiParam(name = "hospital", value = "社区医院", defaultValue = "")
                                                              @ApiParam(name = "hospital", value = "社区医院", defaultValue = "")
                                                           @RequestParam(value = "hospital", required = false) String hospital,
                                                           @ApiParam(name = "orderId", value = "订单id", defaultValue = "")
                                                              @ApiParam(name = "orderId", value = "订单id", defaultValue = "")
                                                           @RequestParam(value = "orderId", required = false) String orderId,
                                                           @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                                              @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                                           @RequestParam(value = "purcharseId", required = false) String purcharseId,
                                                           @ApiParam(name = "isBinding", value = "是否绑定(1已绑定,2未绑定)", defaultValue = "")
                                                              @ApiParam(name = "isBinding", value = "是否绑定(1已绑定,2未绑定)", defaultValue = "")
                                                           @RequestParam(value = "isBinding", required = false) Integer isBinding,
                                                           @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                              @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                           @RequestParam(value = "page", required = false) Integer page,
                                                           @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                              @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                           @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
@ -140,44 +140,44 @@ public class IotDeviceController extends BaseController{
            return deviceService.findProductPageByCompanyId(sn,hospital,orderId,purcharseId,isBinding,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Device.isImportDevice)
    @ApiOperation(value = "是否正在导入设备数据", notes = "是否正在导入设备数据")
    public Envelop<ExistVO> isImportDevice(@ApiParam(name = "purcharseId", value = "purcharseId")
    public MixEnvelop<ExistVO, ExistVO> isImportDevice(@ApiParam(name = "purcharseId", value = "purcharseId")
                                           @RequestParam(value = "purcharseId", required = true) String purcharseId
    ) {
        try {
            return deviceService.isImportDevice(purcharseId);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.Device.importDevice)
    @ApiOperation(value = "设备导入", notes = "设备导入")
    public Envelop<IotDeviceImportRecordVO> uploadStream(@ApiParam(value = "文件", required = true)
    public MixEnvelop<IotDeviceImportRecordVO, IotDeviceImportRecordVO> uploadStream(@ApiParam(value = "文件", required = true)
                                          @RequestParam(value = "file", required = true) MultipartFile file,
                                          @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                                            @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                          @RequestParam(value = "purcharseId", required = true) String purcharseId) {
        try {
            return deviceService.uploadStream(file,purcharseId,request);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @GetMapping(value = IotRequestMapping.Device.queryImportRecordPage)
    @ApiOperation(value = "分页查找导入记录", notes = "分页查找导入记录")
    public Envelop<IotDeviceImportRecordVO> queryImportRecordPage(@ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
    public MixEnvelop<IotDeviceImportRecordVO, IotDeviceImportRecordVO> queryImportRecordPage(@ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                                           @RequestParam(value = "purcharseId", required = true) String purcharseId,
                                                                       @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                     @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                           @RequestParam(value = "page", required = false) Integer page,
                                                                       @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                     @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                           @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
@ -189,7 +189,7 @@ public class IotDeviceController extends BaseController{
            return queryImportRecordPage(purcharseId,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

+ 24 - 24
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/device/IotDeviceOrderController.java

@ -1,8 +1,8 @@
package com.yihu.ehr.iot.controller.device;
package com.yihu.iot.controller.device;
import com.yihu.ehr.iot.controller.common.BaseController;
import com.yihu.ehr.iot.service.device.DeviceOrderService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.iot.controller.common.BaseController;
import com.yihu.iot.service.device.DeviceOrderService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.device.IotDeviceOrderVO;
import com.yihu.jw.restmodel.iot.device.IotOrderPurchaseVO;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
@ -25,31 +25,31 @@ public class IotDeviceOrderController extends BaseController {
    @PostMapping(value = IotRequestMapping.DeviceOrder.createOrder)
    @ApiOperation(value = "创建设备订单", notes = "创建设备订单")
    public Envelop<IotOrderVO> create(@ApiParam(name = "jsonData", value = "", defaultValue = "")
    public MixEnvelop<IotOrderVO, IotOrderVO> create(@ApiParam(name = "jsonData", value = "", defaultValue = "")
                          @RequestParam String jsonData) {
        try {
            return deviceOrderService.create(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.findById)
    @ApiOperation(value = "根据id查找设备订单", notes = "根据id查找设备订单")
    public Envelop<IotDeviceOrderVO> findByCode(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> findByCode(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id) {
        try {
            return deviceOrderService.findByCode(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.findPage)
    @ApiOperation(value = "分页查找设备订单", notes = "分页查找设备订单")
    public Envelop<IotDeviceOrderVO> findPage(@ApiParam(name = "name", value = "供应商名称或负责人姓名", defaultValue = "")
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> findPage(@ApiParam(name = "name", value = "供应商名称或负责人姓名", defaultValue = "")
                                                 @RequestParam(value = "name", required = false) String name,
                                                 @ApiParam(name = "type", value = "企业类型", defaultValue = "")
                                                 @RequestParam(value = "type", required = false) String type,
@ -67,53 +67,53 @@ public class IotDeviceOrderController extends BaseController {
            return deviceOrderService.findPage(name,type,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.DeviceOrder.delOrder)
    @ApiOperation(value = "删除订单", notes = "删除订单")
    public Envelop<IotDeviceOrderVO> delOrder(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> delOrder(@ApiParam(name = "id", value = "id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return deviceOrderService.delOrder(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.DeviceOrder.delPurchase)
    @ApiOperation(value = "删除采购订单", notes = "删除采购订单")
    public Envelop<IotOrderPurchaseVO> delPurchase(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> delPurchase(@ApiParam(name = "id", value = "id")
                                                   @RequestParam(value = "id", required = true) String id) {
        try {
            return deviceOrderService.delPurchase(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.DeviceOrder.updOrder)
    @ApiOperation(value = "修改订单", notes = "修改订单")
    public Envelop<IotOrderVO> updOrder(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
    public MixEnvelop<IotOrderVO, IotOrderVO> updOrder(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
                                            @RequestParam(value = "jsonData", required = false)String jsonData) {
        try {
            return deviceOrderService.updOrder(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.findPurcharsePage)
    @ApiOperation(value = "分页查找采购清单", notes = "分页查找采购清单")
    public Envelop<IotOrderPurchaseVO> findPurcharsePage(@ApiParam(name = "orderId", value = "订单id", defaultValue = "")
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> findPurcharsePage(@ApiParam(name = "orderId", value = "订单id", defaultValue = "")
                                                     @RequestParam(value = "orderId", required = true) String orderId,
                                                         @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                            @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                     @RequestParam(value = "page", required = false) Integer page,
                                                         @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                            @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                     @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
@ -125,26 +125,26 @@ public class IotDeviceOrderController extends BaseController {
            return deviceOrderService.findPurcharsePage(orderId,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.findPurcharseById)
    @ApiOperation(value = "根据id查找采购订单", notes = "根据id查找采购订单")
    public Envelop<IotOrderPurchaseVO>  findPurcharseById(
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> findPurcharseById(
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id) {
        try {
            return deviceOrderService.findPurcharseById(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.findQualityPage)
    @ApiOperation(value = "质检管理", notes = "质检管理")
    public Envelop<IotOrderPurchaseVO> findQualityPage(
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> findQualityPage(
            @ApiParam(name = "qualityStatus", value = "质检状态", defaultValue = "")
            @RequestParam(value = "qualityStatus", required = false) String qualityStatus,
            @ApiParam(name = "orderNo", value = "订单编号", defaultValue = "")
@ -167,7 +167,7 @@ public class IotDeviceOrderController extends BaseController {
            return deviceOrderService.findQualityPage(qualityStatus, orderNo, startTime, endTime, page, size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

+ 18 - 18
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/device/IotDeviceQualityController.java

@ -1,8 +1,8 @@
package com.yihu.ehr.iot.controller.device;
package com.yihu.iot.controller.device;
import com.yihu.ehr.iot.controller.common.BaseController;
import com.yihu.ehr.iot.service.device.IotDeviceQualityService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.iot.controller.common.BaseController;
import com.yihu.iot.service.device.IotDeviceQualityService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.device.IotDeviceQualityInspectionPlanVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
@ -23,33 +23,33 @@ public class IotDeviceQualityController extends BaseController{
    @PostMapping(value = IotRequestMapping.DeviceQuality.addQualityPlan)
    @ApiOperation(value = "创建设备质检", notes = "创建设备质检")
    public Envelop<IotDeviceQualityInspectionPlanVO> create(@ApiParam(name = "jsonData", value = "", defaultValue = "")
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> create(@ApiParam(name = "jsonData", value = "", defaultValue = "")
                          @RequestParam String jsonData) {
        try {
            return iotDeviceQualityService.create(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceQuality.findById)
    @ApiOperation(value = "根据code查找设备质检", notes = "根据code查找设备质检")
    public Envelop<IotDeviceQualityInspectionPlanVO> findByCode(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> findByCode(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id
    ) {
        try {
            return iotDeviceQualityService.findByCode(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceQuality.queryQualityPlanPage)
    @ApiOperation(value = "分页获取设备质检计划", notes = "分页获取设备质检计划")
    public Envelop<IotDeviceQualityInspectionPlanVO> queryQualityPlanPage(
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> queryQualityPlanPage(
            @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
            @RequestParam(value = "purcharseId", required = false) String purcharseId,
            @ApiParam(name = "orderNo", value = "订单编号", defaultValue = "")
@ -66,47 +66,47 @@ public class IotDeviceQualityController extends BaseController{
            return iotDeviceQualityService.queryQualityPlanPage(purcharseId, orderNo, startTime, endTime, page, size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.DeviceQuality.delQualityPlan)
    @ApiOperation(value = "删除质检计划", notes = "删除质检计划")
    public Envelop<IotDeviceQualityInspectionPlanVO> delQualityPlan(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> delQualityPlan(@ApiParam(name = "id", value = "id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return iotDeviceQualityService.delQualityPlan(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.DeviceQuality.completeQualityPlan)
    @ApiOperation(value = "完成质检计划", notes = "完成质检计划")
    public Envelop<IotDeviceQualityInspectionPlanVO> completeQualityPlan(@ApiParam(name = "actualTime", value = "完成时间", defaultValue = "")
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> completeQualityPlan(@ApiParam(name = "actualTime", value = "完成时间", defaultValue = "")
                                            @RequestParam(value = "actualTime", required = true) String actualTime,
                                            @ApiParam(name = "id", value = "id")
                                                                            @ApiParam(name = "id", value = "id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return iotDeviceQualityService.completeQualityPlan(actualTime, id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.DeviceQuality.completePlanByPurchaseId)
    @ApiOperation(value = "完成质检计划(按采购id)", notes = "完成质检计划(按采购id)")
    public Envelop<IotDeviceQualityInspectionPlanVO> completePlanByPurchaseId(@ApiParam(name = "actualTime", value = "完成时间", defaultValue = "")
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> completePlanByPurchaseId(@ApiParam(name = "actualTime", value = "完成时间", defaultValue = "")
                                                                              @RequestParam(value = "actualTime", required = true) String actualTime,
                                                                              @ApiParam(name = "purchaseId", value = "purchaseId")
                                                                                 @ApiParam(name = "purchaseId", value = "purchaseId")
                                                                              @RequestParam(value = "purchaseId", required = true) String purchaseId) {
        try {
            return iotDeviceQualityService.completePlanByPurchaseId(actualTime, purchaseId);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

+ 26 - 26
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/product/IotProductController.java

@ -1,9 +1,9 @@
package com.yihu.ehr.iot.controller.product;
package com.yihu.iot.controller.product;
import com.yihu.ehr.iot.controller.common.BaseController;
import com.yihu.ehr.iot.model.ehr.MStdDataSet;
import com.yihu.ehr.iot.service.product.ProductService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.iot.controller.common.BaseController;
import com.yihu.iot.model.ehr.MStdDataSet;
import com.yihu.iot.service.product.ProductService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.product.IotMaintenanceUnitVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoVO;
import com.yihu.jw.restmodel.iot.product.IotProductVO;
@ -27,11 +27,11 @@ public class IotProductController extends BaseController {
    @GetMapping(value = IotRequestMapping.Product.data_sets)
    @ApiOperation(value = "测量数据", notes = "测量数据")
    public Envelop<MStdDataSet> data_sets(@ApiParam(name = "name", value = "名称", defaultValue = "")
    public MixEnvelop<MStdDataSet, MStdDataSet> data_sets(@ApiParam(name = "name", value = "名称", defaultValue = "")
                                         @RequestParam(value = "name", required = false) String name,
                                         @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                             @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                         @RequestParam(value = "page", required = false) Integer page,
                                         @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                             @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                         @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
@ -43,14 +43,14 @@ public class IotProductController extends BaseController {
            return productService.data_sets(page, size, name);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Product.findProductPage)
    @ApiOperation(value = "分页查找产品", notes = "分页查找产品")
    public Envelop<IotProductBaseInfoVO> findCompanyPage(
    public MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> findCompanyPage(
            @ApiParam(name = "name", value = "注册证号或产品名称", defaultValue = "")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "classify", value = "产品分类", defaultValue = "")
@ -71,19 +71,19 @@ public class IotProductController extends BaseController {
            return productService.findCompanyPage(name,classify,companyId,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Product.findProductPageByCompanyId)
    @ApiOperation(value = "分页查找产品(按企业id)", notes = "分页查找产品")
    public Envelop<IotProductBaseInfoVO> findProductPageByCompanyId(@ApiParam(name = "name", value = "产品名称", defaultValue = "")
    public MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> findProductPageByCompanyId(@ApiParam(name = "name", value = "产品名称", defaultValue = "")
                                                         @RequestParam(value = "name", required = false) String name,
                                                         @ApiParam(name = "companyId", value = "企业id", defaultValue = "")
                                                                       @ApiParam(name = "companyId", value = "企业id", defaultValue = "")
                                                         @RequestParam(value = "companyId", required = true) String companyId,
                                                         @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                       @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                         @RequestParam(value = "page", required = false) Integer page,
                                                         @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                       @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                         @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
@ -95,69 +95,69 @@ public class IotProductController extends BaseController {
            return productService.findProductPageByCompanyId(name,companyId,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Product.addProduct)
    @ApiOperation(value = "创建产品", notes = "创建产品")
    public Envelop<IotProductVO> addProduct(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
    public MixEnvelop<IotProductVO, IotProductVO> addProduct(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
                                            @RequestParam(value = "jsonData", required = false)String jsonData) {
        try {
            return productService.addProduct(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Product.findProductById)
    @ApiOperation(value = "根据id查找产品", notes = "根据id查找产品")
    public Envelop<IotProductVO> findByCode(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotProductVO, IotProductVO> findByCode(@ApiParam(name = "id", value = "id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return productService.findByCode(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Product.maintenanceUnitById)
    @ApiOperation(value = "根据id查找产品的维护单位", notes = "根据id查找产品的维护单位")
    public Envelop<IotMaintenanceUnitVO> maintenanceUnitById(@ApiParam(name = "productId", value = "productId")
    public MixEnvelop<IotMaintenanceUnitVO, IotMaintenanceUnitVO> maintenanceUnitById(@ApiParam(name = "productId", value = "productId")
                                            @RequestParam(value = "productId", required = true) String productId) {
        try {
            return productService.maintenanceUnitById(productId);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Product.delProduct)
    @ApiOperation(value = "删除产品", notes = "删除产品")
    public Envelop<IotProductVO> delCompany(@ApiParam(name = "id", value = "id")
    public MixEnvelop<IotProductVO, IotProductVO> delCompany(@ApiParam(name = "id", value = "id")
                                            @RequestParam(value = "id", required = true) String id) {
        try {
            return productService.delCompany(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Product.updProduct)
    @ApiOperation(value = "修改产品信息", notes = "修改产品信息")
    public Envelop<IotProductVO> updCompany(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
    public MixEnvelop<IotProductVO, IotProductVO> updCompany(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
                                            @RequestParam(value = "jsonData", required = false)String jsonData) {
        try {
            return productService.updCompany(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

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

@ -1,8 +1,8 @@
package com.yihu.ehr.iot.controller.third.wlyy;
package com.yihu.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.iot.controller.common.BaseController;
import com.yihu.iot.service.third.wlyy.MonitoringHealthService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -36,7 +36,7 @@ public class MonitoringHealthPlatformController extends BaseController{
    @GetMapping(value = IotRequestMapping.PatientDevice.findLocationByIdCard)
    @ApiOperation(value = "根据idCard查询设备地址", notes = "根据idCard查询设备地址")
    public Envelop<LocationDataVO> findDeviceLocationsByIdCard(
    public MixEnvelop<LocationDataVO, LocationDataVO> findDeviceLocationsByIdCard(
            @ApiParam(name = "diseaseCondition", value = "病情:0绿标,1黄标,2红标,-1没有标注的居民", defaultValue = "")
            @RequestParam(value = "diseaseCondition",required = false) Integer diseaseCondition,
            @ApiParam(name = "type", value = "1高血压 2糖尿病", defaultValue = "")
@ -55,7 +55,7 @@ public class MonitoringHealthPlatformController extends BaseController{
            return monitoringHealthService.findDeviceLocations(diseaseCondition,page,pageSize,type);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/AccessToken.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model;
package com.yihu.iot.model;
/**
 * Created by zhenglingfeng on 2017/3/8.

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ListResult.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model;
package com.yihu.iot.model;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/model/MenuResult.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.model;
package com.yihu.iot.model;
import java.util.ArrayList;
import java.util.List;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/model/ObjectResult.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.model;
package com.yihu.iot.model;
/**

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/Result.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model;
package com.yihu.iot.model;
import java.lang.reflect.Field;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ehr/MRsMetadata.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model.ehr;
package com.yihu.iot.model.ehr;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ehr/MStdDataSet.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model.ehr;
package com.yihu.iot.model.ehr;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/model/user/UserModel.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.model.user;
package com.yihu.iot.model.user;
import java.io.Serializable;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/config/EhrWebHttpSessionConfiguration.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.config;
package com.yihu.iot.security.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

+ 3 - 3
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/config/EhrWebSecurityConfiguration.java

@ -1,7 +1,7 @@
package com.yihu.ehr.iot.security.config;
package com.yihu.iot.security.config;
import com.yihu.ehr.iot.security.core.*;
import com.yihu.ehr.iot.security.entryPoint.LoginEntryPoint;
import com.yihu.iot.security.entryPoint.LoginEntryPoint;
import com.yihu.iot.security.core.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAccessDecisionManager.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.iot.security.core;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationFailureHandler.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.iot.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.util.rest.Envelop;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationProvider.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.iot.security.core;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.InternalAuthenticationServiceException;

+ 1 - 3
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationSuccessHandler.java

@ -1,14 +1,12 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.iot.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.iot.util.CurrentRequest;
import com.yihu.ehr.util.rest.Envelop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import javax.servlet.ServletException;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationToken.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.iot.security.core;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

+ 1 - 16
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebContextLogoutHandler.java

@ -1,31 +1,16 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.iot.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.iot.util.CurrentRequest;
import com.yihu.ehr.util.rest.Envelop;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.util.Assert;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by progr1mmer on 2018/1/26.

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebUserDetails.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.iot.security.core;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

+ 3 - 6
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebUserDetailsService.java

@ -1,17 +1,14 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.iot.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.iot.util.http.HttpHelper;
import com.yihu.ehr.iot.util.http.HttpResponse;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.ehr.util.rest.Envelop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;

+ 3 - 3
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebUsernamePasswordAuthenticationFilter.java

@ -1,9 +1,9 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.iot.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.iot.util.http.HttpHelper;
import com.yihu.ehr.iot.util.http.HttpResponse;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.ehr.util.rest.Envelop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/entryPoint/LoginEntryPoint.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.entryPoint;
package com.yihu.iot.security.entryPoint;
import com.alibaba.fastjson.JSONObject;
import org.springframework.security.core.AuthenticationException;

+ 10 - 10
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/BaseService.java

@ -1,18 +1,18 @@
package com.yihu.ehr.iot.service.common;
package com.yihu.iot.service.common;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.iot.model.AccessToken;
import com.yihu.ehr.iot.model.ListResult;
import com.yihu.ehr.iot.model.ObjectResult;
import com.yihu.ehr.iot.model.Result;
import com.yihu.ehr.iot.util.encode.AES;
import com.yihu.ehr.iot.util.encode.Base64;
import com.yihu.ehr.iot.util.http.HttpHelper;
import com.yihu.ehr.iot.util.http.HttpResponse;
import com.yihu.ehr.iot.util.operator.StringUtil;
import com.yihu.iot.model.AccessToken;
import com.yihu.iot.model.ListResult;
import com.yihu.iot.model.ObjectResult;
import com.yihu.iot.model.Result;
import com.yihu.iot.util.encode.AES;
import com.yihu.iot.util.encode.Base64;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.iot.util.operator.StringUtil;
import com.yihu.ehr.util.rest.Envelop;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;

+ 2 - 2
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/FileUploadService.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.service.common;
package com.yihu.iot.service.common;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.restmodel.iot.common.UploadVO;
@ -63,7 +63,7 @@ public class FileUploadService extends BaseService{
                uploadVO = new UploadVO();
                uploadVO.setFileName(obj.getString("groupName"));
                uploadVO.setFileType(obj.getString("remoteFileName"));
                uploadVO.setFullUri(obj.getString("fid"));
                uploadVO.setFullUri(obj.getString("fileId"));
                uploadVO.setFullUrl(obj.getString("fileUrl"));
            }
        } catch (IOException e) {

+ 7 - 7
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/LoginService.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.service.common;
package com.yihu.iot.service.common;
import com.yihu.ehr.agModel.user.RoleOrgModel;
import com.yihu.ehr.agModel.user.UserDetailModel;
@ -8,12 +8,12 @@ import com.yihu.ehr.model.geography.MGeographyDict;
import com.yihu.ehr.model.org.MOrganization;
import com.yihu.ehr.model.resource.MRsRolesResource;
import com.yihu.ehr.model.user.MRoles;
import com.yihu.ehr.iot.constant.AuthorityKey;
import com.yihu.ehr.iot.util.http.HttpHelper;
import com.yihu.ehr.iot.util.http.HttpResponse;
import com.yihu.ehr.iot.model.AccessToken;
import com.yihu.ehr.iot.model.ObjectResult;
import com.yihu.ehr.iot.model.Result;
import com.yihu.iot.constant.AuthorityKey;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.iot.model.AccessToken;
import com.yihu.iot.model.ObjectResult;
import com.yihu.iot.model.Result;
import com.yihu.ehr.util.log.LogService;
import com.yihu.ehr.util.rest.Envelop;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;

+ 11 - 11
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/SystemDictService.java

@ -1,11 +1,11 @@
package com.yihu.ehr.iot.service.common;
package com.yihu.iot.service.common;
import com.yihu.ehr.constants.ErrorCode;
import com.yihu.ehr.iot.constant.ServiceApi;
import com.yihu.ehr.iot.model.ObjectResult;
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.iot.constant.ServiceApi;
import com.yihu.iot.model.ObjectResult;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import org.springframework.stereotype.Service;
@ -25,14 +25,14 @@ public class SystemDictService extends BaseService{
     * @return
     * @throws Exception
     */
    public Envelop<IotSystemDictVO> getList(String dictName) throws Exception {
    public MixEnvelop<IotSystemDictVO, IotSystemDictVO> getList(String dictName) throws Exception {
        if("HOSPITAL".equals(dictName)){
            return organizations();
        }
        Map<String, Object> params = new HashMap<>();
        params.put("dictName", dictName);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.System.FindDictByCode, params);
        Envelop<IotSystemDictVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotSystemDictVO, IotSystemDictVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -40,9 +40,9 @@ public class SystemDictService extends BaseService{
     * 获取组织机构信息
     * @return
     */
    private Envelop<IotSystemDictVO> organizations(){
    private MixEnvelop<IotSystemDictVO, IotSystemDictVO> organizations(){
        String url = "/organizations";
        Envelop<IotSystemDictVO> envelop = new Envelop<IotSystemDictVO>();
        MixEnvelop<IotSystemDictVO, IotSystemDictVO> envelop = new MixEnvelop<>();
        Map<String, Object> params = new HashMap<>();
        params.put("fields","");
        params.put("sorts","");
@ -53,7 +53,7 @@ public class SystemDictService extends BaseService{
            HttpResponse response = HttpHelper.get(profileInnerUrl + url, params);
            ObjectResult result =  objectMapper.readValue(response.getBody(),ObjectResult.class);
            if(result.isSuccessFlg()){
                envelop = objectMapper.readValue(response.getBody(),Envelop.class);
                envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
                envelop.setStatus(200);
            }else {
                envelop.setStatus(-1);

+ 38 - 38
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/company/CompanyService.java

@ -1,14 +1,14 @@
package com.yihu.ehr.iot.service.company;
package com.yihu.iot.service.company;
import com.yihu.ehr.constants.ErrorCode;
import com.yihu.ehr.iot.constant.ServiceApi;
import com.yihu.ehr.iot.model.ObjectResult;
import com.yihu.ehr.iot.model.Result;
import com.yihu.ehr.iot.model.user.UserModel;
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.iot.constant.ServiceApi;
import com.yihu.iot.model.ObjectResult;
import com.yihu.iot.model.Result;
import com.yihu.iot.model.user.UserModel;
import com.yihu.iot.service.common.BaseService;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.company.IotCompanyCertificateVO;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import org.springframework.beans.factory.annotation.Value;
@ -38,7 +38,7 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyVO> findCompanyPage(String name,String status,String type,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findCompanyPage(String name, String status, String type, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("status", status);
@ -46,7 +46,7 @@ public class CompanyService extends BaseService {
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Company.FindCompanyPage, params);
        Envelop<IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyVO, IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -57,8 +57,8 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyVO> addCompany(String jsonData) throws IOException {
        Envelop<IotCompanyVO> envelop = new Envelop<IotCompanyVO>();
    public MixEnvelop<IotCompanyVO, IotCompanyVO> addCompany(String jsonData) throws IOException {
        MixEnvelop<IotCompanyVO, IotCompanyVO> envelop = new MixEnvelop<>();
        //新增ehr用户
        IotCompanyVO iotCompany = toModel(jsonData, IotCompanyVO.class);
@ -94,7 +94,7 @@ public class CompanyService extends BaseService {
            envelop.setMessage("该手机号码已存在");
            return envelop;
        }
        Envelop<UserModel> userModelEnvelop = updateUser(iotCompany);
        MixEnvelop<UserModel, UserModel> userModelEnvelop = updateUser(iotCompany);
        if(userModelEnvelop.getStatus()!=200){
            envelop.setStatus(-1);
            envelop.setMessage(userModelEnvelop.getMessage());
@ -104,7 +104,7 @@ public class CompanyService extends BaseService {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", toJson(iotCompany));
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Company.AddCompany, params);
        envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -114,7 +114,7 @@ public class CompanyService extends BaseService {
     * @param envelop
     * @return
     */
    private Envelop<IotCompanyVO> userVerification(IotCompanyVO iotCompany,Envelop<IotCompanyVO> envelop){
    private MixEnvelop<IotCompanyVO, IotCompanyVO> userVerification(IotCompanyVO iotCompany, MixEnvelop<IotCompanyVO, IotCompanyVO> envelop){
        if(StringUtils.isEmpty(iotCompany.getAccount())){
            envelop.setStatus(-1);
            envelop.setMessage("账号不能为空");
@ -168,7 +168,7 @@ public class CompanyService extends BaseService {
     * @param iotCompany
     * @return
     */
    private Envelop<UserModel> updateUser(IotCompanyVO iotCompany){
    private MixEnvelop<UserModel, UserModel> updateUser(IotCompanyVO iotCompany){
        String url = "/user/";
        UserModel userModel = new UserModel();
        userModel.setEmail(iotCompany.getContactsEmail());
@ -177,7 +177,7 @@ public class CompanyService extends BaseService {
        userModel.setTelephone(iotCompany.getContactsMobile());
        userModel.setRealName(iotCompany.getContactsName());
        userModel.setRole(roleId);
        Envelop envelop  = new Envelop();
        MixEnvelop envelop  = new MixEnvelop();
        Map<String, Object> params = new HashMap<>();
        params.put("user_json_data",toJson(userModel));
        try {
@ -208,8 +208,8 @@ public class CompanyService extends BaseService {
     * @param passWord
     * @return
     */
    public Envelop changePassWord(String userId,String passWord){
        Envelop envelop = new Envelop();
    public MixEnvelop changePassWord(String userId, String passWord){
        MixEnvelop envelop = new MixEnvelop();
        String url = "/users/changePassWord";
        Map<String, Object> params = new HashMap<>();
        params.put("user_id",userId);
@ -240,11 +240,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyVO> findByCode(String id) throws IOException {
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findByCode(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Company.FindCompanyById, params);
        Envelop<IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyVO, IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -253,11 +253,11 @@ public class CompanyService extends BaseService {
     * @param id
     * @return
     */
    public Envelop<IotCompanyCertificateVO> delCompanyCert(String id) throws IOException {
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> delCompanyCert(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Company.DelCompanyCert, params);
        Envelop<IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -267,11 +267,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyVO> findByBusinessLicense(String businessLicense) throws IOException {
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findByBusinessLicense(String businessLicense) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("businessLicense", businessLicense);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Company.FindByBusinessLicense, params);
        Envelop<IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyVO, IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -281,11 +281,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyVO> delCompany(String id) throws IOException {
    public MixEnvelop<IotCompanyVO, IotCompanyVO> delCompany(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Company.DelCompany, params);
        Envelop<IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyVO, IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -295,11 +295,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyVO> updCompany(String jsonData) throws IOException {
    public MixEnvelop<IotCompanyVO, IotCompanyVO> updCompany(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Company.UpdCompany, params);
        Envelop<IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyVO, IotCompanyVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -312,14 +312,14 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyCertificateVO> findCompanyCertPage(String name,Integer page,Integer size,String companyId) throws IOException{
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> findCompanyCertPage(String name, Integer page, Integer size, String companyId) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("companyId", companyId);
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Company.FindCompanyCertPage, params);
        Envelop<IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -329,11 +329,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyCertificateVO> findCompanyCertById(String id) throws IOException {
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> findCompanyCertById(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Company.FindCompanyCertById, params);
        Envelop<IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -343,11 +343,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyCertificateVO> findCompanyCertByCompanyId(String companyId) throws IOException {
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> findCompanyCertByCompanyId(String companyId) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("companyId", companyId);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Company.FindCompanyCertByCompanyId, params);
        Envelop<IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -357,11 +357,11 @@ public class CompanyService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotCompanyCertificateVO> addCompanyCert(String jsonData) throws IOException {
    public MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> addCompanyCert(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Company.AddCompanyCert, params);
        Envelop<IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotCompanyCertificateVO, IotCompanyCertificateVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
}

+ 26 - 26
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/device/DeviceOrderService.java

@ -1,10 +1,10 @@
package com.yihu.ehr.iot.service.device;
package com.yihu.iot.service.device;
import com.yihu.ehr.iot.constant.ServiceApi;
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.iot.constant.ServiceApi;
import com.yihu.iot.service.common.BaseService;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.device.IotDeviceOrderVO;
import com.yihu.jw.restmodel.iot.device.IotOrderPurchaseVO;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
@ -18,7 +18,7 @@ import java.util.Map;
 * @author yeshijie on 2017/12/8.
 */
@Service
public class DeviceOrderService extends BaseService{
public class DeviceOrderService extends BaseService {
    /**
     * 创建设备订单
@ -26,11 +26,11 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotOrderVO> create(String jsonData) throws IOException {
    public MixEnvelop<IotOrderVO, IotOrderVO> create(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.DeviceOrder.CreateOrder, params);
        Envelop<IotOrderVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotOrderVO, IotOrderVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -40,11 +40,11 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceOrderVO>  findByCode(String id) throws IOException {
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> findByCode(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.DeviceOrder.FindById, params);
        Envelop<IotDeviceOrderVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -57,14 +57,14 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceOrderVO> findPage(String name,String type,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> findPage(String name, String type, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("type", type);
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.DeviceOrder.FindPage, params);
        Envelop<IotDeviceOrderVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -74,11 +74,11 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceOrderVO> delOrder(String id) throws IOException {
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> delOrder(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.DeviceOrder.DelOrder, params);
        Envelop<IotDeviceOrderVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -88,11 +88,11 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotOrderPurchaseVO> delPurchase(String id) throws IOException {
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> delPurchase(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.DeviceOrder.DelPurchase, params);
        Envelop<IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -102,11 +102,11 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotOrderVO> updOrder(String jsonData) throws IOException {
    public MixEnvelop<IotOrderVO, IotOrderVO> updOrder(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.DeviceOrder.UpdOrder, params);
        Envelop<IotOrderVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotOrderVO, IotOrderVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -118,13 +118,13 @@ public class DeviceOrderService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotOrderPurchaseVO> findPurcharsePage(String orderId,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> findPurcharsePage(String orderId, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("orderId", orderId);
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.DeviceOrder.FindPurcharsePage, params);
        Envelop<IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -133,11 +133,11 @@ public class DeviceOrderService extends BaseService{
     * @param id
     * @return
     */
    public Envelop<IotOrderPurchaseVO> findPurcharseById(String id) throws IOException {
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> findPurcharseById(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.DeviceOrder.FindPurcharseById, params);
        Envelop<IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -151,8 +151,8 @@ public class DeviceOrderService extends BaseService{
     * @param size
     * @return
     */
    public Envelop<IotOrderPurchaseVO> findQualityPage(String qualityStatus,
            String orderNo,String startTime,String endTime,Integer page,Integer size) throws IOException {
    public MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> findQualityPage(String qualityStatus,
                                                          String orderNo, String startTime, String endTime, Integer page, Integer size) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("qualityStatus", qualityStatus);
        params.put("orderNo", orderNo);
@ -161,7 +161,7 @@ public class DeviceOrderService extends BaseService{
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.DeviceOrder.FindQualityPage, params);
        Envelop<IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(), Envelop.class);
        MixEnvelop<IotOrderPurchaseVO, IotOrderPurchaseVO> envelop = objectMapper.readValue(response.getBody(), MixEnvelop.class);
        return envelop;
    }

+ 41 - 41
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/device/DeviceService.java

@ -1,18 +1,18 @@
package com.yihu.ehr.iot.service.device;
package com.yihu.iot.service.device;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.base.fastdfs.FastDFSHelper;
import com.yihu.ehr.iot.constant.ServiceApi;
import com.yihu.ehr.iot.service.common.BaseService;
import com.yihu.ehr.iot.service.common.FileUploadService;
import com.yihu.ehr.iot.util.excel.AExcelReader;
import com.yihu.ehr.iot.util.excel.reader.IotDeviceImportVOReader;
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.common.base.BaseEnvelop;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.iot.constant.ServiceApi;
import com.yihu.iot.service.common.BaseService;
import com.yihu.iot.service.common.FileUploadService;
import com.yihu.iot.util.excel.AExcelReader;
import com.yihu.iot.util.excel.reader.IotDeviceImportVOReader;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.iot.common.ExistVO;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportRecordVO;
@ -33,10 +33,10 @@ import java.util.Map;
 * @author yeshijie on 2017/12/8.
 */
@Service
public class DeviceService extends BaseService{
public class DeviceService extends BaseService {
    @Autowired
    private FastDFSHelper fastDFSHelper;
    private FastDFSUtil fastDFSHelper;
    @Value("${neiwang.enable}")
    private Boolean isneiwang;  //如果不是内网项目要转到到内网在上传
    @Autowired
@ -48,11 +48,11 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceVO> create(String jsonData) throws IOException {
    public MixEnvelop<IotDeviceVO, IotDeviceVO> create(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.CreateDevice, params);
        Envelop<IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceVO, IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -62,11 +62,11 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceVO> findByCode(String id)throws IOException{
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findByCode(String id)throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Device.GetDeviceById, params);
        Envelop<IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceVO, IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -76,11 +76,11 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<ExistVO> isSnExist(String sn) throws IOException {
    public MixEnvelop<ExistVO, ExistVO> isSnExist(String sn) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("sn", sn);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Device.IsSnExist, params);
        Envelop<ExistVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<ExistVO, ExistVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -90,11 +90,11 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<ExistVO> isSimExist(String sim) throws IOException {
    public MixEnvelop<ExistVO, ExistVO> isSimExist(String sim) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("sim", sim);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Device.IsSimExist, params);
        Envelop<ExistVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<ExistVO, ExistVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -104,12 +104,12 @@ public class DeviceService extends BaseService{
     * @param id
     * @return
     */
    public BaseEnvelop updSim(String sim,String id) throws IOException{
    public Envelop updSim(String sim, String id) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("sim", sim);
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.UpdSim, params);
        BaseEnvelop envelop = objectMapper.readValue(response.getBody(),BaseEnvelop.class);
        Envelop envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        return envelop;
    }
@ -118,11 +118,11 @@ public class DeviceService extends BaseService{
     * @param id
     * @return
     */
    public Envelop<IotDeviceVO> delDevice(String id) throws IOException{
    public MixEnvelop<IotDeviceVO, IotDeviceVO> delDevice(String id) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.DelDevice, params);
        Envelop<IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceVO, IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -131,11 +131,11 @@ public class DeviceService extends BaseService{
     * @param jsonData
     * @return
     */
    public BaseEnvelop updDevice(String jsonData) throws IOException{
    public Envelop updDevice(String jsonData) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.UpdDevice, params);
        BaseEnvelop envelop = objectMapper.readValue(response.getBody(),BaseEnvelop.class);
        Envelop envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        return envelop;
    }
@ -150,8 +150,8 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceVO> findProductPageByCompanyId(String sn,String hospital,String orderId,
                String purcharseId,Integer isBinding,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findProductPageByCompanyId(String sn, String hospital, String orderId,
                                                              String purcharseId, Integer isBinding, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("sn", sn);
        params.put("hospital", hospital);
@ -161,7 +161,7 @@ public class DeviceService extends BaseService{
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Device.QueryDevicePage, params);
        Envelop<IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceVO, IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -170,8 +170,8 @@ public class DeviceService extends BaseService{
     * @param purcharseId
     * @return
     */
    public Envelop<ExistVO> isImportDevice(String purcharseId) throws IOException {
        Envelop<ExistVO> envelop = objectMapper.readValue(isImporting(purcharseId),Envelop.class);
    public MixEnvelop<ExistVO, ExistVO> isImportDevice(String purcharseId) throws IOException {
        MixEnvelop<ExistVO, ExistVO> envelop = objectMapper.readValue(isImporting(purcharseId),MixEnvelop.class);
        return envelop;
    }
@ -194,15 +194,15 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceImportRecordVO> uploadStream(MultipartFile file,String purcharseId,HttpServletRequest request) throws Exception {
    public MixEnvelop<IotDeviceImportRecordVO, IotDeviceImportRecordVO> uploadStream(MultipartFile file, String purcharseId, HttpServletRequest request) throws Exception {
        String res = isImporting(purcharseId);
        JSONObject json = JSON.parseObject(res);
        if(json.getInteger("status")==200){
            if(json.getJSONObject("obj").getInteger("isExist")==1){
                return Envelop.getError("已存在导入中的数据,请等待上次数据处理完后在导入");
                return MixEnvelop.getError("已存在导入中的数据,请等待上次数据处理完后在导入");
            }
        }else {
            return Envelop.getError("查询是否在导入中失败");
            return MixEnvelop.getError("查询是否在导入中失败");
        }
        //文件上传
@ -211,7 +211,7 @@ public class DeviceService extends BaseService{
        //得到文件类型
        String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
        if(!"xls".equals(fileType)){
            return Envelop.getError("文件格式不正确");
            return MixEnvelop.getError("文件格式不正确");
        }
        String fileName = fullName.substring(0, fullName.lastIndexOf("."));
@ -222,11 +222,11 @@ public class DeviceService extends BaseService{
        if(isneiwang){
            objectNode = fastDFSHelper.upload(file.getInputStream(), fileType, "");
            params.put("url", objectNode.get("fid").toString().replaceAll("\"", ""));
            params.put("url", objectNode.get("fileId").toString().replaceAll("\"", ""));
        }else {
            UploadVO uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
            if(uploadVO==null){
                return Envelop.getError("文件上传失败");
                return MixEnvelop.getError("文件上传失败");
            }
            params.put("url", uploadVO.getFullUri());
        }
@ -240,7 +240,7 @@ public class DeviceService extends BaseService{
        params.put("fileName", fileName);
        String ret = HttpHelper.postBody(iotUrl + ServiceApi.Device.ImportDevice,JSONObject.toJSONString(params));
        Envelop<IotDeviceImportRecordVO> envelop = objectMapper.readValue(ret,Envelop.class);
        MixEnvelop<IotDeviceImportRecordVO, IotDeviceImportRecordVO> envelop = objectMapper.readValue(ret,MixEnvelop.class);
        return envelop;
    }
@ -252,13 +252,13 @@ public class DeviceService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceImportRecordVO> queryImportRecordPage(String purcharseId,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotDeviceImportRecordVO, IotDeviceImportRecordVO> queryImportRecordPage(String purcharseId, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("purcharseId", purcharseId);
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Device.QueryImportRecordPage, params);
        Envelop<IotDeviceImportRecordVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceImportRecordVO, IotDeviceImportRecordVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }

+ 20 - 20
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/device/IotDeviceQualityService.java

@ -1,10 +1,10 @@
package com.yihu.ehr.iot.service.device;
package com.yihu.iot.service.device;
import com.yihu.ehr.iot.constant.ServiceApi;
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.iot.constant.ServiceApi;
import com.yihu.iot.service.common.BaseService;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.device.IotDeviceQualityInspectionPlanVO;
import org.springframework.stereotype.Service;
@ -16,18 +16,18 @@ import java.util.Map;
 * @author yeshijie on 2018/01/24.
 */
@Service
public class IotDeviceQualityService extends BaseService{
public class IotDeviceQualityService extends BaseService {
    /**
     * 创建设备质检
     * @param jsonData
     * @return
     */
    public Envelop<IotDeviceQualityInspectionPlanVO> create(String jsonData) throws IOException {
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> create(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Quality.AddQualityPlan, params);
        Envelop<IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -36,11 +36,11 @@ public class IotDeviceQualityService extends BaseService{
     * @param id
     * @return
     */
    public Envelop<IotDeviceQualityInspectionPlanVO> findByCode(String id) throws IOException {
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> findByCode(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Quality.FindById, params);
        Envelop<IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -52,8 +52,8 @@ public class IotDeviceQualityService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceQualityInspectionPlanVO> queryQualityPlanPage(String purcharseId,String orderNo,
            String startTime,String endTime,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> queryQualityPlanPage(String purcharseId, String orderNo,
                                                                             String startTime, String endTime, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("purcharseId", purcharseId);
        params.put("orderNo", orderNo);
@ -62,7 +62,7 @@ public class IotDeviceQualityService extends BaseService{
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Quality.QueryQualityPlanPage, params);
        Envelop<IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -72,11 +72,11 @@ public class IotDeviceQualityService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceQualityInspectionPlanVO> delQualityPlan(String id) throws IOException {
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> delQualityPlan(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Quality.DelQualityPlan, params);
        Envelop<IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -87,12 +87,12 @@ public class IotDeviceQualityService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceQualityInspectionPlanVO> completeQualityPlan(String actualTime,String id) throws IOException {
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> completeQualityPlan(String actualTime, String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("actualTime", actualTime);
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Quality.CompleteQualityPlan, params);
        Envelop<IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -103,12 +103,12 @@ public class IotDeviceQualityService extends BaseService{
     * @return
     * @throws IOException
     */
    public Envelop<IotDeviceQualityInspectionPlanVO> completePlanByPurchaseId(String actualTime,String purchaseId) throws IOException {
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> completePlanByPurchaseId(String actualTime, String purchaseId) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("actualTime", actualTime);
        params.put("purchaseId", purchaseId);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Quality.CompletePlanByPurchaseId, params);
        Envelop<IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }

+ 25 - 25
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/product/ProductService.java

@ -1,13 +1,13 @@
package com.yihu.ehr.iot.service.product;
package com.yihu.iot.service.product;
import com.yihu.ehr.constants.ErrorCode;
import com.yihu.ehr.iot.constant.ServiceApi;
import com.yihu.ehr.iot.model.ObjectResult;
import com.yihu.ehr.iot.model.ehr.MStdDataSet;
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.iot.constant.ServiceApi;
import com.yihu.iot.model.ObjectResult;
import com.yihu.iot.model.ehr.MStdDataSet;
import com.yihu.iot.service.common.BaseService;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.product.IotMaintenanceUnitVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoVO;
import com.yihu.jw.restmodel.iot.product.IotProductVO;
@ -37,9 +37,9 @@ public class ProductService extends BaseService {
     * 测量数据(ehr标准规范管理-平台标准-标准数据集)
     * @return
     */
    public Envelop<MStdDataSet> data_sets(Integer page, Integer size, String name){
    public MixEnvelop<MStdDataSet, MStdDataSet> data_sets(Integer page, Integer size, String name){
        String url = "/std/data_sets";
        Envelop<MStdDataSet> envelop = new Envelop<MStdDataSet>();
        MixEnvelop<MStdDataSet, MStdDataSet> envelop = new MixEnvelop<>();
        Map<String, Object> params = new HashMap<>();
        String filters = "reference="+reference+";";
        if(StringUtils.isNotBlank(name)){
@ -53,7 +53,7 @@ public class ProductService extends BaseService {
            HttpResponse response = HttpHelper.get(profileInnerUrl + url, params);
            ObjectResult result =  objectMapper.readValue(response.getBody(),ObjectResult.class);
            if(result.isSuccessFlg()){
                envelop = objectMapper.readValue(response.getBody(),Envelop.class);
                envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
                envelop.setStatus(200);
            }else {
                envelop.setStatus(-1);
@ -77,7 +77,7 @@ public class ProductService extends BaseService {
     * @param size
     * @return
     */
    public Envelop<IotProductBaseInfoVO> findCompanyPage(String name,String classify,String companyId,Integer page,Integer size) throws IOException{
    public MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> findCompanyPage(String name, String classify, String companyId, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("classify", classify);
@ -85,7 +85,7 @@ public class ProductService extends BaseService {
        params.put("page", page);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Product.FindProductPage, params);
        Envelop<IotProductBaseInfoVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -98,14 +98,14 @@ public class ProductService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotProductBaseInfoVO> findProductPageByCompanyId(String name,String companyId,Integer page, Integer size) throws IOException{
    public MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> findProductPageByCompanyId(String name, String companyId, Integer page, Integer size) throws IOException{
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("page", page);
        params.put("companyId", companyId);
        params.put("size", size);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Product.FindProductPageByCompanyId, params);
        Envelop<IotProductBaseInfoVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -115,11 +115,11 @@ public class ProductService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotProductVO> addProduct(String jsonData) throws IOException {
    public MixEnvelop<IotProductVO, IotProductVO> addProduct(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Product.AddProduct, params);
        Envelop<IotProductVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotProductVO, IotProductVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -129,11 +129,11 @@ public class ProductService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotProductVO> findByCode(String id) throws IOException {
    public MixEnvelop<IotProductVO, IotProductVO> findByCode(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Product.FindProductById, params);
        Envelop<IotProductVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotProductVO, IotProductVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -143,11 +143,11 @@ public class ProductService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotMaintenanceUnitVO> maintenanceUnitById(String productId) throws IOException {
    public MixEnvelop<IotMaintenanceUnitVO, IotMaintenanceUnitVO> maintenanceUnitById(String productId) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("productId", productId);
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Product.MaintenanceUnitById, params);
        Envelop<IotMaintenanceUnitVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotMaintenanceUnitVO, IotMaintenanceUnitVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -159,11 +159,11 @@ public class ProductService extends BaseService {
     */
    @PostMapping(value = IotRequestMapping.Product.delProduct)
    @ApiOperation(value = "删除产品", notes = "删除产品")
    public Envelop<IotProductVO> delCompany(String id) throws IOException {
    public MixEnvelop<IotProductVO, IotProductVO> delCompany(String id) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Product.DelProduct, params);
        Envelop<IotProductVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotProductVO, IotProductVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }
@ -173,11 +173,11 @@ public class ProductService extends BaseService {
     * @return
     * @throws IOException
     */
    public Envelop<IotProductVO> updCompany(String jsonData) throws IOException {
    public MixEnvelop<IotProductVO, IotProductVO> updCompany(String jsonData) throws IOException {
        Map<String, Object> params = new HashMap<>();
        params.put("jsonData", jsonData);
        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Product.UpdProduct, params);
        Envelop<IotProductVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        MixEnvelop<IotProductVO, IotProductVO> envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
        return envelop;
    }

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

@ -1,14 +1,14 @@
package com.yihu.ehr.iot.service.third.wlyy;
package com.yihu.iot.service.third.wlyy;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.ehr.iot.constant.ServiceApi;
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.util.date.DateUtil;
import com.yihu.ehr.util.datetime.DateUtil;
import com.yihu.iot.constant.ServiceApi;
import com.yihu.iot.service.common.BaseService;
import com.yihu.iot.util.http.HttpHelper;
import com.yihu.iot.util.http.HttpResponse;
import com.yihu.jw.restmodel.web.MixEnvelop;
import io.swagger.annotations.ApiOperation;
import iot.device.LocationDataVO;
import org.apache.commons.lang.StringUtils;
@ -28,7 +28,7 @@ import java.util.Map;
 * @author yeshijie on 2018/2/11.
 */
@Service
public class MonitoringHealthService extends BaseService{
public class MonitoringHealthService extends BaseService {
    private Logger logger = LoggerFactory.getLogger(MonitoringHealthService.class);
    @Value("${third.wlyy.url}")
@ -44,9 +44,9 @@ public class MonitoringHealthService extends BaseService{
     * @param diseaseCondition
     * @return
     */
    public Envelop<LocationDataVO> findDeviceLocations(Integer diseaseCondition, Integer page, Integer size, String type) throws IOException {
        Envelop<LocationDataVO> envelop = new Envelop<>();
        Envelop<LocationDataVO> envelopTmp = null;
    public MixEnvelop<LocationDataVO, LocationDataVO> findDeviceLocations(Integer diseaseCondition, Integer page, Integer size, String type) throws IOException {
        MixEnvelop<LocationDataVO, LocationDataVO> envelop = new MixEnvelop<>();
        MixEnvelop<LocationDataVO, LocationDataVO> envelopTmp = null;
        JSONArray jsonArray = new JSONArray();
        Integer total = 0;
        if(StringUtils.isNotBlank(type)){
@ -71,7 +71,7 @@ public class MonitoringHealthService extends BaseService{
                    Map<String, Object> params = new HashMap<>();
                    params.put("jsonData", jsonObject.toString());
                    HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.PatientDevice.findLocationByIdCard, params);
                    envelopTmp = objectMapper.readValue(response.getBody(),Envelop.class);
                    envelopTmp = objectMapper.readValue(response.getBody(),MixEnvelop.class);
                    envelop.getDetailModelList().addAll(envelopTmp.getDetailModelList());
                }
            }
@ -94,7 +94,7 @@ public class MonitoringHealthService extends BaseService{
            Map<String, Object> params = new HashMap<>();
            params.put("jsonData", jsonObject.toString());
            HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.PatientDevice.findLocationByIdCard, params);
            envelop = objectMapper.readValue(response.getBody(),Envelop.class);
            envelop = objectMapper.readValue(response.getBody(),MixEnvelop.class);
            return envelop;
        }
    }
@ -150,7 +150,7 @@ public class MonitoringHealthService extends BaseService{
        if(jsonObject.getInteger("status")==10000){
            String accesstoken = jsonObject.getJSONObject("result").getString("accesstoken");
            tokenMap.put("token",accesstoken);
            tokenMap.put("time",DateUtil.getStringDate());
            tokenMap.put("time", DateUtil.toString(new Date(), DateUtil.DEFAULT_YMDHMSDATE_FORMAT));
            return accesstoken;
        }
        return null;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/ControllerTools.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.util;
package com.yihu.iot.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.util.rest.Envelop;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/CurrentRequest.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util;
package com.yihu.iot.util;
import com.yihu.ehr.agModel.user.UserDetailModel;
import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/ObjectMapperUtil.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.util;
package com.yihu.iot.util;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

+ 4 - 4
app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/AES.java

@ -1,9 +1,9 @@
package com.yihu.ehr.health.util.encode;
package com.yihu.iot.util.encode;
import com.yihu.ehr.health.util.operator.DateUtil;
import com.yihu.ehr.health.util.operator.MD5;
import com.yihu.ehr.health.util.operator.StringUtil;
import com.yihu.iot.util.operator.DateUtil;
import com.yihu.iot.util.operator.MD5;
import com.yihu.iot.util.operator.StringUtil;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/Base64.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util.encode;
package com.yihu.iot.util.encode;
/**

+ 3 - 3
app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/DES.java

@ -1,8 +1,8 @@
package com.yihu.ehr.health.util.encode;
package com.yihu.iot.util.encode;
import com.yihu.ehr.health.util.operator.DateUtil;
import com.yihu.ehr.health.util.operator.StringUtil;
import com.yihu.iot.util.operator.DateUtil;
import com.yihu.iot.util.operator.StringUtil;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/HexEncode.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.util.encode;
package com.yihu.iot.util.encode;
/**
 * @created Created by Air on 2015/6/2.

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/encode/RSA.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util.encode;
package com.yihu.iot.util.encode;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/excel/AExcelReader.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.util.excel;
package com.yihu.iot.util.excel;
import jxl.Sheet;
import jxl.Workbook;

+ 2 - 2
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/excel/reader/IotDeviceImportVOReader.java

@ -1,6 +1,6 @@
package com.yihu.ehr.iot.util.excel.reader;
package com.yihu.iot.util.excel.reader;
import com.yihu.ehr.iot.util.excel.AExcelReader;
import com.yihu.iot.util.excel.AExcelReader;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO;
import jxl.Sheet;
import jxl.Workbook;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/file/FileUtil.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util.file;
package com.yihu.iot.util.file;
import eu.medsea.mimeutil.MimeUtil;

+ 3 - 3
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpClientUtil.java

@ -1,7 +1,7 @@
package com.yihu.ehr.iot.util.http;
package com.yihu.iot.util.http;
import com.yihu.ehr.iot.util.encode.Base64;
import com.yihu.ehr.iot.util.operator.StringUtil;
import com.yihu.iot.util.encode.Base64;
import com.yihu.iot.util.operator.StringUtil;
import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;

+ 2 - 2
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpHelper.java

@ -1,6 +1,6 @@
package com.yihu.ehr.iot.util.http;
package com.yihu.iot.util.http;
import com.yihu.ehr.iot.constant.Constants;
import com.yihu.iot.constant.Constants;
import org.apache.http.NameValuePair;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/http/HttpResponse.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util.http;
package com.yihu.iot.util.http;
/**
 * add by hzp at 2016-3-10

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpUtil.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.util.http;
package com.yihu.iot.util.http;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/operator/CollectionUtil.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util.operator;
package com.yihu.iot.util.operator;
import org.apache.commons.collections.CollectionUtils;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/DateUtil.java

@ -12,7 +12,7 @@
 * -------------------------------------------------------------------------
 * 1.0    2010/07/12    tuchengye              New Making
 ***************************************************************************/
package com.yihu.ehr.iot.util.operator;
package com.yihu.iot.util.operator;
import java.sql.Date;
import java.sql.Time;

+ 2 - 2
app/public-health-server/src/main/java/com/yihu/ehr/health/util/operator/MD5.java

@ -1,7 +1,7 @@
package com.yihu.ehr.health.util.operator;
package com.yihu.iot.util.operator;
import com.yihu.ehr.health.util.encode.HexEncode;
import com.yihu.iot.util.encode.HexEncode;
import java.io.File;
import java.io.FileInputStream;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/StringUtil.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.util.operator;
package com.yihu.iot.util.operator;
import org.apache.commons.lang3.StringUtils;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/util/spring/SpringContextHolder.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.util.spring;
package com.yihu.iot.util.spring;
import org.springframework.beans.BeansException;

+ 10 - 9
app/app-iot-server/src/main/resources/application.yml

@ -78,13 +78,14 @@ ehr:
fast-dfs:
  tracker-server: 172.19.103.54:22122
  public-server: http://172.19.103.54:80/
logging:
  path: /data/logger
  file: app-iot-server
#logging:
#  path: /data/logger
#  file: app-iot-server
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://localhost:9099/iot/
---
spring:
  profiles: jwtest
@ -116,9 +117,9 @@ ehr:
fast-dfs:
  tracker-server: 172.19.103.54:22122
  public-server: http://172.19.103.54:80/
logging:
  path: /data/logger
  file: app-iot-server
#logging:
#  path: /data/logger
#  file: app-iot-server
##如果是外网项目就是flase,false会调用内网http接口项目提交  内网是true直接上传fastDfs
neiwang:
  enable: true
@ -153,9 +154,9 @@ ehr:
fast-dfs:
  tracker-server: 11.1.2.9:22122
  accessUrl: http://11.1.2.9
logging:
  path: /data/logger
  file: app-iot-server
#logging:
#  path: /data/logger
#  file: app-iot-server
##如果是外网项目就是flase 内网是true
neiwang:
  enable: false

app/app-iot-server/src/main/resources/logback.xml → app/app-iot-server/src/main/resources/logback.xml.bak


+ 41 - 136
app/public-health-server/pom.xml

@ -8,21 +8,18 @@
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.2</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
        <artifactId>wlyy-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-parent-pom/pom.xml</relativePath>
    </parent>
    <!-- 依赖包 -->
    <dependencies>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>log4j-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
@ -34,158 +31,75 @@
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>us.codecraft</groupId>
            <artifactId>webmagic-core</artifactId>
            <version>0.4.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>us.codecraft</groupId>
            <artifactId>webmagic-extension</artifactId>
            <version>0.4.2</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>1.3.3</version>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!-- 使用intellij作为集成开发环境 -->
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <scope>compile</scope>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>4.0.0.RELEASE</version>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-extras</artifactId>
            <version>3.0.5</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.4.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>classmate</artifactId>
                    <groupId>com.fasterxml</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <groupId>io.searchbox</groupId>
            <artifactId>jest</artifactId>
            <version>2.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.0</version>
        </dependency>
        <dependency>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.lingala.zip4j</groupId>
            <artifactId>zip4j</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20151123</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- ehr -->
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-admin-gateway-model</artifactId>
@ -195,16 +109,6 @@
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-util</artifactId>
            <version>1.1.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>log4j-core</artifactId>
                    <groupId>org.apache.logging.log4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j-api</artifactId>
                    <groupId>org.apache.logging.log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
@ -212,24 +116,25 @@
            <version>1.1.0</version>
        </dependency>
        <!-- jkzl starter -->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
            <version>1.0.0</version>
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
            <version>1.0.0</version>
            <groupId>com.yihu</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-data-fastdfs</artifactId>
            <version>1.0.0</version>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
        </dependency>
    </dependencies>

+ 20 - 0
app/public-health-server/src/main/java/com/yihu/AppHealthServer.java

@ -0,0 +1,20 @@
package com.yihu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
@SpringBootApplication
public class AppHealthServer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AppHealthServer.class);
    }
	public static void main(String[] args) {
        SpringApplication app = new SpringApplication(AppHealthServer.class);
        app.run(args);
	}
}

+ 0 - 34
app/public-health-server/src/main/java/com/yihu/ehr/health/AppHealthServer.java

@ -1,34 +0,0 @@
package com.yihu.ehr.health;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@EnableAutoConfiguration(exclude = {
        SecurityAutoConfiguration.class,
        ManagementWebSecurityAutoConfiguration.class,
        DataSourceAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class,
        DataSourceTransactionManagerAutoConfiguration.class})
@ComponentScan(basePackages={"com.yihu.base", "com.yihu.ehr.health"})
public class AppHealthServer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AppHealthServer.class);
    }
	public static void main(String[] args) {
        SpringApplication app = new SpringApplication(AppHealthServer.class);
        app.run(args);
	}
}

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/config/SwaggerConfig.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.config;
package com.yihu.health.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/constant/Constants.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.constant;
package com.yihu.health.constant;
/**
 * Created by lingfeng on 2015/6/23.

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/constant/ServiceApi.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.constant;
package com.yihu.health.constant;
/**
 * @author yeshijie on 2018/1/22.

+ 17 - 21
app/public-health-server/src/main/java/com/yihu/ehr/health/controller/archives/ArchivesController.java

@ -1,12 +1,10 @@
package com.yihu.ehr.health.controller.archives;
package com.yihu.health.controller.archives;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.health.service.archives.ArchivesService;
import com.yihu.health.service.archives.ArchivesService;
import com.yihu.jw.restmodel.archives.PatientArchivesInfoVO;
import com.yihu.jw.restmodel.archives.PatientArchivesVO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.archives.PatientArchivesMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -14,8 +12,6 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by Trick on 2018/2/22.
 */
@ -29,59 +25,59 @@ public class ArchivesController {
    @GetMapping(value = PatientArchivesMapping.Archives.findPatientArchives)
    @ApiOperation(value = "查询健康信息列表")
    public Envelop<PatientArchivesVO> findPatientArchives(@ApiParam(name = "name", value = "姓名(模糊匹配)")
    public MixEnvelop<PatientArchivesVO, PatientArchivesVO> findPatientArchives(@ApiParam(name = "name", value = "姓名(模糊匹配)")
                                                          @RequestParam(value = "name", required = false)String name,
                                                          @ApiParam(name = "status", value = "档案状态")
                                                             @ApiParam(name = "status", value = "档案状态")
                                                          @RequestParam(value = "status", required = false)String status,
                                                          @ApiParam(name = "cancelReseanType", value = "注销状态")
                                                             @ApiParam(name = "cancelReseanType", value = "注销状态")
                                                          @RequestParam(value = "cancelReseanType", required = false)String cancelReseanType,
                                                          @ApiParam(name = "page", value = "分页") @RequestParam(value = "page", required = false)Integer page,
                                                          @ApiParam(name = "size", value = "每一页大小")@RequestParam(value = "size", required = false )Integer size){
                                                             @ApiParam(name = "page", value = "分页") @RequestParam(value = "page", required = false)Integer page,
                                                             @ApiParam(name = "size", value = "每一页大小")@RequestParam(value = "size", required = false )Integer size){
        try {
            return archivesService.queryPatientArchivesPage(page,size,status, cancelReseanType ,name);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = PatientArchivesMapping.Archives.findPatientArchivesInfos)
    @ApiOperation(value = "查询健康信息详情列表")
    public Envelop<PatientArchivesInfoVO> queryPatientArchivesInfoPage(@ApiParam(name = "code", value = "档案编号")
    public MixEnvelop<PatientArchivesInfoVO, PatientArchivesInfoVO> queryPatientArchivesInfoPage(@ApiParam(name = "code", value = "档案编号")
                                                                       @RequestParam(value = "code", required = false)String code){
        try {
            return archivesService.queryPatientArchivesInfoPage(code);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = PatientArchivesMapping.Archives.createPatientArchives)
    @ApiOperation(value = "创建健康信息详情列表")
    public Envelop<Boolean> createPatientArchives(@ApiParam(name = "patientArchives", value = "建档基本信息Json")
    public MixEnvelop<Boolean, Boolean> createPatientArchives(@ApiParam(name = "patientArchives", value = "建档基本信息Json")
                                                  @RequestParam(value = "patientArchives", required = true)String patientArchives,
                                                  @ApiParam(name = "list", value = "建档详情Json")
                                                     @ApiParam(name = "list", value = "建档详情Json")
                                                  @RequestParam(value = "list", required = true)String list){
        try {
            return archivesService.createPatientArchives(patientArchives,list);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PutMapping(value = PatientArchivesMapping.Archives.updatePatientArchives)
    @ApiOperation(value = "更新健康信息详情列表")
    public Envelop<Boolean> updatePatientArchives(@ApiParam(name = "patientArchives", value = "建档基本信息Json")
    public MixEnvelop<Boolean, Boolean> updatePatientArchives(@ApiParam(name = "patientArchives", value = "建档基本信息Json")
                                                  @RequestParam(value = "patientArchives", required = true)String patientArchives,
                                                  @ApiParam(name = "list", value = "建档详情")
                                                     @ApiParam(name = "list", value = "建档详情")
                                                  @RequestParam(value = "list", required = true)String list){
        try {
            return archivesService.updatePatientArchives(patientArchives,list);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/controller/common/BaseController.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.controller.common;
package com.yihu.health.controller.common;
import com.yihu.ehr.util.rest.Envelop;
import org.springframework.beans.factory.annotation.Value;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/ErrorController.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.controller.common;
package com.yihu.health.controller.common;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/controller/common/IndexController.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.controller.common;
package com.yihu.health.controller.common;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

+ 3 - 4
app/public-health-server/src/main/java/com/yihu/ehr/health/controller/dictionary/SystemDictController.java

@ -1,9 +1,8 @@
package com.yihu.ehr.health.controller.dictionary;
package com.yihu.health.controller.dictionary;
import com.yihu.ehr.health.controller.common.BaseController;
import com.yihu.ehr.health.service.dictionary.SystemDictService;
import com.yihu.health.controller.common.BaseController;
import com.yihu.health.service.dictionary.SystemDictService;
import com.yihu.jw.restmodel.archives.dict.SystemDictVO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/model/AccessToken.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.model;
package com.yihu.health.model;
/**
 * Created by zhenglingfeng on 2017/3/8.

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/model/ListResult.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.model;
package com.yihu.health.model;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/MenuResult.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model;
package com.yihu.health.model;
import java.util.ArrayList;
import java.util.List;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ObjectResult.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model;
package com.yihu.health.model;
/**

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/model/Result.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.model;
package com.yihu.health.model;
import java.lang.reflect.Field;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/user/UserModel.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.model.user;
package com.yihu.health.model.user;
import java.io.Serializable;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/config/EhrWebHttpSessionConfiguration.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.config;
package com.yihu.health.security.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

app/public-health-server/src/main/java/com/yihu/ehr/health/security/config/EhrWebSecurityConfiguration.java → app/public-health-server/src/main/java/com/yihu/health/security/config/EhrWebSecurityConfiguration.java


+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAccessDecisionManager.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.health.security.core;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationFailureHandler.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.health.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.util.rest.Envelop;

+ 1 - 5
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebAuthenticationProvider.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.health.security.core;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.InternalAuthenticationServiceException;
@ -13,10 +13,6 @@ import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.util.Assert;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
 * Created by progr1mmer on 2018/1/26.

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationSuccessHandler.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.health.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebAuthenticationToken.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.health.security.core;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.SpringSecurityCoreVersion;

+ 1 - 1
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebContextLogoutHandler.java

@ -1,4 +1,4 @@
package com.yihu.ehr.health.security.core;
package com.yihu.health.security.core;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

+ 1 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/core/EhrWebUserDetails.java

@ -1,4 +1,4 @@
package com.yihu.ehr.iot.security.core;
package com.yihu.health.security.core;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

+ 3 - 3
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebUserDetailsService.java

@ -1,9 +1,9 @@
package com.yihu.ehr.health.security.core;
package com.yihu.health.security.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.health.util.http.HttpHelper;
import com.yihu.ehr.health.util.http.HttpResponse;
import com.yihu.health.util.http.HttpHelper;
import com.yihu.health.util.http.HttpResponse;
import com.yihu.ehr.util.rest.Envelop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

+ 0 - 0
app/public-health-server/src/main/java/com/yihu/ehr/health/security/core/EhrWebUsernamePasswordAuthenticationFilter.java


Some files were not shown because too many files changed in this diff