فهرست منبع

添加物联网平台

chenweida 7 سال پیش
والد
کامیت
39df072029
100فایلهای تغییر یافته به همراه11449 افزوده شده و 0 حذف شده
  1. 22 0
      app/app-iot-server/.gitignore
  2. 210 0
      app/app-iot-server/pom.xml
  3. 3 0
      app/app-iot-server/readMe.MD
  4. 20 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/AppIotServer.java
  5. 43 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/CommonConfig.java
  6. 27 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/ErrorPageConfig.java
  7. 87 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/SpringSecurityConfig.java
  8. 28 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/SwaggerConfig.java
  9. 40 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/WebMvcConfig.java
  10. 14 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/AuthorityKey.java
  11. 50 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/constant/Constants.java
  12. 40 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/BaseController.java
  13. 37 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/ErrorController.java
  14. 32 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/IndexController.java
  15. 100 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/controller/common/LoginController.java
  16. 25 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/interceptor/LoginInterceptor.java
  17. 53 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/AccessToken.java
  18. 112 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ListResult.java
  19. 46 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/MenuResult.java
  20. 54 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/ObjectResult.java
  21. 85 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/model/Result.java
  22. 99 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/AccessDecisionManagerImpl.java
  23. 60 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/AccessDeniedHandlerImpl.java
  24. 164 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/RoleCache.java
  25. 258 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/BaseService.java
  26. 515 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/common/LoginService.java
  27. 56 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/ControllerTools.java
  28. 21 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/ObjectMapperUtil.java
  29. 89 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/AES.java
  30. 132 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/Base64.java
  31. 67 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/DES.java
  32. 29 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/HexEncode.java
  33. 118 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/RSA.java
  34. 357 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/file/FileUtil.java
  35. 347 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpClientUtil.java
  36. 221 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpHelper.java
  37. 36 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpResponse.java
  38. 18 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/CollectionUtil.java
  39. 1525 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/DateUtil.java
  40. 75 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/MD5.java
  41. 1441 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/StringUtil.java
  42. 29 0
      app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/spring/SpringContextHolder.java
  43. 144 0
      app/app-iot-server/src/main/resources/application.yml
  44. 181 0
      app/app-iot-server/src/main/resources/logback.xml
  45. 23 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/commonFoot.jsp
  46. 21 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/commonHead.jsp
  47. 17 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/commonInclude.jsp
  48. 21 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/layout.xml
  49. 25 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/mainLayout.jsp
  50. 13 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/simpleLayout.jsp
  51. 5 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/error.jsp
  52. 6 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/signin.jsp
  53. 49 0
      app/app-iot-server/src/main/webapp/WEB-INF/jsp/signinJs.jsp
  54. 12 0
      app/app-iot-server/src/main/webapp/front/css/animate.min.css
  55. 6 0
      app/app-iot-server/src/main/webapp/front/css/bootstrap.min.css
  56. 6 0
      app/app-iot-server/src/main/webapp/front/css/bootstrap.min14ed.css
  57. 1 0
      app/app-iot-server/src/main/webapp/front/css/demo/webuploader-demo.min.css
  58. 4 0
      app/app-iot-server/src/main/webapp/front/css/font-awesome.min93e3.css
  59. 389 0
      app/app-iot-server/src/main/webapp/front/css/index.css
  60. 46 0
      app/app-iot-server/src/main/webapp/front/css/login.css
  61. 1 0
      app/app-iot-server/src/main/webapp/front/css/login.min.css
  62. BIN
      app/app-iot-server/src/main/webapp/front/css/patterns/header-profile-skin-1.png
  63. BIN
      app/app-iot-server/src/main/webapp/front/css/patterns/header-profile-skin-3.png
  64. BIN
      app/app-iot-server/src/main/webapp/front/css/patterns/header-profile.png
  65. BIN
      app/app-iot-server/src/main/webapp/front/css/patterns/shattered.png
  66. 251 0
      app/app-iot-server/src/main/webapp/front/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css
  67. 1 0
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/css/blueimp-gallery.min.css
  68. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/error.png
  69. 5 0
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/error.svg
  70. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/loading.gif
  71. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/play-pause.png
  72. 6 0
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/play-pause.svg
  73. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/video-play.png
  74. 5 0
      app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/video-play.svg
  75. 1 0
      app/app-iot-server/src/main/webapp/front/css/plugins/bootstrap-table/bootstrap-table.min.css
  76. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/chosen/chosen-sprite.png
  77. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/chosen/chosen-sprite@2x.png
  78. 423 0
      app/app-iot-server/src/main/webapp/front/css/plugins/chosen/chosen.css
  79. 168 0
      app/app-iot-server/src/main/webapp/front/css/plugins/clockpicker/clockpicker.css
  80. 77 0
      app/app-iot-server/src/main/webapp/front/css/plugins/codemirror/ambiance.css
  81. 309 0
      app/app-iot-server/src/main/webapp/front/css/plugins/codemirror/codemirror.css
  82. 9 0
      app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css
  83. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/alpha-horizontal.png
  84. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/alpha.png
  85. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/hue-horizontal.png
  86. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/hue.png
  87. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/saturation.png
  88. 9 0
      app/app-iot-server/src/main/webapp/front/css/plugins/cropper/cropper.min.css
  89. 231 0
      app/app-iot-server/src/main/webapp/front/css/plugins/dataTables/dataTables.bootstrap.css
  90. 789 0
      app/app-iot-server/src/main/webapp/front/css/plugins/datapicker/datepicker3.css
  91. 155 0
      app/app-iot-server/src/main/webapp/front/css/plugins/dropzone/basic.css
  92. 410 0
      app/app-iot-server/src/main/webapp/front/css/plugins/dropzone/dropzone.css
  93. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.eot
  94. 78 0
      app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.svg
  95. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.ttf
  96. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.woff
  97. BIN
      app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footabled41d.eot
  98. 178 0
      app/app-iot-server/src/main/webapp/front/css/plugins/footable/footable.core.css
  99. 589 0
      app/app-iot-server/src/main/webapp/front/css/plugins/fullcalendar/fullcalendar.css
  100. 0 0
      app/app-iot-server/src/main/webapp/front/css/plugins/fullcalendar/fullcalendar.print.css

+ 22 - 0
app/app-iot-server/.gitignore

@ -0,0 +1,22 @@
#project files
app-emergency-server.iml
.idea/*
target/*
# ---> Java
*/target
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*#
# thrift generate code

+ 210 - 0
app/app-iot-server/pom.xml

@ -0,0 +1,210 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.yihu.ehr</groupId>
    <artifactId>app-iot-server</artifactId>
    <packaging>war</packaging>
    <version>1.0.0</version>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.0.RELEASE</version>
        <relativePath>pom.xml</relativePath>
    </parent>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
    </properties>
    <!-- 依赖包 -->
    <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>
        </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>
        </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>
        <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.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>
        </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>com.yihu.ehr</groupId>
            <artifactId>commons-admin-gateway-model</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-util</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-rest-model</artifactId>
            <version>1.1.0</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>app-iot-server</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin </artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

+ 3 - 0
app/app-iot-server/readMe.MD

@ -0,0 +1,3 @@
app-iot-server 
物联网平台的前端
目前是嵌入到EHR平台中

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

@ -0,0 +1,20 @@
package com.yihu.ehr.iot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
@SpringBootApplication
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);
	}
}

+ 43 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/CommonConfig.java

@ -0,0 +1,43 @@
package com.yihu.ehr.iot.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;
//@Configuration
//@ComponentScan("com.yihu.ehr.eme.controller")
public class CommonConfig {
    @Bean
    public InternalResourceViewResolver viewResolver() {
        InternalResourceViewResolver resolver = new InternalResourceViewResolver();
        resolver.setPrefix("/WEB-INF/jsp/");
        resolver.setSuffix(".jsp");
        resolver.setOrder(1);
        return resolver;
    }
    @Bean
    public ResourceBundleMessageSource messageSource() {
        ResourceBundleMessageSource resolver = new ResourceBundleMessageSource();
        resolver.setBasenames("text/message");
        resolver.setDefaultEncoding("UTF-8");
        return resolver;
    }
    @Bean
    public TilesViewResolver tilesViewResolver(){
        TilesViewResolver tilesViewResolver = new TilesViewResolver();
        tilesViewResolver.setOrder(0);
        return tilesViewResolver;
    }
    @Bean
    public TilesConfigurer tilesConfigurer(){
        TilesConfigurer tilesConfigurer = new TilesConfigurer();
        tilesConfigurer.setDefinitions("/WEB-INF/jsp/common/layout.xml");
        return tilesConfigurer;
    }
}

+ 27 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/ErrorPageConfig.java

@ -0,0 +1,27 @@
package com.yihu.ehr.iot.config;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
/**
 * Created by progr1mmer on 2017/11/6.
 */
@Configuration
public class ErrorPageConfig {
    @Bean
    public EmbeddedServletContainerCustomizer containerCustomizer(){
        return new EmbeddedServletContainerCustomizer(){
            @Override
            public void customize(ConfigurableEmbeddedServletContainer container) {
                container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400"));
                container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500"));
                container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"));
            }
        };
    }
}

+ 87 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/SpringSecurityConfig.java

@ -0,0 +1,87 @@
package com.yihu.ehr.iot.config;
import com.yihu.ehr.iot.security.AccessDecisionManagerImpl;
import com.yihu.ehr.iot.security.AccessDeniedHandlerImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/7/21
 */
@EnableWebSecurity
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    public void configure(WebSecurity web) throws Exception {
        // 设置不拦截规则
        web.ignoring().antMatchers("/front/**");
    }
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        // 设置拦截规则
        http.authorizeRequests().accessDecisionManager(accessDecisionManager())
                .expressionHandler(webSecurityExpressionHandler())
                .antMatchers("/login").permitAll()
                .antMatchers("/login/**").permitAll()
                .antMatchers("/**").hasRole("USER")
                .and()
                .exceptionHandling().accessDeniedHandler(accessDeniedHandler())
                .and()
                .headers().frameOptions().disable();//取消jfame的安全验证
        // 自定义登录页面
        http.csrf().disable().formLogin().loginPage("/login").permitAll();
        // 自定义注销
        //  http.logout().logoutUrl("/logout").logoutSuccessUrl("/login").invalidateHttpSession(true);
        // session管理
        //http.sessionManagement().sessionFixation().changeSessionId().maximumSessions(1).expiredUrl("/");
        // RemeberMe  和UserDetailsService合作 用来保存用户信息, 一段时间内可以不用在输入用户名和密码登录,暂不使用该功能
        //  http.rememberMe().key("webmvc#FD637E6D9C0F1A5A67082AF56CE32485");
    }
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    }
    /*
     * 最终访问控制器
     */
    @Bean(name = "accessDecisionManager")
    public AccessDecisionManager accessDecisionManager() {
        return new AccessDecisionManagerImpl();
    }
    /*
     * 错误信息拦截器
     */
    @Bean(name = "accessDeniedHandler")
    public AccessDeniedHandlerImpl accessDeniedHandler() {
        AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
        accessDeniedHandler.setErrorPage("/error/403.jsp");
        return accessDeniedHandler;
    }
    /*
     * 表达式控制器
     */
    @Bean(name = "expressionHandler")
    public DefaultWebSecurityExpressionHandler webSecurityExpressionHandler() {
        DefaultWebSecurityExpressionHandler webSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
        return webSecurityExpressionHandler;
    }
}

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

@ -0,0 +1,28 @@
package com.yihu.ehr.iot.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
                .select().apis(RequestHandlerSelectors.basePackage("com.yihu.ehr.eme.controller")).paths(PathSelectors.any())
                .build();
    }
    private ApiInfo apiInfo() {
        return new ApiInfoBuilder().title("政府服务平台 SwaggerUI").description("Government Server").version("v1.0").build();
    }
}

+ 40 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/config/WebMvcConfig.java

@ -0,0 +1,40 @@
package com.yihu.ehr.iot.config;
import com.yihu.ehr.iot.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
 * @author Sand
 * @version 1.0
 * @created 2016.03.03 21:50
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
    @Autowired
    private LoginInterceptor loginInterceptor;
    /**
     * 注册拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/login/**", "/400", "/404", "/500");
        super.addInterceptors(registry);
    }
    /**
     * 配置路径完全匹配
     * @param configurer
     */
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setUseSuffixPatternMatch(false)
                .setUseTrailingSlashMatch(true);
    }
}

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

@ -0,0 +1,14 @@
package com.yihu.ehr.iot.constant;
/**
 * Created by janseny on 2017/9/30.
 */
public class AuthorityKey {
    public static final String IsAccessAll = "isAccessAll";
    public static final String UserAreaSaas = "userAreaSaas";
    public static final String UserOrgSaas = "userOrgSaas";
    public static final String UserRoles = "userRoles";
    public static final String UserResource = "userResource";
}

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

@ -0,0 +1,50 @@
package com.yihu.ehr.iot.constant;
/**
 * Created by lingfeng on 2015/6/23.
 */
public class Constants {
    /**
     * the Special characters
     */
    public static final String ASTERISK = "*";
    public static final String BLANK = " ";
    public static final String EMPTY = "";
    public static final String PERCENT = "%";
    public static final String LEFT_BRACKET = "(";
    public static final String RIGHT_BRACKET = ")";
    public static final String COMMA = ",";
    public static final String UNDERLINE = "_";
    public static final String RAIL = "-";
    /**
     * common
     */
    public static final String OK = "ok";
    public static final String NO = "no";
    public static final String DATA = "data";
    public static final String LEFT_DIAGONAL = "/";
    public static final String DOCUMENT = "documents";
    /**
     * api 接口请求间隔
     */
    public static final Long MAX_INTERVAL = 5000L;
    /**
     * 事件类型 暂用
     */
    public static final String EVENT_TYPE_CLINIC = "0";//门诊
    public static final String EVENT_TYPE_HOSPITAL = "1";//住院
    public static final String EVENT_TYPE_P_EXAMINATION = "2";//体检
    /**
     * sll 加密
     */
    public static String SSL_KEYSOTRE = "";
    public static String SSL_PASSWORD = "";
}

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

@ -0,0 +1,40 @@
package com.yihu.ehr.iot.controller.common;
import com.yihu.ehr.util.rest.Envelop;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
/**
 * Controller - 基类
 * Created by Progr1mmer on 2017/3/17.
 */
public class BaseController {
    @Value("${app.clientId}")
    protected String clientId;
    @Value("${server.contextPath}")
    protected String contextPath;
    public Envelop failed(String errMsg) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        envelop.setErrorMsg(errMsg);
        return envelop;
    }
    public Envelop success(Object object) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(true);
        envelop.setObj(object);
        return envelop;
    }
    public Envelop success(List<Object> objectList) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(true);
        envelop.setDetailModelList(objectList);
        return envelop;
    }
}

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

@ -0,0 +1,37 @@
package com.yihu.ehr.iot.controller.common;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * Controller - 全局错误页
 * Created by progr1mmer on 2017/11/6.
 */
@Controller
@Api(value = "Error", description = "全局错误页")
public class ErrorController extends BaseController{
    @GetMapping("/400")
    @ApiOperation(value = "BAD REQUEST")
    public void badRequest(HttpServletResponse response) throws IOException{
        response.sendRedirect(contextPath + "/front/views/error/400.html");
    }
    @GetMapping("/404")
    @ApiOperation(value = "NOT FOUND")
    public void notFound(HttpServletResponse response) throws IOException{
        response.sendRedirect(contextPath + "/front/views/error/404.html");
    }
    @GetMapping("/500")
    @ApiOperation(value = "INTERNAL SERVER ERROR")
    public void serverError(HttpServletResponse response) throws IOException{
        response.sendRedirect(contextPath + "/front/views/error/500.html");
    }
}

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

@ -0,0 +1,32 @@
package com.yihu.ehr.iot.controller.common;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * Controller - 首页
 * Created by progr1mmer on 2017/11/6.
 */
@Controller
@RequestMapping("/index")
@Api(value = "Index", description = "首页")
public class IndexController extends BaseController {
    /**
     * 首页
     * @param response
     * @return
     */
    @RequestMapping(method = RequestMethod.GET)
    @ApiOperation(value = "首页")
    public void index(HttpServletResponse response)throws IOException {
        response.sendRedirect(contextPath + "/front/views/index.html");
    }
}

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

@ -0,0 +1,100 @@
package com.yihu.ehr.iot.controller.common;
import com.yihu.ehr.iot.model.Result;
import com.yihu.ehr.iot.service.common.LoginService;
import com.yihu.ehr.util.rest.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * Controller - 登陆
 * Created by Progr1mmer on 2017/2/21.
 */
@Controller
@RequestMapping("/login")
@Api(value = "Login", description = "登陆控制器")
public class LoginController extends BaseController{
    @Autowired
    private LoginService loginService;
    /**
     * 登陆页面
     * @param response
     * @return
     */
    @RequestMapping(method = RequestMethod.GET)
    @ApiOperation(value = "登陆首页")
    public void index(HttpServletResponse response)throws IOException {
        response.sendRedirect(contextPath + "/front/views/login.html");
    }
    /**
     * 登陆验证
     * @param request
     * @param userName
     * @param password
     * @return
     */
    @RequestMapping(value = "/submit", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "登录验证")
    public Result login(HttpServletRequest request,
            @ApiParam(name = "userName", value = "登录账号")
            @RequestParam(value = "userName") String userName,
            @ApiParam(name = "password", value = "密码")
            @RequestParam(value = "password") String password) {
            return loginService.login(request, userName, password);
    }
    /**
     * 退出登陆
     * @param request
     * @param response
     * @throws IOException
     */
    @RequestMapping(value = "/exit", method = RequestMethod.GET)
    @ApiOperation(value = "用户安全退出")
    public void exit(HttpServletRequest request, HttpServletResponse response) throws IOException {
        request.getSession().removeAttribute("isLogin");
        request.getSession().removeAttribute("token");
        request.getSession().removeAttribute("loginName");
        request.getSession().removeAttribute("userId");
        response.sendRedirect(contextPath + "/login");
    }
    /**
     * 政府服务平台-oauth2验证集成
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping(value = "/signin")
    @ApiOperation(value = "oauth2验证集成")
    public void signIn(HttpServletResponse response, HttpServletRequest request) throws IOException {
        String clientId = request.getParameter("clientId");
        String host = request.getHeader("referer");
        request.getSession().setAttribute("host", host);
        response.sendRedirect(contextPath + "/front/views/signin.html?clientId=" + clientId);
    }
    /*
     * 自动登录
     */
    @RequestMapping(value = "/autoLogin", method = RequestMethod.POST)
    @ResponseBody
    public Envelop autoLogin(HttpServletRequest request, Model model,
                             @ApiParam(name = "token", value = "TOKEN")
                             @RequestParam(value = "token") String token) throws Exception {
        return loginService.autoLogin(request, model, token);
    }
}

+ 25 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/interceptor/LoginInterceptor.java

@ -0,0 +1,25 @@
package com.yihu.ehr.iot.interceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
public class LoginInterceptor extends HandlerInterceptorAdapter {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if(request.getRequestURL().indexOf("/ambulance/search")!=-1){
            return true;
        }
        Boolean isLogin = (Boolean) request.getSession().getAttribute("isLogin");
        if (isLogin == null || !isLogin) {
            response.sendRedirect("/emergency/login");
            response.setStatus(-200);
            return false;
        }
        return true;
    }
}

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

@ -0,0 +1,53 @@
package com.yihu.ehr.iot.model;
/**
 * Created by zhenglingfeng on 2017/3/8.
 */
public class AccessToken {
    private String accessToken;
    private String refreshToken;
    private String tokenType;
    private String user;
    private int expiresIn;
    public String getAccessToken() {
        return accessToken;
    }
    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }
    public String getRefreshToken() {
        return refreshToken;
    }
    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }
    public String getTokenType() {
        return tokenType;
    }
    public void setTokenType(String tokenType) {
        this.tokenType = tokenType;
    }
    public String getUser() {
        return user;
    }
    public void setUser(String user) {
        this.user = user;
    }
    public int getExpiresIn() {
        return expiresIn;
    }
    public void setExpiresIn(int expiresIn) {
        this.expiresIn = expiresIn;
    }
}

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

@ -0,0 +1,112 @@
package com.yihu.ehr.iot.model;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.Serializable;
import java.util.List;
/**
 * 列表对象
 */
public class ListResult extends Result implements Serializable {
    private int pageSize = 10;
    private int currPage = 1;
    private int totalPage;
    private int totalCount;
    private Object obj;
    private List detailModelList;
    public ListResult() {
    }
    public ListResult(int pageSize, int currPage) {
        this.pageSize = pageSize;
        this.currPage = currPage;
    }
    public static ListResult fromJson(String json) {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.readValue(json, ListResult.class);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
    public String toJson() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            return "";
        }
    }
    public Object getObj() {
        return obj;
    }
    public void setObj(Object obj) {
        this.obj = obj;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public int getCurrPage() {
        return currPage;
    }
    public void setCurrPage(int currPage) {
        this.currPage = currPage;
    }
    public int getTotalPage() {
        if (totalCount % pageSize == 0) {
            totalPage = totalCount / pageSize;
        } else {
            totalPage = totalCount / pageSize + 1;
        }
        return totalPage;
    }
    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
    public int getTotalCount() {
        if (totalCount == 0 && detailModelList != null) {
            totalCount = detailModelList.size();
        }
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    public List getDetailModelList() {
        return detailModelList;
    }
    public void setDetailModelList(List detailModelList) {
        this.detailModelList = detailModelList;
    }
}

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

@ -0,0 +1,46 @@
package com.yihu.ehr.iot.model;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by wxw on 2017/11/3.
 */
public class MenuResult {
    private int id;
    private String name;
    private String url;
    private List<MenuResult> children = new ArrayList<>();
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public List<MenuResult> getChildren() {
        return children;
    }
    public void setChildren(List<MenuResult> children) {
        this.children = children;
    }
}

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

@ -0,0 +1,54 @@
package com.yihu.ehr.iot.model;
/**
 * Created by hzp on 20170315.
 */
public class ObjectResult extends Result {
    private Object data;
    private Object obj;
    private String errorMsg;
    private int errorCode;
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    public Object getObj() {
        return obj;
    }
    public void setObj(Object obj) {
        this.obj = obj;
    }
    public String getErrorMsg() {
        return errorMsg;
    }
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
    public int getErrorCode() {
        return errorCode;
    }
    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
    public ObjectResult()
    {}
    public ObjectResult(boolean successFlg,String message){
        super.setSuccessFlg(successFlg);
        super.setMessage(message);
    }
}

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

@ -0,0 +1,85 @@
package com.yihu.ehr.iot.model;
import java.lang.reflect.Field;
/**
 * Created by chenweida on 2015/12/11.
 * 基础对象
 */
public class Result {
    protected boolean successFlg = true;
    protected String message;
    protected int code;
    public boolean isSuccessFlg() {
        return successFlg;
    }
    public void setSuccessFlg(boolean successFlg) {
        this.successFlg = successFlg;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    /**
     * 错误消息
     */
    public static Result error(String message) {
        Result re= new Result();
        re.successFlg = false;
        re.message = message;
        re.code = -1;
        return re;
    }
    /**
     * 错误消息
     */
    public static Result error(int code,String message) {
        Result re= new Result();
        re.successFlg = false;
        re.message = message;
        re.code = code;
        return re;
    }
    /**
     * 成功消息
     */
    public static Result success(String message) {
        Result re= new Result();
        re.successFlg = true;
        re.message = message;
        re.code = 200;
        return re;
    }
    public void checkValue() {
        try {
            Field[] fields = this.getClass().getDeclaredFields();
            for (int j = 0; j < fields.length; j++) {
                fields[j].setAccessible(true);
                if (fields[j].getType().getName().equals(String.class.getTypeName())
                        && fields[j].get(this) == null){
                    fields[j].set(this, "");//设置为空字串
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

+ 99 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/AccessDecisionManagerImpl.java

@ -0,0 +1,99 @@
package com.yihu.ehr.iot.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.authentication.InsufficientAuthenticationException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.web.FilterInvocation;
import java.util.Collection;
import java.util.Iterator;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/7/22
 */
/**
 * Spring Security提供了一些拦截器,来控制对安全对象的访问权限,例如方法调用或web请求。
 * 一个是否允许执行调用的预调用决定,是由AccessDecisionManager实现的。
 * 这个 AccessDecisionManager 被AbstractSecurityInterceptor调用,
 * 它用来作最终访问控制的决定。
 */
public class AccessDecisionManagerImpl implements AccessDecisionManager {
    @Autowired
    private RoleCache roleCache;
    /**
     * 验证用户是否拥有权限
     * @param authentication 用户权限列表
     * @param object FilterInvocation 请求信息
     * @param configAttributes 当前访问路径所需权限
     * @throws AccessDeniedException 如无权限 抛出该异常
     * @throws InsufficientAuthenticationException
     */
    public void decide(Authentication authentication, Object object,
                       Collection<ConfigAttribute> configAttributes)
            throws AccessDeniedException, InsufficientAuthenticationException {
        if (configAttributes == null) {
            return;
        }
        FilterInvocation fi = (FilterInvocation) object;
        String url = fi.getRequestUrl();
        Iterator<ConfigAttribute> ite = configAttributes.iterator();
        ConfigAttribute ca;
        int index;
        while (ite.hasNext()) {
            ca = ite.next();
            if("anonymous".equals(ca.toString()) || "permitAll".equals(ca.toString())){
                return;
            }
        }
        index = url.indexOf("?");
        if(index!=-1)
            url = url.substring(0, index);
        url.replaceAll("/+", "/");
        if(!roleCache.contains(url))
            return;
        //ga 为用户所被赋予的权限
        if(authentication.getAuthorities().contains(new SimpleGrantedAuthority(url)))
            return;
        throw new AccessDeniedException("没有权限!");
    }
    /**
     * 在启动的时候被AbstractSecurityInterceptor调用,
     * 来决定AccessDecisionManager是否可以执行传递ConfigAttribute。
     * @param attribute
     * @return
     */
    public boolean supports(ConfigAttribute attribute) {
        return true;
    }
    /**
     * 被安全拦截器实现调用,
     * 包含安全拦截器将显示的AccessDecisionManager支持安全对象的类型。
     * @param clazz
     * @return
     */
    public boolean supports(Class<?> clazz) {
        return true;
    }
}

+ 60 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/AccessDeniedHandlerImpl.java

@ -0,0 +1,60 @@
package com.yihu.ehr.iot.security;
import com.yihu.ehr.iot.util.ControllerTools;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/7/22
 */
/**
 * 错误信息拦截器
 */
public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
    private String errorPage;
    /**
     * 拦截错误信息, 并按逻辑返回错误到前端页面
     * @param request
     * @param response
     * @param accessDeniedException
     * @throws IOException
     * @throws ServletException
     */
    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException)
            throws IOException, ServletException {
        if(ControllerTools.isAjaxRequest(request)){
            response.setHeader("noPermission", "true");
            ControllerTools.print(response, "{}");
        }else if (!response.isCommitted()) {
            if (errorPage != null) {
                // Set the 403 status code.
                response.setStatus(HttpServletResponse.SC_FORBIDDEN);
                // forward to error page.
                RequestDispatcher dispatcher = request.getRequestDispatcher(errorPage);
                dispatcher.forward(request, response);
            } else {
                response.sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage());
            }
        }
    }
    public void setErrorPage(String errorPage) {
        if ((errorPage != null) && !errorPage.startsWith("/")) {
            throw new IllegalArgumentException("errorPage must begin with '/'");
        }
        this.errorPage = errorPage;
    }
}

+ 164 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/security/RoleCache.java

@ -0,0 +1,164 @@
package com.yihu.ehr.iot.security;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.iot.util.ObjectMapperUtil;
import com.yihu.ehr.iot.util.http.HttpHelper;
import com.yihu.ehr.iot.util.http.HttpResponse;
import com.yihu.ehr.util.rest.Envelop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/7/22
 */
/**
 * �����ɫ��Ϣ
 */
@Service
public class RoleCache {
    //    private final static Map<String, CopyOnWriteArrayList<String>> resourceMap = new ConcurrentHashMap<>();
    @Value("${service-gateway.profileInnerUrl}")
    private String comUrl;
    @Value("${app.baseClientId}")
    private String baseClientId;
    @Autowired
    private ObjectMapper objectMapper;
    private final static CopyOnWriteArrayList<String> resourceList = new CopyOnWriteArrayList<>();
    //    private final static Set<String> resourceList = Collections.synchronizedSet(new HashSet<String>());
    public RoleCache() throws Exception {
        //loadRole();
    }
    private List<Map<String,Object>> getAppFeatures() throws Exception {
        Map params = new HashMap<>();
        String url = "/filterFeatureNoPage";
        params.put("filters", "appId=" + baseClientId);
        HttpResponse rs = HttpHelper.get(comUrl + url, params);
        //ObjectMapperUtil objectMapperUtil = new ObjectMapperUtil();
        Envelop envelop = (Envelop) ObjectMapperUtil.toModel(rs.getBody(), new TypeReference<Envelop>() {});
        return envelop.getDetailModelList();
        //return null;
    }
    public boolean contains(String url){
        return resourceList.contains(url);
    }
    public void addRes(String res){
        synchronized (resourceList){
            resourceList.add(res);
        }
    }
    public void removeRes(String res){
        synchronized (resourceList) {
            resourceList.remove(res);
        }
    }
    /**
     * ��ʼ�����Ȩ����Ϣ
     */
    @PostConstruct
    private void loadRole() throws Exception {
        List<Map<String,Object>> appFeatureModelList = getAppFeatures();
        for(Map<String,Object> feature: appFeatureModelList){
            if(feature.get("url")!=null)
                resourceList.add(feature.get("url").toString());
        }
//        CopyOnWriteArrayList<String> cas = new CopyOnWriteArrayList<>();
//        cas.add("dataCenterAdmin");
//        resourceMap.put("appDel", cas );
//
//        cas = new CopyOnWriteArrayList<>();
//        cas.add("dataCenterAdmin");
//        resourceMap.put("/app/platform/initial", cas );
//
//        cas = new CopyOnWriteArrayList<>();
//        cas.add("dataCenterAdmin");
//        resourceMap.put("/app/platform/list", cas );
//
//        cas = new CopyOnWriteArrayList<>();
//        cas.add("admin2");
//        resourceMap.put("/app/api/initial", cas );
//
//        cas = new CopyOnWriteArrayList<>();
//        cas.add("admin2");
//        resourceMap.put("appAdd", cas );
    }
//    /**
//     * ��ȡ�ɷ���key��Դ�Ľ�ɫ
//     * @param key ��Դ
//     * @return ��ɫ��
//     */
//    public CopyOnWriteArrayList getConfigAttributes(String key){
//        return resourceMap.get(key);
//    }
//    /**
//     * �ж��Ƿ�ca�Ƿ񱻸���key����Ȩ��
//     * @param key ��Դ��Ϣ
//     * @param ca  ��ɫ
//     * @return
//     */
//    public boolean hasRole(String key, String ca){
//        Collection c = resourceMap.get(key);
//        if(c!=null)
//            return c.contains(ca);
//        return true;
//    }
//
//    /**
//     * �ж��Ƿ�ca�Ƿ񱻸���key����Ȩ��
//     * @param key ��Դ��Ϣ
//     * @param c  ��ɫ��
//     * @return
//     */
//    public boolean hasRole(String key, Collection<String> c) {
//        CopyOnWriteArrayList elements = resourceMap.get(key);
//        for (Object e: c) {
//            if(elements.indexOf(e)>=0)
//                return true;
//        }
//        return false;
//    }
//
//    /**
//     * ���Ȩ����Ϣ
//     * @param key ��Դ��Ϣ
//     * @param ca  ��ɫ
//     */
//    public void addCache(String key, String ca){
//        if(resourceMap.get(key)==null){
//            resourceMap.put(key, new CopyOnWriteArrayList<>());
//        }
//        resourceMap.get(key).add(ca);
//    }
//
//    /**
//     * ɾ��Ȩ����Ϣ
//     * @param key ��Դ��Ϣ
//     * @param ca ��ɫ
//     */
//    public void removeCache(String key, String ca){
//        if(resourceMap.get(key)!=null){
//            resourceMap.get(key).remove(ca);
//        }
//    }
}

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

@ -0,0 +1,258 @@
package com.yihu.ehr.iot.service.common;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
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.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.util.rest.Envelop;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.*;
/**
 * Serveice - 基类
 * Author Progr1mmer
 */
public class BaseService {
    @Autowired
    protected ObjectMapper objectMapper;
    @Value("${permissions.info}")
    protected String permissionsInfo;
    @Value("${app.clientId}")
    protected String clientId;
    @Value("${app.baseClientId}")
    protected String baseClientId;
    @Value("${service-gateway.profileInnerUrl}")
    protected String profileInnerUrl;
    @Value("${service-gateway.profileOuterUrl}")
    protected String profileOuterUrl;
    @Value("${service-gateway.portalInnerUrl}")
    protected String portalInnerUrl;
    @Value("${service-gateway.portalOuterUrl}")
    protected String portalOuterUrl;
    @Value("${app.oauth2InnerUrl}")
    protected String oauth2InnerUrl;
    @Value("${app.oauth2OuterUrl}")
    protected String oauth2OuterUrl;
    public String readFile(String filePath, String charSet) {
        try {
            return readString(new FileInputStream(new File(filePath)), charSet);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return null;
        }
    }
    public String readString(InputStream is, String charSet) {
        try {
            return new String(readByte(is), charSet);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
    }
    public byte[] readByte(InputStream is) {
        try {
            int temp;
            byte[] tempBuffer = new byte[1024];
            byte[] buffer = new byte[0];
            while ((temp = is.read(tempBuffer)) != -1) {
                buffer = ArrayUtils.addAll(buffer, ArrayUtils.subarray(tempBuffer, 0, temp));
            }
            return buffer;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
    public <T> T toModel(String json,Class<T> targetCls){
        try {
            T model = objectMapper.readValue(json, targetCls);
            return model;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
    /**
     * json转为指定对象
     *
     * @param json
     * @param t
     * @param <T>
     * @return
     */
    public <T> T toObj(String json, Class<T> t) {
        try {
            return objectMapper.readValue(json, t);
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 对象转json
     * @param obj
     * @return
     */
    public String toJson(Object obj) {
        try {
            return objectMapper.writeValueAsString(obj);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 将envelop中的DetailList串转化为模板对象集合
     * @param modelList
     * @param targets
     * @param targetCls
     * @param <T>
     * @return
     */
    public <T> Collection<T> getEnvelopList(List modelList, Collection<T> targets, Class<T> targetCls) {
        try {
            for (Object aModelList : modelList) {
                String objJsonData = objectMapper.writeValueAsString(aModelList);
                T model = objectMapper.readValue(objJsonData, targetCls);
                targets.add(model);
            }
            return targets;
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }
    public Map<String, Object> getDecryptionParms(Map<String, Object> params) throws Exception {
        if(!StringUtil.isEmpty(params.get("userId"))){
            String userId = new String(Base64.decode(params.get("userId").toString()), "utf-8");
            params.put("userId", userId);
            String key = AES.genKey(userId);
            String iv = AES.genIV(userId);
            for (String paramKey : params.keySet()) {
                if (!paramKey.equals("userId") && !StringUtil.isEmpty(params.get(paramKey))) {
                    params.put(paramKey, AES.decrypt(params.get(paramKey).toString(), key, iv));
                }
            }
        }
        return params;
    }
    /**
     * 获取省列表
     * @param level
     * @return
     */
    public Result getProvinces(Integer level) {
        try {
            Map<String, Object> request = new HashMap<>();
            Map<String, Object> header = new HashMap<>();
            HttpResponse response = HttpHelper.get(profileInnerUrl + ("/geography_entries/level/" +level), request, header);
            if (response!=null && response.getStatusCode() == 200) {
                return toModel(response.getBody(),ListResult.class);
            }
            else {
                return Result.error(response.getStatusCode(),response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 获取市列表
     * @param pid
     * @return
     */
    public Result getCitys(Integer pid) {
        try {
            Map<String, Object> request = new HashMap<>();
            Map<String, Object> header = new HashMap<>();
            HttpResponse response = HttpHelper.get(profileInnerUrl + ("/geography_entries/pid/" +pid), request, header);
            if (response != null && response.getStatusCode() == 200) {
                return toModel(response.getBody(),ListResult.class);
            }
            else {
                return Result.error(response.getStatusCode(),response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    public Result getDictNameById(Integer id) {
        try {
            Map<String, Object> request = new HashMap<>();
            Map<String, Object> header = new HashMap<>();
            HttpResponse response = HttpHelper.get(profileInnerUrl + ("/geography_entries/" +id), request, header);
            if (response!=null && response.getStatusCode() == 200) {
                return toModel(response.getBody(),ObjectResult.class);
            }
            else {
                return Result.error(response.getStatusCode(),response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 获取存储在缓存中的token信息及clientId信息
     */
    public Map<String, Object> getHeader() {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        Map<String, Object> header = new HashMap<>();
        AccessToken accessToken = (AccessToken)request.getSession().getAttribute("token");
        header.put("token",accessToken.getAccessToken());
        header.put("clientId",clientId);
        return header;
    }
    public Envelop failed(String errMsg) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        envelop.setErrorMsg(errMsg);
        return envelop;
    }
    public Envelop success(Object object) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(true);
        envelop.setObj(object);
        return envelop;
    }
    public Envelop success(List<Object> objectList) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(true);
        envelop.setObj(objectList);
        return envelop;
    }
}

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

@ -0,0 +1,515 @@
package com.yihu.ehr.iot.service.common;
import com.yihu.ehr.agModel.user.RoleOrgModel;
import com.yihu.ehr.agModel.user.UserDetailModel;
import com.yihu.ehr.constants.ServiceApi;
import com.yihu.ehr.constants.SessionAttributeKeys;
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.ehr.util.log.LogService;
import com.yihu.ehr.util.rest.Envelop;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.*;
/**
 * Service - 登陆
 * @author Progr1mmer
 */
@Service
public class LoginService extends BaseService {
    //------------------------ 初始化内外网IP start ------------------------
    private final long a1 = getIpNum("10.0.0.0");
    private final long a2 = getIpNum("10.255.255.255");
    private final long b1 = getIpNum("172.16.0.0");
    private final long b2 = getIpNum("172.31.255.255");
    private final long c1 = getIpNum("192.168.0.0");
    private final long c2 = getIpNum("192.168.255.255");
    private final long d1 = getIpNum("10.44.0.0");
    private final long d2 = getIpNum("10.69.0.255");
    public void initUrlInfo(HttpServletRequest request) {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_CLIENT_IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        if(ip != null) {
            if("0:0:0:0:0:0:0:1".equals(ip)) {
                request.getSession().setAttribute("isInnerIp", true);
            }else {
                if("127.0.0.1".equals(ip) || isInnerIP(ip)) {
                    request.getSession().setAttribute("isInnerIp", true);
                }else {
                    request.getSession().setAttribute("isInnerIp", false);
                }
            }
        }
    }
    public boolean isInnerIP(String ip){
        long n = getIpNum(ip);
        return (n >= a1 && n <= a2) || (n >= b1 && n <= b2) || (n >= c1 && n <= c2) || (n >= d1 && n <= d2);
    }
    public long getIpNum(String ipAddress) {
        String [] ip = ipAddress.split("\\.");
        long a = Integer.parseInt(ip[0]);
        long b = Integer.parseInt(ip[1]);
        long c = Integer.parseInt(ip[2]);
        long d = Integer.parseInt(ip[3]);
        return a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
    }
    //------------------------ 初始化内外网IP end ------------------------
    /**
     * 用户名密码登录
     * @param request
     * @param userName
     * @param password
     * @return
     */
    public Result login(HttpServletRequest request, String userName, String password) {
        try {
            ObjectResult result = new ObjectResult();
            Map<String, Object> params = new HashMap<>();
            params.put("userName", userName);
            params.put("password", password);
            params.put("clientId", clientId);
            HttpResponse response = HttpHelper.get(portalInnerUrl + "/oauth/login", params);
            if (response != null && response.getStatusCode() == 200) {
                ObjectResult re = toModel(response.getBody(), ObjectResult.class);
                if (re.isSuccessFlg()){
                    Map userMap = new HashMap<>();
                    userMap.put("user",re.getData());
                    result.setData(userMap);
                    String userId = ((LinkedHashMap) re.getData()).get("id").toString();
                    //获取token
                    Result tokenResponse = getAccessToken(userName, password, clientId);
                    if (tokenResponse.isSuccessFlg()) {
                        initUrlInfo(request);
                        String data = objectMapper.writeValueAsString(((ObjectResult) tokenResponse).getData());
                        AccessToken token = objectMapper.readValue(data,AccessToken.class);
                        request.getSession().setAttribute("isLogin", true);
                        request.getSession().setAttribute("token", token);
                        request.getSession().setAttribute("loginName", userName);
                        request.getSession().setAttribute("userId", userId);
                        result.setSuccessFlg(true);
                        result.setMessage("登录成功");
                        result.setCode(200);
                        return result;
                    }
                    else{
                        return tokenResponse;
                    }
                }
                else {
                    return re;
                }
            } else {
                return Result.error(response.getStatusCode(), response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 自动登录
     * @param request
     * @param model
     * @param token
     * @return
     * @throws Exception
     */
    public Envelop autoLogin(HttpServletRequest request, Model model, @RequestParam String token) throws Exception {
        try {
            String clientId = request.getParameter("clientId").toString();
            Map<String, Object> params = new HashMap<>();
            params.put("clientId", clientId);
            params.put("accessToken", token);
            HttpResponse response = HttpHelper.post(oauth2InnerUrl + "/oauth/validToken", params);
            Map<String, Object> map = objectMapper.readValue(response.getBody(), Map.class);
            if ((Boolean) map.get("successFlg")) {
                AccessToken accessToken = objectMapper.readValue(objectMapper.writeValueAsString(map.get("data")), AccessToken.class);
                String loginName = accessToken.getUser();
                //验证通过。赋值session中的用户信息
                response = HttpHelper.get(profileInnerUrl + "/users/" + loginName, params);
                Envelop envelop = (Envelop) this.objectMapper.readValue(response.getBody(), Envelop.class);
                String ex = this.objectMapper.writeValueAsString(envelop.getObj());
                UserDetailModel userDetailModel = this.objectMapper.readValue(ex, UserDetailModel.class);
                //获取用户的角色,机构,视图 等权限
                getUserRolePermissions(userDetailModel, loginName, request);
                // 注:SessionAttributeKeys.CurrentUser 是用 @SessionAttributes 来最终赋值,换成用 session.setAttribute() 赋值后将会被覆盖。
                model.addAttribute(SessionAttributeKeys.CurrentUser, userDetailModel);
                HttpSession session = request.getSession();
                //增加超级管理员信息
                if(loginName.equals(permissionsInfo)) {
                    session.setAttribute(AuthorityKey.IsAccessAll, true);
                }else {
                    session.setAttribute(AuthorityKey.IsAccessAll, false);
                }
                session.setAttribute("isLogin", true);
                session.setAttribute("token", accessToken);
                session.setAttribute("loginName", loginName);
                session.setAttribute("userId", userDetailModel.getId());
                session.setAttribute("clientId", clientId);
                //获取用户角色信息
                List<Map<String, Object>> features = getUserFeatures(userDetailModel.getId());
                Collection<GrantedAuthority> grantedAuthorities = new ArrayList<>();
                if (features != null) {
                    for (Map<String, Object> temp : features) {
                        if (temp.get("url") != null && !StringUtils.isEmpty(temp.get("url").toString())){
                            grantedAuthorities.add(new SimpleGrantedAuthority(temp.get("url").toString()));
                        }
                    }
                }
                //生成认证token
                Authentication AuthenticationToken = new UsernamePasswordAuthenticationToken(loginName, "", grantedAuthorities);
                //将信息存放到SecurityContext
                SecurityContextHolder.getContext().setAuthentication(AuthenticationToken);
                return success(userDetailModel);
            } else {
                String msg = String.valueOf(map.get("message"));
                return failed(msg);
            }
        } catch (Exception e) {
            return failed(e.getMessage());
        }
    }
    /**
     * 通过用户名密码获取token
     * @param userName
     * @param password
     * @param clientId
     * @return
     */
    public Result getAccessToken(String userName, String password, String clientId) {
        try {
            Map<String, Object> params = new HashMap<>();
            params.put("userName", userName);
            params.put("password", password);
            params.put("clientId", clientId);
            HttpResponse response = HttpHelper.post(oauth2InnerUrl + "oauth/accessToken", params);
            if (response != null && response.getStatusCode() == 200) {
                return toModel(response.getBody(),ObjectResult.class);
            }
            else {
                return Result.error(response.getStatusCode(),response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 刷新token
     * @param refreshToken
     * @param clientId
     * @return
     */
    public Result refreshToken(String refreshToken, String clientId) {
        try {
            Map<String, Object> params = new HashMap<>();
            params.put("refreshToken", refreshToken);
            params.put("clientId", clientId);
            HttpResponse response = HttpHelper.post(oauth2InnerUrl + "oauth/refreshToken", params);
            if (response!=null && response.getStatusCode() == 200) {
                return toModel(response.getBody(),ObjectResult.class);
            }
            else {
                return Result.error(response.getStatusCode(),response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 校验token
     * @param clientId
     * @param accessToken
     * @return
     */
    public Result validToken(String clientId, String accessToken) {
        try {
            Map<String, Object> params = new HashMap<>();
            params.put("clientId", clientId);
            params.put("accessToken", accessToken);
            HttpResponse response = HttpHelper.post(oauth2InnerUrl + "oauth/validToken", params);
            if (response != null && response.getStatusCode() == 200) {
                return toModel(response.getBody(),ObjectResult.class);
            }
            else {
                return Result.error(response.getStatusCode(),response.getBody());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 获取用户的角色,机构,视图 等权限
     * @param userDetailModel
     * @param request
     * @throws Exception
     */
    public void getUserRolePermissions(UserDetailModel userDetailModel, String loginCode, HttpServletRequest request) throws Exception {
        HttpSession session = request.getSession();
        if(loginCode.equals(permissionsInfo)){
            session.setAttribute(AuthorityKey.UserRoles, null);
            session.setAttribute(AuthorityKey.UserResource, null);
            session.setAttribute(AuthorityKey.UserAreaSaas, null);
            session.setAttribute(AuthorityKey.UserOrgSaas, null);
        }else{
            //获取用户角色
            String roleStr = "";
            List<String> roleList = new ArrayList<>();
            roleStr =  gerUserRoles(userDetailModel.getId());
            if( !StringUtils.isEmpty(roleStr)){
                roleList =  Arrays.asList(roleStr.split(","));
                session.setAttribute(AuthorityKey.UserRoles, roleList);
                //获取角色机构
                List<RoleOrgModel> roleOrgModels = new ArrayList<>();
                gerRolesOrgs(roleList,roleOrgModels);
                if(roleOrgModels !=null && roleOrgModels.size() >0){
                    List<String> roleOrgCodes = new ArrayList<>();
                    for(RoleOrgModel roleOrgModel : roleOrgModels){
                        roleOrgCodes.add(roleOrgModel.getOrgCode());
                    }
                    getUserSaasOrgAndArea(roleOrgCodes, request);
                }else{
                    List<String> userOrgList = new ArrayList<>();
                    userOrgList.add("-NoneOrg");
                    session.setAttribute(AuthorityKey.UserOrgSaas, userOrgList);
                }
                //获取角色视图
                List<String> rolesResourceIdList =  new ArrayList<>();
                List<MRsRolesResource> rolesResourceList = new ArrayList<>();
                gerRolesResource(roleList, rolesResourceList);
                if(rolesResourceList !=null && rolesResourceList.size() >0){
                    for(MRsRolesResource rsRolesResource : rolesResourceList){
                        rolesResourceIdList.add(rsRolesResource.getResourceId());
                    }
                    session.setAttribute(AuthorityKey.UserResource, rolesResourceIdList);
                }else{
                    rolesResourceIdList.add("-NoneResource");
                    session.setAttribute(AuthorityKey.UserResource, rolesResourceIdList);
                }
            }else{
                roleList.add("-NoneRole");
                session.setAttribute(AuthorityKey.UserRoles, roleList);
            }
        }
    }
    /**
     * 获取用户角色
     * @param userId
     * @return
     */
    public String gerUserRoles(String userId){
        //获取用户所属角色
        String roleStr = "";
        try {
            String url = "/roles/role_user/userRolesIds";
            Map<String,Object> params = new HashMap<>();
            params.put("user_id",userId);
            HttpResponse response = HttpHelper.get(profileInnerUrl + url,params);
            Envelop envelop = objectMapper.readValue(response.getBody(),Envelop.class);
            if (envelop.isSuccessFlg() && null != envelop.getObj() && !"".equals(envelop.getObj())) {
                roleStr = envelop.getObj().toString();
            }
        } catch (Exception ex) {
            LogService.getLogger(LoginService.class).error(ex.getMessage());
        }
        return  roleStr;
    }
    /**
     * 获取角色机构
     * @param roleList 角色组列表
     * @return
     */
    public List<RoleOrgModel> gerRolesOrgs(List<String> roleList,List<RoleOrgModel> roleOrgs){
        for(String roleId : roleList){
            try {
                Map<String,Object> params = new HashMap<>();
                String roleUrl = "/roles/role/"+roleId;
                params.put("id",Long.valueOf(roleId));
                HttpResponse response = HttpHelper.get(profileInnerUrl + roleUrl,params);
                Envelop envelopRole = objectMapper.readValue(response.getBody(),Envelop.class);
                if(envelopRole.getObj() != null){
                    MRoles mRoles = objectMapper.convertValue(envelopRole.getObj(), MRoles.class);
                    if ( ! StringUtils.isEmpty( mRoles.getOrgCode() )){
                        RoleOrgModel roleOrgModel = new RoleOrgModel();
                        roleOrgModel.setOrgCode(mRoles.getOrgCode());
                        roleOrgModel.setRoleId(mRoles.getId());
                        roleOrgs.add(roleOrgModel);
                    }
                }
                String url = ServiceApi.Roles.RoleOrgsNoPage;
                params.clear();
                params.put("filters","roleId=" + roleId);
                response = HttpHelper.get(profileInnerUrl + url,params);
                Envelop envelop = objectMapper.readValue(response.getBody(),Envelop.class);
                if (envelop.isSuccessFlg() && null != envelop.getDetailModelList() &&  envelop.getDetailModelList().size()>0) {
                    List<RoleOrgModel> roleOrgModels = envelop.getDetailModelList();
                    if(roleOrgModels != null && roleOrgModels.size() > 0){
                        for(int i = 0; i < roleOrgModels.size() ;i++){
                            RoleOrgModel orgModel = objectMapper.convertValue(roleOrgModels.get(i), RoleOrgModel.class) ;
                            roleOrgs.add(orgModel);
                        }
                    }
                }
            } catch (Exception ex) {
                LogService.getLogger(LoginService.class).error(ex.getMessage());
            }
        }
        return  roleOrgs;
    }
    /**
     * 获取用的saas机构
     */
    public void getUserSaasOrgAndArea(List<String> roleOrgCodes, HttpServletRequest request) throws Exception {
        Envelop envelop = new Envelop();
        List<String> userOrgList = new ArrayList<>();
        for(String code : roleOrgCodes){
            userOrgList.add(code);
        }
        //使用orgCode获取saas化的机构或者区域。
        String urlUOrg = "/org/getUserOrgSaasByUserOrgCode/";
        Map<String, Object> uParams = new HashMap<>();
        uParams.put("orgCodeStr",org.apache.commons.lang.StringUtils.join(roleOrgCodes,',') );
        HttpResponse response = HttpHelper.get(profileInnerUrl + urlUOrg, uParams);
        envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        HttpSession session = request.getSession();
        session.setAttribute("userAreaSaas", envelop.getObj());
        session.setAttribute("userOrgSaas", envelop.getDetailModelList());
        userOrgList = envelop.getDetailModelList();
        List<String> districtList = (List<String>) envelop.getObj();
        String geographyUrl = "/geography_entries/";
        if(districtList != null && districtList.size() > 0){
            for(String code : districtList){
                uParams.clear();
                response = HttpHelper.get(profileInnerUrl + geographyUrl + code, uParams);
                envelop = objectMapper.readValue(response.getBody(),Envelop.class);
                MGeographyDict mGeographyDict = null;
                String objJsonData = objectMapper.writeValueAsString(envelop.getObj());
                mGeographyDict = objectMapper.readValue(objJsonData, MGeographyDict.class);
                if(mGeographyDict != null){
                    String province = "";
                    String city = "";
                    String district = "";
                    if(mGeographyDict.getLevel() == 1){
                        province =  mGeographyDict.getName();
                    }else if(mGeographyDict.getLevel() == 2){
                        city =  mGeographyDict.getName();
                    }else if(mGeographyDict.getLevel() == 3){
                        district =  mGeographyDict.getName();
                    }
                    String  orgGeographyStr = "/organizations/geography";
                    uParams.clear();
                    uParams.put("province",province);
                    uParams.put("city",city);
                    uParams.put("district",district);
                    response = HttpHelper.get(profileInnerUrl + orgGeographyStr , uParams);
                    envelop = objectMapper.readValue(response.getBody(),Envelop.class);
                    if(envelop !=null && envelop.getDetailModelList() != null ){
                        List<MOrganization> organizations = (List<MOrganization>)getEnvelopList(envelop.getDetailModelList(),new ArrayList<MOrganization>(),MOrganization.class);
                        if(organizations !=null ){
                            java.util.Iterator it = organizations.iterator();
                            while(it.hasNext()){
                                MOrganization mOrganization = (MOrganization)it.next();
                                userOrgList.add(mOrganization.getCode());
                            }
                        }
                    }
                }
            }
        }
        userOrgList.removeAll(Collections.singleton(null));
        userOrgList.removeAll(Collections.singleton(""));
        request.getSession().setAttribute(AuthorityKey.UserOrgSaas, userOrgList);
    }
    /**
     * 获取角色视图列表
     * @param roleList
     * @param rolesResourceList
     * @return
     */
    public List<MRsRolesResource> gerRolesResource(List<String> roleList,List<MRsRolesResource> rolesResourceList){
        for(String roleId : roleList){
            try {
                String url = ServiceApi.Resources.GetRolesGrantResources;
                Map<String,Object> params = new HashMap<>();
                params.put("rolesId",roleId);
                HttpResponse response = HttpHelper.get(profileInnerUrl + url,params);
                Envelop envelop = objectMapper.readValue(response.getBody(),Envelop.class);
                if (envelop.isSuccessFlg() && null != envelop.getDetailModelList() && envelop.getDetailModelList().size() > 0 ) {
                    List<MRsRolesResource> roleResourceModels = envelop.getDetailModelList();
                    if(roleResourceModels != null && roleResourceModels.size() > 0){
                        for(int i = 0; i < roleResourceModels.size() ;i++){
                            MRsRolesResource rolesResource = objectMapper.convertValue(roleResourceModels.get(i),MRsRolesResource.class) ;
                            rolesResourceList.add(rolesResource);
                        }
                    }
                }
            } catch (Exception ex) {
                LogService.getLogger(LoginService.class).error(ex.getMessage());
            }
        }
        return  rolesResourceList;
    }
    private List<Map<String, Object>> getUserFeatures(String userId) throws Exception {
        Map params = new HashMap<>();
        params.put("user_id", userId);
        HttpResponse response = HttpHelper.get(profileInnerUrl + "/roles/user/features", params);
        Envelop envelop =  objectMapper.readValue(response.getBody(), Envelop.class);
        if (envelop.isSuccessFlg()) {
            return envelop.getDetailModelList();
        } else {
            throw new Exception(envelop.getErrorMsg());
        }
    }
}

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

@ -0,0 +1,56 @@
package com.yihu.ehr.iot.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.util.rest.Envelop;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/7/22
 */
public class ControllerTools {
    private static ObjectMapper objectMapper = new ObjectMapper();
    public static boolean isAjaxRequest(HttpServletRequest request) {
        return "XMLHttpRequest".equalsIgnoreCase(request.getHeader("X-Requested-With"));
    }
    public static void print(HttpServletResponse response, Envelop envelop) throws IOException {
        response.getWriter().print(toJson(envelop));
    }
    public static void print(HttpServletResponse response, String msg) throws IOException {
        response.getWriter().print(toJson(exception(msg)));
    }
    public static void print(HttpServletResponse response, Exception e) throws IOException {
        response.getWriter().print(toJson(exception(e)));
    }
    
    public static Envelop exception(Exception e) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        envelop.setErrorMsg(e.getMessage());
        return envelop;
    }
    public static Envelop exception(String msg) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        envelop.setErrorMsg(msg);
        return envelop;
    }
    public static String toJson(Object data) {
        try {
            return objectMapper.writeValueAsString(data);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

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

@ -0,0 +1,21 @@
package com.yihu.ehr.iot.util;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.IOException;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/7/25
 */
public class ObjectMapperUtil {
    @Autowired
    static ObjectMapper objectMapper = new ObjectMapper();
    public static Object toModel(String json, TypeReference typeReference) throws IOException {
        return objectMapper.readValue(json, typeReference);
    }
}

+ 89 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/AES.java

@ -0,0 +1,89 @@
package com.yihu.ehr.iot.util.encode;
import com.yihu.ehr.iot.util.operator.DateUtil;
import com.yihu.ehr.iot.util.operator.MD5;
import com.yihu.ehr.iot.util.operator.StringUtil;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * @created Air 2015/6/2.
 */
public class AES {
    public static String encrypt(String encData ,String secretKey, String vector) throws Exception {
        if (StringUtil.isEmpty(encData)) {
            return "";
        }
        if(secretKey == null) {
            return null;
        }
        if(secretKey.length() != 16) {
            return null;
        }
        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
        byte[] raw = secretKey.getBytes();
        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
        IvParameterSpec iv = new IvParameterSpec(vector.getBytes());// 使用CBC模式,需要一个向量iv,可增加加密算法的强度
        cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
        return Base64.encode(cipher.doFinal(encData.getBytes("utf-8")));// 此处使用BASE64做转码。
    }
    public static String decrypt(String sSrc, String key, String ivs) throws Exception {
        if (StringUtil.isEmpty(sSrc)) {
            return "";
        }
        try {
            byte[] raw = key.getBytes("ASCII");
            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
            IvParameterSpec iv = new IvParameterSpec(ivs.getBytes());
            cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
            byte[] encrypted1 = Base64.decode(sSrc);// 先用base64解密
            byte[] original = cipher.doFinal(encrypted1);
            String originalString = new String(original, "utf-8");
            return originalString;
        } catch (Exception ex) {
            return null;
        }
    }
    /**
     * 生成长度为16倍数的DES密钥,不足则末位补0
     *  格式:conten+YYYYMMDD时间+ 补位符0
     * @param content 密钥
     * @return 长度为16倍数的密钥
     */
    public static String genAesPass(String content) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.DEFAULT_CHAR_DATE_YMD_FORMAT);
        StringBuffer passWordBuffer = new StringBuffer();
        passWordBuffer = passWordBuffer.append(content).append(sdf.format(new Date()));
        Integer remainder = passWordBuffer.length() % 16;
        if (remainder != 0) {
            for (int i = 0; i < 16-remainder; i++) {
                passWordBuffer.append(0);
            }
        }
        return MD5.hash(passWordBuffer.toString()).toUpperCase();
    }
    public static String genKey(String content) throws Exception {
        if (StringUtil.isEmpty(content)) {
            return "";
        }
        return genAesPass(content).substring(0, 16).toUpperCase();
    }
    public static String genIV(String content) throws Exception {
        if (StringUtil.isEmpty(content)) {
            return "";
        }
        String iv = genAesPass(content);
        return iv.substring(iv.length() - 16, iv.length()).toUpperCase();
    }
}

+ 132 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/Base64.java

@ -0,0 +1,132 @@
package com.yihu.ehr.iot.util.encode;
/**
 * 标准Base64编解码,具体规范请参见相关文档。
 */
public class Base64 {
    /**
     * Base64编码表。
     */
    private static char Base64Code[] = {
            'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
            'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
            'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
            'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/',
    };
    /**
     * Base64解码表。
     */
    private static byte Base64Decode[] = {
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,  //注意两个63,为兼容SMP,
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 63, -1, 63,  //“/”和“-”都翻译成63。
            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1,
            -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,  //注意两个0:
            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,  //“A”和“=”都翻译成0。
            -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
            41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
    };
    /**
     * 构造方法私有化,防止实例化。
     */
    private Base64() {
    }
    /**
     * Base64编码。将字节数组中字节3个一组编码成4个可见字符。
     *
     * @param b 需要被编码的字节数据。
     * @return 编码后的Base64字符串。
     */
    public static String encode(byte[] b) {
        int code = 0;
        //按实际编码后长度开辟内存,加快速度
        StringBuffer sb = new StringBuffer(((b.length - 1) / 3) << 2 + 4);
        //进行编码
        for (int i = 0; i < b.length; i++) {
            code |= (b[i] << (16 - i % 3 * 8)) & (0xff << (16 - i % 3 * 8));
            if (i % 3 == 2 || i == b.length - 1) {
                sb.append(Base64Code[(code & 0xfc0000) >>> 18]);
                sb.append(Base64Code[(code & 0x3f000) >>> 12]);
                sb.append(Base64Code[(code & 0xfc0) >>> 6]);
                sb.append(Base64Code[code & 0x3f]);
                code = 0;
            }
        }
        //对于长度非3的整数倍的字节数组,编码前先补0,编码后结尾处编码用=代替,
        //=的个数和短缺的长度一致,以此来标识出数据实际长度
        if (b.length % 3 > 0) {
            sb.setCharAt(sb.length() - 1, '=');
        }
        if (b.length % 3 == 1) {
            sb.setCharAt(sb.length() - 2, '=');
        }
        return sb.toString();
    }
    /**
     * Base64解码。
     *
     * @param code 用Base64编码的ASCII字符串
     * @return 解码后的字节数据
     */
    public static byte[] decode(String code) {
        //检查参数合法性
        if (code == null) {
            return null;
        }
        int len = code.length();
        if (len % 4 != 0) {
            throw new IllegalArgumentException("Base64 string length must be 4*n");
        }
        if (code.length() == 0) {
            return new byte[0];
        }
        //统计填充的等号个数
        int pad = 0;
        if (code.charAt(len - 1) == '=') {
            pad++;
        }
        if (code.charAt(len - 2) == '=') {
            pad++;
        }
        int retLen = len / 4 * 3 - pad;
        byte[] ret = new byte[retLen];
        char ch1, ch2, ch3, ch4;
        int i;
        for (i = 0; i < len; i += 4) {
            int j = i / 4 * 3;
            ch1 = code.charAt(i);
            ch2 = code.charAt(i + 1);
            ch3 = code.charAt(i + 2);
            ch4 = code.charAt(i + 3);
            int tmp = (Base64Decode[ch1] << 18) | (Base64Decode[ch2] << 12)
                    | (Base64Decode[ch3] << 6) | (Base64Decode[ch4]);
            ret[j] = (byte) ((tmp & 0xff0000) >> 16);
            if (i < len - 4) {
                ret[j + 1] = (byte) ((tmp & 0x00ff00) >> 8);
                ret[j + 2] = (byte) ((tmp & 0x0000ff));
            } else {
                if (j + 1 < retLen) {
                    ret[j + 1] = (byte) ((tmp & 0x00ff00) >> 8);
                }
                if (j + 2 < retLen) {
                    ret[j + 2] = (byte) ((tmp & 0x0000ff));
                }
            }
        }
        return ret;
    }
}

+ 67 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/DES.java

@ -0,0 +1,67 @@
package com.yihu.ehr.iot.util.encode;
import com.yihu.ehr.iot.util.operator.DateUtil;
import com.yihu.ehr.iot.util.operator.StringUtil;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * @created Air 2015/6/2.
 */
public class DES {
    public static String encrypt(String data, String passWord) throws Exception {
        if (StringUtil.isEmpty(data)) {
            return "";
        }
        DESKeySpec desKey = new DESKeySpec(passWord.getBytes("UTF-8"));
        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
        SecretKey secretKey = keyFactory.generateSecret(desKey);
        Cipher cipher = Cipher.getInstance("DES");
        cipher.init(Cipher.ENCRYPT_MODE, secretKey);
        return Base64.encode(cipher.doFinal(data.getBytes("UTF-8")));
    }
    public static String decrypt(String data, String passWord) throws Exception {
        if (StringUtil.isEmpty(data)) {
            return "";
        }
        DESKeySpec desKey = new DESKeySpec(passWord.getBytes("UTF-8"));
        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
        SecretKey secretKey = keyFactory.generateSecret(desKey);
        Cipher cipher = Cipher.getInstance("DES");
        cipher.init(Cipher.DECRYPT_MODE, secretKey);
        return new String(cipher.doFinal(Base64.decode(data)), "UTF-8");
    }
    /**
     * 生成长度为16倍数的DES密钥,不足则末位补0
     *  格式:conten+YYYYMMDD时间+ 补位符0
     * @param content 密钥
     * @return 长度为16倍数的密钥
     */
    public static String genDesPass(String content) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.DEFAULT_CHAR_DATE_YMD_FORMAT);
        StringBuffer passWordBuffer = new StringBuffer();
        if (StringUtil.isEmpty(content)) {
            return "";
        }
        passWordBuffer = passWordBuffer.append(content).append(sdf.format(new Date()));
        Integer remainder = passWordBuffer.length() % 16;
        if (remainder != 0) {
            for (int i = 0; i < 16-remainder; i++) {
                passWordBuffer.append(0);
            }
        }
        return passWordBuffer.toString();
    }
}

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

@ -0,0 +1,29 @@
package com.yihu.ehr.iot.util.encode;
/**
 * @created Created by Air on 2015/6/2.
 */
public class HexEncode {
    static public String toHexString(byte[] bytes) {
        StringBuilder stringBuffer = new StringBuilder();
        for (byte aByte : bytes) {
            if (Integer.toHexString(0xFF & aByte).length() == 1) {
                stringBuffer.append("0").append(Integer.toHexString(0xFF & aByte));
            } else {
                stringBuffer.append(Integer.toHexString(0xFF & aByte));
            }
        }
        return stringBuffer.toString();
    }
    static public byte[] toBytes(String hexString) {
        byte[] bytes;
        bytes = new byte[hexString.length() / 2];
        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
        }
        return bytes;
    }
}

+ 118 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/encode/RSA.java

@ -0,0 +1,118 @@
package com.yihu.ehr.iot.util.encode;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import javax.crypto.Cipher;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
import java.util.HashMap;
/**
 * RSA加密辅助类,采用Base64编码
 *
 * @created Air  2015/6/02.
 */
public class RSA {
    public static final String PUBLIC_KEY = "public";
    public static final String PRIVATE_KEY = "private";
    public static final String KEY_ALGORITHM = "RSA";
    private static Logger logger = LogManager.getLogger(RSA.class);
    /**
     * 生成公钥和私钥
     *
     * @throws NoSuchAlgorithmException
     */
    public static HashMap<String, Key> generateKeys() throws NoSuchAlgorithmException {
        KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM);
        keyPairGen.initialize(1024);
        KeyPair keyPair = keyPairGen.generateKeyPair();
        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
        RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
        HashMap<String, Key> map = new HashMap<>();
        map.put(PUBLIC_KEY, publicKey);
        map.put(PRIVATE_KEY, privateKey);
        return map;
    }
    public static String encodeKey(Key key) {
        return new String(Base64.getEncoder().encode(key.getEncoded()));
    }
    public static Key genPrivateKey(String key) {
        byte[] bytes = Base64.getDecoder().decode(key);
        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(bytes);
        try {
            KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
            return keyFactory.generatePrivate(pkcs8KeySpec);
        } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {
            logger.error(ex.getMessage());
        }
        return null;
    }
    public static Key genPublicKey(String key) {
        byte[] bytes = Base64.getDecoder().decode(key);
        X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(bytes);
        try {
            KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
            return keyFactory.generatePublic(x509KeySpec);
        } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {
            logger.error(ex.getMessage());
        }
        return null;
    }
    /**
     * @param data 明文
     * @param key  密钥
     * @return HexString密文
     * @throws Exception
     */
    public static String encrypt(String data, Key key) throws Exception {
        Cipher cipher = Cipher.getInstance(KEY_ALGORITHM);
        cipher.init(Cipher.ENCRYPT_MODE, key);
        return new String(Base64.getEncoder().encode(cipher.doFinal(data.getBytes())));
    }
    /**
     * @param data HexString密文
     * @param key  密钥
     * @return 明文
     * @throws Exception
     */
    public static String decrypt(String data, Key key) throws Exception {
        Cipher cipher = Cipher.getInstance(KEY_ALGORITHM);
        cipher.init(Cipher.DECRYPT_MODE, key);
        //return new String(cipher.doFinal(HexEncode.toBytes(data)));
        return new String(cipher.doFinal(Base64.getDecoder().decode(data)));
    }
    /**
     *  通过字符串私钥加密
     * @param data   明文
     * @param privateKey 字符串私钥
     * @return  密文
     * @throws Exception
     */
    public static String encryptByPriKey(String data, String privateKey) throws Exception {
        Cipher cipher = Cipher.getInstance(KEY_ALGORITHM);
        cipher.init(Cipher.ENCRYPT_MODE, genPrivateKey(privateKey));
        return new String(Base64.getEncoder().encode(cipher.doFinal(data.getBytes())));
    }
}

+ 357 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/file/FileUtil.java

@ -0,0 +1,357 @@
package com.yihu.ehr.iot.util.file;
import eu.medsea.mimeutil.MimeUtil;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
 * @author Air
 * @version 1.0
 * @created 2015.06.25 14:14
 */
public class FileUtil {
    public static boolean writeFile(String filePath, String data, String encoding) throws IOException {
        File file = new File(filePath);
        if (!file.getParentFile().exists()) {
            if (!file.getParentFile().mkdirs()) {
                return false;
            }
        }
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, encoding);
        outputStreamWriter.write(data);
        outputStreamWriter.flush();
        outputStreamWriter.close();
        return true;
    }
    public static boolean writeFile(String filePath, byte[] bytes, String encoding) throws IOException {
        File file = new File(filePath);
        if (!file.getParentFile().exists()) {
            if (!file.getParentFile().mkdirs()) {
                return false;
            }
        }
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        byte[] bbuf = new byte[1024];
        InputStream fis = new ByteArrayInputStream(bytes);
        int hasRead = 0;
        //循环从输入流中取出数据
        while ((hasRead = fis.read(bbuf)) > 0) {
            fileOutputStream.write(bbuf, 0, hasRead);
        }
        fileOutputStream.close();
        return true;
    }
    public static boolean writeFile(String filePath,InputStream fis, String encoding) throws IOException {
        File file = new File(filePath);
        if (!file.getParentFile().exists()) {
            if (!file.getParentFile().mkdirs()) {
                return false;
            }
        }
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        byte[] bbuf = new byte[1024];
        int hasRead = 0;
        //循环从输入流中取出数据
        while ((hasRead = fis.read(bbuf)) > 0) {
            fileOutputStream.write(bbuf, 0, hasRead);
        }
        fileOutputStream.close();
        return true;
    }
    /**
     * 删除整个目录
     *
     * @param dir 目录
     * @return boolean
     * @created Airhead
     */
    public static boolean deleteDirectory(File dir) {
        if (dir.isDirectory()) {
            String[] children = dir.list();
            //递归删除目录中的子目录下
            for (int i = 0; i < children.length; i++) {
                boolean success = deleteDirectory(new File(dir, children[i]));
                if (!success) {
                    return false;
                }
            }
        }
        // 目录此时为空,可以删除
        return dir.delete();
    }
    /**
     * file转string
     * @param file 文件
     * @return string类型流
     */
    public static String convertFileToString(File file) {
        StringBuilder sb = new StringBuilder();
        if(file.isFile()&&file.exists()) {
            InputStreamReader read = null;
            try {
                read = new InputStreamReader(new FileInputStream(file), "UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
            BufferedReader reader = new BufferedReader(read);
            String line = null;
            try {
                while ((line = reader.readLine()) != null) {
                    sb.append(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return sb.toString();
    }
    public static String streamToString(InputStream inputStream) {
        StringBuilder sb = new StringBuilder();
            InputStreamReader read = null;
            try {
                read = new InputStreamReader(inputStream, "UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            BufferedReader reader = new BufferedReader(read);
            String line = null;
            try {
                while ((line = reader.readLine()) != null) {
                    sb.append(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        return sb.toString();
    }
    /**
     * 清空文件内容
     * @param filePath 文件路径
     * @param content 写入内容
     */
    public static void clearInfoForFile(String filePath,String content) {
        File file =new File(filePath);
        try {
            if(!file.exists()) {
                file.createNewFile();
            }
            FileWriter fileWriter =new FileWriter(file);
            fileWriter.write(content);
            fileWriter.flush();
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    /**
     * 记录文件最后读取的位置
     * @param readPath  被读取文件路径
     * @param savePath  保存被读取文件的最后位置 的文件路径
     */
    public static Integer  saveFilePos(String  readPath,  String  savePath)  {
        boolean result=false;
        File readFile=new File(readPath);
        Integer lenth=null;
        try  {
            if(readFile.exists()){
                InputStream inputStream = new FileInputStream(readPath);
                lenth = inputStream.available();
                clearInfoForFile(savePath,"");//清空内容
                writeFile(savePath,lenth.toString(),"UTF-8");//重新写入标识
            }
        }
        catch  (Exception  e)  {
            e.printStackTrace();
        }
        return lenth;
    }
    public static Integer getFileSize(String path) {
        Integer size=0;
        InputStream inputStream=null;
        File file=new File(path);
        if (file.exists()){
            try {
                inputStream = new FileInputStream(path);
                size = inputStream.available();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
       return size;
    }
    /**
     * 读取文本文件内容
     * @param file  文件路径
     * @return
     */
    public static String readFileText(File file) {
        StringBuilder stringBuilder = new StringBuilder();
        InputStream in = null;
        BufferedReader br = null;
        try {
            in = new FileInputStream(file);
            br = new BufferedReader(new InputStreamReader(in, "UTF-8"));
            String line = null;
            while ((line = br.readLine()) != null) {
                stringBuilder.append(line);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e1) {
                }
            }
        }
        return stringBuilder.toString();
    }
    public static  byte[] getBytesByStream(InputStream inputStream){
        byte[] buffer = null;
        try {
            ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
            byte[] b = new byte[1024];
            int n;
            while ((n = inputStream.read(b)) != -1) {
                bos.write(b, 0, n);
            }
            bos.close();
            buffer = bos.toByteArray();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return buffer;
    }
    /**
     * 获得指定文件的byte数组
     */
    public static  byte[] getBytes(String filePath){
        byte[] buffer = null;
        try {
            File file = new File(filePath);
            FileInputStream fis = new FileInputStream(file);
            ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
            byte[] b = new byte[1024];
            int n;
            while ((n = fis.read(b)) != -1) {
                bos.write(b, 0, n);
            }
            fis.close();
            bos.close();
            buffer = bos.toByteArray();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return buffer;
    }
    // 将byte数组转换成InputStream
    public static InputStream byteTOInputStream(byte[] in) throws Exception {
        ByteArrayInputStream is = new ByteArrayInputStream(in);
        return is;
    }
    /**
     * 获取文件Mine-Type
     * @param file
     * @return
     */
    public static String getMimeType(File file) {
        MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
        Collection<?> collection=MimeUtil.getMimeTypes(file);
        return collection.toString();
    }
    public static String getMimeType(byte[] bytes) {
        MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
        Collection<?> collection=MimeUtil.getMimeTypes(bytes);
        return collection.toString();
    }
    /**
     * 非结构化档案--文件类型map生成
     * @param map
     * @return
     */
    public static Map<String, StringBuffer> groupDataMap(Map<String, String> map) {
        Map<String, StringBuffer> result = new HashMap<String, StringBuffer>();
        Iterator<String> rs=map.keySet().iterator();
        while (rs.hasNext()) {
            String key = rs.next();
            String value = map.get(key);
            if (result.containsKey(value)) {
                result.get(value).append(",").append(key);
            } else {
                result.put(value, new StringBuffer(key));
            }
        }
        return result;
    }
    /**
     * 获取文件后缀名
     * @param file
     * @return
     */
    public static String getSuffix(File file){
        String suffix = file.getName().substring(file.getName().lastIndexOf(".") + 1);
        return suffix;
    }
    public static String getSuffix(MultipartFile file){
        String suffix = file.getName().substring(file.getName().lastIndexOf(".") + 1);
        return suffix;
    }
}

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

@ -0,0 +1,347 @@
package com.yihu.ehr.iot.util.http;
import com.yihu.ehr.iot.util.encode.Base64;
import com.yihu.ehr.iot.util.operator.StringUtil;
import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.*;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.springframework.util.StringUtils;
import java.io.*;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by hzp on 2016/4/14.
 */
public class HttpClientUtil {
    /**************************** 私有方法 *****************************************/
    private static CloseableHttpClient getCloseableHttpClient(SSLConnectionSocketFactory ssl) {
        if(ssl == null)
        {
            return HttpClients.createDefault();
        }
        else{
            CloseableHttpClient httpClient = HttpClients.custom()
                    .setSSLSocketFactory(ssl)
                    .build();
            return httpClient;
        }
    }
    private static void close(CloseableHttpClient httpClient, CloseableHttpResponse response) {
        try {
            if (httpClient != null) {
                httpClient.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            if (response != null) {
                response.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private static HttpRequestBase getRequest(String method,String url,Map<String,Object> params,Map<String,Object> header) throws Exception
    {
        List<BasicNameValuePair> jsonParams = new ArrayList<>();
        //配置参数
        if(params!=null) {
            for (String key : params.keySet()) {
                if (!StringUtil.isEmpty(String.valueOf(params.get(key))) && !"null".equals( String.valueOf(params.get(key)))) {
                    jsonParams.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
                }
            }
        }
        HttpRequestBase request;
        if(method.equals("POST"))
        {
            request = new HttpPost(url + "?" + URLEncodedUtils.format(jsonParams, Consts.UTF_8));
        }
        else if(method.equals("PUT"))
        {
            request = new HttpPut(url + "?" + URLEncodedUtils.format(jsonParams, Consts.UTF_8));
        }
        else if(method.equals("DELETE"))
        {
            request = new HttpDelete(url + "?" + URLEncodedUtils.format(jsonParams, Consts.UTF_8));
        }
        else
        {
            request = new HttpGet(url + "?" + URLEncodedUtils.format(jsonParams, Consts.UTF_8));
        }
        //配置头部信息
        if(header!=null)
        {
            for (String key : header.keySet()) {
                request.addHeader(key, header.get(key).toString());
            }
        }
        return request;
    }
    /****************************** 公用方法 *******************************************/
    /**
     * get请求
     */
    public static HttpResponse request(String method, String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl, String user, String password) {
        HttpResponse re = new HttpResponse();
        CloseableHttpResponse response = null;
        CloseableHttpClient httpclient = getCloseableHttpClient(ssl);
        //设置请求信息
        try {
            RequestConfig requestConfig = RequestConfig.custom().
                    setAuthenticationEnabled(true).build();
            HttpRequestBase request = getRequest(method,url,params,header);
            request.setConfig(requestConfig);
            //需要验证
            if (!StringUtils.isEmpty(user) && !StringUtils.isEmpty(password)) {
                HttpClientContext context = HttpClientContext.create();
                //通过http的上下文设置账号密码
                CredentialsProvider credsProvider = new BasicCredentialsProvider();
                credsProvider.setCredentials(new org.apache.http.auth.AuthScope(org.apache.http.auth.AuthScope.ANY_HOST, org.apache.http.auth.AuthScope.ANY_PORT),new org.apache.http.auth.UsernamePasswordCredentials(user, password));
                context.setCredentialsProvider(credsProvider);
                response = httpclient.execute(request, context);
            } else {
                response = httpclient.execute(request);
            }
            re.setBody(EntityUtils.toString(response.getEntity(), "UTF-8"));
            re.setStatusCode(response.getStatusLine().getStatusCode());
        } catch (Exception e) {
            re.setStatusCode(201);
            re.setBody(e.getMessage());
            e.printStackTrace();
        } finally {
            close(httpclient, response);
        }
        return re;
    }
    /**
     * 发送文件
     *
     * @param url        路径
     * @param formParams 参数
     * @return
     */
    public static HttpResponse postFile(String url,
                                        File file, List<NameValuePair> formParams, SSLConnectionSocketFactory ssl, String username, String password, Map<String,Object> header) {
        HttpResponse re = new HttpResponse();
        CloseableHttpResponse response = null;
        CloseableHttpClient httpClient = getCloseableHttpClient(ssl);
        try{
            //设置请求信息
            RequestConfig requestConfig = RequestConfig.custom().
                    setAuthenticationEnabled(true).build();
            //创建httppost请求
            HttpPost httpPost = new HttpPost(url);
            if(header!=null) {
                for (String key : header.keySet()) {
                    httpPost.addHeader(key, header.get(key).toString());
                }
            }
            httpPost.setConfig(requestConfig);
            //新建文件对象并且设置文件
            FileBody bin = new FileBody(file);
            MultipartEntityBuilder reqEntity = MultipartEntityBuilder.create();
            reqEntity.addBinaryBody("pack", file);
            //设置参数
            if (formParams != null && formParams.size() > 0) {
                for (NameValuePair nv : formParams) {
                    reqEntity.addTextBody(nv.getName(), nv.getValue(), ContentType.create("text/plain", Charset.forName(HTTP.UTF_8)));
                }
            }
            httpPost.setEntity(reqEntity.build());
            //设置验证
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                //需要验证
                HttpClientContext context = HttpClientContext.create();
                //通过http的上下文设置账号密码
                CredentialsProvider credsProvider = new BasicCredentialsProvider();
                credsProvider.setCredentials(new org.apache.http.auth.AuthScope(org.apache.http.auth.AuthScope.ANY_HOST, org.apache.http.auth.AuthScope.ANY_PORT),
                        new org.apache.http.auth.UsernamePasswordCredentials(username, password));
                context.setCredentialsProvider(credsProvider);
                response = httpClient.execute(httpPost, context);
            } else {
                response = httpClient.execute(httpPost);
            }
            re.setStatusCode(response.getStatusLine().getStatusCode());
            re.setBody(EntityUtils.toString(response.getEntity(), "UTF-8"));;
        } catch (Exception e) {
            re.setStatusCode(201);
            re.setBody(e.getMessage());
            e.printStackTrace();
        } finally {
            close(httpClient, response);
        }
        return re;
    }
    /**
     * 发送File
     */
    public static File downLoadFileByBase64(String filePath, Map<String, Object> params, String url, String username, String password) {
        File file = null;
        CloseableHttpResponse response = null;
        List<BasicNameValuePair> jsonParams = new ArrayList<>();
        CloseableHttpClient httpclient = getCloseableHttpClient(null);
        try {
            HttpPost httpPost = new HttpPost(url);
            //设置请求信息
            RequestConfig requestConfig = RequestConfig.custom().
                    setAuthenticationEnabled(true).build();
            //设置参数
            List<NameValuePair> formparams = new ArrayList<NameValuePair>();
            for (Map.Entry<String, Object> entry : params.entrySet()) {
                formparams.add(new BasicNameValuePair(entry.getKey(), String.valueOf(entry.getValue())));
            }
            UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, Consts.UTF_8);
            httpPost.setEntity(entity);
            httpPost.setConfig(requestConfig);
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                //需要验证
                HttpClientContext context = HttpClientContext.create();
                //通过http的上下文设置账号密码
                CredentialsProvider credsProvider = new BasicCredentialsProvider();
                credsProvider.setCredentials(new org.apache.http.auth.AuthScope(org.apache.http.auth.AuthScope.ANY_HOST, org.apache.http.auth.AuthScope.ANY_PORT),
                        new org.apache.http.auth.UsernamePasswordCredentials(username, password));
                context.setCredentialsProvider(credsProvider);
                response = httpclient.execute(httpPost, context);
            } else {
                response = httpclient.execute(httpPost);
            }
            HttpEntity httpEntity = response.getEntity();
            String responString = EntityUtils.toString(httpEntity, "UTF-8");
            file = new File(filePath);
            file.getParentFile().mkdirs();
            InputStream i = new ByteArrayInputStream(Base64.decode(responString));
            FileOutputStream fileout = new FileOutputStream(file);
            /**
             * 根据实际运行效果 设置缓冲区大小
             */
            byte[] buffer = new byte[1024];
            int ch = 0;
            while ((ch = i.read(buffer)) != -1) {
                fileout.write(buffer, 0, ch);
            }
            i.close();
            fileout.flush();
            fileout.close();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        } finally {
            close(httpclient, response);
        }
        return file;
    }
    public static HttpResponse postForm(String url, List<NameValuePair> formParams) {
        CloseableHttpClient httpClient = HttpClients.createDefault();
        UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formParams, Consts.UTF_8);
        HttpPost httpPost = new HttpPost(url);
        httpPost.setEntity(postEntity);
        CloseableHttpResponse response = null;
        HttpEntity entity = null;
        try {
            response = httpClient.execute(httpPost);
            entity = response.getEntity();
            HttpResponse res = new HttpResponse(response.getStatusLine().getStatusCode(), EntityUtils.toString(entity));
            return res;
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            close(httpClient, response);
        }
        return null;
    }
    /**
     * 下载文件
     */
    public static File downLoadFile(String filePath, String url, String username, String password) {
        File file = null;
        CloseableHttpResponse response = null;
        List<BasicNameValuePair> jsonParams = new ArrayList<>();
        CloseableHttpClient httpclient = getCloseableHttpClient(null);
        try {
            HttpGet httpGet = new HttpGet(url);
            //设置请求信息
            RequestConfig requestConfig = RequestConfig.custom().
                    setAuthenticationEnabled(true).build();
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                //需要验证
                HttpClientContext context = HttpClientContext.create();
                //通过http的上下文设置账号密码
                CredentialsProvider credsProvider = new BasicCredentialsProvider();
                credsProvider.setCredentials(new org.apache.http.auth.AuthScope(org.apache.http.auth.AuthScope.ANY_HOST, org.apache.http.auth.AuthScope.ANY_PORT),
                        new org.apache.http.auth.UsernamePasswordCredentials(username, password));
                context.setCredentialsProvider(credsProvider);
                response = httpclient.execute(httpGet, context);
            } else {
                response = httpclient.execute(httpGet);
            }
            HttpEntity httpEntity = response.getEntity();
            InputStream is = httpEntity.getContent();
            file = new File(filePath);
            file.getParentFile().mkdirs();
            FileOutputStream fileout = new FileOutputStream(file);
            /**
             * 根据实际运行效果 设置缓冲区大小
             */
            byte[] buffer = new byte[1024];
            int ch = 0;
            while ((ch = is.read(buffer)) != -1) {
                fileout.write(buffer, 0, ch);
            }
            is.close();
            fileout.flush();
            fileout.close();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        } finally {
            close(httpclient, response);
        }
        return file;
    }
}

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

@ -0,0 +1,221 @@
package com.yihu.ehr.iot.util.http;
import com.yihu.ehr.iot.constant.Constants;
import org.apache.http.NameValuePair;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.ssl.SSLContexts;
import org.springframework.stereotype.Component;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.util.List;
import java.util.Map;
@Component
public class HttpHelper {
    private static SSLConnectionSocketFactory defaultSSL;
    private static String defaultHttpUser;
    private static String defaultHttpPassword;
    static {
        //默认配置
        try {
            if (Constants.SSL_KEYSOTRE != null && Constants.SSL_KEYSOTRE.length() > 0 && Constants.SSL_PASSWORD != null && Constants.SSL_PASSWORD.length() > 0) {
                SSLContext sslContext = SSLContexts.custom()
                        .loadTrustMaterial(new File(Constants.SSL_KEYSOTRE), Constants.SSL_PASSWORD.toCharArray(),
                                new TrustSelfSignedStrategy())
                        .build();
                defaultSSL = new SSLConnectionSocketFactory(
                        sslContext,
                        new String[]{"TLSv1"},
                        null,
                        SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
            }
        } catch (Exception e) {
            System.out.print(e.getMessage());
        }
    }
    /************************** Get方法 ******************************************/
    public static HttpResponse get(String url)
    {
        return get(url,null,null);
    }
    public static HttpResponse get(String url, Map<String,Object> params)
    {
        return get(url,params,null);
    }
    public static HttpResponse get(String url, Map<String,Object> params, Map<String,Object> header)
    {
        if(url.startsWith("https"))
        {
            return get(url,params,header,defaultSSL);
        }
        else{
            //默认http不走ssl和用户密码
            return get(url, params, header, null, null, null);
        }
    }
    public static HttpResponse get(String url, Map<String,Object> params, Map<String,Object> header, Boolean isCheck)
    {
        if(isCheck)
        {
            return get(url, params, header,defaultSSL, defaultHttpUser, defaultHttpPassword);
        }
        else{
            return get(url, params, header, null, null, null);
        }
    }
    public static HttpResponse get(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl)
    {
        return get(url, params, header, ssl, defaultHttpUser, defaultHttpPassword);
    }
    public static HttpResponse get(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl, String user, String password)
    {
        return HttpClientUtil.request("GET", url, params, header, ssl, user, password);
    }
    /************************** Post方法 ******************************************/
    public static HttpResponse post(String url)
    {
        return post(url, null, null);
    }
    public static HttpResponse post(String url, Map<String,Object> params)
    {
        return post(url, params, null);
    }
    public static HttpResponse post(String url, Map<String,Object> params, Map<String,Object> header)
    {
        if(url.startsWith("https"))
        {
            return post(url, params, header, defaultSSL);
        }
        else{
            //默认http不走ssl和用户密码
            return post(url, params, header, null, null, null);
        }
    }
    public static HttpResponse post(String url, Map<String,Object> params, Map<String,Object> header, Boolean isCheck)
    {
        if(isCheck)
        {
            return post(url, params, header, defaultSSL, defaultHttpUser, defaultHttpPassword);
        }
        else{
            return post(url, params, header, null, null, null);
        }
    }
    public static HttpResponse post(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl)
    {
        return post(url, params, header, ssl, defaultHttpUser, defaultHttpPassword);
    }
    public static HttpResponse post(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl, String user, String password)
    {
        return HttpClientUtil.request("POST",url,params,header,ssl,user,password);
    }
    public static HttpResponse postFile(String url, List<NameValuePair> formParams, String filePath, Map<String,Object> header)
    {
        File file = new File(filePath);
        if(url.startsWith("https"))
        {
            return HttpClientUtil.postFile(url, file, formParams, defaultSSL, defaultHttpUser, defaultHttpPassword, header);
        }
        else{
            //默认http不走ssl和用户密码
            return HttpClientUtil.postFile(url, file, formParams, null, defaultHttpUser, defaultHttpPassword, header);
        }
    }
    public static HttpResponse postFile(String url, List<NameValuePair> formParams, File file, Map<String,Object> header)
    {
        if(url.startsWith("https")) {
            return HttpClientUtil.postFile(url, file, formParams, defaultSSL,defaultHttpUser,defaultHttpPassword, header);
        }
        else{
            //默认http不走ssl和用户密码
            return HttpClientUtil.postFile(url, file, formParams, null,defaultHttpUser,defaultHttpPassword, header);
        }
    }
    /************************** Put方法 ******************************************/
    public static HttpResponse put(String url)
    {
        return put(url, null, null);
    }
    public static HttpResponse put(String url, Map<String,Object> params)
    {
        return put(url, params, null);
    }
    public static HttpResponse put(String url, Map<String,Object> params, Map<String,Object> header)
    {
        if(url.startsWith("https"))
        {
            return put(url, params, header, defaultSSL);
        }
        else{
            //默认http不走ssl和用户密码
            return put(url, params, header, null, null, null);
        }
    }
    public static HttpResponse put(String url, Map<String,Object> params, Map<String,Object> header, Boolean isCheck)
    {
        if(isCheck)
        {
            return put(url, params, header, defaultSSL, defaultHttpUser, defaultHttpPassword);
        }
        else{
            return put(url, params, header, null, null, null);
        }
    }
    public static HttpResponse put(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl)
    {
        return put(url, params, header, ssl, defaultHttpUser, defaultHttpPassword);
    }
    public static HttpResponse put(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl, String user, String password)
    {
        return HttpClientUtil.request("PUT",url,params,header,ssl,user,password);
    }
    /************************** Delete方法 **************************************/
    public static HttpResponse delete(String url)
    {
        return delete(url, null, null);
    }
    public static HttpResponse delete(String url, Map<String,Object> params)
    {
        return delete(url, params, null);
    }
    public static HttpResponse delete(String url, Map<String,Object> params, Map<String,Object> header)
    {
        if(url.startsWith("https"))
        {
            return delete(url, params, header, defaultSSL);
        }
        else{
            //默认http不走ssl和用户密码
            return delete(url, params, header, null, null, null);
        }
    }
    public static HttpResponse delete(String url, Map<String,Object> params, Map<String,Object> header, Boolean isCheck)
    {
        if(isCheck)
        {
            return delete(url, params, header, defaultSSL, defaultHttpUser, defaultHttpPassword);
        }
        else{
            return delete(url, params, header, null, null, null);
        }
    }
    public static HttpResponse delete(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl)
    {
        return delete(url, params, header, ssl, defaultHttpUser, defaultHttpPassword);
    }
    public static HttpResponse delete(String url, Map<String,Object> params, Map<String,Object> header, SSLConnectionSocketFactory ssl, String user, String password)
    {
        return HttpClientUtil.request("DELETE",url,params,header,ssl,user,password);
    }
}

+ 36 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/http/HttpResponse.java

@ -0,0 +1,36 @@
package com.yihu.ehr.iot.util.http;
/**
 * add by hzp at 2016-3-10
 */
public class HttpResponse {
    public HttpResponse()
    {
    }
    public HttpResponse(int statusCode, String body) {
        this.statusCode = statusCode;
        this.body = body;
    }
    private int statusCode;
    private String body;
    public int getStatusCode() {
        return statusCode;
    }
    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }
    public String getBody() {
        return body;
    }
    public void setBody(String body) {
        this.body = body;
    }
}

+ 18 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/CollectionUtil.java

@ -0,0 +1,18 @@
package com.yihu.ehr.iot.util.operator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Collection;
/**
 * Hibernate Criteria utils
 *
 * @since 1.0.6
 */
public class CollectionUtil {
    public static boolean isEmpty(Collection coll) {
        return CollectionUtils.isEmpty(coll);
    }
}

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

@ -0,0 +1,1525 @@
/****************************************************************************
 * Copyright(c) Yamaha Motor Solutions CO.,Ltd. 2010 All Rights Reserved
 * <p>
 * System Name:(smart)Human Resource Management System
 * SubSystem Name:-
 * service for all substystems
 * <p>
 * File Name: DateUtil
 * <p>
 * HISTORY RECORD
 * Ver.   Date           Create User/Update     Comment
 * -------------------------------------------------------------------------
 * 1.0    2010/07/12    tuchengye              New Making
 ***************************************************************************/
package com.yihu.ehr.iot.util.operator;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.*;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
public class DateUtil {
    public static final String DEFAULT_DATE_YEAR_FORMAT = "yyyy";
    public static final String DEFAULT_DATE_MONTH_FORMAT = "MM";
    public static final String PRINT_DATE_YM_FORMAT = "MMM., yyyy";
    public static final String PRINT_DATE_YMD_FORMAT = "MMM. d, yyyy";
    public static final Locale PRINT_LOCALE = Locale.ENGLISH;
    public static final String DEFAULT_YEARS = "0.0";
    public static final String DEFAULT_DATE_YMD_FORMAT = "yyyy-MM-dd";
    public static final String DEFAULT_DATE_YM_FORMAT = "yyyyMM";
    public static final String DEFAULT_DATE_MD_FORMAT = "MMdd";
    public static final String DEFAULT_CHAR_DATE_YMD_FORMAT = "yyyyMMdd";
    public static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
    public final static String DEFAULT_SIMPLEDATE_FORMAT = "yyyy-MM-dd HH:mm:ss SSS";
    public final static String DEFAULT_YMDHMSDATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
    public static final String DEFAULT_NOW_STRING_FORMAT = "yyyyMMddHHmmssSSS";
    public static final String DATE_MDY_FORMAT = "MMddyyyy";
    public static final String DATE_MY_FORMAT = "MMyyyy";
    public static final String DATE_WORLD_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
    public static String changeFormat(String changeDate, String beforeFormat, String afterFormat) {
        if (StringUtil.isBlank(changeDate)) {
            return changeDate;
        }
        return formatDate(parseDate(changeDate, beforeFormat), afterFormat);
    }
    public static String changeToYMDFormatForPrint(String changeDate) {
        if (StringUtil.isBlank(changeDate)) {
            return "";
        }
        DateFormat df = new SimpleDateFormat(PRINT_DATE_YMD_FORMAT, Locale.ENGLISH);
        return df.format(parseDate(changeDate, DEFAULT_CHAR_DATE_YMD_FORMAT));
    }
    public static String changeToYMFormatForPrint(String changeDate) {
        if (StringUtil.isBlank(changeDate)) {
            return "";
        }
        DateFormat df = new SimpleDateFormat(PRINT_DATE_YM_FORMAT, Locale.ENGLISH);
        return df.format(parseDate(changeDate, DEFAULT_DATE_YM_FORMAT));
    }
    public static String getFirstDate(String yearMonthStr, String yearMonthFormat, String dateFormat) throws Exception {
        DateFormat dfYearMonth = new SimpleDateFormat(yearMonthFormat);
        DateFormat dfDate = new SimpleDateFormat(dateFormat);
        java.util.Date date;
        if (yearMonthStr == null || yearMonthStr.equals("")) {
            throw new Exception(yearMonthStr + " is invalid.");
        }
        try {
            date = dfYearMonth.parse(yearMonthStr);
        } catch (ParseException e) {
            throw new Exception(yearMonthStr + " is invalid.");
        }
        return dfDate.format(date);
    }
    public static String getLastDate(String dateSource, String dateSourceFormat, String dateFormat) throws Exception {
        DateFormat dsf = new SimpleDateFormat(dateSourceFormat);
        DateFormat df = new SimpleDateFormat(dateFormat);
        java.util.Date date;
        String resultDateString;
        if (dateSource == null || dateSource.equals("")) {
            throw new Exception(dateSource + " is invalid.");
        }
        try {
            date = dsf.parse(dateSource);
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);
            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
            resultDateString = df.format(cal.getTime());
        } catch (ParseException e) {
            throw new Exception(dateSource + " is invalid.");
        }
        return resultDateString;
    }
    public static String getYearFromDBDate(String dateStr) {
        if (dateStr == null || dateStr.length() != DEFAULT_CHAR_DATE_YMD_FORMAT.length()) {
            return null;
        }
        return changeFormat(dateStr, DEFAULT_CHAR_DATE_YMD_FORMAT, DEFAULT_DATE_YEAR_FORMAT);
    }
    public static String getMonthFromDBDate(String dateStr) {
        if (dateStr == null || dateStr.length() != DEFAULT_CHAR_DATE_YMD_FORMAT.length()) {
            return null;
        }
        return changeFormat(dateStr, DEFAULT_CHAR_DATE_YMD_FORMAT, DEFAULT_DATE_MONTH_FORMAT);
    }
    public static String getYMFromDBDate(String dateStr) {
        if (dateStr == null || dateStr.length() != DEFAULT_CHAR_DATE_YMD_FORMAT.length()) {
            return null;
        }
        return changeFormat(dateStr, DEFAULT_CHAR_DATE_YMD_FORMAT, DEFAULT_DATE_YM_FORMAT);
    }
    public static int getDifferenceOfDays(java.util.Date dateFrom, java.util.Date dateTo) {
        return new Long((dateTo.getTime() - dateFrom.getTime()) / 1000 / 60 / 60 / 24).intValue();
    }
    public static int getDifferenceOfDays(String dateFromStr, String dateToStr, String dateFormat) {
        java.util.Date dateFrom = parseDate(dateFromStr, dateFormat);
        java.util.Date dateTo = parseDate(dateToStr, dateFormat);
        return getDifferenceOfDays(dateFrom, dateTo);
    }
    public static int getDifferenceOfDays(String dateFromStr, String dateToStr) {
        return getDifferenceOfDays(dateFromStr, dateToStr, DEFAULT_CHAR_DATE_YMD_FORMAT);
    }
    public static String formatTime(String timeStr) {
        if (timeStr == null || timeStr.length() != 6) {
            return null;
        }
        return StringUtil.substring(timeStr, 0, 2)
                + ":" + StringUtil.substring(timeStr, 2, 4)
                + ":" + StringUtil.substring(timeStr, 4);
    }
    public static String toString(Date date) {
        return toString((java.util.Date) date);
    }
    public static String toString(java.util.Date date) {
        return toString(date, DEFAULT_DATE_YMD_FORMAT);
    }
    public static String toString(Date date, String format) {
        return toString((java.util.Date) date, format);
    }
    public static String toString(java.util.Date date, String format) {
        if (date == null) {
            return null;
        }
        if (format == null) {
            throw new IllegalArgumentException("The value of an argument is inaccurate.");
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
    public static String formatTimestamp(Timestamp time) {
        return formatTimestamp(time, DEFAULT_TIMESTAMP_FORMAT);
    }
    public static String formatTimestamp(Timestamp time, String format) {
        if (time == null) {
            return null;
        }
        if (format == null) {
            throw new IllegalArgumentException("The value of an argument is inaccurate.");
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(time);
    }
    public static String toString(Time time, String format) {
        if (time == null) {
            return null;
        }
        if (format == null) {
            throw new IllegalArgumentException("The value of an argument is inaccurate.");
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(time);
    }
    public static Date formatCharDateYMD(String str) {
        return formatCharDateYMD(str, DEFAULT_DATE_YMD_FORMAT);
    }
    public static Date formatCharDateYMD(String str, String format) {
        if (str == null || str.trim().length() == 0) {
            return null;
        }
        if (format == null) {
            throw new IllegalArgumentException("The value of an argument is inaccurate.");
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        ParsePosition pos = new ParsePosition(0);
        java.util.Date date = sdf.parse(str, pos);
        if (date == null) {
            return null;
        }
        return new Date(date.getTime());
    }
    public static Date formatCharDateYMD(String yy, String mm, String dd) {
        if (yy == null || mm == null || dd == null || yy.trim().length() == 0 ||
                mm.trim().length() == 0 || dd.trim().length() == 0) {
            return null;
        }
        return formatCharDateYMD(yy + "-" + (mm != null && mm.length() == 1 ? "0" + mm : mm) + "-" +
                (dd != null && dd.length() == 1 ? "0" + dd : dd));
    }
    public static Timestamp toTimestamp(String str) {
        if (str == null) {
            return null;
        }
        try {
            return Timestamp.valueOf(str.trim());
        } catch (IllegalArgumentException iae) {
            return null;
        }
    }
    public static Timestamp toTimestamp(String str, String format) {
        if (str == null) {
            return null;
        }
        try {
            return new Timestamp(parseDate(str, format).getTime());
        } catch (Exception e) {
            return null;
        }
    }
    public static Time toTime(String str) {
        if (str == null) {
            return null;
        }
        try {
            return (str.length() == 5 ? Time.valueOf(str + ":00") : Time.valueOf(str));
        } catch (Exception e) {
            return null;
        }
    }
    public static String toString(Time time) {
        return toString(time, DEFAULT_TIME_FORMAT);
    }
    public static String toYM(String yy, String mm) {
        if (yy == null || mm == null) {
            return null;
        }
        if (yy.trim().length() == 0 && mm.trim().length() != 0 ||
                yy.trim().length() != 0 && mm.trim().length() == 0) {
            return null;
        }
        return yy + (mm != null && mm.length() == 1 ? "0" + mm : mm);
    }
    public static String getNowDate() {
        return getNowDate(DEFAULT_NOW_STRING_FORMAT);
    }
    public static String getNowDate(String format) {
        if (format == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.JAPAN);
        java.util.Date date = Calendar.getInstance().getTime();
        if (date == null) {
            return null;
        }
        return sdf.format(date);
    }
    public static Date getSysDate() {
        return new Date(Calendar.getInstance().getTime().getTime());
    }
    public static java.util.Date getSysDateYMDHMS() {
        Date dSysDateYMD = DateUtil.getSysDate();
        Timestamp ts = formatYMDToYMDHMS(StringUtil.toString(dSysDateYMD));
        return ts;
    }
    public static Timestamp getSysDateTime() {
        return new Timestamp(Calendar.getInstance().getTime().getTime());
    }
    public static Time getSysTime() {
        return new Time(Calendar.getInstance().getTime().getTime());
    }
    public static String toAge(String birthDay) {
        if (birthDay == null || birthDay.length() != 8) {
            return null;
        }
        int birthYear = Integer.parseInt(birthDay.substring(0, 4));
        int birthMonth = Integer.parseInt(birthDay.substring(4, 6));
        int birthDayOfMonth = Integer.parseInt(birthDay.substring(6, 8));
        return toAge(birthYear, birthMonth, birthDayOfMonth);
    }
    public static String toAge(int birthYear, int birthMonth, int birthDayOfMonth) {
        Calendar cl = Calendar.getInstance();
        int year = cl.get(Calendar.YEAR);
        int month = cl.get(Calendar.MONTH) + 1;
        int day = cl.get(Calendar.DAY_OF_MONTH);
        int sa = 0;
        if (month > birthMonth) {
            sa = 0;
        } else if (month == birthMonth && day >= birthDayOfMonth) {
            sa = 0;
        } else {
            sa = 1;
        }
        int age = year - birthYear - sa;
        return Integer.toString(age);
    }
    public static Date addDate(int add, java.util.Date d) {
        return addDate(add, new Date(d.getTime()));
    }
    public static java.util.Date addDateTime(int add, java.util.Date d) {
        return addDateTime(add, new Date(d.getTime()));
    }
    public static Date addDate(int add, Date d) {
        if (d == null) {
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.setTime((java.util.Date) d);
        cal.setTimeZone(TimeZone.getDefault());
        cal.add(Calendar.DAY_OF_MONTH, add);
        return new Date(cal.getTime().getTime());
    }
    public static java.util.Date addDateTime(int add, Date d) {
        if (d == null) {
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.setTime((java.util.Date) d);
        cal.setTimeZone(TimeZone.getDefault());
        cal.add(Calendar.DAY_OF_MONTH, add);
        return cal.getTime();
    }
    public static String addDate(int add, String sDate) {
        if (sDate.length() < 8) {
            return null;
        }
        return formatDate(addDate(add, formatCharDateYMD(sDate, DEFAULT_CHAR_DATE_YMD_FORMAT)), DEFAULT_CHAR_DATE_YMD_FORMAT);
    }
    public static Date addMonth(int add, java.util.Date d) {
        return addMonth(add, new Date(d.getTime()));
    }
    public static Date addMonth(int add, Date d) {
        if (d == null) {
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.setTime((java.util.Date) d);
        cal.setTimeZone(TimeZone.getDefault());
        cal.add(Calendar.MONTH, add);
        return new Date(cal.getTime().getTime());
    }
    public static String addMonth(int add, String sDate) {
        if (sDate.length() < 8) {
            return null;
        }
        return formatDate(addMonth(add, formatCharDateYMD(sDate, DEFAULT_CHAR_DATE_YMD_FORMAT)), DEFAULT_CHAR_DATE_YMD_FORMAT);
    }
    public static Date addYear(int add, java.util.Date d) {
        return addYear(add, new Date(d.getTime()));
    }
    public static Date addYear(int add, Date d) {
        if (d == null) {
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.setTime((java.util.Date) d);
        cal.setTimeZone(TimeZone.getDefault());
        cal.add(Calendar.YEAR, add);
        return new Date(cal.getTime().getTime());
    }
    public static String addYear(int add, String sDate) {
        if (sDate.length() < 8) {
            return null;
        }
        return formatDate(addYear(add, formatCharDateYMD(sDate, DEFAULT_CHAR_DATE_YMD_FORMAT)), DEFAULT_CHAR_DATE_YMD_FORMAT);
    }
    public static String getNowDateTime() {
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss", Locale.JAPAN);
        df.setTimeZone(TimeZone.getDefault());
        return df.format(new java.util.Date());
    }
    public static String getCurrentString() {
        return getCurrentString(DEFAULT_SIMPLEDATE_FORMAT);
    }
    public static String getCurrentString(String pattern) {
        SimpleDateFormat f = new SimpleDateFormat(pattern);
        return f.format(Calendar.getInstance(TimeZone.getDefault()).getTime());
    }
    public static long compareDate(String pattern, String s1, String s2) {
        SimpleDateFormat f = new SimpleDateFormat(pattern);
        try {
            return f.parse(s1).getTime() - f.parse(s2).getTime();
        } catch (Exception e) {
            return -1;
        }
    }
    public static long compareDate(java.util.Date s1, java.util.Date s2) {
        try {
            return compareDate(DEFAULT_DATE_YMD_FORMAT, toString(s1), toString(s2));
        } catch (Exception e) {
            return -1;
        }
    }
    public static long compareDateTime(java.util.Date s1, java.util.Date s2) {
        return s1.getTime() - s2.getTime();
    }
    public static java.util.Date parseDate(String value, String pattern) {
        try {
            TimeZone tz = TimeZone.getDefault();
            String dateFormat = pattern;
            SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
            sdf.setTimeZone(tz);
            // Parse date
            java.util.Date parsed = null;
            parsed = sdf.parse(value);
            return parsed;
        } catch (ParseException e) {
            return null;
        }
    }
    public static String formatDate(java.util.Date value, String pattern) {
        TimeZone tz = TimeZone.getDefault();
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        sdf.setTimeZone(tz);
        return sdf.format(value);
    }
    public static int getLastDay(Date dt) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(dt);
        int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
        return lastDay;
    }
    public static String getYMDFormat(String datePtn) {
        final String[][] DATE_FORMAT_YMD_LIST = {{"1", "yyyy/MM/dd"},
                {"2", "yyyy.MM.dd"},
                {"3", "yyyy-MM-dd"},
                {"4", "MM/dd/yyyy"},
                {"5", "MM.dd.yyyy"},
                {"6", "MM-dd-yyyy"},
                {"7", "dd/MM/yyyy"},
                {"8", "dd.MM.yyyy"},
                {"9", "dd-MM-yyyy"},
                {"A", "dd/MM yyyy"}
        };
        String format = null;
        for (int i = 0; i < DATE_FORMAT_YMD_LIST.length; i++) {
            if (DATE_FORMAT_YMD_LIST[i][0].equals(datePtn)) {
                format = DATE_FORMAT_YMD_LIST[i][1];
                break;
            }
        }
        if (format == null) {
            throw new IllegalArgumentException("The value of an argument is inaccurate.");
        }
        return format;
    }
    public static String getYMFormat(String datePtn) {
        final String[][] DATE_FORMAT_YM_LIST = {{"1", "yyyy/MM"},
                {"2", "yyyy.MM"},
                {"3", "yyyy-MM"},
                {"4", "MM/yyyy"},
                {"5", "MM.yyyy"},
                {"6", "MM-yyyy"},
                {"7", "MM/yyyy"},
                {"8", "MM.yyyy"},
                {"9", "MM-yyyy"},
                {"A", "MM yyyy"},
                {"B", "yyyyMM"}
        };
        String format = null;
        for (int i = 0; i < DATE_FORMAT_YM_LIST.length; i++) {
            if (DATE_FORMAT_YM_LIST[i][0].equals(datePtn)) {
                format = DATE_FORMAT_YM_LIST[i][1];
                break;
            }
        }
        if (format == null) {
            throw new IllegalArgumentException("The value of an argument is inaccurate.");
        }
        return format;
    }
    public static String toYMD(Date date, String datePtn) {
        if (date == null) {
            return null;
        }
        return toString(date, getYMDFormat(datePtn));
    }
    public static String formatDateYMD(String str, String datePtn) {
        if (str == null || str.trim().length() == 0) {
            return null;
        }
        return toYMD(formatCharDateYMD(str), datePtn);
    }
    public static String formatDateYMD(String yy, String mm, String dd, String datePtn) {
        if (yy == null || mm == null || dd == null || yy.trim().length() == 0
                || mm.trim().length() == 0 || dd.trim().length() == 0) {
            return null;
        }
        return formatDateYMD(yy + "-" + (mm != null && mm.length() == 1 ? "0" + mm : mm)
                + "-" + (dd != null && dd.length() == 1 ? "0" + dd : dd), datePtn);
    }
    public static String formatDateYM(Date date, String datePtn) {
        if (date == null) {
            return null;
        }
        return toString(date, getYMFormat(datePtn));
    }
    public static String formatDateYM(String str, String datePtn) {
        if (str == null || str.trim().length() == 0) {
            return null;
        }
        return formatDateYM(formatCharDateYMD(str, DEFAULT_DATE_YM_FORMAT), datePtn);
    }
    public static String formatDateYM(String yy, String mm, String datePtn) {
        if (yy == null || mm == null || yy.trim().length() == 0 || mm.trim().length() == 0) {
            return null;
        }
        return formatDateYM(yy + (mm != null && mm.length() == 1 ? "0" + mm : mm), datePtn);
    }
    public static String getTimestampFormat(String dateStyleId) {
        return getYMDFormat(dateStyleId) + " HH:mm:ss";
    }
    public static Date toDateFromTime(String time) {
        try {
            return toDateFromTime(Long.parseLong(time));
        } catch (Exception iae) {
            return null;
        }
    }
    public static Date toDateFromTime(long time) {
        return new Date(time);
    }
    public static Timestamp toTimestampFromTime(String time) {
        try {
            return toTimestampFromTime(Long.parseLong(time));
        } catch (Exception iae) {
            return null;
        }
    }
    public static Timestamp toTimestampFromTime(long time) {
        return new Timestamp(time);
    }
    public static Timestamp toTimestampFromGMT(int yy, int mm, int dd, int hh, int mi, int ss) {
        return toTimestampFromGMT(
                String.valueOf(yy),
                String.valueOf(mm),
                String.valueOf(dd),
                String.valueOf(hh),
                String.valueOf(mi),
                String.valueOf(ss));
    }
    public static Timestamp toTimestampFromGMT(String yy, String mm, String dd,
                                               String hh, String mi, String ss) {
        mm = mm != null && mm.length() == 1 ? "0" + mm : mm;
        dd = dd != null && dd.length() == 1 ? "0" + dd : dd;
        hh = hh != null && hh.length() == 1 ? "0" + hh : hh;
        mi = mi != null && mi.length() == 1 ? "0" + mi : mi;
        ss = ss != null && ss.length() == 1 ? "0" + ss : ss;
        return toTimestampFromGMT(yy + "-" + mm + "-" + dd + " " + hh + ":" + mi + ":" + ss);
    }
    public static Timestamp toTimestampFromGMT(String str) {
        if (str == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_TIMESTAMP_FORMAT);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        ParsePosition pos = new ParsePosition(0);
        java.util.Date date = sdf.parse(str, pos);
        if (date == null) {
            return null;
        }
        return new Timestamp(date.getTime());
    }
    public static Timestamp toTimestampFromGMT(Timestamp time) {
        return toTimestampFromGMT(StringUtil.toString(time));
    }
    public static Timestamp toTimestampFromLocal(String yy, String mm, String dd, String hh,
                                                 String mi, String ss, String differTimeSign,
                                                 String differenceTime, String summerTimeFrom,
                                                 String summerTimeTo, String summerTime) {
        mm = mm != null && mm.length() == 1 ? "0" + mm : mm;
        dd = dd != null && dd.length() == 1 ? "0" + dd : dd;
        hh = hh != null && hh.length() == 1 ? "0" + hh : hh;
        mi = mi != null && mi.length() == 1 ? "0" + mi : mi;
        ss = ss != null && ss.length() == 1 ? "0" + ss : ss;
        return toTimestampFromLocal(
                yy + "-" + mm + "-" + dd + " " + hh + ":" + mi + ":" + ss,
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime);
    }
    public static Timestamp toTimestampFromLocal(String str, String differTimeSign,
                                                 String differenceTime, String summerTimeFrom,
                                                 String summerTimeTo, String summerTime) {
        if (str == null) {
            return null;
        }
        Timestamp time = toTimestamp(str);
        if (time == null) {
            return null;
        }
        long localTime = toGMTTimeFromLocalTime(
                time.getTime(),
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime);
        return toTimestampFromGMT(new Timestamp(localTime));
    }
    public static Timestamp toTimestampFromLocal(Timestamp time, String differTimeSign,
                                                 String differenceTime, String summerTimeFrom,
                                                 String summerTimeTo, String summerTime) {
        return toTimestampFromLocal(
                StringUtil.toString(time),
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime);
    }
    public static long toGMTTime(long local) {
        SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_TIMESTAMP_FORMAT);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        ParsePosition pos = new ParsePosition(0);
        java.util.Date date = sdf.parse(StringUtil.toString(new Timestamp(local)), pos);
        if (date == null) {
            return -1;
        }
        return date.getTime();
    }
    public static long toGMTTime(Timestamp local) {
        if (local == null) {
            return -1;
        }
        return toGMTTime(local.getTime());
    }
    public static Timestamp toGMTTimestamp(long local) {
        long time = toGMTTime(local);
        if (time == -1) {
            return null;
        }
        return new Timestamp(time);
    }
    public static Timestamp toGMTTimestamp(Timestamp local) {
        if (local == null) {
            return null;
        }
        return toGMTTimestamp(local.getTime());
    }
    public static String toYMD(String yy, String mm, String dd) {
        if (yy == null || mm == null || dd == null) {
            return null;
        }
        if (yy.trim().length() == 0 || mm.trim().length() == 0) {
            return "";
        }
        mm = mm != null && mm.length() == 1 ? "0" + mm : mm;
        if (dd != null && dd.length() == 0) {
            dd = "  ";
        }
        if (dd != null && dd.length() == 1) {
            dd = "0" + dd;
        }
        return yy + mm + dd;
    }
    public static String getYearFromYM(String ym) {
        if (ym == null || ym.length() != DEFAULT_DATE_YM_FORMAT.length()) {
            return null;
        }
        return ym.substring(0, 4);
    }
    public static String getMonthFromYM(String ym) {
        if (ym == null || ym.length() != DEFAULT_DATE_YM_FORMAT.length()) {
            return null;
        }
        return ym.substring(4, 6);
    }
    public static String getYearFromYMD(Date ymd) {
        return getYearFromYMD(toString(ymd));
    }
    public static String getMonthFromYMD(Date ymd) {
        return getMonthFromYMD(toString(ymd));
    }
    public static String getDateFromYMD(Date ymd) {
        return getDateFromYMD(toString(ymd));
    }
    public static String getYearFromYMD(String ymd) {
        if (ymd == null || ymd.length() != DEFAULT_DATE_YMD_FORMAT.length()) {
            return null;
        }
        return ymd.substring(0, 4);
    }
    public static String getMonthFromYMD(String ymd) {
        if (ymd == null || ymd.length() != DEFAULT_DATE_YMD_FORMAT.length()) {
            return null;
        }
        return ymd.substring(5, 7);
    }
    public static String getDateFromYMD(String ymd) {
        if (ymd == null || ymd.length() != DEFAULT_DATE_YMD_FORMAT.length()) {
            return null;
        }
        return ymd.substring(8, 10);
    }
    public static String getHourFromHMS(String hms) {
        if (hms == null || hms.length() != DEFAULT_TIME_FORMAT.length()) {
            return null;
        }
        return hms.substring(0, 2);
    }
    public static String getMinuteFromHMS(String hms) {
        if (hms == null || hms.length() != DEFAULT_TIME_FORMAT.length()) {
            return null;
        }
        return hms.substring(3, 5);
    }
    public static String getSecondFromHMS(String hms) {
        if (hms == null || hms.length() != DEFAULT_TIME_FORMAT.length()) {
            return null;
        }
        return hms.substring(6, 8);
    }
    public static String formatDateYMD(Date date, String dateStyleId) {
        if (date == null) {
            return null;
        }
        return toString(date, getYMDFormat(dateStyleId));
    }
    public static long getSystemTime() {
        return Calendar.getInstance().getTime().getTime();
    }
    public static Timestamp getSystemTimestamp() {
        return new Timestamp(getSystemTime());
    }
    public static long getSystemTimeGMTToday() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        Timestamp today = toTimestamp(sdf.format(Calendar.getInstance().getTime()) + " 00:00:00");
        return toGMTTime(today);
    }
    public static Timestamp getSystemTimestampGMTToday() {
        long time = getSystemTimeGMTToday();
        if (time == -1) {
            return null;
        }
        return new Timestamp(time);
    }
    public static Date getSysDateGMTToday() {
        long time = getSystemTimeGMTToday();
        if (time == -1) {
            return null;
        }
        return new Date(getSystemTimeGMTToday());
    }
    public static String formatTimestamp(Timestamp time, String differTimeSign,
                                         String differenceTime, String summerTimeFrom,
                                         String summerTimeTo, String summerTime) {
        if (time == null) {
            return null;
        }
        return toStringFormatLocalTime(
                time.getTime(),
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                DEFAULT_TIMESTAMP_FORMAT);
    }
    public static String formatTimestamp(Timestamp time, String differTimeSign,
                                         String differenceTime, String summerTimeFrom,
                                         String summerTimeTo, String summerTime, String dateStyleId) {
        if (time == null) {
            return null;
        }
        return toStringFormatLocalTime(
                time.getTime(),
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                getTimestampFormat(dateStyleId));
    }
    public static String formatTimestamp(long time, String differTimeSign, String differenceTime,
                                         String summerTimeFrom, String summerTimeTo, String summerTime) {
        return toStringFormatLocalTime(
                time,
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                DEFAULT_TIMESTAMP_FORMAT);
    }
    public static String formatTimestamp(long time, String differTimeSign, String differenceTime,
                                         String summerTimeFrom, String summerTimeTo,
                                         String summerTime, String dateStyleId) {
        return toStringFormatLocalTime(
                time,
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                getTimestampFormat(dateStyleId));
    }
    public static String formatTimestampToDate(Timestamp time, String differTimeSign,
                                               String differenceTime, String summerTimeFrom,
                                               String summerTimeTo, String summerTime) {
        if (time == null) {
            return null;
        }
        return toStringFormatLocalTime(
                time.getTime(),
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                DEFAULT_DATE_YMD_FORMAT);
    }
    public static String formatTimestampToDate(Timestamp time, String differTimeSign,
                                               String differenceTime, String summerTimeFrom,
                                               String summerTimeTo, String summerTime, String dateStyleId) {
        if (time == null) {
            return null;
        }
        return toStringFormatLocalTime(
                time.getTime(),
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                getYMDFormat(dateStyleId));
    }
    public static String formatTimestampToDate(long time, String differTimeSign,
                                               String differenceTime, String summerTimeFrom,
                                               String summerTimeTo, String summerTime) {
        return toStringFormatLocalTime(
                time,
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                DEFAULT_DATE_YMD_FORMAT);
    }
    public static String formatTimestampToDate(long time, String differTimeSign,
                                               String differenceTime, String summerTimeFrom,
                                               String summerTimeTo, String summerTime, String dateStyleId) {
        return toStringFormatLocalTime(
                time,
                differTimeSign,
                differenceTime,
                summerTimeFrom,
                summerTimeTo,
                summerTime,
                getYMDFormat(dateStyleId));
    }
    public static String toStringFormatLocalTime(long time, String differTimeSign,
                                                 String differenceTime, String summerTimeFrom,
                                                 String summerTimeTo, String summerTime, String format) {
        long localTime = time;
        long differenceTimeLong = toDifferenceTimeLong(differenceTime);
        long summerTimeLong = toSummerTimeLong(summerTime);
        if (differTimeSign != null && differTimeSign.equals("+")) {
            localTime += differenceTimeLong;
        } else {
            localTime -= differenceTimeLong;
        }
        if (isSummerTime(time, summerTimeFrom, summerTimeTo)) {
            localTime -= summerTimeLong;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        return sdf.format(new java.util.Date(localTime));
    }
    public static long toGMTTimeFromLocalTime(long localTime, String differTimeSign,
                                              String differenceTime, String summerTimeFrom,
                                              String summerTimeTo, String summerTime) {
        long time = localTime;
        long differenceTimeLong = toDifferenceTimeLong(differenceTime);
        long summerTimeLong = toSummerTimeLong(summerTime);
        if (differTimeSign != null && differTimeSign.equals("+")) {
            time -= differenceTimeLong;
        } else {
            time += differenceTimeLong;
        }
        if (isSummerTime(localTime, summerTimeFrom, summerTimeTo)) {
            time += summerTimeLong;
        }
        return time;
    }
    public static long toDifferenceTimeLong(String differenceTime) {
        long differenceTimeLong;
        try {
            long differenceTimeM = Long.parseLong(differenceTime.substring(0, 2));
            long differenceTimeS = Long.parseLong(differenceTime.substring(2, 4));
            differenceTimeLong = (differenceTimeM * 60 * 60 * 1000) + (differenceTimeS * 60 * 1000);
        } catch (Exception e) {
            differenceTimeLong = 0;
        }
        return differenceTimeLong;
    }
    public static long toSummerTimeLong(String summerTime) {
        long summerTimeLong;
        try {
            long summerTimeM = Long.parseLong(summerTime.substring(0, 2));
            long summerTimeS = Long.parseLong(summerTime.substring(2, 4));
            summerTimeLong = (summerTimeM * 60 * 60 * 1000) + (summerTimeS * 60 * 1000);
        } catch (Exception e) {
            summerTimeLong = 0;
        }
        return summerTimeLong;
    }
    public static boolean isSummerTime(long time, String summerTimeFrom, String summerTimeTo) {
        if (summerTimeFrom == null || summerTimeFrom.trim().length() != 4 ||
                summerTimeTo == null || summerTimeTo.trim().length() != 4) {
            return false;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_DATE_MD_FORMAT);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        String md = sdf.format(new java.util.Date(time));
        if (md.compareTo(summerTimeFrom) >= 0 && md.compareTo(summerTimeTo) <= 0) {
            // サマータイム
            return true;
        } else {
            return false;
        }
    }
    public static String formatGMTTimestamp(Timestamp time) {
        return toStringFormatGMTTime(time, DEFAULT_TIMESTAMP_FORMAT);
    }
    public static String formatGMTTimestamp(Timestamp time, String dateStyleId) {
        return toStringFormatGMTTime(time, getTimestampFormat(dateStyleId));
    }
    public static String formatGMTTimestamp(long time) {
        return toStringFormatGMTTime(time, DEFAULT_TIMESTAMP_FORMAT);
    }
    public static String formatGMTTimestamp(long time, String dateStyleId) {
        return toStringFormatGMTTime(time, getTimestampFormat(dateStyleId));
    }
    public static String formatGMTTimestampToDate(Timestamp time) {
        return toStringFormatGMTTime(time, DEFAULT_DATE_YMD_FORMAT);
    }
    public static String formatGMTTimestampToDate(Timestamp time, String dateStyleId) {
        return toStringFormatGMTTime(time, getYMDFormat(dateStyleId));
    }
    public static String formatGMTTimestampToDate(long time) {
        return toStringFormatGMTTime(time, DEFAULT_DATE_YMD_FORMAT);
    }
    public static String formatGMTTimestampToDate(long time, String dateStyleId) {
        return toStringFormatGMTTime(time, getYMDFormat(dateStyleId));
    }
    public static String toStringFormatGMTTime(Timestamp time, String format) {
        if (time == null) {
            return null;
        }
        return toStringFormatGMTTime(time.getTime(), format);
    }
    public static String toStringFormatGMTTime(long time, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        return sdf.format(new java.util.Date(time));
    }
    public static String toStringFormatTime(long time, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new java.util.Date(time));
    }
    public static int getLastDay(int yy, int mm) {
        GregorianCalendar gc = new GregorianCalendar(yy, mm - 1, 1);
        return gc.getActualMaximum(GregorianCalendar.DATE);
    }
    public static String getLocalPattern(Locale locale) {
        SimpleDateFormat f = new SimpleDateFormat();
        f.setCalendar(Calendar.getInstance(locale));
        return f.toLocalizedPattern();
    }
    public static int getYears(java.util.Date date0, java.util.Date date1) {
        Calendar calendar0 = Calendar.getInstance();
        calendar0.setTime(date0);
        Calendar calendar1 = Calendar.getInstance();
        calendar1.setTime(date1);
        int year0 = calendar0.get(Calendar.YEAR);
        int year1 = calendar1.get(Calendar.YEAR);
        int years = year1 - year0;
        return years;
    }
    public static String getDifferenceOfYears(java.util.Date dateFrom, java.util.Date dateTo) {
        String years = DEFAULT_YEARS;
        if (dateFrom == null || dateTo == null) {
            years = DEFAULT_YEARS;
        } else {
            int days = getDifferenceOfDays(dateFrom, dateTo);
            DecimalFormat df = new DecimalFormat("#.0");
            years = df.format(days / 365.0);
        }
        return years;
    }
    public static Date formatCharDateYMDHMS(String str) {
        String format = DEFAULT_YMDHMSDATE_FORMAT;
        if (str == null || str.trim().length() == 0) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        ParsePosition pos = new ParsePosition(0);
        java.util.Date date = sdf.parse(str, pos);
        if (date == null) {
            return null;
        }
        return new Date(date.getTime());
    }
    public static Timestamp formatYMDToYMDHMS(String str) {
        String format = DEFAULT_YMDHMSDATE_FORMAT;
        if (str == null || str.trim().length() == 0) {
            return null;
        }
        str += " 00:00:00";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        ParsePosition pos = new ParsePosition(0);
        java.util.Date date = sdf.parse(str, pos);
        if (date == null) {
            return null;
        }
        Timestamp ts = DateUtil.fromatDateToTimestamp(new Date(date.getTime()));
        return ts;
    }
    public static Timestamp fromatDateToTimestamp(java.util.Date date) {
        Timestamp ts = new Timestamp(System.currentTimeMillis());
        try {
            SimpleDateFormat df = new SimpleDateFormat(DEFAULT_YMDHMSDATE_FORMAT);
            String time = df.format(date);
            ts = Timestamp.valueOf(time);
        } catch (Exception e) {
            return null;
        }
        return ts;
    }
    /**
     * 获取标准时区偏移
     * @return
     */
    public static int geTimeZoneOffset(){
        int offset=0;
        Calendar cal = Calendar.getInstance();
        TimeZone timeZone = cal.getTimeZone();
        offset=timeZone.getRawOffset()/(1000*60*60);
        return offset;
    }
    /**
     *  凌晨0点的时间
     * @param date  时间
     * @param days  正数为 days天后 ,负数为 days天前
     * @return
     */
    public static java.util.Date getTimesmorning(java.util.Date date,int days){
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(Calendar.DATE, cal.get(Calendar.DATE) +(days));
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return  cal.getTime();
    }
    /**
     *  晚上24点的时间
     * @param date  时间
     * @param days  正数为 days天后 ,负数为 days天前
     * @return
     */
    public static java.util.Date getTimesnight(java.util.Date date,int days){
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(Calendar.DATE, cal.get(Calendar.DATE) +(days));
        cal.set(Calendar.HOUR_OF_DAY, 24);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return  cal.getTime();
    }
    /**
     *  日期加减天数 (可优化)
     * @param date 时间
     * @param days 天数差
     * @return
     */
    public static java.util.Date setDateTime(java.util.Date date,int days){
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(Calendar.DATE, cal.get(Calendar.DATE) +(days));
        return  cal.getTime();
    }
    public static Boolean isExpire(java.util.Date fromDate, java.util.Date endDate, Integer expiresIn){
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long diff = (endDate.getTime() - fromDate.getTime())/1000;
        if(diff > expiresIn){
            return true;
        }
        else{
            return false;
        }
    }
    public static String getUtcDate(String dateStr,String format){
        SimpleDateFormat sdf1 = new SimpleDateFormat(DATE_WORLD_FORMAT);
        SimpleDateFormat sdf2 = new SimpleDateFormat(format);
        String date= null;
        try {
            date = sdf1.format(sdf2.parse(dateStr));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
    public static String getUtcDate(java.util.Date date){
        SimpleDateFormat sdf1 = new SimpleDateFormat(DATE_WORLD_FORMAT);
        String utcDate = sdf1.format(date);
        return utcDate;
    }
    //utc时间转换
    public static String utcToDate(String utcTime,String format){
        SimpleDateFormat utcSdf = new SimpleDateFormat(DATE_WORLD_FORMAT);
        SimpleDateFormat newSdf = new SimpleDateFormat(format);
        String date= null;
        try {
            if (!StringUtil.isEmpty(utcTime))
                date = newSdf.format(utcSdf.parse(utcTime));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}

+ 75 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/operator/MD5.java

@ -0,0 +1,75 @@
package com.yihu.ehr.iot.util.operator;
import com.yihu.ehr.iot.util.encode.HexEncode;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Method;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.security.AccessController;
import java.security.MessageDigest;
import java.security.PrivilegedAction;
/**
 * @created  Air 2015/6/2.
 */
public class MD5 {
    static public String hash(String str) throws Exception {
        MessageDigest messageDigest = null;
        messageDigest = MessageDigest.getInstance("MD5");
        messageDigest.reset();
        messageDigest.update(str.getBytes());
        return HexEncode.toHexString(messageDigest.digest());
    }
    public static String getMd5ByFile(File file) throws FileNotFoundException {
        String value = null;
        FileInputStream in = new FileInputStream(file);
        MappedByteBuffer byteBuffer =null;
        try {
            byteBuffer = in.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, file.length());
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update(byteBuffer);
//            BigInteger bi = new BigInteger(1, md5.digest());
//            value = bi.toString(16);
            value= HexEncode.toHexString(md5.digest());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if(null != in) {
                try {
                    in.close();
                    clean(byteBuffer);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        return value;
    }
    public static void clean(final Object buffer) throws Exception {
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                try {
                    Method getCleanerMethod = buffer.getClass().getMethod("cleaner", new Class[0]);
                    getCleanerMethod.setAccessible(true);
                    sun.misc.Cleaner cleaner = (sun.misc.Cleaner) getCleanerMethod.invoke(buffer, new Object[0]);
                    cleaner.clean();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return null;
            }
        });
    }
}

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

@ -0,0 +1,1441 @@
package com.yihu.ehr.iot.util.operator;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.sql.Clob;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtil {
    public static String substring(String str, int start) {
        return StringUtils.substring(str, start);
    }
    public static String substring(String str, int start, int end) {
        return StringUtils.substring(str, start, end);
    }
    public static boolean isBlank(String str) {
        return StringUtils.isBlank(str);
    }
    public static String toString(Object obj) {
        if (obj == null) {
            return null;
        }
        return obj.toString();
    }
    public static String trimLeft(String value) {
        if (value == null)
            return "";
        String result = value;
        char ch[] = result.toCharArray();
        int index = -1;
        for (int i = 0; i < ch.length; i++) {
            if (Character.isWhitespace(ch[i])) {
                index = i;
            } else {
                break;
            }
        }
        if (index != -1) {
            result = result.substring(index + 1);
        }
        return result;
    }
    /**
     * ?��??????????????????
     *
     * @param value ?????
     * @return String src????????
     */
    public static String trimRight(String value) {
        if (value == null)
            return "";
        String result = value;
        char ch[] = result.toCharArray();
        int endIndex = -1;
        for (int i = ch.length - 1; i > -1; i--) {
            if (Character.isWhitespace(ch[i])) {
                endIndex = i;
            } else {
                break;
            }
        }
        if (endIndex != -1) {
            result = result.substring(0, endIndex);
        }
        return result;
    }
    /**
     * ***************************************************** ??
     * ??????????????????"0",?????????? ????????param str:???????????? param len???????????? ?? ???Stirng
     * <p/> ??��????? ??????? ******************************************************
     */
    public static String fillHeadCharsLen(String strOri, int len) {
        return fillHeadCharsLen(strOri, "0", len);
    }
    /**
     * ***************************************************** ??
     * ???????????????????"0",?????????? ????????param str:???????????? param len???????????? ?? ???Stirng
     * <p/> ??��????? ??????? ******************************************************
     */
    public static String fillBackCharsLen(String strOri, int len) {
        return fillBackCharsLen(strOri, "0", len);
    }
    /**
     * ***************************************************** ??
     * ??????????????????????????,?????????? ????????param str:???????????? param subStr:????????????
     * param len???????????? ?? ???Stirng <p/> ??��????? ???????
     * ******************************************************
     */
    public static String fillHeadCharsLen(String strOri, String subStr, int len) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (subStr == null) {
            subStr = " ";
        }
        String fillStr = "";
        for (int i = 0; i < len; i++) {
            fillStr = fillStr + subStr;
        }
        subStr = fillStr + strOri;
        return (subStr.substring(subStr.length() - len, subStr.length()));
    }
    /**
     * ***************************************************** ??
     * ???????????????????????????,?????????? ????????param str:???????????? param subStr:????????????
     * param len???????????? ?? ???Stirng <p/> ??��????? ???????
     * ******************************************************
     */
    public static String fillBackCharsLen(String strOri, String subStr, int len) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (subStr == null) {
            subStr = " ";
        }
        String fillStr = "";
        for (int i = 0; i < len; i++) {
            fillStr = fillStr + subStr;
        }
        subStr = strOri + fillStr;
        return (subStr.substring(0, len));
    }
    /**
     * ***************************************************** ?? ??????????????????"0"
     * ????????param str:???????????? param counter??????????? ?? ???Stirng <p/> ??��????? ???????
     * ******************************************************
     */
    public static String fillHeadChars(String strOri, int counter) {
        return fillHeadChars(strOri, "0", counter);
    }
    /**
     * ***************************************************** ?? ???????????????????"0"
     * ????????param str:???????????? param counter??????????? ?? ???Stirng <p/> ??��????? ???????
     * ******************************************************
     */
    public static String fillBackChars(String strOri, int counter) {
        return fillBackChars(strOri, "0", counter);
    }
    /**
     * ***************************************************** ?? ??????????????????????????
     * ????????param str:???????????? param subStr:???????????? param counter??????????? ??
     * ???Stirng <p/> ??��????? ???????
     * ******************************************************
     */
    public static String fillHeadChars(String strOri, String subStr, int counter) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (counter <= 0 || subStr == null) {
            return strOri;
        }
        String fillStr = "";
        for (int i = 0; i < counter; i++) {
            fillStr = fillStr + subStr;
        }
        return (fillStr + strOri);
    }
    /**
     * ***************************************************** ?? ???????????????????????????
     * ????????param str:???????????? param subStr:???????????? param counter??????????? ??
     * ???Stirng <p/> ??��????? ???????
     * ******************************************************
     */
    public static String fillBackChars(String strOri, String subStr, int counter) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (counter <= 0 || subStr == null) {
            return strOri;
        }
        String fillStr = "";
        for (int i = 0; i < counter; i++) {
            fillStr = fillStr + subStr;
        }
        return (strOri + fillStr);
    }
    /**
     * ***************************************************** ??
     * ????��???????????????null(???????) ????????param str:???????????? ????????? ?? ??????null??true;
     * ?????false <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isEmpty(Object strObj) {
        if (strObj == null || strObj.toString().trim().length() < 1) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ??
     * ????��??????????????????null????(???????)?? ????????param str:???��??????? ????????? ??
     * ???true?????false????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isStrEmpty(String str) {
        if ((str == null) || (str.trim().length() < 1) || "null".endsWith(str.toLowerCase())) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ??
     * ????????????????????????????????null????? ????????param str:???????????? ????????? ??
     * ???????????????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String getValue(String str) {
        if (str == null) {
            return "";
        }
        if (str.trim().length() <= 0)
            return "";
        str = "H" + str;
        str = str.trim();
        str = str.substring(1);
        return str;
    }
    /**
     * ***************************************************** ?? ????��?????????????????????
     * ????????param text:???��?????????param len:????????? ????????? ?? ???return
     * true??��??????false??????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean chkTextLen(String text, int len) {
        if (text == null || text.length() > len) {
            return false;
        } else {
            return true;
        }
    }
    /**
     * ***************************************************** ??
     * ????��??????????????????????????? ????????param text:???��?????????param len:????????? ????????? ??
     * ???return true??��??????false??????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean chkTextTrimLen(String text, int len) {
        if (text == null || text.trim().length() > len) {
            return false;
        } else {
            return true;
        }
    }
    /**
     * ***************************************************** ??
     * ????��???????????????english ????????param text:???��????????? ????????? ?? ???return
     * true???????false:????????????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isStrEn(String text) {
        for (int i = 0; i < text.length(); i++) {
            if (text.charAt(i) > 127) {
                return false;
            }
        }
        return true;
    }
    /**
     * ***************************************************** ?? ????��????????????????
     * ????????param ch:???��????? ????????? ?? ???return true???????false:?????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isCharNum(char ch) {
        if (ch > 47 && ch < 58) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ??
     * ????��?????????????��????????? ????????param str:???��??????? ????????? ?? ???return
     * true??Null?????????????false:??????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isStrNum(String str) {
        if (isStrEmpty(str)) {
            return true;
        }
        boolean notNum = false;
        for (int i = 0; i < str.length(); i++) {
            if (!isCharNum(str.charAt(i))) {
                notNum = true;
            }
        }
        return !notNum;
    }
    /**
     * ***************************************************** ??
     * ????��?????????????��????????? ????????param strSrc:???��??????? ????????? ?? ???return
     * true??????????false:????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isNum(String strSrc) throws Exception {
        for (int i = 0; i < strSrc.length(); i++) {
            if (!isCharNum(strSrc.charAt(i)))
                return false;
        }
        return true;
    }
    /**
     * ***************************************************** ?? ????��??????????????????
     * ????????param ch:???��????? ????????? ?? ???return true????????????false:?????????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isCharLetter(char ch) {
        if ((ch >= 65 && ch <= 90) && (ch >= 97 && ch <= 122)) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ?? ????��?????????????????????
     * ????????param str:???��??????? ????????? ?? ???return true??NULL???��?????????false:?????????
     * <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean isStrLetter(String str) {
        if (isStrEmpty(str))
            return true;
        boolean notLetter = false;
        for (int i = 0; i < str.length(); i++) {
            if (!isCharLetter(str.charAt(i))) {
                notLetter = true;
            }
        }
        return !notLetter;
    }
    /**
     * ***************************************************** ??
     * ?????????????????????????????? ????????param src:?????????? ????????? ?? ???return
     * ??????????????????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static char strToChar(String src) {
        src = src.trim();
        char result = src.charAt(0);
        return result;
    }
    /**
     * ***************************************************** ??
     * ??????????????????????ASCII?? ????????param sql:???????sql?????? ????????? ?? ?????????????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static String encodeSQL(String sql) {
        StringBuffer tempBuff = new StringBuffer();
        for (int i = 0; i < sql.length(); i++) {
            tempBuff.append(Integer.toHexString(sql.charAt(i)));
        }
        return tempBuff.toString();
    }
    /**
     * ***************************************************** ??
     * ??????????ASCII????????????????? ????????param encoded:???????????? ????????? ?? ?????????????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static String decodeSQL(String encoded) {
        StringBuffer tempBuff = new StringBuffer();
        for (int i = 0; i < encoded.length(); i += 2) {
            tempBuff.append((char) Integer.parseInt(
                    encoded.substring(i, i + 2), 16));
        }
        return tempBuff.toString();
    }
    /**
     * ***************************************************** ?? ?????????��??
     * ????????param path1:????��????param context1:?????? ????????? ?? ???return ???��?? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static String getAbsolutePath(String path1, String context1) {
        int i1 = path1.indexOf(context1);
        if (i1 < 0) {
            return path1;
        } else {
            return path1.substring(path1.indexOf(context1) + context1.length());
        }
    }
    /**
     * ***************************************************** ?? ????????? ????????param
     * str1:???????????????param sindex:???��???param eindex:????��?? ????????? ??
     * ???????????��????????��???????????????????��??��??0?????????��????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String getSubString(String str1, int sindex, int eindex) {
        if (str1 == null) {
            return "";
        }
        if (str1.trim().length() <= 0)
            return "";
        if (str1.length() > sindex) {
            if (eindex >= 0)
                return str1.substring(sindex, eindex);
            else if (eindex < 0)
                return str1.substring(sindex);
        }
        return "";
    }
    /**
     * ***************************************************** ??
     * ????????????????????????��??????????????? ????????param strs:???????????????�param size1:?????????�A??
     * ????????? ?? ???return ??????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String[] getValues(String[] strs, int size1) {
        String[] strs1 = new String[size1];
        for (int i = 0; i < size1; i++) {
            strs1[i] = "";
        }
        if (strs == null) {
            return strs1;
        } else {
            if (strs.length < size1) {
                for (int i = 0; i < strs.length; i++) {
                    strs1[i] = strs[i];
                }
                return strs1;
            } else {
                return strs;
            }
        }
    }
    /**
     * ***************************************************** ?? ????????????�I????
     * ????????param strSource ???�I?????????param strFrom ????????param strTo ???????? ????????? ??
     * ????�I???????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String replaceStrAll(String strSource, String strFrom,
                                       String strTo) {
        String strDest = "";
        int intFromLen = strFrom.length();
        int intPos;
        while ((intPos = strSource.indexOf(strFrom)) != -1) {
            strDest = strDest + strSource.substring(0, intPos);
            strDest = strDest + strTo;
            strSource = strSource.substring(intPos + intFromLen);
        }
        strDest = strDest + strSource;
        return strDest;
    }
    public static String replaceStr(String strTarget, String strNew) {
        int iIndex = -1;
        while (true) {
            iIndex = strTarget.indexOf('\n');
            if (iIndex < 0) {
                break;
            }
            String strTemp = null;
            strTemp = strTarget.substring(0, iIndex);
            strTarget = strTemp + strNew + strTarget.substring(iIndex + 1);
        }
        return strTarget;
    }
    /**
     * ***************************************************** ??
     * ????��????????????????��?????? ????????param str1 ?????????????param strarray ??????????????�
     * ????????? ?? ???return true??????;false??��???? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static boolean includestr(String str1, String[] strarray) {
        if (strarray == null || strarray.length <= 0)
            return false;
        for (int i = 0; i < strarray.length; i++) {
            if (strarray[i] == null) {
                if (str1 == null)
                    return true;
                else
                    continue;
            }
            if (strarray[i].trim().equals(str1)) {
                return true;
            }
        }
        return false;
    }
    /**
     * ***************************************************** ??
     * ?????\n?????????????????????????�?????\r ????????param fvalue ???????????? ????????? ?? ???return
     * ?????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String[] getAreaValues(String fvalue) {
        String tmpstr = fvalue;
        int i = 0;
        if (tmpstr == null)
            return null;
        if (tmpstr.trim().equals(""))
            return null;
        while (tmpstr.indexOf("\n") >= 0) {
            i++;
            tmpstr = tmpstr.substring(tmpstr.indexOf("\n") + 1);
        }
        if (tmpstr.trim().equals("")) {
            i--;
        }
        String[] fvalues = new String[i + 1];
        tmpstr = fvalue;
        i = 0;
        while (tmpstr.indexOf("\n") >= 0) {
            fvalues[i] = tmpstr.substring(0, tmpstr.indexOf("\n"));
            if (fvalues[i].indexOf("\r") >= 0)
                fvalues[i] = fvalues[i].substring(0, fvalues[i].indexOf("\r"));
            i++;
            tmpstr = tmpstr.substring(tmpstr.indexOf("\n") + 1);
        }
        if (!tmpstr.trim().equals(""))
            fvalues[i] = tmpstr;
        return fvalues;
    }
    /**
     * ***************************************************** ?? ???????????��?|????\n
     * ????????param fvalue ???????????? ????????? ?? ?????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String getrealAreaValues(String fvalue) {
        String tmpstr = fvalue;
        String returnstr = "";
        if (tmpstr == null)
            return null;
        if (tmpstr.trim().equals(""))
            return "";
        while (tmpstr.indexOf("|") > 0) {
            returnstr += tmpstr.substring(0, tmpstr.indexOf("|")) + "\n";
            tmpstr = tmpstr.substring(tmpstr.indexOf("|") + 1);
        }
        return returnstr;
    }
    /**
     * ***************************************************** ??
     * ?????????????��??��???????????? ????????param strInput ??????????????param chr ????????? ????????? ??
     * ???return ???????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static int countChar(String strInput, char chr) {
        int iCount = 0;
        char chrTmp = ' ';
        if (strInput.trim().length() == 0)
            return 0;
        // ?????????????????
        for (int i = 0; i < strInput.length(); i++) {
            chrTmp = strInput.charAt(i);
            if (chrTmp == chr) {
                iCount++;
            }
        }
        return iCount;
    }
    /**
     * ***************************************************** ?? ??????????????????????????
     * ????????param strs ???????????????? ????????? ?? ????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String strArrayToStr(String[] strs) {
        return strArrayToStr(strs, null);
    }
    /**
     * ***************************************************** ?? ??????��???????????????????
     * ????????param strs ???????????????? ????????? ?? ????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static void printStrs(String[] strs) {
        for (int i = 0; i < strs.length; i++) {
            System.out.println(strs[i]);
        }
    }
    /**
     * ***************************************************** ??
     * ???????????��??????��??????????????????? ????????param strs ?????????????????? ????????? ?? ????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static void printDualStr(String[][] dualStr) {
        for (int i = 0; i < dualStr.length; i++) {
            for (int j = 0; j < dualStr[i].length; j++) {
                System.out.print(dualStr[i][j] + " ");
            }
            System.out.println();
        }
    }
    /**
     * ***************************************************** ??
     * ???????????????????????��???��????��???? ????????param dualStr ??????????? ????????? ?? ???return
     * ???????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String[][] rowToColumn(String[][] dualStr) {
        String[][] returnDualStr = null;
        if (dualStr != null) {
            returnDualStr = new String[dualStr[0].length][dualStr.length];
            for (int i = 0; i < dualStr.length; i++)
                for (int j = 0; j < dualStr[0].length; j++)
                    returnDualStr[j][i] = dualStr[i][j];
        }
        return returnDualStr;
    }
    /**
     * ***************************************************** ??
     * ????????????????????String?????��???????????????? ????????param inStr ?????????? ????????? ?? ???return
     * ??????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String latinString(String inStr) {
        String res = inStr;
        if (null == res)
            return null;
        res = replaceStrAll(res, "\"", "\\\"");
        res = replaceStrAll(res, "'", "\\'");
        return res;
    }
    /**
     * ***************************************************** ?? ?????????????��???�I???????
     * ????????param String strTarget, String strNew ????????? ?? ???return String
     * ????????�I????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String replaceWhiteSpace(String strTarget, String strNew) {
        int iIndex = -1;
        while (true) {
            char cRep = 32;
            iIndex = strTarget.indexOf(cRep);
            if (iIndex < 0) {
                break;
            }
            String strTemp = null;
            strTemp = strTarget.substring(0, iIndex);
            strTarget = strTemp + strNew + strTarget.substring(iIndex + 1);
        }
        return strTarget;
    }
    /**
     * ***************************************************** ??
     * ?????????��?????????��????��?????????????��????��?????????��???? ????????param amount ???????, param
     * length ?????��??��???? ????????? ?? ???return ??????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String double2str(double amount, int length) {
        String strAmt = Double.toString(amount);
        int pos = strAmt.indexOf('.');
        if (pos != -1 && strAmt.length() > length + pos + 1)
            strAmt = strAmt.substring(0, pos + length + 1);
        return strAmt;
    }
    /**
     * ***************************************************** ??
     * ???????chr?????????????String???????split???????"|"??????? ????????param str ??????????,param
     * chr ?????? ????????? ?? ???return String[] ??????????????,????????????|?????????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static String[] doSplit(String str, char chr) {
        int iCount = 0;
        char chrTmp = ' ';
        // ?????????????????
        for (int i = 0; i < str.length(); i++) {
            chrTmp = str.charAt(i);
            if (chrTmp == chr) {
                iCount++;
            }
        }
        String[] strArray = new String[iCount];
        for (int i = 0; i < iCount; i++) {
            int iPos = str.indexOf(chr);
            if (iPos == 0) {
                strArray[i] = "";
            } else {
                strArray[i] = str.substring(0, iPos);
            }
            str = str.substring(iPos + 1); // ??iPos+1??????,str????????��
        }
        return strArray;
    }
    /**
     * ***************************************************** ??
     * ???????s?????????????String???????split???????"|"??????? ????????param str ??????????,param s
     * ???????? ????????? ?? ???return String[] ??????????????,??????????|?????????? <p/>
     * ??��?????20051220 ???????
     * ******************************************************
     */
    public static String[] strSplit(String src, String splitchar) {
        int resultSize = 0;
        int len = src.length();
        int idx = 0;
        String strTemp = "";
        for (int i = 0; i < len; i++) {
            if (src.substring(i, i + 1).equals(splitchar)) {
                resultSize++;
            }
        }
        if ((len > 1) & (!src.substring(len - 1, len).equals(splitchar))) {
            resultSize++;
        }
        String result[] = new String[resultSize];
        for (int i = 0; i < len; i++) {
            if (src.substring(i, i + 1).equals(splitchar)) {
                result[idx] = strTemp;
                idx++;
                strTemp = "";
            } else {
                strTemp = String.valueOf(strTemp)
                        + String.valueOf(src.charAt(i));
            }
        }
        if (!strTemp.equals("")) {
            result[idx] = strTemp;
        }
        return result;
    }
    /**
     * ***************************************************** ??
     * ???????strSeparator?????????????????????��??????? ????????param strToSplit ??????????,param
     * strSeparator ????????,param iLimit ?????�� ????????? ?? ???return String[] ??????????????
     * <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String[] split(String strToSplit, String strSeparator,
                                 int iLimit) {
        ArrayList tmpList = new ArrayList();
        int iFromIndex = 0;
        int iCurIndex = strToSplit.length();
        String strUnitInfo = "";
        int iCurCounts = 0;
        while ((iCurIndex != -1) && (iFromIndex < strToSplit.length())
                && (iCurCounts < iLimit)) {
            iCurIndex = strToSplit.indexOf(strSeparator, iFromIndex);
            if (iCurIndex == -1) {
                strUnitInfo = strToSplit.substring(iFromIndex, strToSplit
                        .length());
            } else {
                strUnitInfo = strToSplit.substring(iFromIndex, iCurIndex);
                iFromIndex = iCurIndex + 1;
            }
            tmpList.add(strUnitInfo);
            iCurCounts++;
        }
        int iCounts = tmpList.size();
        String tmpArray[] = new String[iCounts];
        for (int i = 0; i < iCounts; i++) {
            tmpArray[i] = (String) tmpList.get(i);
        }
        return tmpArray;
    }
    /**
     * ***************************************************** ??
     * ????????????��????????????????????...???? ????????param src ???????????,param len ?????�� ????????? ??
     * ???return String ??��????????????????????...??????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String strIntercept(String src, int len) {
        if (src == null) {
            return "";
        }
        if (src.length() > len) {
            src = String.valueOf(String.valueOf(src.substring(0, len))).concat(
                    "...");
        }
        return src;
    }
    /**
     * ***************************************************** ??
     * ?????????????ISO8859_1???? ????????param str_in ??????????????? ????????? ?? ???return String
     * ????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public static String strtochn(String str_in) {
        try {
            String temp_p = str_in;
            if (temp_p == null) {
                temp_p = "";
            }
            String temp = "";
            if (!temp_p.equals("")) {
                byte[] byte1 = temp_p.getBytes("ISO8859_1");
                temp = new String(byte1);
            }
            return temp;
        } catch (Exception e) {
        }
        return "null";
    }
    /**
     * ***************************************************** ??
     * ?????ISO8859_1????????GBK???? ????????param strvalue ??????????????? ????????? ?? ???return
     * String ????????????? ???????
     * ******************************************************
     */
    public static String ISO2GBK(String strvalue) {
        try {
            if (strvalue == null)
                return null;
            else {
                strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK");
                return strvalue;
            }
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * ***************************************************** ??
     * ?????????????????????��?????? ????????param str ??????????????? ????????? ?? ???return String
     * ????????????? ??????? ******************************************************
     */
    public static String cnCodeTrans(String str) {
        String s = "";
        try {
            s = new String(str.getBytes("GB2312"), "8859_1");
        } catch (UnsupportedEncodingException a) {
            System.out.print("chinese thansform exception");
        }
        return s;
    }
    /**
     * ***************************************************** ??
     * ????��?????????????????STaaaa????ST****** ????????param strSource???????????????param
     * strRule???? ????????? ?? ???return false:???????????true:????????? ???????
     * ******************************************************
     */
    public static boolean judgeMatch(String strSource, String strRule) {
        int i = 0;
        // ????????��?
        if ((null == strSource) || (strSource.length() == 0))
            return false;
        // ????????��?
        if ((null == strRule) || (strRule.length() == 0))
            return false;
        // ??????????
        if (strSource.length() > strRule.length())
            return false;
        // ??��???��?
        for (i = 0; i < strRule.length(); i++) {
            // ?????????
            if (strSource.length() < i + 1) {
                break;
            }
            if ((strRule.charAt(i) != '*')
                    && (strSource.charAt(i) != strRule.charAt(i))) {
                return false;
            }
        }
        // ??????????????????????????????'*'?????????
        for (; i < strRule.length(); i++) {
            if (strRule.charAt(i) != '*')
                return false;
        }
        return true;
    }
    public static String column2Property(String column) {
        column = column.toLowerCase();
        int i = column.indexOf("_");
        while (i != -1) {
            if (i != column.length() - 1) {
                char temp = column.charAt(i + 1);
                String strTemp = String.valueOf(temp);
                column = column.replaceFirst("_" + strTemp, strTemp
                        .toUpperCase());
                i = column.indexOf("_");
            } else {
                break;
            }
        }
        return column;
    }
    public static String strArrayToStr(String[] strs, String separator) {
        StringBuffer returnstr = new StringBuffer("");
        if (strs == null)
            return "";
        if (separator == null)
            separator = "";
        for (int i = 0; i < strs.length; i++) {
            returnstr.append(strs[i]);
            if (i < strs.length - 1)
                returnstr.append(separator);
        }
        return returnstr.toString();
    }
    public static String objectArrayToStr(Object[] objects, String separator) {
        StringBuffer returnstr = new StringBuffer("");
        if (objects == null)
            return "";
        if (separator == null)
            separator = "";
        for (int i = 0; i < objects.length; i++) {
            returnstr.append(String.valueOf(objects[i]));
            if (i < objects.length - 1)
                returnstr.append(separator);
        }
        return returnstr.toString();
    }
    public static String listToStr(List element, String separator) {
        StringBuffer returnstr = new StringBuffer("");
        if (element == null)
            return "";
        if (separator == null)
            separator = "";
        Iterator it = element.iterator();
        while (it.hasNext()) {
            returnstr.append(String.valueOf(it.next()));
            if (it.hasNext())
                returnstr.append(separator);
        }
        return returnstr.toString();
    }
    public static String[] listToStrArray(List element) {
        if (element == null || element.size() == 0)
            return null;
        Iterator it = element.iterator();
        String[] strArray = new String[element.size()];
        int i = 0;
        while (it.hasNext()) {
            strArray[i] = String.valueOf(it.next());
            i++;
        }
        return strArray;
    }
    public static List strToList(String str, String separator) {
        if (str == null || str.equals(""))
            return null;
        if (separator == null)
            separator = "";
        String[] strArr = str.split(separator);
        int size = strArr.length;
        List list = new ArrayList();
        for (int i = 0; i < size; i++) {
            list.add(strArr[i]);
        }
        return list;
    }
    public static StringBuffer populate(StringBuffer bf, String value,
                                        boolean isNotLast) {
        if (value == null) {
            return bf;
        }
        // ???????????????????�I??????????????????????????????SQL???????????
        System.out.println(value.replaceAll("'", "''"));
        bf.append("'").append(value.replaceAll("'", "''")).append("'");
        if (isNotLast)
            bf.append(",");
        return bf;
    }
    public static boolean isExist(String str, String substr, String sepatator) {
        if (str == null || str.trim().equals(""))
            return false;
        if (substr == null || substr.trim().equals(""))
            return false;
        String[] strArr = str.split(sepatator);
        int size = strArr.length;
        for (int i = 0; i < size; i++) {
            if (strArr[i].equals(substr))
                return true;
        }
        return false;
    }
    public static boolean isExist(String str, String substr) {
        return isExist(str, substr, ",");
    }
    public static String leftInclude(String str) {
        if (str == null || str.equals(""))
            return str;
        return str + "%";
    }
    public static String rightInclude(String str) {
        if (str == null || str.equals(""))
            return str;
        return "%" + str;
    }
    public static String include(String str) {
        if (str == null || str.equals(""))
            return str;
        return "%" + str + "%";
    }
    /**
     * ???????????????????????????????
     *
     * @param source String ?????
     * @param target String ????????
     * @return String ???
     */
    public static String nvl(Object source, Object target) {
        return source != null ? String.valueOf(source)
                : (target != null ? String.valueOf(target) : null);
    }
    /**
     * ??clob??????????????
     *
     * @param clobValue
     * @return
     * @throws SQLException
     */
    public static String clob2Str(Object clobValue) throws SQLException {
        return ((Clob) clobValue).getSubString(1, (int) ((Clob) clobValue)
                .length());
    }
    /**
     * ???web????????Ip
     *
     * @param request
     * @return
     */
    public static String getRemoteAddr(HttpServletRequest request) {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        return ip;
    }
    public static String hideFlowStr(String str, int maxLen) {
        if (str == null || maxLen == 0) {
            return "";
        }
        if (str.length() > maxLen) {
            str = str.substring(0, maxLen) + "...";
        }
        return str;
    }
    /**
     * ???????????????
     *
     * @param str
     * @return
     */
    public static String escapeLuceneSpecialCharacters(String str) {
        if (str == null) {
            return null;
        }
        try {
            StringWriter writer = new StringWriter(str.length() * 2);
            escapeLuceneSpecialCharacterString(writer, str);
            return writer.toString();
        } catch (IOException ex) {
            //LogService.getLogger(StringUtil.class).error(ex.getMessage());
            return null;
        }
    }
    private static void escapeLuceneSpecialCharacterString(Writer out,
                                                           String str) throws IOException {
        if (str == null) {
            return;
        }
        int sz = str.length();
        for (int i = 0; i < sz; i++) {
            char ch = str.charAt(i);
            /*
             * Reference link:
			 * http://lucene.apache.org/java/docs/queryparsersyntax.html Lucene
			 * supports escaping special characters that are part of the query
			 * syntax. The current list special characters are: + - && || ! ( ) { } [ ] ^ " ~ * ? : \
			 * To escape these character use the \ before the character.
			 */
            switch (ch) {
                case '+':
                case '-':
                case '!':
                case '(':
                case ')':
                case '{':
                case '}':
                case '[':
                case ']':
                case '^':
                case '\"':
                case '~':
                case '*':
                case '?':
                case ':':
                case '\\':
                    out.write('\\');
                    out.write(ch);
                    break;
                case '&':
                case '|':
                    // check if it is '&&' or '||' ~ check if the next char is '&'
                    // or '|'
                    if ((i + 1) < sz && str.charAt(i + 1) == ch) {
                        out.write('\\');
                        out.write(ch);
                        i++;
                    }
                    out.write(ch);
                    break;
                default:
                    out.write(ch);
                    break;
            }
        }
    }
    /**
     * ???????????????????????
     */
    public static String getFirstLetter(String chinese) {
        /**
         * ???
         */
        final int[] li_SecPosValue = {1601, 1637, 1833, 2078, 2274, 2302,
                2433, 2594, 2787, 3106, 3212, 3472, 3635, 3722, 3730, 3858,
                4027, 4086, 4390, 4558, 4684, 4925, 5249, 5590};
        final String[] lc_FirstLetter = {"A", "B", "C", "D", "E", "F", "G",
                "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
                "W", "X", "Y", "Z"};
        if (chinese == null || chinese.trim().length() == 0) {
            return "";
        }
        chinese = conversionStr(chinese, "GB2312", "ISO8859-1");
        if (chinese.length() > 1) { // ?��?????????
            int li_SectorCode = (int) chinese.charAt(0); // ????????
            int li_PositionCode = (int) chinese.charAt(1); // ????��??
            li_SectorCode = li_SectorCode - 160;
            li_PositionCode = li_PositionCode - 160;
            int li_SecPosCode = li_SectorCode * 100 + li_PositionCode;// ??????��??
            if (li_SecPosCode > 1600 && li_SecPosCode < 5590) {
                for (int i = 0; i < 23; i++) {
                    if (li_SecPosCode >= li_SecPosValue[i]
                            && li_SecPosCode < li_SecPosValue[i + 1]) {
                        chinese = lc_FirstLetter[i];
                        break;
                    }
                }
            } else {
                chinese = conversionStr(chinese, "ISO8859-1", "GB2312");
                chinese = chinese.substring(0, 1);
            }
        }
        return chinese;
    }
    private static String conversionStr(String str, String charsetName,
                                        String toCharsetName) {
        try {
            str = new String(str.getBytes(charsetName), toCharsetName);
        } catch (UnsupportedEncodingException ex) {
            System.out.println("????????????????" + ex.getMessage());
        }
        return str;
    }
    /**
     * ????????????
     *
     * @param html
     * @return
     */
    public static String checkStr(String html) {
        try {
            html = html.replaceAll("\r", "");
            html = html.replaceAll("\n", "");
            html = html.replaceAll("\"", "'");
            html = html.replaceAll("\t", " ");
            Pattern p_script;
            Matcher m_script;
            Pattern p_href;
            Matcher m_href;
            Pattern p_a;
            Matcher m_a;
            Pattern p_on;
            Matcher m_on;
            Pattern p_iframe;
            Matcher m_iframe;
            Pattern p_frameset;
            Matcher m_frameset;
            Pattern p_img;
            Matcher m_img;
            Pattern p_p1;
            Matcher m_p1;
            Pattern p_p2;
            Matcher m_p2;
            String stript_str = "<script[\\s\\S]+</script *>";
            String href_str = " href *= *[\\s\\S]*script *:";
            String on_str = " on[\\s\\S]*=";
            String iframe_str = "<iframe[\\s\\S]+</iframe *>";
            String frameset_str = "<frameset[\\s\\S]+</frameset *>";
            String a_str = "<a ([^>])*>.*?</a([^>])*>";
            //String img_str = "\\<img[^\\>]+\\>";
            String p_str1 = "</p>";
            String p_str2 = "<p>";
            p_script = Pattern.compile(stript_str, Pattern.CASE_INSENSITIVE);
            m_script = p_script.matcher(html);
            html = m_script.replaceAll(""); // ????script???
            p_href = Pattern.compile(href_str, Pattern.CASE_INSENSITIVE);
            m_href = p_href.matcher(html);
            html = m_href.replaceAll(""); // ????script???
            p_a = Pattern.compile(a_str, Pattern.CASE_INSENSITIVE);
            m_a = p_a.matcher(html);
            html = m_a.replaceAll(""); // ????script???
            p_on = Pattern.compile(on_str, Pattern.CASE_INSENSITIVE);
            m_on = p_on.matcher(html);
            html = m_on.replaceAll(""); // ????script???
            p_iframe = Pattern.compile(iframe_str, Pattern.CASE_INSENSITIVE);
            m_iframe = p_iframe.matcher(html);
            html = m_iframe.replaceAll(""); // ????script???
            p_frameset = Pattern
                    .compile(frameset_str, Pattern.CASE_INSENSITIVE);
            m_frameset = p_frameset.matcher(html);
            html = m_frameset.replaceAll(""); // ????script???
            // p_img = Pattern.compile(img_str, Pattern.CASE_INSENSITIVE);
            // m_img = p_img.matcher(html);
            // html = m_img.replaceAll(""); // ????script???
            p_p1 = Pattern.compile(p_str1, Pattern.CASE_INSENSITIVE);
            m_p1 = p_p1.matcher(html);
            html = m_p1.replaceAll(""); // ????script???
            p_p2 = Pattern.compile(p_str2, Pattern.CASE_INSENSITIVE);
            m_p2 = p_p2.matcher(html);
            html = m_p2.replaceAll(""); // ????script???
        } catch (Exception e) {
            System.err.println("Html2Text: " + e.getMessage());
        }
        return html;
    }
    public static String substr(String value, int maxlength, String postfix) {
        int k = 0;
        int l = 0;
        for (int i = 0; i < value.length() && maxlength > l * 2 + k; i++) {
            if (value.charAt(i) > '\200') {
                l++;
            } else {
                k++;
            }
        }
        // value????????????????????
        if (l + k >= value.length()) {
            return value;
        } else if (maxlength >= l * 2 + k && l + k > 0) {
            value = value.substring(0, l + k);
        } else if (l + k > 0) {
            value = value.substring(0, (l + k) - 1);
        } else {
            return value;
        }
        // ????????????????????????????????????????
        if (!StringUtils.isEmpty(postfix)) {
            value += postfix;
        }
        return value;
    }
    /**
     * ***************************************************** ??
     * ??????��??????????null???????????????????? ????????param Content:???????????? ????????? ??
     * ?????????????null???????????????????? <p/> ??��?????20051220 ???????
     * ******************************************************
     */
    public String nullToSpace(String Content) {
        if (Content == null) {
            Content = "";
        }
        return Content;
    }
    /**
     * ***************************************************** ??
     * ?????GBK????????ISO8859_1???? ????????param strvalue ??????????????? ????????? ?? ???return
     * String ????????????? ???????
     * ******************************************************
     */
    public String GBK2ISO(String strvalue) throws Exception {
        try {
            if (strvalue == null)
                return null;
            else {
                strvalue = new String(strvalue.getBytes("GBK"), "ISO8859_1");
                return strvalue;
            }
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * 去除换行符
     * @param str
     * @return
     */
    public static   String replaceBlank(String str) {
        String dest = "";
        if (str!=null) {
            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
            Matcher m = p.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }
}

+ 29 - 0
app/app-iot-server/src/main/java/com/yihu/ehr/iot/util/spring/SpringContextHolder.java

@ -0,0 +1,29 @@
package com.yihu.ehr.iot.util.spring;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SpringContextHolder implements ApplicationContextAware {
    @Autowired
    private static ApplicationContext context;
    @Override
    public void setApplicationContext(ApplicationContext context) throws BeansException {
        SpringContextHolder.context = context;
    }
    public static Object getSpringBean(String beanName) {
        return context == null ? null : context.getBean(beanName);
    }
    public static String[] getBeanDefinitionNames() {
        return context.getBeanDefinitionNames();
    }
}

+ 144 - 0
app/app-iot-server/src/main/resources/application.yml

@ -0,0 +1,144 @@
server:
  contextPath: /emergency
  port: 9099
  sessionTimeout: 30000000
spring:
  redis:
    database: 0 # Database index used by the connection factory.
    port: 6379 # Redis server port.
    password: # Login password of the redis server.
    timeout: 0 # Connection timeout in milliseconds.
    #sentinel:
    #  master: # Name of Redis server.
    #  nodes: # Comma-separated list of host:port pairs.
    pool:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1  # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
  application:
    name: app-emergency-server
    message: EHR Emergency Server
permissions:
  info: admin
app:
  clientId: 3CDhsgepr4
  baseClientId: 5DloGvRVVZ  # 【卫生应急指挥平台】应用
---
spring:
  profiles: dev
  loginVaild: true
  redis:
    host: 172.19.103.47 # Redis server host.
    port: 6379
    password: redis!@456
app:
  oauth2InnerUrl: http://172.19.103.73:10260/
  oauth2OuterUrl: http://27.154.233.186:10260/  #上饶-授权外网映射
service-gateway:
  profileInnerUrl: http://172.19.103.73:10000/api/v1.0/admin
  profileOuterUrl: http://27.154.233.186:10000/api/v1.0/admin
  portalInnerUrl: http://172.19.103.73:10280/api/v1.0/portal
  portalOuterUrl: http://27.154.233.186:10280/api/v1.0/portal
fast-dfs:
  tracker-server: 172.19.103.13:22122
  public-server: http://172.19.103.52:80
logging:
  path: /data/logger
  file: app-emergency-server
---
spring:
  profiles: test
  loginVaild: true
  redis:
    host: 172.19.103.47 # Redis server host.
    port: 6379
    password: redis!@456
app:
  oauth2InnerUrl: http://172.19.103.73:10260/
  oauth2OuterUrl: http://27.154.233.186:10260/
service-gateway:
  profileInnerUrl: http://172.19.103.73:10000/api/v1.0/admin
  profileOuterUrl: http://27.154.233.186:10000/api/v1.0/admin
  portalInnerUrl: http://172.19.103.73:10280/api/v1.0/portal
  portalOuterUrl: http://27.154.233.186:10280/api/v1.0/portal
fast-dfs:
  tracker-server: 172.19.103.13:22122
  public-server: http://172.19.103.52:80
logging:
  path: /data/logger
  file: app-emergency-server
---
spring:
  profiles: prod
  loginVaild: true
  redis:
    host: 172.19.103.47 # Redis server host.
    port: 6379
    password: redis!@456
app:
  oauth2InnerUrl: http://172.19.103.73:10260/
  oauth2OuterUrl: http://27.154.233.186:10260/
service-gateway:
  profileInnerUrl: http://172.19.103.73:10000/api/v1.0/admin
  profileOuterUrl: http://27.154.233.186:10000/api/v1.0/admin
  portalInnerUrl: http://172.19.103.73:10280/api/v1.0/portal
  portalOuterUrl: http://27.154.233.186:10280/api/v1.0/portal
fast-dfs:
  tracker-server: 11.1.2.9:22122
  accessUrl: http://11.1.2.9
logging:
  path: /data/logger
  file: app-emergency-server
---
spring:
  profiles: prod_fz
  loginVaild: true
  redis:
    host: 192.168.135.40 # Redis server host.
    port: 6390
    password: redis!@456
app:
  oauth2InnerUrl: http://192.168.135.35:10260/
  oauth2OuterUrl: http://11.1.2.16:10260/
service-gateway:
  profileInnerUrl: http://192.168.135.31:10001/api/v1.0/admin
  profileOuterUrl: http://11.1.2.13:10000/api/v1.0/admin
  portalInnerUrl: http://192.168.135.31:10280/api/v1.0/portal
  portalOuterUrl: http://11.1.2.13:10280/api/v1.0/portal
fast-dfs:
  tracker-server: 192.168.135.42:22122
  public-server: http://192.168.135.42:22122
logging:
  path: /data/logger
  file: app-emergency-server
---
spring:
  profiles: prod_sr
  loginVaild: true
  redis:
    host: 10.176.97.5 # Redis server host.
    port: 6390
    password: q4YaQemf
app:
  oauth2InnerUrl: http://10.176.97.10:10260/
  oauth2OuterUrl: http://171.35.109.46:10260/
service-gateway:
  profileInnerUrl: http://10.176.97.10:10000/api/v1.0/admin
  profileOuterUrl: http://171.35.109.46:10000/api/v1.0/admin
  portalInnerUrl: http://10.176.97.10:10280/api/v1.0/portal
  portalOuterUrl: http://171.35.109.46:10280/api/v1.0/portal
fast-dfs:
  tracker-server: 10.176.97.5:22122
  public-server: http://10.176.97.5:8888
logging:
  path: /data/logger
  file: app-emergency-server

+ 181 - 0
app/app-iot-server/src/main/resources/logback.xml

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 从高到地低 OFF 、 FATAL 、 ERROR 、 WARN 、 INFO 、 DEBUG 、 TRACE 、 ALL -->
<!-- 日志输出规则  根据当前ROOT 级别,日志输出时,级别高于root默认的级别时  会输出 -->
<!-- 以下  每个配置的 filter 是过滤掉输出文件里面,会出现高级别文件,依然出现低级别的日志信息,通过filter 过滤只记录本级别的日志-->
<!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
	debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="60 seconds" debug="false">
    <!-- 定义日志文件 输入位置 -->
    <property name="log_dir" value="/home/dev-admin/logs"/>
    <!-- 日志最大的历史 30天 -->
    <property name="maxHistory" value="30"/>
    <!-- ConsoleAppender 控制台输出日志 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- 对日志进行格式化 -->
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger -%msg%n</pattern>
        </encoder>
    </appender>
    <!-- ERROR级别日志 -->
    <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
    <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- 过滤器,只记录WARN级别的日志 -->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>INFO</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <!-- 最常用的滚动策略,它根据时间来制定滚动策略.既负责滚动也负责出发滚动 -->
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!--日志输出位置  可相对、和绝对路径 -->
            <fileNamePattern>${log_dir}/%d{yyyy-MM-dd}/error-log.log</fileNamePattern>
            <!-- 可选节点,控制保留的归档文件的最大数量,超出数量就删除旧文件假设设置每个月滚动,且<maxHistory>是6,
            则只保存最近6个月的文件,删除之前的旧文件。注意,删除旧文件是,那些为了归档而创建的目录也会被删除-->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <!-- 按照固定窗口模式生成日志文件,当文件大于20MB时,生成新的日志文件。窗口大小是1到3,当保存了3个归档文件后,将覆盖最早的日志。
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
          <fileNamePattern>${log_dir}/%d{yyyy-MM-dd}/.log.zip</fileNamePattern>
          <minIndex>1</minIndex>
          <maxIndex>3</maxIndex>
           </rollingPolicy>   -->
        <!-- 查看当前活动文件的大小,如果超过指定大小会告知RollingFileAppender 触发当前活动文件滚动
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
              <maxFileSize>5MB</maxFileSize>
           </triggeringPolicy>   -->
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
        </encoder>
    </appender>
    <!-- WARN级别日志 appender -->
    <appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- 过滤器,只记录WARN级别的日志 -->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>WARN</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- 按天回滚 daily -->
            <fileNamePattern>${log_dir}/%d{yyyy-MM-dd}/warn-log.log
            </fileNamePattern>
            <!-- 日志最大的历史 60天 -->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
        </encoder>
    </appender>
    <!-- INFO级别日志 appender -->
    <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- 过滤器,只记录INFO级别的日志 -->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>INFO</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- 按天回滚 daily -->
            <fileNamePattern>${log_dir}/%d{yyyy-MM-dd}/info-log.log
            </fileNamePattern>
            <!-- 日志最大的历史 60天 -->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
        </encoder>
    </appender>
    <!-- DEBUG级别日志 appender -->
    <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- 过滤器,只记录DEBUG级别的日志 -->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>DEBUG</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- 按天回滚 daily -->
            <fileNamePattern>${log_dir}/%d{yyyy-MM-dd}/debug-log.log
            </fileNamePattern>
            <!-- 日志最大的历史 60天 -->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
        </encoder>
    </appender>
    <!-- TRACE级别日志 appender -->
    <appender name="TRACE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- 过滤器,只记录ERROR级别的日志 -->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>TRACE</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- 按天回滚 daily -->
            <fileNamePattern>${log_dir}/%d{yyyy-MM-dd}/trace-log.log
            </fileNamePattern>
            <!-- 日志最大的历史 60天 -->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
        </encoder>
    </appender>
    <logger name="java.sql.PreparedStatement" value="DEBUG" />
    <logger name="java.sql.Connection" value="DEBUG" />
    <logger name="java.sql.Statement" value="DEBUG" />
    <logger name="com.ibatis" value="DEBUG" />
    <logger name="com.ibatis.common.jdbc.SimpleDataSource" value="DEBUG" />
    <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG"/>
    <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" value="DEBUG" />
    <!-- root级别   DEBUG -->
    <root level="INFO">
        <!-- 控制台输出 -->
        <appender-ref ref="STDOUT" />
        <!-- 文件输出 -->
        <appender-ref ref="ERROR" />
        <appender-ref ref="INFO" />
        <appender-ref ref="WARN" />
        <appender-ref ref="DEBUG" />
        <appender-ref ref="TRACE" />
    </root>
</configuration>
        <!--admin-->
        <!--<?xml version="1.0" encoding="UTF-8"?>-->
<!--<configuration>-->
<!--<include resource="org/springframework/boot/logging/logback/base.xml"/>-->
<!--<jmxConfigurator/>-->
<!--</configuration>-->

+ 23 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/commonFoot.jsp

@ -0,0 +1,23 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<script src="${staticRoot}/js/lib/jquery.min.js"></script>
<script>
    $.extend({
        Context: {
            PATH: '${contextRoot}',
            STATIC_PATH: '${staticRoot}'
        }
    })
</script>
<script>
    (function ($, win) {
        $(function () {
            var $title = $('title'),
                    $headTitleTarget = $('[data-head-title="true"]');
            document.title = $headTitleTarget.text();
        });
    })(jQuery, window);
</script>

+ 21 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/commonHead.jsp

@ -0,0 +1,21 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<%--定义页面文档类型以及使用的字符集,浏览器会根据此来调用相应的字符集显示页面内容--%>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<%--IE=edge告诉IE使用最新的引擎渲染网页,chrome=1则可以激活Chrome Frame.--%>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${staticRoot}/css/reset.css">
<link rel="stylesheet" href="${staticRoot}/css/bootstrap.min.css">
<head>
    <link rel="icon" href="${staticRoot}/images/logo.png" type="image/x-icon" />
    <link rel="shortcut icon" href="${staticRoot}/images/logo.png" type="image/x-icon" />
</head>

+ 17 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/commonInclude.jsp

@ -0,0 +1,17 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles-extras" prefix="tilesx" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<c:set var="contextRoot" value="<%=request.getContextPath()%>" scope="page" />
<c:set var="devgMode" value="true" scope="page" />
<c:choose>
  <c:when test="${devgMode == 'true'}">
    <c:set var="staticRoot" value="${contextRoot}/front" scope="page" />
  </c:when>
  <c:otherwise>
    <c:set var="staticRoot" value="${contextRoot}/webapp/front/static" scope="page" />
  </c:otherwise>
</c:choose>

+ 21 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/layout.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
        "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
        "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
    <!--出错页面提示-->
    <definition name="errorPage"  template="/WEB-INF/jsp/error.jsp"></definition>
    <!-- 主布局 -->
    <definition name="layout" template="/WEB-INF/jsp/common/mainLayout.jsp">
    </definition>
    <!-- 主布局 -->
    <definition name="generalView" extends="layout">
        <put-attribute name="header" value="/WEB-INF/jsp/common/commonHead.jsp" />
        <!--<put-attribute name="pageCss" expression="/WEB-INF/jsp/${contentPage}Css.jsp" />-->
        <put-attribute name="contentPage" expression="/WEB-INF/jsp/${contentPage}.jsp" />
        <put-attribute name="footer" value="/WEB-INF/jsp/common/commonFoot.jsp" />
        <put-attribute name="pageJs" expression="/WEB-INF/jsp/${contentPage}Js.jsp" />
    </definition>
</tiles-definitions>

+ 25 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/mainLayout.jsp

@ -0,0 +1,25 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%--定义页面文档类型以及使用的字符集,浏览器会根据此来调用相应的字符集显示页面内容--%>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <%--IE=edge告诉IE使用最新的引擎渲染网页,chrome=1则可以激活Chrome Frame.--%>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>${title}</title>
    <tiles:insertAttribute name="header" />
    <tiles:insertAttribute name="pageCss" ignore="true"/>
</head>
<body>
    <div data-content-page>
        <tiles:insertAttribute name="contentPage" ignore="true"/>
    </div>
    <tiles:insertAttribute name="footer"/>
    <tiles:insertAttribute name="pageJs" ignore="true"/>
    <input type="hidden" id="flag_top_window" />
</body>
</html>

+ 13 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/common/simpleLayout.jsp

@ -0,0 +1,13 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<script>
    $.extend({
        Context: {
            PATH: '${contextRoot}',
            STATIC_PATH: '${staticRoot}'
        }
    })
</script>
<tiles:insertAttribute name="pageCss" ignore="true"/>
<tiles:insertAttribute name="contentPage" ignore="true"/>
<tiles:insertAttribute name="pageJs" ignore="true"/>

+ 5 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/error.jsp

@ -0,0 +1,5 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<div id="divErrorContent" style="width:550px;height:400px;margin:0 auto;background: url('${contextRoot}/src/images/404.png') no-repeat;">
</div>

+ 6 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/signin.jsp

@ -0,0 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<div style="margin:20px;">
加载中,请稍候...
</div>

+ 49 - 0
app/app-iot-server/src/main/webapp/WEB-INF/jsp/signinJs.jsp

@ -0,0 +1,49 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@include file="/WEB-INF/jsp/common/commonInclude.jsp" %>
<script>
    var clientId = '${clientId}';
    var signin = {
        init:function () {
            //判断是否自动登录
            var hash = window.location.hash;
            if(hash.indexOf("#access_token")>=0)
            {
                //获取accrss_token
                var tokenString =hash.substring(1,hash.indexOf("&"));
                var token = tokenString.substr(hash.indexOf("="));
                debugger;
                //自动登录
                $.ajax({
                    url: "${contextRoot}/login/autoLogin",
                    type: 'POST',
                    dataType: 'json',
                    data:{
                        "token":token,
                        "clientId": clientId
                    },
                    success: function (data) {
                        debugger;
                        if(data.successFlg){
                            sessionStorage.setItem("ZF_UID",data.obj.id);
                            sessionStorage.setItem("ZF_UN",data.obj.realName);
                            sessionStorage.setItem("ZF_U",data.obj);
                            location.href = '${contextRoot}/index';
                        }else{
                            location.href = '${contextRoot}/login';
                        }
                    },
                    error: function (data) {
                        location.href = '${contextRoot}/login';
                    }
                });
                return;
            }
        }
    }
    $(function() {
        signin.init();
    });
</script>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 12 - 0
app/app-iot-server/src/main/webapp/front/css/animate.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 6 - 0
app/app-iot-server/src/main/webapp/front/css/bootstrap.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 6 - 0
app/app-iot-server/src/main/webapp/front/css/bootstrap.min14ed.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
app/app-iot-server/src/main/webapp/front/css/demo/webuploader-demo.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 4 - 0
app/app-iot-server/src/main/webapp/front/css/font-awesome.min93e3.css


+ 389 - 0
app/app-iot-server/src/main/webapp/front/css/index.css

@ -0,0 +1,389 @@
html, body{height: 100%;}
a {
    outline: 0;
    cursor: pointer;
}
a:hover{
    text-decoration:none;
}
ul{
    padding: 0;
    margin: 0;
}
li {
    list-style: none;
}
p{
    margin: 0;
}
.overflow{
    overflow: hidden;
}
.pr-10{
    padding-right: 10px;
}
.mb-7{
    margin-bottom: 7px;
}
.mb-10{
    margin-bottom: 10px;
}
.mb-16{
    margin-bottom: 16px;
}
.f-fs12{
    font-size: 12px;
}
.f-fs14{
    font-size: 14px;
}
.f-fs16{
    font-size: 16px;
}
.main-color{
    color:#1FA2FF;
}
.color1{
    color: #333;
}
.color2{
    color: #00CF92;
}
.color3{
    color: #F54336;
}
.color4{
    color: #999;
}
.bg-color1{
    background-color: #F6F6F6;
}
.items {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center
}
.item{
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
}
.map-content {
    background: #fff;
    overflow-y: auto;
    overflow-x: auto;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.left{
    float: left;
    width: 426px;
    overflow: hidden;
    height: 100%;
    position: relative;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
}
.car{
    padding: 10px 20px;
    position: relative;
    overflow: hidden;
}
li.car{
    border-bottom: 1px solid #ddd;
}
.car-img{
    float: left;
    padding-right: 20px;
}
.item-left{
    display: inline-block;
    width: 100px;
    color: #999;
}
.dingwei{
    background: url(../images/weizhidingwei_btn.png) no-repeat 0;
    display: inline-block;
    width: 65px;
    text-align: right;
}
.weizhi{
    background: url(../images/weizhi_icon.png) no-repeat 0;
    width: 15px;
    height: 14px;
    display: inline-block;
}
.weizhi-bg{
    background-color: #1FA2FF;
    color: #fff;
    height: 60px;
    overflow: hidden;
}
.nav-tabs {
    text-align: center;
    padding: 10px;
    font-size: 0;
    position: absolute;
    top: 0;
    width: 100%;
}
.nav>li{
    display: inline-block;
}
.nav-tabs>li {
    float: none;
}
.nav-tabs>li:first-child a{
    border-radius: 5px 0 0 5px;
}
.nav-tabs>li:last-child a{
    border-radius: 0 5px 5px 0;
}
.nav-tabs>li>a{
    color:#1FA2FF;
    padding: 9px 37px;
    margin-right: 0;
    border: 1px solid #1FA2FF;
    background-color: transparent;
    font-size: 16px;
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover{
    color: #fff;
    cursor: default;
    background-color: #1FA2FF;
    border: 1px solid #1FA2FF;
}
.nav-tabs>li>a:focus, .nav-tabs>li>a:hover{
    border: 1px solid #1FA2FF;
    background-color: #fff;
}
.tab-content{
    margin-top: 60px;
    overflow: auto;
    height: 100%;
}
.dislpay-arrow a {
    background: url(../images/shouhui_btn_pre.png) no-repeat;
}
.dislpay-arrow a.zhankai {
    background: url(../images/zhankai_btn_pre.png) no-repeat;
}
.dislpay-arrow a:hover{
    background: url(../images/shouhui_btn.png) no-repeat;
}
.dislpay-arrow a.zhankai:hover{
    background: url(../images/zhankai_btn.png) no-repeat;
}
.dislpay-arrow a {
    position: absolute;
    display: block;
    width: 26px;
    height: 124px;
    top: 50%;
    margin-top: -62px;
    outline: none;
}
#left-panel {
    position: absolute;
    left: 40px;
    top: 20px;
    pointer-events: none;
    overflow: hidden;
}
#searchbox {
    width: 483px;
    position: relative;
    z-index: 5;
    border-radius: 2px;
}
.clearfix {
    zoom: 1;
}
.clearfix::before, .clearfix::after {
    display: table;
    content: "";
}
#searchbox #searchbox-container {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    width: 426px;
    float: left;
    box-sizing: border-box;
    box-shadow: rgba(0, 0, 0, 0.15) 1px 2px 1px;
}
#sole-searchbox-content {
    position: relative;
}
.searchbox-content {
    width: 426px;
    border-radius: 2px 0 0 2px;
    background: #fff;
}
#sole-searchbox-content #sole-input {
    box-sizing: border-box;
    border-top-style: initial;
    border-bottom-style: initial;
    border-top-color: initial;
    border-bottom-color: initial;
    line-height: 20px;
    font-size: 14px;
    height: 38px;
    color: rgb(51, 51, 51);
    position: relative;
    border-width: 0px 27px 0px 10px;
    border-image: initial;
    padding: 9px 0px;
    border-left: 10px solid transparent;
    border-right: 27px solid transparent;
    border-radius: 2px 0px 0px 2px;
}
input:focus{
    outline: 0;
    -webkit-box-shadow: none;
    box-shadow: none;
}
.searchbox-content .searchbox-content-common {
    box-sizing: border-box;
    float: left;
    width: 426px;
    height: 38px;
}
#search-button {
    pointer-events: auto;
    width: 57px;
    height: 38px;
    float: left;
    cursor: pointer;
    box-shadow: rgba(0, 0, 0, 0.15) 1px 2px 1px;
    border-width: 0px;
    border-style: initial;
    border-color: initial;
    border-image: initial;
    padding: 0px;
    border-radius: 0px 2px 2px 0px;
    background: url(../images/sousuo_icon.png) no-repeat center #1FA2FF;
    color: #fff;
}
.searchbox-content .input-clear {
    cursor: pointer;
    position: absolute;
    width: 27px;
    height: 38px;
    right: 0;
    top: 0;
    background: url(../images/searchbox.png) no-repeat 0 -114px #fff;
    display: none;
}
.ui3-suggest-wrap {
    position: absolute;
    background-color: #fff;
    display: none;
    box-shadow: 1px 2px 1px rgba(0,0,0,.15);
    border-radius: 0 0 2px 2px;
    top: 58px;
    left: 40px;
    z-index: 1000;
    width: 426px;
}
.list-scroll {
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    width: 426px;
    height: 350px;
}
.ui3-suggest-wrap .ui3-suggest-item a {
    display: block;
    height: 35px;
    line-height: 35px;
    padding-right: 10px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ui3-suggest-wrap .ui3-suggest-item a:hover{
    background-color: #ddd;
}
.ui3-suggest-wrap .ui3-suggest-item i.default {
    background: url(../images/p.png) no-repeat 12px;
    background-size: contain;
}
.ui3-suggest-wrap .ui3-suggest-item i {
    padding-left: 39px;
    font-style: normal;
    color: #666;
    position: relative;
    z-index: 1;
    padding-top: 1px;
}
.ui3-suggest-wrap .ui3-suggest-item em {
    margin-left: 10px;
    margin-right: 20px;
    font-style: normal;
    color: #999;
}
#addr-list{
    border-top: 1px solid #E4E6E7;
}
#car-list{
    top:128px;
}
#car-back{
    top: 78px;
    padding: 10px 20px;
}
.btn-primary {
    color: #fff;
    background-color: #1fa2ff;
    border-color: #1fa2ff;
}
.btn-primary:hover {
    color: #fff;
    background-color: #1c8ddd;
    border-color: #1c8ddd;
}
.btn-primary:focus {
    color: #fff;
    background-color: #1c8ddd;
    border-color: #1c8ddd;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
    color: #fff;
    background-color: #1c8ddd;
    border-color: #1c8ddd;
}
.btn-primary:active:hover,
.btn-primary.active:hover,
.open > .dropdown-toggle.btn-primary:hover,
.btn-primary:active:focus,
.btn-primary.active:focus,
.open > .dropdown-toggle.btn-primary:focus,
.btn-primary:active.focus,
.btn-primary.active.focus,
.open > .dropdown-toggle.btn-primary.focus {
    color: #fff;
    background-color: #1c8ddd;
    border-color: #1c8ddd;
}
.query-attendance{
    position: fixed;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    background-color: #fff;
    text-align: center;
    padding: 20px;
    box-shadow: rgba(0, 0, 0, 0.15) 1px 2px 1px;
    cursor: pointer;
}

+ 46 - 0
app/app-iot-server/src/main/webapp/front/css/login.css

@ -0,0 +1,46 @@
.l-body{position: fixed;left: 0;bottom: 0;right: 0;top: 0;min-width: 790px;min-height: 700px;min-width:1160px;background-color: #fff;}
.l-header{position: relative;width: 100%;height: 100px;}
.l-l{ display: inline-block;*display:inline;*zoom:1;width: 210px;height: 100px;background: url(../images/logo.png) center no-repeat;background-size: cover;margin-left: 200px;text-indent: -9999px;}
.l-s{float: right;margin-right: 220px;}
.l-s li{position:relative;display: inline-block;height: 100px;line-height: 100px;font-size: 16px;}
/*.l-s li:first-child{margin-right: 60px;}*/
.l-s li a{display: block;color: #333;font-weight: 600;}
.l-s li a:hover{color: #0c93e4}
.l-main{position: relative;width: 100%;height: 500px;background: url(../images/login_bg.png) center no-repeat;background-size: contain;background-color: #0c93e4;}
.l-form{position: absolute;width: 341px;height: 360px;top: 70px;right: 220px;padding: 0 40px;background-color: #fff;-webkit-border-radius: 5px;border-radius: 5px; }
.l-tab{border-bottom: 1px solid #dcdcdc;}
.l-t-item{position:relative;display: inline-block;width: 49%;height: 60px;text-align: center;line-height: 60px;font-size: 20px;font-weight: 400;}
.l-t-item:first-child::before{content: " ";position:absolute;width: 1px;height: 12px;background: #dcdcdc;right: 0;top: 24px}
.l-t-item a{display: block;color: #999;width: 60px;height: 59px;margin: 0 auto;}
.l-t-item a.l-active{border-bottom: 2px solid #0c93e4;}
.l-f-tit{height: 60px;line-height: 60px;font-size: 16px;color: #a9a9a9;}
.l-f-input{width: 260px;height: 38px;line-height: 38px;border: 1px solid #dcdcdc;margin-bottom: 20px;-webkit-border-radius: 2px;border-radius: 2px;font-size: 14px;color: #333;padding-left: 39px;padding-right: 12px;}
.l-f-input[type=password]{margin-bottom: 12px;}
.l-f-c>div{position: relative;}
.l-f-icon{position: absolute;display: block;width: 15px;height: 15px;left: 12px;top: 12px;cursor: pointer/* padding: 0 12px; */}
.i-an{background: url(../images/zhanghao_icon.png) center no-repeat;}
.i-pwd{background: url(../images/mima_icon.png) center no-repeat;}
.l-f-radio{display: inline-block;width: 16px;height: 16px;background: url(../images/gouxuan_btn.png) center no-repeat;vertical-align: middle;/* -webkit-appearance: none; *//*appearance: none;*/margin-right: 10px;}
.l-f-radio.active{background: url(../images/gouxuan_btn_pre.png) center no-repeat;}
.l-f-radio input[type="checkbox"]{opacity: 0;}
.i-an,.i-pwd{background-size: cover;}
.f-p{display: inline-block;vertical-align: middle;color: #555;font-size: 14px}
.f-l{display: block;float: right;font-size: 14px;color: #0c93e4}
.l-btn{width: 260px;height: 40px;line-height: 40px;margin-top: 32px;/* margin-bottom: 12px; */text-align: center;background: #0c93e4;color: #fff;font-size: 14px;-webkit-border-radius: 2px;border-radius: 2px;cursor: pointer;-webkit-box-shadow: 0 0 3px 2px #dcdcdc;-moz-box-shadow: 0 0 3px 2px #dcdcdc;box-shadow: 0 0 3px 2px #dcdcdc;border: none;}
.l-btn:hover{background:#4db2ee }
.l-f-footer{height: 35px;line-height: 35px;font-size: 14px;color: #555;}
.l-f-footer>a{color: #0c93e4}
.l-footer{width: 100%;position: absolute;bottom: 40px;left: 0;text-align: center;color: #999;font-size: 14px;}
.header-xz-wrap {
    height: 97px;
    line-height: 97px;
    background-color: #ffffff;
}
.header-xz-logo {
    /* background-color: #259ee7; */
    background: url(../images/xz-logo.png) center no-repeat;
    width: 355px;
    height: 38px;
    margin-top: 30px;
    margin-left: 30px;
}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
app/app-iot-server/src/main/webapp/front/css/login.min.css


BIN
app/app-iot-server/src/main/webapp/front/css/patterns/header-profile-skin-1.png


BIN
app/app-iot-server/src/main/webapp/front/css/patterns/header-profile-skin-3.png


BIN
app/app-iot-server/src/main/webapp/front/css/patterns/header-profile.png


BIN
app/app-iot-server/src/main/webapp/front/css/patterns/shattered.png


+ 251 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css

@ -0,0 +1,251 @@
.checkbox {
  padding-left: 20px;
}
.checkbox label {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  padding-left: 5px;
}
.checkbox label::before {
  content: "";
  display: inline-block;
  position: absolute;
  width: 17px;
  height: 17px;
  left: 0;
  margin-left: -20px;
  border: 1px solid #cccccc;
  border-radius: 3px;
  background-color: #fff;
  -webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  -o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}
.checkbox label::after {
  display: inline-block;
  position: absolute;
  width: 16px;
  height: 16px;
  left: 0;
  top: 0;
  margin-left: -20px;
  padding-left: 3px;
  padding-top: 1px;
  font-size: 11px;
  color: #555555;
}
.checkbox input[type="checkbox"],
.checkbox input[type="radio"] {
  opacity: 0;
  z-index: 1;
}
.checkbox input[type="checkbox"]:focus + label::before,
.checkbox input[type="radio"]:focus + label::before {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
.checkbox input[type="checkbox"]:checked + label::after,
.checkbox input[type="radio"]:checked + label::after {
  font-family: "FontAwesome";
  content: "\f00c";
}
.checkbox input[type="checkbox"]:disabled + label,
.checkbox input[type="radio"]:disabled + label {
  opacity: 0.65;
}
.checkbox input[type="checkbox"]:disabled + label::before,
.checkbox input[type="radio"]:disabled + label::before {
  background-color: #eeeeee;
  cursor: not-allowed;
}
.checkbox.checkbox-circle label::before {
  border-radius: 50%;
}
.checkbox.checkbox-inline {
  margin-top: 0;
}
.checkbox-primary input[type="checkbox"]:checked + label::before,
.checkbox-primary input[type="radio"]:checked + label::before {
  background-color: #337ab7;
  border-color: #337ab7;
}
.checkbox-primary input[type="checkbox"]:checked + label::after,
.checkbox-primary input[type="radio"]:checked + label::after {
  color: #fff;
}
.checkbox-danger input[type="checkbox"]:checked + label::before,
.checkbox-danger input[type="radio"]:checked + label::before {
  background-color: #d9534f;
  border-color: #d9534f;
}
.checkbox-danger input[type="checkbox"]:checked + label::after,
.checkbox-danger input[type="radio"]:checked + label::after {
  color: #fff;
}
.checkbox-info input[type="checkbox"]:checked + label::before,
.checkbox-info input[type="radio"]:checked + label::before {
  background-color: #5bc0de;
  border-color: #5bc0de;
}
.checkbox-info input[type="checkbox"]:checked + label::after,
.checkbox-info input[type="radio"]:checked + label::after {
  color: #fff;
}
.checkbox-warning input[type="checkbox"]:checked + label::before,
.checkbox-warning input[type="radio"]:checked + label::before {
  background-color: #f0ad4e;
  border-color: #f0ad4e;
}
.checkbox-warning input[type="checkbox"]:checked + label::after,
.checkbox-warning input[type="radio"]:checked + label::after {
  color: #fff;
}
.checkbox-success input[type="checkbox"]:checked + label::before,
.checkbox-success input[type="radio"]:checked + label::before {
  background-color: #5cb85c;
  border-color: #5cb85c;
}
.checkbox-success input[type="checkbox"]:checked + label::after,
.checkbox-success input[type="radio"]:checked + label::after {
  color: #fff;
}
.radio {
  padding-left: 20px;
}
.radio label {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  padding-left: 5px;
}
.radio label::before {
  content: "";
  display: inline-block;
  position: absolute;
  width: 17px;
  height: 17px;
  left: 0;
  margin-left: -20px;
  border: 1px solid #cccccc;
  border-radius: 50%;
  background-color: #fff;
  -webkit-transition: border 0.15s ease-in-out;
  -o-transition: border 0.15s ease-in-out;
  transition: border 0.15s ease-in-out;
}
.radio label::after {
  display: inline-block;
  position: absolute;
  content: " ";
  width: 11px;
  height: 11px;
  left: 3px;
  top: 3px;
  margin-left: -20px;
  border-radius: 50%;
  background-color: #555555;
  -webkit-transform: scale(0, 0);
  -ms-transform: scale(0, 0);
  -o-transform: scale(0, 0);
  transform: scale(0, 0);
  -webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  -moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  -o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
}
.radio input[type="radio"] {
  opacity: 0;
  z-index: 1;
}
.radio input[type="radio"]:focus + label::before {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
.radio input[type="radio"]:checked + label::after {
  -webkit-transform: scale(1, 1);
  -ms-transform: scale(1, 1);
  -o-transform: scale(1, 1);
  transform: scale(1, 1);
}
.radio input[type="radio"]:disabled + label {
  opacity: 0.65;
}
.radio input[type="radio"]:disabled + label::before {
  cursor: not-allowed;
}
.radio.radio-inline {
  margin-top: 0;
}
.radio-primary input[type="radio"] + label::after {
  background-color: #337ab7;
}
.radio-primary input[type="radio"]:checked + label::before {
  border-color: #337ab7;
}
.radio-primary input[type="radio"]:checked + label::after {
  background-color: #337ab7;
}
.radio-danger input[type="radio"] + label::after {
  background-color: #d9534f;
}
.radio-danger input[type="radio"]:checked + label::before {
  border-color: #d9534f;
}
.radio-danger input[type="radio"]:checked + label::after {
  background-color: #d9534f;
}
.radio-info input[type="radio"] + label::after {
  background-color: #5bc0de;
}
.radio-info input[type="radio"]:checked + label::before {
  border-color: #5bc0de;
}
.radio-info input[type="radio"]:checked + label::after {
  background-color: #5bc0de;
}
.radio-warning input[type="radio"] + label::after {
  background-color: #f0ad4e;
}
.radio-warning input[type="radio"]:checked + label::before {
  border-color: #f0ad4e;
}
.radio-warning input[type="radio"]:checked + label::after {
  background-color: #f0ad4e;
}
.radio-success input[type="radio"] + label::after {
  background-color: #5cb85c;
}
.radio-success input[type="radio"]:checked + label::before {
  border-color: #5cb85c;
}
.radio-success input[type="radio"]:checked + label::after {
  background-color: #5cb85c;
}
input[type="checkbox"].styled:checked + label:after,
input[type="radio"].styled:checked + label:after {
  font-family: 'FontAwesome';
  content: "\f00c";
}
input[type="checkbox"] .styled:checked + label::before,
input[type="radio"] .styled:checked + label::before {
  color: #fff;
}
input[type="checkbox"] .styled:checked + label::after,
input[type="radio"] .styled:checked + label::after {
  color: #fff;
}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/css/blueimp-gallery.min.css


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/error.png


+ 5 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/error.svg

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
	<circle cx="32" cy="32" r="25" stroke="red" stroke-width="7" fill="black" fill-opacity="0.2"/>
	<rect x="28" y="7" width="8" height="50" fill="red" transform="rotate(45, 32, 32)"/>
</svg>

BIN
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/loading.gif


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/play-pause.png


+ 6 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/play-pause.svg

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="30" height="15">
	<polygon points="2,1 2,14 13,7" stroke="black" stroke-width="1" fill="white"/>
	<rect x="17" y="2" width="4" height="11" stroke="black" stroke-width="1" fill="white"/>
	<rect x="24" y="2" width="4" height="11" stroke="black" stroke-width="1" fill="white"/>
</svg>

BIN
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/video-play.png


+ 5 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/blueimp/img/video-play.svg

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
	<circle cx="32" cy="32" r="25" stroke="white" stroke-width="7" fill="black" fill-opacity="0.2"/>
	<polygon points="26,22 26,42 43,32" fill="white"/>
</svg>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/bootstrap-table/bootstrap-table.min.css


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/chosen/chosen-sprite.png


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/chosen/chosen-sprite@2x.png


+ 423 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/chosen/chosen.css

@ -0,0 +1,423 @@
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.1.0
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
/* @group Base */
.chosen-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    font-size: 13px;
    zoom: 1;
    *display: inline;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
.chosen-container .chosen-drop {
    position: absolute;
    top: 100%;
    left: -9999px;
    z-index: 1010;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #aaa;
    border-top: 0;
    background: #fff;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
}
.chosen-container.chosen-with-drop .chosen-drop {
    left: 0;
}
.chosen-container a {
    cursor: pointer;
}
/* @end */
/* @group Single Chosen */
.chosen-container-single .chosen-single {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0 0 0 8px;
    height: 23px;
    border: 1px solid #aaa;
    border-radius: 5px;
    background-color: #fff;
    background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
    background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
    background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
    background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
    background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
    background-clip: padding-box;
    box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
    color: #444;
    text-decoration: none;
    white-space: nowrap;
    line-height: 24px;
}
.chosen-container-single .chosen-default {
    color: #999;
}
.chosen-container-single .chosen-single span {
    display: block;
    overflow: hidden;
    margin-right: 26px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chosen-container-single .chosen-single-with-deselect span {
    margin-right: 38px;
}
.chosen-container-single .chosen-single abbr {
    position: absolute;
    top: 6px;
    right: 26px;
    display: block;
    width: 12px;
    height: 12px;
    background: url('chosen-sprite.png') -42px 1px no-repeat;
    font-size: 1px;
}
.chosen-container-single .chosen-single abbr:hover {
    background-position: -42px -10px;
}
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
    background-position: -42px -10px;
}
.chosen-container-single .chosen-single div {
    position: absolute;
    top: 0;
    right: 0;
    display: block;
    width: 18px;
    height: 100%;
}
.chosen-container-single .chosen-single div b {
    display: block;
    width: 100%;
    height: 100%;
    background: url('chosen-sprite.png') no-repeat 0px 7px;
}
.chosen-container-single .chosen-search {
    position: relative;
    z-index: 1010;
    margin: 0;
    padding: 3px 4px;
    white-space: nowrap;
}
.chosen-container-single .chosen-search input[type="text"] {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 1px 0;
    padding: 4px 20px 4px 5px;
    width: 100%;
    height: auto;
    outline: 0;
    border: 1px solid #aaa;
    background: white url('chosen-sprite.png') no-repeat 100% -20px;
    background: url('chosen-sprite.png') no-repeat 100% -20px;
    font-size: 1em;
    font-family: sans-serif;
    line-height: normal;
    border-radius: 0;
}
.chosen-container-single .chosen-drop {
    margin-top: -1px;
    border-radius: 0 0 4px 4px;
    background-clip: padding-box;
}
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
    position: absolute;
    left: -9999px;
}
/* @end */
/* @group Results */
.chosen-container .chosen-results {
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 4px 4px 0;
    padding: 0 0 0 4px;
    max-height: 240px;
    -webkit-overflow-scrolling: touch;
}
.chosen-container .chosen-results li {
    display: none;
    margin: 0;
    padding: 5px 6px;
    list-style: none;
    line-height: 15px;
    -webkit-touch-callout: none;
}
.chosen-container .chosen-results li.active-result {
    display: list-item;
    cursor: pointer;
}
.chosen-container .chosen-results li.disabled-result {
    display: list-item;
    color: #ccc;
    cursor: default;
}
.chosen-container .chosen-results li.highlighted {
    background-color: #3875d7;
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
    background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
    background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
    background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
    background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
    color: #fff;
}
.chosen-container .chosen-results li.no-results {
    display: list-item;
    background: #f4f4f4;
}
.chosen-container .chosen-results li.group-result {
    display: list-item;
    font-weight: bold;
    cursor: default;
}
.chosen-container .chosen-results li.group-option {
    padding-left: 15px;
}
.chosen-container .chosen-results li em {
    font-style: normal;
    text-decoration: underline;
}
/* @end */
/* @group Multi Chosen */
.chosen-container-multi .chosen-choices {
    -moz-box-sizing: border-box;
    background-color: #FFFFFF;
    border: 1px solid #CBD5DD;
    border-radius: 2px;
    cursor: text;
    height: auto !important;
    margin: 0;
    min-height: 30px;
    overflow: hidden;
    padding: 2px;
    position: relative;
    width: 100%;
}
.chosen-container-multi .chosen-choices li {
    float: left;
    list-style: none;
}
.chosen-container-multi .chosen-choices li.search-field {
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
    margin: 1px 0;
    padding: 5px;
    height: 25px;
    outline: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none;
    color: #666;
    font-size: 100%;
    font-family: sans-serif;
    line-height: normal;
    border-radius: 0;
}
.chosen-container-multi .chosen-choices li.search-field .default {
    color: #999;
}
.chosen-container-multi .chosen-choices li.search-choice {
    position: relative;
    margin: 3px 0 3px 5px;
    padding: 3px 20px 3px 5px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background-color: #e4e4e4;
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
    background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-clip: padding-box;
    box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
    color: #333;
    line-height: 13px;
    cursor: default;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
    position: absolute;
    top: 4px;
    right: 3px;
    display: block;
    width: 12px;
    height: 12px;
    background: url('chosen-sprite.png') -42px 1px no-repeat;
    font-size: 1px;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
    background-position: -42px -10px;
}
.chosen-container-multi .chosen-choices li.search-choice-disabled {
    padding-right: 5px;
    border: 1px solid #ccc;
    background-color: #e4e4e4;
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
    background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
    color: #666;
}
.chosen-container-multi .chosen-choices li.search-choice-focus {
    background: #d4d4d4;
}
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
    background-position: -42px -10px;
}
.chosen-container-multi .chosen-results {
    margin: 0;
    padding: 0;
}
.chosen-container-multi .chosen-drop .result-selected {
    display: list-item;
    color: #ccc;
    cursor: default;
}
/* @end */
/* @group Active  */
.chosen-container-active .chosen-single {
    border: 1px solid #5897fb;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active.chosen-with-drop .chosen-single {
    border: 1px solid #aaa;
    -moz-border-radius-bottomright: 0;
    border-bottom-right-radius: 0;
    -moz-border-radius-bottomleft: 0;
    border-bottom-left-radius: 0;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
    border-left: none;
    background: transparent;
}
.chosen-container-active.chosen-with-drop .chosen-single div b {
    background-position: -18px 7px;
}
.chosen-container-active .chosen-choices {
    border: 1px solid #5897fb;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
    color: #111 !important;
}
/* @end */
/* @group Disabled Support */
.chosen-disabled {
    opacity: 0.5 !important;
    cursor: default;
}
.chosen-disabled .chosen-single {
    cursor: default;
}
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
    cursor: default;
}
/* @end */
/* @group Right to Left */
.chosen-rtl {
    text-align: right;
}
.chosen-rtl .chosen-single {
    overflow: visible;
    padding: 0 8px 0 0;
}
.chosen-rtl .chosen-single span {
    margin-right: 0;
    margin-left: 26px;
    direction: rtl;
}
.chosen-rtl .chosen-single-with-deselect span {
    margin-left: 38px;
}
.chosen-rtl .chosen-single div {
    right: auto;
    left: 3px;
}
.chosen-rtl .chosen-single abbr {
    right: auto;
    left: 26px;
}
.chosen-rtl .chosen-choices li {
    float: right;
}
.chosen-rtl .chosen-choices li.search-field input[type="text"] {
    direction: rtl;
}
.chosen-rtl .chosen-choices li.search-choice {
    margin: 3px 5px 3px 0;
    padding: 3px 5px 3px 19px;
}
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
    right: auto;
    left: 4px;
}
.chosen-rtl.chosen-container-single-nosearch .chosen-search,
.chosen-rtl .chosen-drop {
    left: 9999px;
}
.chosen-rtl.chosen-container-single .chosen-results {
    margin: 0 0 4px 4px;
    padding: 0 4px 0 0;
}
.chosen-rtl .chosen-results li.group-option {
    padding-right: 15px;
    padding-left: 0;
}
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
    border-right: none;
}
.chosen-rtl .chosen-search input[type="text"] {
    padding: 4px 5px 4px 20px;
    background: white url('chosen-sprite.png') no-repeat -30px -20px;
    background: url('chosen-sprite.png') no-repeat -30px -20px;
    direction: rtl;
}
.chosen-rtl.chosen-container-single .chosen-single div b {
    background-position: 6px 2px;
}
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
    background-position: -12px 2px;
}
/* @end */
/* @group Retina compatibility */
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
    .chosen-rtl .chosen-search input[type="text"],
    .chosen-container-single .chosen-single abbr,
    .chosen-container-single .chosen-single div b,
    .chosen-container-single .chosen-search input[type="text"],
    .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
    .chosen-container .chosen-results-scroll-down span,
    .chosen-container .chosen-results-scroll-up span {
        background-image: url('chosen-sprite%402x.png') !important;
        background-size: 52px 37px !important;
        background-repeat: no-repeat !important;
    }
}
/* @end */

+ 168 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/clockpicker/clockpicker.css

@ -0,0 +1,168 @@
/*!
 * ClockPicker v{package.version} for Bootstrap (http://weareoutman.github.io/clockpicker/)
 * Copyright 2014 Wang Shenwei.
 * Licensed under MIT (https://github.com/weareoutman/clockpicker/blob/gh-pages/LICENSE)
 */
.clockpicker .input-group-addon {
	cursor: pointer;
}
.clockpicker-moving {
	cursor: move;
}
.clockpicker-align-left.popover > .arrow {
	left: 25px;
}
.clockpicker-align-top.popover > .arrow {
	top: 17px;
}
.clockpicker-align-right.popover > .arrow {
	left: auto;
	right: 25px;
}
.clockpicker-align-bottom.popover > .arrow {
	top: auto;
	bottom: 6px;
}
.clockpicker-popover .popover-title {
	background-color: #fff;
	color: #999;
	font-size: 24px;
	font-weight: bold;
	line-height: 30px;
	text-align: center;
}
.clockpicker-popover .popover-title span {
	cursor: pointer;
}
.clockpicker-popover .popover-content {
	background-color: #f8f8f8;
	padding: 12px;
}
.popover-content:last-child {
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
}
.clockpicker-plate {
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: 50%;
	width: 200px;
	height: 200px;
	overflow: visible;
	position: relative;
	/* Disable text selection highlighting. Thanks to Hermanya */
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
.clockpicker-canvas,
.clockpicker-dial {
	width: 200px;
	height: 200px;
	position: absolute;
	left: -1px;
	top: -1px;
}
.clockpicker-minutes {
	visibility: hidden;
}
.clockpicker-tick {
	border-radius: 50%;
	color: #666;
	line-height: 26px;
	text-align: center;
	width: 26px;
	height: 26px;
	position: absolute;
	cursor: pointer;
}
.clockpicker-tick.active,
.clockpicker-tick:hover {
	background-color: rgb(192, 229, 247);
	background-color: rgba(0, 149, 221, .25);
}
.clockpicker-button {
	background-image: none;
	background-color: #fff;
	border-width: 1px 0 0;
	border-top-left-radius: 0;
	border-top-right-radius: 0;
	margin: 0;
	padding: 10px 0;
}
.clockpicker-button:hover {
	background-image: none;
	background-color: #ebebeb;
}
.clockpicker-button:focus {
	outline: none!important;
}
.clockpicker-dial {
	-webkit-transition: -webkit-transform 350ms, opacity 350ms;
	-moz-transition: -moz-transform 350ms, opacity 350ms;
	-ms-transition: -ms-transform 350ms, opacity 350ms;
	-o-transition: -o-transform 350ms, opacity 350ms;
	transition: transform 350ms, opacity 350ms;
}
.clockpicker-dial-out {
	opacity: 0;
}
.clockpicker-hours.clockpicker-dial-out {
	-webkit-transform: scale(1.2, 1.2);
	-moz-transform: scale(1.2, 1.2);
	-ms-transform: scale(1.2, 1.2);
	-o-transform: scale(1.2, 1.2);
	transform: scale(1.2, 1.2);
}
.clockpicker-minutes.clockpicker-dial-out {
	-webkit-transform: scale(.8, .8);
	-moz-transform: scale(.8, .8);
	-ms-transform: scale(.8, .8);
	-o-transform: scale(.8, .8);
	transform: scale(.8, .8);
}
.clockpicker-canvas {
	-webkit-transition: opacity 175ms;
	-moz-transition: opacity 175ms;
	-ms-transition: opacity 175ms;
	-o-transition: opacity 175ms;
	transition: opacity 175ms;
}
.clockpicker-canvas-out {
	opacity: 0.25;
}
.clockpicker-canvas-bearing,
.clockpicker-canvas-fg {
	stroke: none;
	fill: rgb(0, 149, 221);
}
.clockpicker-canvas-bg {
	stroke: none;
	fill: rgb(192, 229, 247);
}
.clockpicker-canvas-bg-trans {
	fill: rgba(0, 149, 221, .25);
}
.clockpicker-canvas line {
	stroke: rgb(0, 149, 221);
	stroke-width: 1;
	stroke-linecap: round;
	/*shape-rendering: crispEdges;*/
}
.clockpicker-button.am-button {
	margin: 1px;
	padding: 5px;
	border: 1px solid rgba(0, 0, 0, .2);
	border-radius: 4px;
}
.clockpicker-button.pm-button {
	margin: 1px 1px 1px 136px;
	padding: 5px;
	border: 1px solid rgba(0, 0, 0, .2);
	border-radius: 4px;
}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 77 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/codemirror/ambiance.css


+ 309 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/codemirror/codemirror.css

@ -0,0 +1,309 @@
/* BASICS */
.CodeMirror {
  /* Set height, width, borders, and global font properties here */
  font-family: monospace;
  height: 300px;
}
.CodeMirror-scroll {
  /* Set scrolling behaviour here */
  overflow: auto;
}
/* PADDING */
.CodeMirror-lines {
  padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
  padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
  border-right: 1px solid #ddd;
  background-color: #f7f7f7;
  white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
  padding: 0 3px 0 5px;
  min-width: 20px;
  text-align: right;
  color: #999;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}
.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
  border-left: 1px solid black;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
  border-left: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
  width: auto;
  border: 0;
  background: #7e7;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursors {
  z-index: 1;
}
.cm-animate-fat-cursor {
  width: auto;
  border: 0;
  -webkit-animation: blink 1.06s steps(1) infinite;
  -moz-animation: blink 1.06s steps(1) infinite;
  animation: blink 1.06s steps(1) infinite;
}
@-moz-keyframes blink {
  0% { background: #7e7; }
  50% { background: none; }
  100% { background: #7e7; }
}
@-webkit-keyframes blink {
  0% { background: #7e7; }
  50% { background: none; }
  100% { background: #7e7; }
}
@keyframes blink {
  0% { background: #7e7; }
  50% { background: none; }
  100% { background: #7e7; }
}
/* Can style cursor different in overwrite (non-insert) mode */
div.CodeMirror-overwrite div.CodeMirror-cursor {}
.cm-tab { display: inline-block; text-decoration: inherit; }
.CodeMirror-ruler {
  border-left: 1px solid #ccc;
  position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
   the editor. You probably shouldn't touch them. */
.CodeMirror {
  line-height: 1;
  position: relative;
  overflow: hidden;
  background: white;
  color: black;
}
.CodeMirror-scroll {
  /* 30px is the magic margin used to hide the element's real scrollbars */
  /* See overflow: hidden in .CodeMirror */
  margin-bottom: -30px; margin-right: -30px;
  padding-bottom: 30px;
  height: 100%;
  outline: none; /* Prevent dragging from highlighting the element */
  position: relative;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}
.CodeMirror-sizer {
  position: relative;
  border-right: 30px solid transparent;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
   before actuall scrolling happens, thus preventing shaking and
   flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  position: absolute;
  z-index: 6;
  display: none;
}
.CodeMirror-vscrollbar {
  right: 0; top: 0;
  overflow-x: hidden;
  overflow-y: scroll;
}
.CodeMirror-hscrollbar {
  bottom: 0; left: 0;
  overflow-y: hidden;
  overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
  right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
  left: 0; bottom: 0;
}
.CodeMirror-gutters {
  position: absolute; left: 0; top: 0;
  padding-bottom: 30px;
  z-index: 3;
}
.CodeMirror-gutter {
  white-space: normal;
  height: 100%;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  padding-bottom: 30px;
  margin-bottom: -32px;
  display: inline-block;
  /* Hack to make IE7 behave */
  *zoom:1;
  *display:inline;
}
.CodeMirror-gutter-elt {
  position: absolute;
  cursor: default;
  z-index: 4;
}
.CodeMirror-lines {
  cursor: text;
  min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre {
  /* Reset some styles that the rest of the page might have set */
  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  border-width: 0;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  margin: 0;
  white-space: pre;
  word-wrap: normal;
  line-height: inherit;
  color: inherit;
  z-index: 2;
  position: relative;
  overflow: visible;
}
.CodeMirror-wrap pre {
  word-wrap: break-word;
  white-space: pre-wrap;
  word-break: normal;
}
.CodeMirror-linebackground {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 0;
}
.CodeMirror-linewidget {
  position: relative;
  z-index: 2;
  overflow: auto;
}
.CodeMirror-widget {}
.CodeMirror-wrap .CodeMirror-scroll {
  overflow-x: hidden;
}
.CodeMirror-measure {
  position: absolute;
  width: 100%;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor {
  position: absolute;
  border-right: none;
  width: 0;
}
div.CodeMirror-cursors {
  visibility: hidden;
  position: relative;
  z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
  visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.cm-searching {
  background: #ffa;
  background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }
@media print {
  /* Hide the cursor when printing */
  .CodeMirror div.CodeMirror-cursors {
    visibility: hidden;
  }
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 9 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/alpha-horizontal.png


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/alpha.png


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/hue-horizontal.png


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/hue.png


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/colorpicker/img/bootstrap-colorpicker/saturation.png


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 9 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/cropper/cropper.min.css


+ 231 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/dataTables/dataTables.bootstrap.css

@ -0,0 +1,231 @@
div.dataTables_length label {
    float: left;
    text-align: left;
    font-weight: normal;
}
div.dataTables_length select {
    width: 75px;
}
div.dataTables_filter label {
    float: right;
    font-weight: normal;
}
div.dataTables_filter input {
    width: 16em;
}
div.dataTables_info {
    padding-top: 8px;
}
div.dataTables_paginate {
    float: right;
    margin: 0;
}
div.dataTables_paginate ul.pagination {
    margin: 2px 0;
    white-space: nowrap;
}
table.dataTable,
table.dataTable td,
table.dataTable th {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
}
table.dataTable {
    clear: both;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    max-width: none !important;
}
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
    cursor: pointer;
}
table.dataTable thead .sorting {
}
table.dataTable thead .sorting_asc {
    background: url('../images/sort_asc.png') no-repeat center right;
}
table.dataTable thead .sorting_desc {
    background: url('../images/sort_desc.png') no-repeat center right;
}
table.dataTable thead .sorting_asc_disabled {
}
table.dataTable thead .sorting_desc_disabled {
}
table.dataTable th:active {
    outline: none;
}
/* Scrolling */
div.dataTables_scrollHead table {
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
div.dataTables_scrollHead table thead tr:last-child th:first-child,
div.dataTables_scrollHead table thead tr:last-child td:first-child {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
div.dataTables_scrollBody table {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-top: none;
}
div.dataTables_scrollBody tbody tr:first-child th,
div.dataTables_scrollBody tbody tr:first-child td {
    border-top: none;
}
div.dataTables_scrollFoot table {
    margin-top: 0 !important;
    border-top: none;
}
/*
 * TableTools styles
 */
.table tbody tr.active td,
.table tbody tr.active th {
    color: white;
    background-color: #08C;
}
.table tbody tr.active:hover td,
.table tbody tr.active:hover th {
    background-color: #0075b0 !important;
}
.table tbody tr.active a {
    color: white;
}
.table-striped tbody tr.active:nth-child(odd) td,
.table-striped tbody tr.active:nth-child(odd) th {
    background-color: #017ebc;
}
table.DTTT_selectable tbody tr {
    cursor: pointer;
}
div.DTTT .btn {
    font-size: 12px;
    color: #333 !important;
}
div.DTTT .btn:hover {
    text-decoration: none !important;
}
ul.DTTT_dropdown.dropdown-menu {
    z-index: 2003;
}
ul.DTTT_dropdown.dropdown-menu a {
    color: #333 !important; /* needed only when demo_page.css is included */
}
ul.DTTT_dropdown.dropdown-menu li {
    position: relative;
}
ul.DTTT_dropdown.dropdown-menu li:hover a {
    color: white !important;
    background-color: #0088cc;
}
div.DTTT_collection_background {
    z-index: 2002;
}
/* TableTools information display */
div.DTTT_print_info.modal {
    height: 150px;
    margin-top: -75px;
    text-align: center;
}
div.DTTT_print_info h6 {
    margin: 1em;
    font-size: 28px;
    font-weight: normal;
    line-height: 28px;
}
div.DTTT_print_info p {
    font-size: 14px;
    line-height: 20px;
}
/*
 * FixedColumns styles
 */
div.DTFC_LeftHeadWrapper table,
div.DTFC_LeftFootWrapper table,
div.DTFC_RightHeadWrapper table,
div.DTFC_RightFootWrapper table,
table.DTFC_Cloned tr.even {
    background-color: white;
}
div.DTFC_RightHeadWrapper table,
div.DTFC_LeftHeadWrapper table {
    margin-bottom: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child,
div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child,
div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
div.DTFC_RightBodyWrapper table,
div.DTFC_LeftBodyWrapper table {
    margin-bottom: 0 !important;
    border-top: none;
}
div.DTFC_RightBodyWrapper tbody tr:first-child th,
div.DTFC_RightBodyWrapper tbody tr:first-child td,
div.DTFC_LeftBodyWrapper tbody tr:first-child th,
div.DTFC_LeftBodyWrapper tbody tr:first-child td {
    border-top: none;
}
div.DTFC_RightFootWrapper table,
div.DTFC_LeftFootWrapper table {
    border-top: none;
}

+ 789 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/datapicker/datepicker3.css

@ -0,0 +1,789 @@
/*!
 * Datepicker for Bootstrap
 *
 * Copyright 2012 Stefan Petre
 * Improvements by Andrew Rowls
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 */
.datepicker {
  padding: 4px;
  border-radius: 4px;
  direction: ltr;
  /*.dow {
		border-top: 1px solid #ddd !important;
	}*/
}
.datepicker-inline {
  width: 220px;
}
.datepicker.datepicker-rtl {
  direction: rtl;
}
.datepicker.datepicker-rtl table tr td span {
  float: right;
}
.datepicker-dropdown {
  top: 0;
  left: 0;
}
.datepicker-dropdown:before {
  content: '';
  display: inline-block;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #ccc;
  border-top: 0;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  position: absolute;
}
.datepicker-dropdown:after {
  content: '';
  display: inline-block;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
  border-top: 0;
  position: absolute;
}
.datepicker-dropdown.datepicker-orient-left:before {
  left: 6px;
}
.datepicker-dropdown.datepicker-orient-left:after {
  left: 7px;
}
.datepicker-dropdown.datepicker-orient-right:before {
  right: 6px;
}
.datepicker-dropdown.datepicker-orient-right:after {
  right: 7px;
}
.datepicker-dropdown.datepicker-orient-top:before {
  top: -7px;
}
.datepicker-dropdown.datepicker-orient-top:after {
  top: -6px;
}
.datepicker-dropdown.datepicker-orient-bottom:before {
  bottom: -7px;
  border-bottom: 0;
  border-top: 7px solid #999;
}
.datepicker-dropdown.datepicker-orient-bottom:after {
  bottom: -6px;
  border-bottom: 0;
  border-top: 6px solid #fff;
}
.datepicker > div {
  display: none;
}
.datepicker.days div.datepicker-days {
  display: block;
}
.datepicker.months div.datepicker-months {
  display: block;
}
.datepicker.years div.datepicker-years {
  display: block;
}
.datepicker table {
  margin: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.datepicker table tr td,
.datepicker table tr th {
  text-align: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
}
.table-striped .datepicker table tr td,
.table-striped .datepicker table tr th {
  background-color: transparent;
}
.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused {
  background: #eeeeee;
  cursor: pointer;
}
.datepicker table tr td.old,
.datepicker table tr td.new {
  color: #999999;
}
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
  background: none;
  color: #999999;
  cursor: default;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
.datepicker table tr td.today.disabled:hover {
  color: #000000;
  background-color: #ffdb99;
  border-color: #ffb733;
}
.datepicker table tr td.today:hover,
.datepicker table tr td.today:hover:hover,
.datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today.disabled:hover:hover,
.datepicker table tr td.today:focus,
.datepicker table tr td.today:hover:focus,
.datepicker table tr td.today.disabled:focus,
.datepicker table tr td.today.disabled:hover:focus,
.datepicker table tr td.today:active,
.datepicker table tr td.today:hover:active,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.active,
.datepicker table tr td.today:hover.active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.today,
.open .dropdown-toggle.datepicker table tr td.today:hover,
.open .dropdown-toggle.datepicker table tr td.today.disabled,
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
  color: #000000;
  background-color: #ffcd70;
  border-color: #f59e00;
}
.datepicker table tr td.today:active,
.datepicker table tr td.today:hover:active,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.active,
.datepicker table tr td.today:hover.active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.today,
.open .dropdown-toggle.datepicker table tr td.today:hover,
.open .dropdown-toggle.datepicker table tr td.today.disabled,
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
  background-image: none;
}
.datepicker table tr td.today.disabled,
.datepicker table tr td.today:hover.disabled,
.datepicker table tr td.today.disabled.disabled,
.datepicker table tr td.today.disabled:hover.disabled,
.datepicker table tr td.today[disabled],
.datepicker table tr td.today:hover[disabled],
.datepicker table tr td.today.disabled[disabled],
.datepicker table tr td.today.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.today,
fieldset[disabled] .datepicker table tr td.today:hover,
fieldset[disabled] .datepicker table tr td.today.disabled,
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today:hover.disabled:hover,
.datepicker table tr td.today.disabled.disabled:hover,
.datepicker table tr td.today.disabled:hover.disabled:hover,
.datepicker table tr td.today[disabled]:hover,
.datepicker table tr td.today:hover[disabled]:hover,
.datepicker table tr td.today.disabled[disabled]:hover,
.datepicker table tr td.today.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.today:hover,
fieldset[disabled] .datepicker table tr td.today:hover:hover,
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:hover,
.datepicker table tr td.today.disabled:focus,
.datepicker table tr td.today:hover.disabled:focus,
.datepicker table tr td.today.disabled.disabled:focus,
.datepicker table tr td.today.disabled:hover.disabled:focus,
.datepicker table tr td.today[disabled]:focus,
.datepicker table tr td.today:hover[disabled]:focus,
.datepicker table tr td.today.disabled[disabled]:focus,
.datepicker table tr td.today.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.today:focus,
fieldset[disabled] .datepicker table tr td.today:hover:focus,
fieldset[disabled] .datepicker table tr td.today.disabled:focus,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:focus,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today:hover.disabled:active,
.datepicker table tr td.today.disabled.disabled:active,
.datepicker table tr td.today.disabled:hover.disabled:active,
.datepicker table tr td.today[disabled]:active,
.datepicker table tr td.today:hover[disabled]:active,
.datepicker table tr td.today.disabled[disabled]:active,
.datepicker table tr td.today.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.today:active,
fieldset[disabled] .datepicker table tr td.today:hover:active,
fieldset[disabled] .datepicker table tr td.today.disabled:active,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today:hover.disabled.active,
.datepicker table tr td.today.disabled.disabled.active,
.datepicker table tr td.today.disabled:hover.disabled.active,
.datepicker table tr td.today[disabled].active,
.datepicker table tr td.today:hover[disabled].active,
.datepicker table tr td.today.disabled[disabled].active,
.datepicker table tr td.today.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.today.active,
fieldset[disabled] .datepicker table tr td.today:hover.active,
fieldset[disabled] .datepicker table tr td.today.disabled.active,
fieldset[disabled] .datepicker table tr td.today.disabled:hover.active {
  background-color: #ffdb99;
  border-color: #ffb733;
}
.datepicker table tr td.today:hover:hover {
  color: #000;
}
.datepicker table tr td.today.active:hover {
  color: #fff;
}
.datepicker table tr td.range,
.datepicker table tr td.range:hover,
.datepicker table tr td.range.disabled,
.datepicker table tr td.range.disabled:hover {
  background: #eeeeee;
  border-radius: 0;
}
.datepicker table tr td.range.today,
.datepicker table tr td.range.today:hover,
.datepicker table tr td.range.today.disabled,
.datepicker table tr td.range.today.disabled:hover {
  color: #000000;
  background-color: #f7ca77;
  border-color: #f1a417;
  border-radius: 0;
}
.datepicker table tr td.range.today:hover,
.datepicker table tr td.range.today:hover:hover,
.datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today.disabled:hover:hover,
.datepicker table tr td.range.today:focus,
.datepicker table tr td.range.today:hover:focus,
.datepicker table tr td.range.today.disabled:focus,
.datepicker table tr td.range.today.disabled:hover:focus,
.datepicker table tr td.range.today:active,
.datepicker table tr td.range.today:hover:active,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.active,
.datepicker table tr td.range.today:hover.active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.range.today,
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
  color: #000000;
  background-color: #f4bb51;
  border-color: #bf800c;
}
.datepicker table tr td.range.today:active,
.datepicker table tr td.range.today:hover:active,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.active,
.datepicker table tr td.range.today:hover.active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.range.today,
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
  background-image: none;
}
.datepicker table tr td.range.today.disabled,
.datepicker table tr td.range.today:hover.disabled,
.datepicker table tr td.range.today.disabled.disabled,
.datepicker table tr td.range.today.disabled:hover.disabled,
.datepicker table tr td.range.today[disabled],
.datepicker table tr td.range.today:hover[disabled],
.datepicker table tr td.range.today.disabled[disabled],
.datepicker table tr td.range.today.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.range.today,
fieldset[disabled] .datepicker table tr td.range.today:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today:hover.disabled:hover,
.datepicker table tr td.range.today.disabled.disabled:hover,
.datepicker table tr td.range.today.disabled:hover.disabled:hover,
.datepicker table tr td.range.today[disabled]:hover,
.datepicker table tr td.range.today:hover[disabled]:hover,
.datepicker table tr td.range.today.disabled[disabled]:hover,
.datepicker table tr td.range.today.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.range.today:hover,
fieldset[disabled] .datepicker table tr td.range.today:hover:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:hover,
.datepicker table tr td.range.today.disabled:focus,
.datepicker table tr td.range.today:hover.disabled:focus,
.datepicker table tr td.range.today.disabled.disabled:focus,
.datepicker table tr td.range.today.disabled:hover.disabled:focus,
.datepicker table tr td.range.today[disabled]:focus,
.datepicker table tr td.range.today:hover[disabled]:focus,
.datepicker table tr td.range.today.disabled[disabled]:focus,
.datepicker table tr td.range.today.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.range.today:focus,
fieldset[disabled] .datepicker table tr td.range.today:hover:focus,
fieldset[disabled] .datepicker table tr td.range.today.disabled:focus,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:focus,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today:hover.disabled:active,
.datepicker table tr td.range.today.disabled.disabled:active,
.datepicker table tr td.range.today.disabled:hover.disabled:active,
.datepicker table tr td.range.today[disabled]:active,
.datepicker table tr td.range.today:hover[disabled]:active,
.datepicker table tr td.range.today.disabled[disabled]:active,
.datepicker table tr td.range.today.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.range.today:active,
fieldset[disabled] .datepicker table tr td.range.today:hover:active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today:hover.disabled.active,
.datepicker table tr td.range.today.disabled.disabled.active,
.datepicker table tr td.range.today.disabled:hover.disabled.active,
.datepicker table tr td.range.today[disabled].active,
.datepicker table tr td.range.today:hover[disabled].active,
.datepicker table tr td.range.today.disabled[disabled].active,
.datepicker table tr td.range.today.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.range.today.active,
fieldset[disabled] .datepicker table tr td.range.today:hover.active,
fieldset[disabled] .datepicker table tr td.range.today.disabled.active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover.active {
  background-color: #f7ca77;
  border-color: #f1a417;
}
.datepicker table tr td.selected,
.datepicker table tr td.selected:hover,
.datepicker table tr td.selected.disabled,
.datepicker table tr td.selected.disabled:hover {
  color: #ffffff;
  background-color: #999999;
  border-color: #555555;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td.selected:hover,
.datepicker table tr td.selected:hover:hover,
.datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected.disabled:hover:hover,
.datepicker table tr td.selected:focus,
.datepicker table tr td.selected:hover:focus,
.datepicker table tr td.selected.disabled:focus,
.datepicker table tr td.selected.disabled:hover:focus,
.datepicker table tr td.selected:active,
.datepicker table tr td.selected:hover:active,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.active,
.datepicker table tr td.selected:hover.active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.selected,
.open .dropdown-toggle.datepicker table tr td.selected:hover,
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
  color: #ffffff;
  background-color: #858585;
  border-color: #373737;
}
.datepicker table tr td.selected:active,
.datepicker table tr td.selected:hover:active,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.active,
.datepicker table tr td.selected:hover.active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.selected,
.open .dropdown-toggle.datepicker table tr td.selected:hover,
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
  background-image: none;
}
.datepicker table tr td.selected.disabled,
.datepicker table tr td.selected:hover.disabled,
.datepicker table tr td.selected.disabled.disabled,
.datepicker table tr td.selected.disabled:hover.disabled,
.datepicker table tr td.selected[disabled],
.datepicker table tr td.selected:hover[disabled],
.datepicker table tr td.selected.disabled[disabled],
.datepicker table tr td.selected.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.selected,
fieldset[disabled] .datepicker table tr td.selected:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected:hover.disabled:hover,
.datepicker table tr td.selected.disabled.disabled:hover,
.datepicker table tr td.selected.disabled:hover.disabled:hover,
.datepicker table tr td.selected[disabled]:hover,
.datepicker table tr td.selected:hover[disabled]:hover,
.datepicker table tr td.selected.disabled[disabled]:hover,
.datepicker table tr td.selected.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.selected:hover,
fieldset[disabled] .datepicker table tr td.selected:hover:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:hover,
.datepicker table tr td.selected.disabled:focus,
.datepicker table tr td.selected:hover.disabled:focus,
.datepicker table tr td.selected.disabled.disabled:focus,
.datepicker table tr td.selected.disabled:hover.disabled:focus,
.datepicker table tr td.selected[disabled]:focus,
.datepicker table tr td.selected:hover[disabled]:focus,
.datepicker table tr td.selected.disabled[disabled]:focus,
.datepicker table tr td.selected.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.selected:focus,
fieldset[disabled] .datepicker table tr td.selected:hover:focus,
fieldset[disabled] .datepicker table tr td.selected.disabled:focus,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:focus,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected:hover.disabled:active,
.datepicker table tr td.selected.disabled.disabled:active,
.datepicker table tr td.selected.disabled:hover.disabled:active,
.datepicker table tr td.selected[disabled]:active,
.datepicker table tr td.selected:hover[disabled]:active,
.datepicker table tr td.selected.disabled[disabled]:active,
.datepicker table tr td.selected.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.selected:active,
fieldset[disabled] .datepicker table tr td.selected:hover:active,
fieldset[disabled] .datepicker table tr td.selected.disabled:active,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected:hover.disabled.active,
.datepicker table tr td.selected.disabled.disabled.active,
.datepicker table tr td.selected.disabled:hover.disabled.active,
.datepicker table tr td.selected[disabled].active,
.datepicker table tr td.selected:hover[disabled].active,
.datepicker table tr td.selected.disabled[disabled].active,
.datepicker table tr td.selected.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.selected.active,
fieldset[disabled] .datepicker table tr td.selected:hover.active,
fieldset[disabled] .datepicker table tr td.selected.disabled.active,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover.active {
  background-color: #999999;
  border-color: #555555;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.disabled,
.datepicker table tr td.active.disabled:hover {
  color: #ffffff;
  background-color: #428bca;
  border-color: #357ebd;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td.active:hover,
.datepicker table tr td.active:hover:hover,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active.disabled:hover:hover,
.datepicker table tr td.active:focus,
.datepicker table tr td.active:hover:focus,
.datepicker table tr td.active.disabled:focus,
.datepicker table tr td.active.disabled:hover:focus,
.datepicker table tr td.active:active,
.datepicker table tr td.active:hover:active,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.active,
.open .dropdown-toggle.datepicker table tr td.active:hover,
.open .dropdown-toggle.datepicker table tr td.active.disabled,
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
  color: #ffffff;
  background-color: #3276b1;
  border-color: #285e8e;
}
.datepicker table tr td.active:active,
.datepicker table tr td.active:hover:active,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.active,
.open .dropdown-toggle.datepicker table tr td.active:hover,
.open .dropdown-toggle.datepicker table tr td.active.disabled,
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
  background-image: none;
}
.datepicker table tr td.active.disabled,
.datepicker table tr td.active:hover.disabled,
.datepicker table tr td.active.disabled.disabled,
.datepicker table tr td.active.disabled:hover.disabled,
.datepicker table tr td.active[disabled],
.datepicker table tr td.active:hover[disabled],
.datepicker table tr td.active.disabled[disabled],
.datepicker table tr td.active.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.active,
fieldset[disabled] .datepicker table tr td.active:hover,
fieldset[disabled] .datepicker table tr td.active.disabled,
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active:hover.disabled:hover,
.datepicker table tr td.active.disabled.disabled:hover,
.datepicker table tr td.active.disabled:hover.disabled:hover,
.datepicker table tr td.active[disabled]:hover,
.datepicker table tr td.active:hover[disabled]:hover,
.datepicker table tr td.active.disabled[disabled]:hover,
.datepicker table tr td.active.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.active:hover,
fieldset[disabled] .datepicker table tr td.active:hover:hover,
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:hover,
.datepicker table tr td.active.disabled:focus,
.datepicker table tr td.active:hover.disabled:focus,
.datepicker table tr td.active.disabled.disabled:focus,
.datepicker table tr td.active.disabled:hover.disabled:focus,
.datepicker table tr td.active[disabled]:focus,
.datepicker table tr td.active:hover[disabled]:focus,
.datepicker table tr td.active.disabled[disabled]:focus,
.datepicker table tr td.active.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.active:focus,
fieldset[disabled] .datepicker table tr td.active:hover:focus,
fieldset[disabled] .datepicker table tr td.active.disabled:focus,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:focus,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active:hover.disabled:active,
.datepicker table tr td.active.disabled.disabled:active,
.datepicker table tr td.active.disabled:hover.disabled:active,
.datepicker table tr td.active[disabled]:active,
.datepicker table tr td.active:hover[disabled]:active,
.datepicker table tr td.active.disabled[disabled]:active,
.datepicker table tr td.active.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.active:active,
fieldset[disabled] .datepicker table tr td.active:hover:active,
fieldset[disabled] .datepicker table tr td.active.disabled:active,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active:hover.disabled.active,
.datepicker table tr td.active.disabled.disabled.active,
.datepicker table tr td.active.disabled:hover.disabled.active,
.datepicker table tr td.active[disabled].active,
.datepicker table tr td.active:hover[disabled].active,
.datepicker table tr td.active.disabled[disabled].active,
.datepicker table tr td.active.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.active.active,
fieldset[disabled] .datepicker table tr td.active:hover.active,
fieldset[disabled] .datepicker table tr td.active.disabled.active,
fieldset[disabled] .datepicker table tr td.active.disabled:hover.active {
  background-color: #428bca;
  border-color: #357ebd;
}
.datepicker table tr td span {
  display: block;
  width: 23%;
  height: 54px;
  line-height: 54px;
  float: left;
  margin: 1%;
  cursor: pointer;
  border-radius: 4px;
}
.datepicker table tr td span:hover {
  background: #eeeeee;
}
.datepicker table tr td span.disabled,
.datepicker table tr td span.disabled:hover {
  background: none;
  color: #999999;
  cursor: default;
}
.datepicker table tr td span.active,
.datepicker table tr td span.active:hover,
.datepicker table tr td span.active.disabled,
.datepicker table tr td span.active.disabled:hover {
  color: #ffffff;
  background-color: #428bca;
  border-color: #357ebd;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td span.active:hover,
.datepicker table tr td span.active:hover:hover,
.datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active.disabled:hover:hover,
.datepicker table tr td span.active:focus,
.datepicker table tr td span.active:hover:focus,
.datepicker table tr td span.active.disabled:focus,
.datepicker table tr td span.active.disabled:hover:focus,
.datepicker table tr td span.active:active,
.datepicker table tr td span.active:hover:active,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.active,
.datepicker table tr td span.active:hover.active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td span.active,
.open .dropdown-toggle.datepicker table tr td span.active:hover,
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
  color: #ffffff;
  background-color: #3276b1;
  border-color: #285e8e;
}
.datepicker table tr td span.active:active,
.datepicker table tr td span.active:hover:active,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.active,
.datepicker table tr td span.active:hover.active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td span.active,
.open .dropdown-toggle.datepicker table tr td span.active:hover,
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
  background-image: none;
}
.datepicker table tr td span.active.disabled,
.datepicker table tr td span.active:hover.disabled,
.datepicker table tr td span.active.disabled.disabled,
.datepicker table tr td span.active.disabled:hover.disabled,
.datepicker table tr td span.active[disabled],
.datepicker table tr td span.active:hover[disabled],
.datepicker table tr td span.active.disabled[disabled],
.datepicker table tr td span.active.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td span.active,
fieldset[disabled] .datepicker table tr td span.active:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active:hover.disabled:hover,
.datepicker table tr td span.active.disabled.disabled:hover,
.datepicker table tr td span.active.disabled:hover.disabled:hover,
.datepicker table tr td span.active[disabled]:hover,
.datepicker table tr td span.active:hover[disabled]:hover,
.datepicker table tr td span.active.disabled[disabled]:hover,
.datepicker table tr td span.active.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td span.active:hover,
fieldset[disabled] .datepicker table tr td span.active:hover:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,
.datepicker table tr td span.active.disabled:focus,
.datepicker table tr td span.active:hover.disabled:focus,
.datepicker table tr td span.active.disabled.disabled:focus,
.datepicker table tr td span.active.disabled:hover.disabled:focus,
.datepicker table tr td span.active[disabled]:focus,
.datepicker table tr td span.active:hover[disabled]:focus,
.datepicker table tr td span.active.disabled[disabled]:focus,
.datepicker table tr td span.active.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td span.active:focus,
fieldset[disabled] .datepicker table tr td span.active:hover:focus,
fieldset[disabled] .datepicker table tr td span.active.disabled:focus,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active:hover.disabled:active,
.datepicker table tr td span.active.disabled.disabled:active,
.datepicker table tr td span.active.disabled:hover.disabled:active,
.datepicker table tr td span.active[disabled]:active,
.datepicker table tr td span.active:hover[disabled]:active,
.datepicker table tr td span.active.disabled[disabled]:active,
.datepicker table tr td span.active.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td span.active:active,
fieldset[disabled] .datepicker table tr td span.active:hover:active,
fieldset[disabled] .datepicker table tr td span.active.disabled:active,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active:hover.disabled.active,
.datepicker table tr td span.active.disabled.disabled.active,
.datepicker table tr td span.active.disabled:hover.disabled.active,
.datepicker table tr td span.active[disabled].active,
.datepicker table tr td span.active:hover[disabled].active,
.datepicker table tr td span.active.disabled[disabled].active,
.datepicker table tr td span.active.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td span.active.active,
fieldset[disabled] .datepicker table tr td span.active:hover.active,
fieldset[disabled] .datepicker table tr td span.active.disabled.active,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {
  background-color: #428bca;
  border-color: #357ebd;
}
.datepicker table tr td span.old,
.datepicker table tr td span.new {
  color: #999999;
}
.datepicker th.datepicker-switch {
  width: 145px;
}
.datepicker thead tr:first-child th,
.datepicker tfoot tr th {
  cursor: pointer;
}
.datepicker thead tr:first-child th:hover,
.datepicker tfoot tr th:hover {
  background: #eeeeee;
}
.datepicker .cw {
  font-size: 10px;
  width: 12px;
  padding: 0 2px 0 5px;
  vertical-align: middle;
}
.datepicker thead tr:first-child th.cw {
  cursor: default;
  background-color: transparent;
}
.input-group.date .input-group-addon i {
  cursor: pointer;
  width: 16px;
  height: 16px;
}
.input-daterange input {
  text-align: center;
}
.input-daterange input:first-child {
  border-radius: 3px 0 0 3px;
}
.input-daterange input:last-child {
  border-radius: 0 3px 3px 0;
}
.input-daterange .input-group-addon {
  width: auto;
  min-width: 16px;
  padding: 4px 5px;
  font-weight: normal;
  line-height: 1.428571429;
  text-align: center;
  text-shadow: 0 1px 0 #fff;
  vertical-align: middle;
  background-color: #eeeeee;
  border-width: 1px 0;
  margin-left: -5px;
  margin-right: -5px;
}
.datepicker.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  float: left;
  display: none;
  min-width: 160px;
  list-style: none;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  -webkit-background-clip: padding-box;
  -moz-background-clip: padding;
  background-clip: padding-box;
  *border-right-width: 2px;
  *border-bottom-width: 2px;
  color: #333333;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.428571429;
}
.datepicker.dropdown-menu th,
.datepicker.dropdown-menu td {
  padding: 4px 5px;
}

+ 155 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/dropzone/basic.css

@ -0,0 +1,155 @@
/* The MIT License */
.dropzone,
.dropzone *,
.dropzone-previews,
.dropzone-previews * {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.dropzone {
  position: relative;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  padding: 1em;
}
.dropzone.dz-clickable {
  cursor: pointer;
}
.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message span {
  cursor: pointer;
}
.dropzone.dz-clickable * {
  cursor: default;
}
.dropzone .dz-message {
  opacity: 1;
  -ms-filter: none;
  filter: none;
}
.dropzone.dz-drag-hover {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.04);
}
.dropzone.dz-started .dz-message {
  display: none;
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
  background: rgba(255,255,255,0.8);
  position: relative;
  display: inline-block;
  margin: 17px;
  vertical-align: top;
  border: 1px solid #acacac;
  padding: 6px 6px 6px 6px;
}
.dropzone .dz-preview.dz-file-preview [data-dz-thumbnail],
.dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] {
  display: none;
}
.dropzone .dz-preview .dz-details,
.dropzone-previews .dz-preview .dz-details {
  width: 100px;
  height: 100px;
  position: relative;
  background: #ebebeb;
  padding: 5px;
  margin-bottom: 22px;
}
.dropzone .dz-preview .dz-details .dz-filename,
.dropzone-previews .dz-preview .dz-details .dz-filename {
  overflow: hidden;
  height: 100%;
}
.dropzone .dz-preview .dz-details img,
.dropzone-previews .dz-preview .dz-details img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
}
.dropzone .dz-preview .dz-details .dz-size,
.dropzone-previews .dz-preview .dz-details .dz-size {
  position: absolute;
  bottom: -28px;
  left: 3px;
  height: 28px;
  line-height: 28px;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
  display: block;
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
  display: block;
}
.dropzone .dz-preview:hover .dz-details img,
.dropzone-previews .dz-preview:hover .dz-details img {
  display: none;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  display: none;
  position: absolute;
  width: 40px;
  height: 40px;
  font-size: 30px;
  text-align: center;
  right: -10px;
  top: -10px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
  color: #8cc657;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  color: #ee162d;
}
.dropzone .dz-preview .dz-progress,
.dropzone-previews .dz-preview .dz-progress {
  position: absolute;
  top: 100px;
  left: 6px;
  right: 6px;
  height: 6px;
  background: #d7d7d7;
  display: none;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background-color: #8cc657;
}
.dropzone .dz-preview.dz-processing .dz-progress,
.dropzone-previews .dz-preview.dz-processing .dz-progress {
  display: block;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
  display: none;
  position: absolute;
  top: -5px;
  left: -20px;
  background: rgba(245,245,245,0.8);
  padding: 8px 10px;
  color: #800;
  min-width: 140px;
  max-width: 500px;
  z-index: 500;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
  display: block;
}

+ 410 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/dropzone/dropzone.css

@ -0,0 +1,410 @@
/* The MIT License */
.dropzone,
.dropzone *,
.dropzone-previews,
.dropzone-previews * {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.dropzone {
  position: relative;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  padding: 1em;
}
.dropzone.dz-clickable {
  cursor: pointer;
}
.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message span {
  cursor: pointer;
}
.dropzone.dz-clickable * {
  cursor: default;
}
.dropzone .dz-message {
  opacity: 1;
  -ms-filter: none;
  filter: none;
}
.dropzone.dz-drag-hover {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.04);
}
.dropzone.dz-started .dz-message {
  display: none;
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
  background: rgba(255,255,255,0.8);
  position: relative;
  display: inline-block;
  margin: 17px;
  vertical-align: top;
  border: 1px solid #acacac;
  padding: 6px 6px 6px 6px;
}
.dropzone .dz-preview.dz-file-preview [data-dz-thumbnail],
.dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] {
  display: none;
}
.dropzone .dz-preview .dz-details,
.dropzone-previews .dz-preview .dz-details {
  width: 100px;
  height: 100px;
  position: relative;
  background: #ebebeb;
  padding: 5px;
  margin-bottom: 22px;
}
.dropzone .dz-preview .dz-details .dz-filename,
.dropzone-previews .dz-preview .dz-details .dz-filename {
  overflow: hidden;
  height: 100%;
}
.dropzone .dz-preview .dz-details img,
.dropzone-previews .dz-preview .dz-details img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
}
.dropzone .dz-preview .dz-details .dz-size,
.dropzone-previews .dz-preview .dz-details .dz-size {
  position: absolute;
  bottom: -28px;
  left: 3px;
  height: 28px;
  line-height: 28px;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
  display: block;
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
  display: block;
}
.dropzone .dz-preview:hover .dz-details img,
.dropzone-previews .dz-preview:hover .dz-details img {
  display: none;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  display: none;
  position: absolute;
  width: 40px;
  height: 40px;
  font-size: 30px;
  text-align: center;
  right: -10px;
  top: -10px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
  color: #8cc657;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  color: #ee162d;
}
.dropzone .dz-preview .dz-progress,
.dropzone-previews .dz-preview .dz-progress {
  position: absolute;
  top: 100px;
  left: 6px;
  right: 6px;
  height: 6px;
  background: #d7d7d7;
  display: none;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background-color: #8cc657;
}
.dropzone .dz-preview.dz-processing .dz-progress,
.dropzone-previews .dz-preview.dz-processing .dz-progress {
  display: block;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
  display: none;
  position: absolute;
  top: -5px;
  left: -20px;
  background: rgba(245,245,245,0.8);
  padding: 8px 10px;
  color: #800;
  min-width: 140px;
  max-width: 500px;
  z-index: 500;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
  display: block;
}
.dropzone {
  border: 1px solid rgba(0,0,0,0.03);
  min-height: 360px;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  background: rgba(0,0,0,0.03);
  padding: 23px;
}
.dropzone .dz-default.dz-message {
  opacity: 1;
  -ms-filter: none;
  filter: none;
  -webkit-transition: opacity 0.3s ease-in-out;
  -moz-transition: opacity 0.3s ease-in-out;
  -o-transition: opacity 0.3s ease-in-out;
  -ms-transition: opacity 0.3s ease-in-out;
  transition: opacity 0.3s ease-in-out;
  background-image: url("../images/spritemap.png");
  background-repeat: no-repeat;
  background-position: 0 0;
  position: absolute;
  width: 428px;
  height: 123px;
  margin-left: -214px;
  margin-top: -61.5px;
  top: 50%;
  left: 50%;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
  .dropzone .dz-default.dz-message {
    background-image: url("../images/spritemap%402x.png");
    -webkit-background-size: 428px 406px;
    -moz-background-size: 428px 406px;
    background-size: 428px 406px;
  }
}
.dropzone .dz-default.dz-message span {
  display: none;
}
.dropzone.dz-square .dz-default.dz-message {
  background-position: 0 -123px;
  width: 268px;
  margin-left: -134px;
  height: 174px;
  margin-top: -87px;
}
.dropzone.dz-drag-hover .dz-message {
  opacity: 0.15;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=15)";
  filter: alpha(opacity=15);
}
.dropzone.dz-started .dz-message {
  display: block;
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
  -webkit-box-shadow: 1px 1px 4px rgba(0,0,0,0.16);
  box-shadow: 1px 1px 4px rgba(0,0,0,0.16);
  font-size: 14px;
}
.dropzone .dz-preview.dz-image-preview:hover .dz-details img,
.dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img {
  display: block;
  opacity: 0.1;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";
  filter: alpha(opacity=10);
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
  opacity: 1;
  -ms-filter: none;
  filter: none;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
  opacity: 1;
  -ms-filter: none;
  filter: none;
}
.dropzone .dz-preview.dz-error .dz-progress .dz-upload,
.dropzone-previews .dz-preview.dz-error .dz-progress .dz-upload {
  background: #ee1e2d;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
  display: block;
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  -webkit-transition: opacity 0.4s ease-in-out;
  -moz-transition: opacity 0.4s ease-in-out;
  -o-transition: opacity 0.4s ease-in-out;
  -ms-transition: opacity 0.4s ease-in-out;
  transition: opacity 0.4s ease-in-out;
  background-image: url("../images/spritemap.png");
  background-repeat: no-repeat;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
  .dropzone .dz-preview .dz-error-mark,
  .dropzone-previews .dz-preview .dz-error-mark,
  .dropzone .dz-preview .dz-success-mark,
  .dropzone-previews .dz-preview .dz-success-mark {
    background-image: url("../images/spritemap%402x.png");
    -webkit-background-size: 428px 406px;
    -moz-background-size: 428px 406px;
    background-size: 428px 406px;
  }
}
.dropzone .dz-preview .dz-error-mark span,
.dropzone-previews .dz-preview .dz-error-mark span,
.dropzone .dz-preview .dz-success-mark span,
.dropzone-previews .dz-preview .dz-success-mark span {
  display: none;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  background-position: -268px -123px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
  background-position: -268px -163px;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
  -webkit-animation: loading 0.4s linear infinite;
  -moz-animation: loading 0.4s linear infinite;
  -o-animation: loading 0.4s linear infinite;
  -ms-animation: loading 0.4s linear infinite;
  animation: loading 0.4s linear infinite;
  -webkit-transition: width 0.3s ease-in-out;
  -moz-transition: width 0.3s ease-in-out;
  -o-transition: width 0.3s ease-in-out;
  -ms-transition: width 0.3s ease-in-out;
  transition: width 0.3s ease-in-out;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-image: url("../images/spritemap.png");
  background-repeat: repeat-x;
  background-position: 0px -400px;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
  .dropzone .dz-preview .dz-progress .dz-upload,
  .dropzone-previews .dz-preview .dz-progress .dz-upload {
    background-image: url("../images/spritemap%402x.png");
    -webkit-background-size: 428px 406px;
    -moz-background-size: 428px 406px;
    background-size: 428px 406px;
  }
}
.dropzone .dz-preview.dz-success .dz-progress,
.dropzone-previews .dz-preview.dz-success .dz-progress {
  display: block;
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  -webkit-transition: opacity 0.4s ease-in-out;
  -moz-transition: opacity 0.4s ease-in-out;
  -o-transition: opacity 0.4s ease-in-out;
  -ms-transition: opacity 0.4s ease-in-out;
  transition: opacity 0.4s ease-in-out;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
  display: block;
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  -webkit-transition: opacity 0.3s ease-in-out;
  -moz-transition: opacity 0.3s ease-in-out;
  -o-transition: opacity 0.3s ease-in-out;
  -ms-transition: opacity 0.3s ease-in-out;
  transition: opacity 0.3s ease-in-out;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
  opacity: 1;
  -ms-filter: none;
  filter: none;
}
.dropzone a.dz-remove,
.dropzone-previews a.dz-remove {
  background-image: -webkit-linear-gradient(top, #fafafa, #eee);
  background-image: -moz-linear-gradient(top, #fafafa, #eee);
  background-image: -o-linear-gradient(top, #fafafa, #eee);
  background-image: -ms-linear-gradient(top, #fafafa, #eee);
  background-image: linear-gradient(to bottom, #fafafa, #eee);
  -webkit-border-radius: 2px;
  border-radius: 2px;
  border: 1px solid #eee;
  text-decoration: none;
  display: block;
  padding: 4px 5px;
  text-align: center;
  color: #aaa;
  margin-top: 26px;
}
.dropzone a.dz-remove:hover,
.dropzone-previews a.dz-remove:hover {
  color: #666;
}
@-moz-keyframes loading {
  0% {
    background-position: 0 -400px;
  }
  100% {
    background-position: -7px -400px;
  }
}
@-webkit-keyframes loading {
  0% {
    background-position: 0 -400px;
  }
  100% {
    background-position: -7px -400px;
  }
}
@-o-keyframes loading {
  0% {
    background-position: 0 -400px;
  }
  100% {
    background-position: -7px -400px;
  }
}
@-ms-keyframes loading {
  0% {
    background-position: 0 -400px;
  }
  100% {
    background-position: -7px -400px;
  }
}
@keyframes loading {
  0% {
    background-position: 0 -400px;
  }
  100% {
    background-position: -7px -400px;
  }
}

BIN
app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.eot


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 78 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.svg


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.ttf


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footable.woff


BIN
app/app-iot-server/src/main/webapp/front/css/plugins/footable/fonts/footabled41d.eot


+ 178 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/footable/footable.core.css

@ -0,0 +1,178 @@
@font-face {
  font-family: 'footable';
  src: url('fonts/footable.eot');
  src: url('fonts/footabled41d.eot?#iefix') format('embedded-opentype'), url('fonts/footable.woff') format('woff'), url('fonts/footable.ttf') format('truetype'), url('fonts/footable.svg#footable') format('svg');
  font-weight: normal;
  font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  @font-face {
    font-family: 'footable';
    src: url('fonts/footable.svg#footable') format('svg');
    font-weight: normal;
    font-style: normal;
  }
}
.footable {
  width: 100%;
  /** SORTING **/
  /** PAGINATION **/
}
.footable.breakpoint > tbody > tr.footable-detail-show > td {
  border-bottom: none;
}
.footable.breakpoint > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e001";
}
.footable.breakpoint > tbody > tr:hover:not(.footable-row-detail) {
  cursor: pointer;
}
.footable.breakpoint > tbody > tr > td.footable-cell-detail {
  background: #eee;
  border-top: none;
}
.footable.breakpoint > tbody > tr > td > span.footable-toggle {
  display: inline-block;
  font-family: 'footable';
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  padding-right: 5px;
  font-size: 14px;
  color: #888888;
}
.footable.breakpoint > tbody > tr > td > span.footable-toggle:before {
  content: "\e000";
}
.footable.breakpoint.toggle-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e005";
}
.footable.breakpoint.toggle-circle > tbody > tr > td > span.footable-toggle:before {
  content: "\e004";
}
.footable.breakpoint.toggle-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e003";
}
.footable.breakpoint.toggle-circle-filled > tbody > tr > td > span.footable-toggle:before {
  content: "\e002";
}
.footable.breakpoint.toggle-square > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e007";
}
.footable.breakpoint.toggle-square > tbody > tr > td > span.footable-toggle:before {
  content: "\e006";
}
.footable.breakpoint.toggle-square-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e009";
}
.footable.breakpoint.toggle-square-filled > tbody > tr > td > span.footable-toggle:before {
  content: "\e008";
}
.footable.breakpoint.toggle-arrow > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e00f";
}
.footable.breakpoint.toggle-arrow > tbody > tr > td > span.footable-toggle:before {
  content: "\e011";
}
.footable.breakpoint.toggle-arrow-small > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e013";
}
.footable.breakpoint.toggle-arrow-small > tbody > tr > td > span.footable-toggle:before {
  content: "\e015";
}
.footable.breakpoint.toggle-arrow-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e01b";
}
.footable.breakpoint.toggle-arrow-circle > tbody > tr > td > span.footable-toggle:before {
  content: "\e01d";
}
.footable.breakpoint.toggle-arrow-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e00b";
}
.footable.breakpoint.toggle-arrow-circle-filled > tbody > tr > td > span.footable-toggle:before {
  content: "\e00d";
}
.footable.breakpoint.toggle-arrow-tiny > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e01f";
}
.footable.breakpoint.toggle-arrow-tiny > tbody > tr > td > span.footable-toggle:before {
  content: "\e021";
}
.footable.breakpoint.toggle-arrow-alt > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
  content: "\e017";
}
.footable.breakpoint.toggle-arrow-alt > tbody > tr > td > span.footable-toggle:before {
  content: "\e019";
}
.footable.breakpoint.toggle-medium > tbody > tr > td > span.footable-toggle {
  font-size: 18px;
}
.footable.breakpoint.toggle-large > tbody > tr > td > span.footable-toggle {
  font-size: 24px;
}
.footable > thead > tr > th {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: -moz-none;
  -ms-user-select: none;
  user-select: none;
}
.footable > thead > tr > th.footable-sortable:hover {
  cursor: pointer;
}
.footable > thead > tr > th.footable-sorted > span.footable-sort-indicator:before {
  content: "\e013";
}
.footable > thead > tr > th.footable-sorted-desc > span.footable-sort-indicator:before {
  content: "\e012";
}
.footable > thead > tr > th > span.footable-sort-indicator {
  display: inline-block;
  font-family: 'footable';
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  padding-left: 5px;
}
.footable > thead > tr > th > span.footable-sort-indicator:before {
  content: "\e022";
}
.footable > tfoot .pagination {
  margin: 0;
}
.footable.no-paging .hide-if-no-paging {
  display: none;
}
.footable-row-detail-inner {
  display: table;
}
.footable-row-detail-row {
  display: table-row;
  line-height: 1.5em;
}
.footable-row-detail-group {
  display: block;
  line-height: 2em;
  font-size: 1.2em;
  font-weight: bold;
}
.footable-row-detail-name {
  display: table-cell;
  font-weight: bold;
  padding-right: 0.5em;
}
.footable-row-detail-value {
  display: table-cell;
}
.footable-odd {
  background-color: #f7f7f7;
}

+ 589 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/fullcalendar/fullcalendar.css

@ -0,0 +1,589 @@
/*!
 * FullCalendar v1.6.4 Stylesheet
 * Docs & License: http://arshaw.com/fullcalendar/
 * (c) 2013 Adam Shaw
 */
.fc {
	direction: ltr;
	text-align: left;
	}
.fc table {
	border-collapse: collapse;
	border-spacing: 0;
	}
html .fc,
.fc table {
	font-size: 1em;
	}
.fc td,
.fc th {
	padding: 0;
	vertical-align: top;
	}
/* Header
------------------------------------------------------------------------*/
.fc-header td {
	white-space: nowrap;
	}
.fc-header-left {
	width: 25%;
	text-align: left;
	}
.fc-header-center {
	text-align: center;
	}
.fc-header-right {
	width: 25%;
	text-align: right;
	}
.fc-header-title {
	display: inline-block;
	vertical-align: top;
	}
.fc-header-title h2 {
	margin-top: 0;
	white-space: nowrap;
	}
.fc .fc-header-space {
	padding-left: 10px;
	}
.fc-header .fc-button {
	margin-bottom: 1em;
	vertical-align: top;
	}
/* buttons edges butting together */
.fc-header .fc-button {
	margin-right: -1px;
	}
.fc-header .fc-corner-right,  /* non-theme */
.fc-header .ui-corner-right { /* theme */
	margin-right: 0; /* back to normal */
	}
/* button layering (for border precedence) */
.fc-header .fc-state-hover,
.fc-header .ui-state-hover {
	z-index: 2;
	}
.fc-header .fc-state-down {
	z-index: 3;
	}
.fc-header .fc-state-active,
.fc-header .ui-state-active {
	z-index: 4;
	}
/* Content
------------------------------------------------------------------------*/
.fc-content {
	clear: both;
	zoom: 1; /* for IE7, gives accurate coordinates for [un]freezeContentHeight */
	}
.fc-view {
	width: 100%;
	overflow: hidden;
	}
/* Cell Styles
------------------------------------------------------------------------*/
.fc-widget-header,    /* <th>, usually */
.fc-widget-content {  /* <td>, usually */
	border: 1px solid #ddd;
	}
.fc-state-highlight { /* <td> today cell */ /* TODO: add .fc-today to <th> */
	background: #fcf8e3;
	}
.fc-cell-overlay { /* semi-transparent rectangle while dragging */
	background: #bce8f1;
	opacity: .3;
	filter: alpha(opacity=30); /* for IE */
	}
/* Buttons
------------------------------------------------------------------------*/
.fc-button {
	position: relative;
	display: inline-block;
	padding: 0 .6em;
	overflow: hidden;
	height: 1.9em;
	line-height: 1.9em;
	white-space: nowrap;
	cursor: pointer;
	}
.fc-state-default { /* non-theme */
	border: 1px solid;
	}
.fc-state-default.fc-corner-left { /* non-theme */
	border-top-left-radius: 4px;
	border-bottom-left-radius: 4px;
	}
.fc-state-default.fc-corner-right { /* non-theme */
	border-top-right-radius: 4px;
	border-bottom-right-radius: 4px;
	}
/*
	Our default prev/next buttons use HTML entities like &lsaquo; &rsaquo; &laquo; &raquo;
	and we'll try to make them look good cross-browser.
*/
.fc-text-arrow {
	margin: 0 .1em;
	font-size: 2em;
	font-family: "Courier New", Courier, monospace;
	vertical-align: baseline; /* for IE7 */
	}
.fc-button-prev .fc-text-arrow,
.fc-button-next .fc-text-arrow { /* for &lsaquo; &rsaquo; */
	font-weight: bold;
	}
/* icon (for jquery ui) */
.fc-button .fc-icon-wrap {
	position: relative;
	float: left;
	top: 50%;
	}
.fc-button .ui-icon {
	position: relative;
	float: left;
	margin-top: -50%;
	*margin-top: 0;
	*top: -50%;
	}
/*
  button states
  borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
*/
.fc-state-default {
	background-color: #f5f5f5;
	background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
	background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
	background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
	background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
	background-repeat: repeat-x;
	border-color: #e6e6e6 #e6e6e6 #bfbfbf;
	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
	color: #333;
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
	}
.fc-state-hover,
.fc-state-down,
.fc-state-active,
.fc-state-disabled {
	color: #333333;
	background-color: #e6e6e6;
	}
.fc-state-hover {
	color: #333333;
	text-decoration: none;
	background-position: 0 -15px;
	-webkit-transition: background-position 0.1s linear;
	   -moz-transition: background-position 0.1s linear;
	     -o-transition: background-position 0.1s linear;
	        transition: background-position 0.1s linear;
	}
.fc-state-down,
.fc-state-active {
	background-color: #cccccc;
	background-image: none;
	outline: 0;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
	}
.fc-state-disabled {
	cursor: default;
	background-image: none;
	opacity: 0.65;
	filter: alpha(opacity=65);
	box-shadow: none;
	}
/* Global Event Styles
------------------------------------------------------------------------*/
.fc-event-container > * {
	z-index: 8;
	}
.fc-event-container > .ui-draggable-dragging,
.fc-event-container > .ui-resizable-resizing {
	z-index: 9;
	}
.fc-event {
	border: 1px solid #3a87ad; /* default BORDER color */
	background-color: #3a87ad; /* default BACKGROUND color */
	color: #fff;               /* default TEXT color */
	font-size: .85em;
	cursor: default;
	}
a.fc-event {
	text-decoration: none;
	}
a.fc-event,
.fc-event-draggable {
	cursor: pointer;
	}
.fc-rtl .fc-event {
	text-align: right;
	}
.fc-event-inner {
	width: 100%;
	height: 100%;
	overflow: hidden;
	}
.fc-event-time,
.fc-event-title {
	padding: 0 1px;
	}
.fc .ui-resizable-handle {
	display: block;
	position: absolute;
	z-index: 99999;
	overflow: hidden; /* hacky spaces (IE6/7) */
	font-size: 300%;  /* */
	line-height: 50%; /* */
	}
/* Horizontal Events
------------------------------------------------------------------------*/
.fc-event-hori {
	border-width: 1px 0;
	margin-bottom: 1px;
	}
.fc-ltr .fc-event-hori.fc-event-start,
.fc-rtl .fc-event-hori.fc-event-end {
	border-left-width: 1px;
	border-top-left-radius: 3px;
	border-bottom-left-radius: 3px;
	}
.fc-ltr .fc-event-hori.fc-event-end,
.fc-rtl .fc-event-hori.fc-event-start {
	border-right-width: 1px;
	border-top-right-radius: 3px;
	border-bottom-right-radius: 3px;
	}
/* resizable */
.fc-event-hori .ui-resizable-e {
	top: 0           !important; /* importants override pre jquery ui 1.7 styles */
	right: -3px      !important;
	width: 7px       !important;
	height: 100%     !important;
	cursor: e-resize;
	}
.fc-event-hori .ui-resizable-w {
	top: 0           !important;
	left: -3px       !important;
	width: 7px       !important;
	height: 100%     !important;
	cursor: w-resize;
	}
.fc-event-hori .ui-resizable-handle {
	_padding-bottom: 14px; /* IE6 had 0 height */
	}
/* Reusable Separate-border Table
------------------------------------------------------------*/
table.fc-border-separate {
	border-collapse: separate;
	}
.fc-border-separate th,
.fc-border-separate td {
	border-width: 1px 0 0 1px;
	}
.fc-border-separate th.fc-last,
.fc-border-separate td.fc-last {
	border-right-width: 1px;
	}
.fc-border-separate tr.fc-last th,
.fc-border-separate tr.fc-last td {
	border-bottom-width: 1px;
	}
.fc-border-separate tbody tr.fc-first td,
.fc-border-separate tbody tr.fc-first th {
	border-top-width: 0;
	}
/* Month View, Basic Week View, Basic Day View
------------------------------------------------------------------------*/
.fc-grid th {
	text-align: center;
	}
.fc .fc-week-number {
	width: 22px;
	text-align: center;
	}
.fc .fc-week-number div {
	padding: 0 2px;
	}
.fc-grid .fc-day-number {
	float: right;
	padding: 0 2px;
	}
.fc-grid .fc-other-month .fc-day-number {
	opacity: 0.3;
	filter: alpha(opacity=30); /* for IE */
	/* opacity with small font can sometimes look too faded
	   might want to set the 'color' property instead
	   making day-numbers bold also fixes the problem */
	}
.fc-grid .fc-day-content {
	clear: both;
	padding: 2px 2px 1px; /* distance between events and day edges */
	}
/* event styles */
.fc-grid .fc-event-time {
	font-weight: bold;
	}
/* right-to-left */
.fc-rtl .fc-grid .fc-day-number {
	float: left;
	}
.fc-rtl .fc-grid .fc-event-time {
	float: right;
	}
/* Agenda Week View, Agenda Day View
------------------------------------------------------------------------*/
.fc-agenda table {
	border-collapse: separate;
	}
.fc-agenda-days th {
	text-align: center;
	}
.fc-agenda .fc-agenda-axis {
	width: 50px;
	padding: 0 4px;
	vertical-align: middle;
	text-align: right;
	white-space: nowrap;
	font-weight: normal;
	}
.fc-agenda .fc-week-number {
	font-weight: bold;
	}
.fc-agenda .fc-day-content {
	padding: 2px 2px 1px;
	}
/* make axis border take precedence */
.fc-agenda-days .fc-agenda-axis {
	border-right-width: 1px;
	}
.fc-agenda-days .fc-col0 {
	border-left-width: 0;
	}
/* all-day area */
.fc-agenda-allday th {
	border-width: 0 1px;
	}
.fc-agenda-allday .fc-day-content {
	min-height: 34px; /* TODO: doesnt work well in quirksmode */
	_height: 34px;
	}
/* divider (between all-day and slots) */
.fc-agenda-divider-inner {
	height: 2px;
	overflow: hidden;
	}
.fc-widget-header .fc-agenda-divider-inner {
	background: #eee;
	}
/* slot rows */
.fc-agenda-slots th {
	border-width: 1px 1px 0;
	}
.fc-agenda-slots td {
	border-width: 1px 0 0;
	background: none;
	}
.fc-agenda-slots td div {
	height: 20px;
	}
.fc-agenda-slots tr.fc-slot0 th,
.fc-agenda-slots tr.fc-slot0 td {
	border-top-width: 0;
	}
.fc-agenda-slots tr.fc-minor th,
.fc-agenda-slots tr.fc-minor td {
	border-top-style: dotted;
	}
.fc-agenda-slots tr.fc-minor th.ui-widget-header {
	*border-top-style: solid; /* doesn't work with background in IE6/7 */
	}
/* Vertical Events
------------------------------------------------------------------------*/
.fc-event-vert {
	border-width: 0 1px;
	}
.fc-event-vert.fc-event-start {
	border-top-width: 1px;
	border-top-left-radius: 3px;
	border-top-right-radius: 3px;
	}
.fc-event-vert.fc-event-end {
	border-bottom-width: 1px;
	border-bottom-left-radius: 3px;
	border-bottom-right-radius: 3px;
	}
.fc-event-vert .fc-event-time {
	white-space: nowrap;
	font-size: 10px;
	}
.fc-event-vert .fc-event-inner {
	position: relative;
	z-index: 2;
	}
.fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay  */
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #fff;
	opacity: .25;
	filter: alpha(opacity=25);
	}
.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
.fc-select-helper .fc-event-bg {
	display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
	}
/* resizable */
.fc-event-vert .ui-resizable-s {
	bottom: 0        !important; /* importants override pre jquery ui 1.7 styles */
	width: 100%      !important;
	height: 8px      !important;
	overflow: hidden !important;
	line-height: 8px !important;
	font-size: 11px  !important;
	font-family: monospace;
	text-align: center;
	cursor: s-resize;
	}
.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
	_overflow: hidden;
	}

+ 0 - 0
app/app-iot-server/src/main/webapp/front/css/plugins/fullcalendar/fullcalendar.print.css


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است