liguoqing преди 7 години
родител
ревизия
515a60e65e
променени са 89 файла, в които са добавени 44094 реда и са изтрити 39 реда
  1. 4 39
      README.md
  2. 260 0
      pom.xml
  3. 28 0
      src/main/java/com/mtgg/Application.java
  4. 17 0
      src/main/java/com/mtgg/RestConfiguration.java
  5. 18 0
      src/main/java/com/mtgg/bean/ADTO.java
  6. 39 0
      src/main/java/com/mtgg/bean/ConfigBean.java
  7. 37 0
      src/main/java/com/mtgg/bean/PayLogDTO.java
  8. 63 0
      src/main/java/com/mtgg/bean/PoiExcelBean.java
  9. 28 0
      src/main/java/com/mtgg/bean/User.java
  10. 20 0
      src/main/java/com/mtgg/bean/WXData.java
  11. 55 0
      src/main/java/com/mtgg/common/Constant.java
  12. 36 0
      src/main/java/com/mtgg/common/CrossDomainFilter.java
  13. 27 0
      src/main/java/com/mtgg/common/DefaultExceptionHandler.java
  14. 22 0
      src/main/java/com/mtgg/common/ErrorCode.java
  15. 14 0
      src/main/java/com/mtgg/common/Response.java
  16. 85 0
      src/main/java/com/mtgg/controller/AController.java
  17. 87 0
      src/main/java/com/mtgg/controller/OauthController.java
  18. 138 0
      src/main/java/com/mtgg/controller/ServerController.java
  19. 222 0
      src/main/java/com/mtgg/controller/WXController.java
  20. 20 0
      src/main/java/com/mtgg/dao/AMapper.java
  21. 76 0
      src/main/java/com/mtgg/dao/BaseMapper.java
  22. 44 0
      src/main/java/com/mtgg/dao/BatisMapper.java
  23. 21 0
      src/main/java/com/mtgg/dto/MtRecordDTO.java
  24. 100 0
      src/main/java/com/mtgg/entity/MtRecordPO.java
  25. 19 0
      src/main/java/com/mtgg/service/AService.java
  26. 8 0
      src/main/java/com/mtgg/service/BaseService.java
  27. 51 0
      src/main/java/com/mtgg/service/BatisService.java
  28. 51 0
      src/main/java/com/mtgg/service/imp/AServiceImp.java
  29. 75 0
      src/main/java/com/mtgg/service/imp/BaseServiceImp.java
  30. 84 0
      src/main/java/com/mtgg/service/imp/BatisServiceImp.java
  31. 147 0
      src/main/java/com/mtgg/utils/DownloadExcelUtil.java
  32. 384 0
      src/main/java/com/mtgg/utils/ExcelUtil.java
  33. 55 0
      src/main/java/com/mtgg/utils/HttpUtils.java
  34. 38 0
      src/main/java/com/mtgg/utils/IOUtil.java
  35. 44 0
      src/main/java/com/mtgg/utils/IpUtil.java
  36. 52 0
      src/main/java/com/mtgg/utils/IsNum.java
  37. 96 0
      src/main/java/com/mtgg/utils/Page.java
  38. 21 0
      src/main/java/com/mtgg/utils/PageDataDTO.java
  39. 94 0
      src/main/java/com/mtgg/utils/VoiceUtil.java
  40. 173 0
      src/main/java/com/mtgg/utils/WechatUtils.java
  41. 90 0
      src/main/java/com/mtgg/utils/voice/ConnUtil.java
  42. 10 0
      src/main/java/com/mtgg/utils/voice/DemoException.java
  43. 122 0
      src/main/java/com/mtgg/utils/voice/TokenHolder.java
  44. 126 0
      src/main/java/com/mtgg/utils/voice/TtsMain.java
  45. 35 0
      src/main/resources/application.yml
  46. 25 0
      src/main/resources/log4j.properties
  47. 32 0
      src/main/resources/mapper/AMapper.xml
  48. 102 0
      src/main/resources/mapper/batisMapper.xml
  49. 14 0
      src/main/resources/source/config.properties
  50. 22 0
      src/main/webapp/WEB-INF/web.xml
  51. 97 0
      src/main/webapp/content/PayList.html
  52. 91 0
      src/main/webapp/content/login.html
  53. 18 0
      src/main/webapp/content/pay.html
  54. 46 0
      src/main/webapp/content/test.html
  55. 9 0
      src/main/webapp/css/bootstap/bootstrap-responsive.min.css
  56. 9 0
      src/main/webapp/css/bootstap/bootstrap.min.css
  57. 1614 0
      src/main/webapp/css/bootstap/jquery-ui.css
  58. 525 0
      src/main/webapp/css/bootstap/select2.css
  59. 99 0
      src/main/webapp/css/bootstap/unicorn.grey.css
  60. 91 0
      src/main/webapp/css/bootstap/unicorn.login.css
  61. 1599 0
      src/main/webapp/css/bootstap/unicorn.main.css
  62. 611 0
      src/main/webapp/css/bootstap/uniform.css
  63. BIN
      src/main/webapp/img/dog.jpg
  64. BIN
      src/main/webapp/img/little_qrcode.jpg
  65. 57 0
      src/main/webapp/index.html
  66. 6 0
      src/main/webapp/js/bootstap/bootstrap.min.js
  67. 672 0
      src/main/webapp/js/bootstap/jquery-uniform.js
  68. 154 0
      src/main/webapp/js/bootstap/jquery.dataTables.min.js
  69. 4 0
      src/main/webapp/js/bootstap/jquery.min.js
  70. 14850 0
      src/main/webapp/js/bootstap/jquery.ui.custom.js
  71. 82 0
      src/main/webapp/js/bootstap/select2.min.js
  72. 134 0
      src/main/webapp/js/bootstap/unicorn.js
  73. 44 0
      src/main/webapp/js/bootstap/unicorn.login.js
  74. 102 0
      src/main/webapp/js/bootstap/unicorn.tables.js
  75. 32 0
      src/main/webapp/js/html/index.js
  76. 67 0
      src/main/webapp/js/html/pay.js
  77. 16 0
      src/main/webapp/js/html/test.js
  78. 7 0
      src/main/webapp/js/utils/bootstrap.min.js
  79. 148 0
      src/main/webapp/js/utils/components.js
  80. 38 0
      src/main/webapp/js/utils/config.js
  81. 36 0
      src/main/webapp/js/utils/cookieUtil.js
  82. 6253 0
      src/main/webapp/js/utils/jquery-weui.js
  83. 6 0
      src/main/webapp/js/utils/jquery-weui.min.css
  84. 13 0
      src/main/webapp/js/utils/jquery-weui.min.js
  85. 10253 0
      src/main/webapp/js/utils/jquery.min.js
  86. 36 0
      src/main/webapp/js/utils/require.min.js
  87. 2 0
      src/main/webapp/js/utils/template.js
  88. 2836 0
      src/main/webapp/js/utils/weui.css
  89. 6 0
      src/main/webapp/js/utils/weui.min.js

+ 4 - 39
README.md

@@ -1,42 +1,7 @@
-# BootMtgg
+----------------------------------------------
 
-#### 项目介绍
-srpingboot
-微信支付
-后台-bootstrap
-requireJs
-weui
+springboot的简单实现
 
+requireJs的应用
 
-#### 软件架构
-软件架构说明
-
-
-#### 安装教程
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### 使用说明
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### 参与贡献
-
-1. Fork 本项目
-2. 新建 Feat_xxx 分支
-3. 提交代码
-4. 新建 Pull Request
-
-
-#### 码云特技
-
-1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
-2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
-3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
-4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
-5. 码云官方提供的使用手册 [http://git.mydoc.io/](http://git.mydoc.io/)
-6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+连接sqlserver数据库

+ 260 - 0
pom.xml

@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.mtgg</groupId>
+  <artifactId>BootMTGG</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>war</packaging>
+
+  <name>BootMTGG</name>
+  <description>Demo project for BootMTGG</description>
+
+  <parent>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-parent</artifactId>
+    <version>1.5.6.RELEASE</version>
+    <relativePath />
+  </parent>
+
+  <properties>
+    <weixin-java-mp.version>2.8.0</weixin-java-mp.version>
+  </properties>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+      <!-- 移除嵌入式tomcat插件 -->
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-tomcat</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.1.0</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mybatis.spring.boot</groupId>
+      <artifactId>mybatis-spring-boot-starter</artifactId>
+      <version>1.3.1</version>
+    </dependency>
+
+    <!--单元测试-->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  <!--spring-boot热部署-->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-devtools</artifactId>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-configuration-processor</artifactId>
+      <optional>true</optional>
+    </dependency>
+
+    <!-- log4j -->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-log4j</artifactId>
+      <version>1.3.8.RELEASE</version>
+    </dependency>
+
+    <!--log-->
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+      <version>1.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.projectlombok</groupId>
+      <artifactId>lombok</artifactId>
+      <version>1.16.8</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.jfinal</groupId>
+      <artifactId>enjoy</artifactId>
+      <version>3.2</version>
+    </dependency>
+
+    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+      <version>2.6.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.github.binarywang</groupId>
+      <artifactId>weixin-java-mp</artifactId>
+      <version>2.8.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.jfinal</groupId>
+      <artifactId>jfinal</artifactId>
+      <version>3.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.jfinal</groupId>
+      <artifactId>jfinal-weixin</artifactId>
+      <version>1.9</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.github.javen205</groupId>
+      <artifactId>IJPay</artifactId>
+      <version>1.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.alibaba</groupId>
+      <artifactId>fastjson</artifactId>
+      <version>1.2.37</version>
+    </dependency>
+
+    <!--http-->
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpmime</artifactId>
+      <version>4.3.1</version>
+    </dependency>
+    <dependency>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.6.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+      <version>4.5.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.7</version>
+    </dependency>
+    <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <version>1.10</version>
+    </dependency>
+
+    <!-- okhttp2 -->
+    <dependency>
+      <groupId>com.squareup.okhttp</groupId>
+      <artifactId>okhttp</artifactId>
+      <version>2.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>com.squareup.okhttp3</groupId>
+      <artifactId>okhttp</artifactId>
+      <version>3.8.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.squareup.okio</groupId>
+      <artifactId>okio</artifactId>
+      <version>1.11.0</version>
+    </dependency>
+
+    <!-- poi start -->
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi</artifactId>
+      <version>3.16</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi-ooxml-schemas</artifactId>
+      <version>3.16</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi-ooxml</artifactId>
+      <version>3.16</version>
+    </dependency>
+    <!-- poi end -->
+
+    <!-- https://mvnrepository.com/artifact/net.sf.jacob-project/jacob -->
+    <dependency>
+      <groupId>net.sf.jacob-project</groupId>
+      <artifactId>jacob</artifactId>
+      <version>1.14.3</version>
+    </dependency>
+
+    <!-- https://mvnrepository.com/artifact/com.baidu.aip/java-sdk -->
+    <dependency>
+      <groupId>com.baidu.aip</groupId>
+      <artifactId>java-sdk</artifactId>
+      <version>4.3.2</version>
+    </dependency>
+
+
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <configuration>
+          <fork>true</fork>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

+ 28 - 0
src/main/java/com/mtgg/Application.java

@@ -0,0 +1,28 @@
+package com.mtgg;
+import com.mtgg.bean.ConfigBean;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.boot.web.support.ErrorPageFilter;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@EnableConfigurationProperties({ConfigBean.class})
+@SpringBootApplication
+@EnableTransactionManagement // 支持事务
+@MapperScan(basePackages = "com.mtgg.dao")
+public class Application extends SpringBootServletInitializer {
+	@Override
+	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+		setRegisterErrorPageFilter(false);
+		return application.sources(Application.class);
+	}
+
+	public static  void  main(String[] args){
+		SpringApplication.run(Application.class,args);
+	}
+}

+ 17 - 0
src/main/java/com/mtgg/RestConfiguration.java

@@ -0,0 +1,17 @@
+package com.mtgg;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+@Configuration
+public class RestConfiguration {
+    @Autowired
+    RestTemplateBuilder builder;
+    @Bean
+    public RestTemplate restTemplate(){
+        return builder.build();
+    }
+}

+ 18 - 0
src/main/java/com/mtgg/bean/ADTO.java

@@ -0,0 +1,18 @@
+package com.mtgg.bean;
+
+import lombok.Data;
+
+import java.io.Serializable;
+/**
+ * @Author: MTGG
+ * @Date: 18:56 2018/7/19
+ * @Describe:
+ */
+@Data
+public class ADTO implements Serializable {
+    private Long id;
+
+    private String name;
+
+    private Integer age;
+}

+ 39 - 0
src/main/java/com/mtgg/bean/ConfigBean.java

@@ -0,0 +1,39 @@
+package com.mtgg.bean;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@PropertySource("classpath:source/config.properties")
+@ConfigurationProperties(prefix = "config")
+public class ConfigBean {
+
+    //支付宝
+    private String appId;
+
+    private String privateKey;
+
+    private String publicKey;
+
+    private String serverUrl;
+
+    private String domain;
+
+    //微信
+    private String wxAppId;
+
+    private String wxSecret;
+
+    private String wxMchId;
+
+    private String wxPartnerKey;
+
+    private String wxNotifyUrl;
+
+
+    private String excelUrl;
+
+}

+ 37 - 0
src/main/java/com/mtgg/bean/PayLogDTO.java

@@ -0,0 +1,37 @@
+package com.mtgg.bean;
+
+import java.io.Serializable;
+
+public class PayLogDTO implements Serializable {
+    private static final long serialVersionUID = -3780055231427704994L;
+
+    private Integer totalFee;
+
+    private String account;
+
+    private String date;
+
+    public Integer getTotalFee() {
+        return totalFee;
+    }
+
+    public void setTotalFee(Integer totalFee) {
+        this.totalFee = totalFee;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+}

+ 63 - 0
src/main/java/com/mtgg/bean/PoiExcelBean.java

@@ -0,0 +1,63 @@
+package com.mtgg.bean;
+
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
+
+import java.io.Serializable;
+
+/**
+ * @Author: MTGG   
+ * @Date: 21:20 2018/7/8
+ * @Describe: 
+ */
+public class PoiExcelBean implements Serializable{
+    private static final long serialVersionUID = 1L;
+
+    private String headTextName; //列头(标题)名
+    private String propertyName; //对应字段名
+    private Integer cols; //合并单元格数
+    private XSSFCellStyle cellStyle;
+    public PoiExcelBean(){
+    }
+    public PoiExcelBean(String headTextName, String propertyName){
+        this.headTextName = headTextName;
+        this.propertyName = propertyName;
+    }
+    public PoiExcelBean(String headTextName, String propertyName, Integer cols) {
+        super();
+        this.headTextName = headTextName;
+        this.propertyName = propertyName;
+        this.cols = cols;
+    }
+
+    public String getHeadTextName() {
+        return headTextName;
+    }
+
+    public void setHeadTextName(String headTextName) {
+        this.headTextName = headTextName;
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public void setPropertyName(String propertyName) {
+        this.propertyName = propertyName;
+    }
+
+    public Integer getCols() {
+        return cols;
+    }
+
+    public void setCols(Integer cols) {
+        this.cols = cols;
+    }
+
+    public XSSFCellStyle getCellStyle() {
+        return cellStyle;
+    }
+
+    public void setCellStyle(XSSFCellStyle cellStyle) {
+        this.cellStyle = cellStyle;
+    }
+}

+ 28 - 0
src/main/java/com/mtgg/bean/User.java

@@ -0,0 +1,28 @@
+package com.mtgg.bean;
+
+import java.io.Serializable;
+
+public class User implements Serializable{
+	private static final long serialVersionUID = 1L;
+
+	private int userID;
+
+	private String password;
+	
+	public int getUserID() {
+		return userID;
+	}
+	
+	public void setUserID(int userID) {
+		this.userID = userID;
+	}
+	
+	public String getPassword() {
+		return password;
+	}
+	
+	public void setPassword(String password) {
+		this.password = password;
+	}
+}
+

+ 20 - 0
src/main/java/com/mtgg/bean/WXData.java

@@ -0,0 +1,20 @@
+package com.mtgg.bean;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author: MTGG  若非遥远,不负时光
+ * @Date: 19:37 2018/7/4
+ * @Describe:
+ */
+@Data
+public class WXData implements Serializable{
+    private static final long serialVersionUID = 1L;
+
+    private String openid;
+
+    private String sessionKey;
+
+}

+ 55 - 0
src/main/java/com/mtgg/common/Constant.java

@@ -0,0 +1,55 @@
+package com.mtgg.common;
+
+/**
+ * 全局变量定义
+ *
+ * @author bostin.wang
+ * @date 2017-12-23
+ */
+public class Constant {
+
+	public static final String SPLIT = "|";
+
+	//全局域名
+	public static final String API_URL = "http://dx771.com/JHS/";
+
+	//Redis key定义
+	public static final Integer REDIS_DB_IDX = 0;
+	public static final String REDIS_KEY_MOBILE = "tel";
+	public static final String REDIS_KEY_ACCESS_TOKEN = "access_token";
+	public static final String REDIS_KEY_JSAPI_TICKET = "jsapi_ticket";
+	public static final String REDIS_KEY_WX_USERINFO = "wx_userinfo";
+    public static final String REDIS_KEY_USER_TOKEN = "user_token";
+    public static final String REDIS_KEY_MOBILE_SHORT_MSG ="redis_key_mobile_short_msg";
+    public static final String REDIS_KEY_OPENDID = "REDIS_KEY_OPENDID";
+    public static final String REDIS_KEY_STATIONS_IDS = "REDIS_KEY_STATIONS_IDS";
+    public static final String REDIS_KEY_LOGIN_TOKEN = "REDIS_KEY_LOGIN_TOKEN";
+    public static final String REDIS_KEY_USER_ID="REDIS_KEY_USER_ID";
+	//md5加密盐
+	public static final String TOKEN_MD5_SALT = "MD5_KEY_OPENID_SALT";
+
+
+    /**
+     * 短信模板内容  1 注册
+     */
+    public static final int SMS_REGIST_CONTENT = 1;
+
+	//Redis key默认超时时间,单位秒
+	public static final Long REDIS_KEY_EXPIRE = 86400L;//24小时
+
+	//微信token缓存时间
+	public static final Long REDIS_ACCESS_TOKEN_EXPIRE = 7000L;
+	public static final Long REDIS_JSAPI_TICKET_EXPIRE = 7000L;
+
+	//微信access token错误
+	public static final String ACCESS_TOKEN_INVALID = "access_token_invalid";
+	public static final Integer ACCESS_TOKEN_ERR = 40001;
+
+	public static final Long REDIS_SEND_MSGSHORT_EXPIRE = 60L;
+	public static final Long REDIS_MSGSHORT_EXPIRE = 1800L;
+
+	//token生效时间,一个月30天
+	public static final Long REDIS_LOGIN_TOKEN_EXPIRE = 2592000L;
+
+	public static final String MSGSHORT_CONTENT = "(操作验证码,请完成验证),如非本人操作,请忽略本短信。【魔急便】";
+}

+ 36 - 0
src/main/java/com/mtgg/common/CrossDomainFilter.java

@@ -0,0 +1,36 @@
+package com.mtgg.common;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 跨域
+ *
+ * @author bostin
+ * @date 2017-12-26
+ */
+public class CrossDomainFilter implements Filter {
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+        HttpServletResponse resp = (HttpServletResponse) response;
+        resp.setHeader("Access-Control-Allow-Origin", "*");
+        resp.setHeader("Access-Control-Allow-Methods", "*");
+        resp.setHeader("Access-Control-Max-Age", "17000");
+        resp.setHeader("Access-Control-Allow-Headers", "X-AuthToken-With,openId,Content-Type");
+        resp.setHeader("Access-Control-Allow-Credentials", "true");
+        resp.setHeader("Content-Type", "application/json");
+        resp.setHeader("Access-Control-Expose-Headers","Content-Disposition");
+        chain.doFilter(request, response);
+    }
+
+    @Override
+    public void destroy() {
+
+    }
+}

+ 27 - 0
src/main/java/com/mtgg/common/DefaultExceptionHandler.java

@@ -0,0 +1,27 @@
+package com.mtgg.common;
+
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.servlet.ModelAndView;
+
+
+/**
+ * @Author: MTGG  极端之美
+ * @Date: 22:15 2018/4/20
+ * @Describe:
+ */
+@ControllerAdvice
+public class DefaultExceptionHandler {
+    @ExceptionHandler(Exception.class)
+    public ModelAndView exceptionHandler(Exception e) {
+        ModelAndView mv = new ModelAndView();
+        if (e instanceof HttpRequestMethodNotSupportedException) {
+            mv.setViewName("Exception");
+            return mv;
+        } else {
+            mv.setViewName("Exception");
+            return mv;
+        }
+    }
+}

+ 22 - 0
src/main/java/com/mtgg/common/ErrorCode.java

@@ -0,0 +1,22 @@
+package com.mtgg.common;
+
+/**
+ * @Author: MTGG
+ * @Date: 22:18 2018/4/20
+ * @Describe: 爱自己,佩服自己
+ */
+public enum ErrorCode {
+
+    SUCCESS(0, "success"),
+    FAIL(-1, "服务器出错了"),
+    ERR_PARAM(-2, "参数错误"),
+    ERR_NOT_EXIST(-3, "资源不存在");
+
+    public final int code;
+    public final String message;
+
+    ErrorCode(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+}

+ 14 - 0
src/main/java/com/mtgg/common/Response.java

@@ -0,0 +1,14 @@
+package com.mtgg.common;
+
+import lombok.Data;
+
+/**
+ * @author bostin.wang
+ * @date 2017-12-22
+ */
+@Data
+public class Response<T> {
+    private Integer res;
+    private String msg;
+    private T obj;
+}

+ 85 - 0
src/main/java/com/mtgg/controller/AController.java

@@ -0,0 +1,85 @@
+package com.mtgg.controller;
+
+import com.mtgg.bean.ADTO;
+import com.mtgg.bean.ConfigBean;
+import com.mtgg.bean.User;
+import com.mtgg.common.ErrorCode;
+import com.mtgg.common.Response;
+import com.mtgg.service.AService;
+import com.mtgg.utils.HttpUtils;
+import com.mtgg.utils.VoiceUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@RestController
+public class AController {
+
+    @Autowired
+    private ConfigBean configBean;
+    @Autowired
+    private AService aService;
+
+
+    @RequestMapping(value = "/one", method = RequestMethod.GET)
+    public Response one(User user) throws Exception {
+        Response result = new Response();
+        Map<String, String> map = new HashMap<String, String>();
+//		try {
+//			map.put("abc","1");
+//			HttpUtils.sendGet("www.baidu.com",map);
+//			log.info("获取:{}",configBean.getAppId());
+//		}catch (Exception e){
+//			log.info("error:{}",e);
+//		}
+        log.info(configBean.getExcelUrl());
+        user.setUserID(11111111);
+        result.setObj(user);
+        result.setRes(ErrorCode.SUCCESS.code);
+        return result;
+    }
+
+    @RequestMapping("/two")
+    public Response two(Integer pageNum,Integer pageSize) {
+        Response jsonResponse = new Response();
+        log.info("pageNUm:{},pagesize:{}",pageNum,pageSize);
+        List<ADTO> list = aService.geta(pageNum,pageSize);
+        jsonResponse.setObj(list);
+        jsonResponse.setRes(aService.getCount());
+        return jsonResponse;
+    }
+    @RequestMapping("/update")
+    public Response update() {
+        Response jsonResponse = new Response();
+        int ret = aService.updateById();
+        jsonResponse.setObj(ret);
+        return jsonResponse;
+    }
+    @RequestMapping("/insert")
+    public Response insert() {
+        Response jsonResponse = new Response();
+        int ret = aService.insert();
+        jsonResponse.setObj(ret);
+        return jsonResponse;
+    }
+
+    @RequestMapping("/test2")
+    public String test2(HttpServletRequest request) {
+        System.out.println(request.getRealPath(request.getRequestURI()));
+        System.out.println(request.getSession().getServletContext().getRealPath("/"));
+        System.out.println(this.getClass().getClassLoader().getResource("").getPath());
+
+        return "ok";
+    }
+}

+ 87 - 0
src/main/java/com/mtgg/controller/OauthController.java

@@ -0,0 +1,87 @@
+package com.mtgg.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jfinal.weixin.sdk.api.SnsAccessToken;
+import com.jfinal.weixin.sdk.api.SnsAccessTokenApi;
+import com.mtgg.bean.ConfigBean;
+import com.mtgg.common.ErrorCode;
+import com.mtgg.common.Response;
+import com.mtgg.utils.HttpUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@RestController
+@RequestMapping("/oauth")
+public class OauthController {
+
+    @Autowired
+    private ConfigBean configBean;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private HttpUtils httpUtils;
+
+
+    /**
+     * @Author: MTGG
+     * @Date: 9:33 2018/7/5
+     * @Describe: 获取code
+     */
+    @RequestMapping(value = "/openid", method = RequestMethod.GET)
+    public Response getCode(String code) {
+        Response result = new Response();
+        String appId = configBean.getWxAppId();
+        String secret = configBean.getWxSecret();
+        log.info("参数code:{};appid:{};secret:{}", code, appId, secret);
+        //通过code换取网页授权access_token
+        try {
+            SnsAccessToken snsAccessToken = SnsAccessTokenApi.getSnsAccessToken(appId, secret, code);
+            log.info("通过code换取网页授权access_token:{}", snsAccessToken);
+            log.info("openid:{}", snsAccessToken.getOpenid());
+            result.setObj(snsAccessToken);
+            result.setRes(ErrorCode.SUCCESS.code);
+            return result;
+        } catch (Exception e) {
+            log.info("错误");
+            return null;
+        }
+    }
+
+    @RequestMapping(value = "/send", method = RequestMethod.GET)
+    public Response getDataByCityName(String cityName) {
+        Response result = new Response();
+//        String uri="http://wthrcdn.etouch.cn/weather_mini?city="+cityName;
+        String uri = "http://www.baidu.com";
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+        HttpEntity<String> entity = new HttpEntity<String>(headers);
+        String strbody = restTemplate.exchange(uri, HttpMethod.GET, entity, String.class).getBody();
+        log.info("strbody:{}", strbody);
+        JSONObject jsonObject = JSONObject.parseObject(strbody);
+        log.info("json:{}", jsonObject);
+
+        try {
+            jsonObject = httpUtils.sendGet(uri);
+            log.info("jsonObject:{}", jsonObject);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.info("eeee:" + e);
+        }
+        result.setObj(jsonObject);
+        return result;
+    }
+
+
+}

+ 138 - 0
src/main/java/com/mtgg/controller/ServerController.java

@@ -0,0 +1,138 @@
+package com.mtgg.controller;
+
+import com.mtgg.bean.ConfigBean;
+import com.mtgg.bean.PayLogDTO;
+import com.mtgg.common.ErrorCode;
+import com.mtgg.common.Response;
+import com.mtgg.dto.MtRecordDTO;
+import com.mtgg.entity.MtRecordPO;
+import com.mtgg.service.BatisService;
+import com.mtgg.utils.ExcelUtil;
+import com.mtgg.utils.Page;
+import com.mtgg.utils.PageDataDTO;
+import com.mtgg.utils.voice.TtsMain;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: MTGG
+ * @Date: 22:08 2018/7/8
+ * @Describe:
+ */
+@Slf4j
+@RestController
+@RequestMapping("/server")
+public class ServerController {
+
+    @Autowired
+    private ConfigBean configBean;
+    @Autowired
+    private BatisService batisService;
+
+
+    @RequestMapping("/list")
+    public List list(){
+        List<List<String>> list = ExcelUtil.getExcel(configBean.getExcelUrl());
+        List<PayLogDTO> doDTOList = new ArrayList<PayLogDTO>();
+        int i = 0;
+        for (List<String> dataList:list){
+            if (i == 0){
+                i++;
+                continue;
+            }
+            PayLogDTO dataDoDTO = new PayLogDTO();
+            dataDoDTO.setAccount(dataList.get(0));
+            dataDoDTO.setTotalFee(Integer.parseInt(dataList.get(1)));
+            dataDoDTO.setDate(dataList.get(2));
+            doDTOList.add(dataDoDTO);
+        }
+
+        return doDTOList;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 0:28 2018/5/14
+     * @Describe: login check  密码写死
+     */
+    @RequestMapping(value = "/login",method = RequestMethod.POST)
+    public boolean login(String name,String pwd){
+        if ("jiaheshun".equals(name) && "jiaheshun888".equals(pwd)){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 22:12 2018/7/19
+     * @Describe: 获取list
+     */
+    @RequestMapping(value = "/lists",method = RequestMethod.GET)
+    public Response lists(){
+        Response result = new Response();
+        log.info("start");
+        PageDataDTO pageDataDTO = new PageDataDTO();
+
+        List<MtRecordDTO> list = batisService.getList(pageDataDTO);
+        int totalMoney = batisService.getTotalMoney();
+        log.info("end");
+        result.setRes(ErrorCode.SUCCESS.code);
+        result.setMsg(String.valueOf(totalMoney));
+        result.setObj(list);
+        return result;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 15:45 2018/7/20
+     * @Describe:
+     */
+    @RequestMapping(value = "/status",method = RequestMethod.GET)
+    public Response status(){
+        Response result = new Response();
+        log.info("--check--");
+        int ret = batisService.getCountByStatus();
+        result.setRes(ret);
+        return result;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 22:59 2018/7/23
+     * @Describe: 生成wav,获取路径
+     */
+    @RequestMapping(value = "/file",method = RequestMethod.POST)
+    public Response file(HttpServletRequest request){
+        Response result = new Response();
+        (new TtsMain()).voiceRun(request);
+        return result;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 17:27 2018/7/20
+     * @Describe: 确定更新状态
+     */
+    @RequestMapping(value = "/update/{id}",method = RequestMethod.POST)
+    public Response status(@PathVariable("id") Long id){
+        Response result = new Response();
+        log.info("确认状态接收:{}", id);
+        MtRecordPO mtRecordPO = new MtRecordPO();
+        mtRecordPO.setId(id);
+        mtRecordPO.setStatus((byte) 1);
+        int ret = batisService.updateById(mtRecordPO);
+        log.info("id:{}更改状态返回:{}", id, ret);
+        result.setRes(ErrorCode.SUCCESS.code);
+        return result;
+    }
+}

+ 222 - 0
src/main/java/com/mtgg/controller/WXController.java

@@ -0,0 +1,222 @@
+package com.mtgg.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jpay.ext.kit.HttpKit;
+import com.jpay.ext.kit.PaymentKit;
+import com.jpay.ext.kit.StrKit;
+import com.jpay.weixin.api.WxPayApi;
+import com.jpay.weixin.api.WxPayApiConfig;
+import com.jpay.weixin.api.WxPayApiConfigKit;
+import com.mtgg.bean.ConfigBean;
+import com.mtgg.bean.PayLogDTO;
+import com.mtgg.bean.WXData;
+import com.mtgg.common.ErrorCode;
+import com.mtgg.common.Response;
+import com.mtgg.dto.MtRecordDTO;
+import com.mtgg.entity.MtRecordPO;
+import com.mtgg.service.BatisService;
+import com.mtgg.utils.ExcelUtil;
+import com.mtgg.utils.IpUtil;
+import com.mtgg.utils.WechatUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author: MTGG 成长,是否是注定失去很多东西,这是一种悲哀,即使你有信心不会失去,但是这个事物就是这样,你站在两座山的中间
+ * 你走向一座山,便注定远离另一座山
+ * @Date: 19:29 2018/6/25
+ * @Describe:
+ */
+@Slf4j
+@Controller
+@ResponseBody
+@RequestMapping("/wx")
+public class WXController {
+
+    @Autowired
+    private ConfigBean configBean;
+    @Autowired
+    private BatisService batisService;
+
+
+    public WxPayApiConfig getApiConfig() {
+        return WxPayApiConfig.New()
+                .setAppId(configBean.getWxAppId())
+                .setMchId(configBean.getWxMchId())
+                .setPaternerKey(configBean.getWxPartnerKey())
+                .setPayModel(WxPayApiConfig.PayModel.BUSINESSMODEL);
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 19:33 2018/7/4
+     * @Describe: 获取openid
+     */
+    @RequestMapping(value = "/openid", method = RequestMethod.GET)
+    public Response getOpenId(@RequestParam("code") String code) {
+        Response jr = new Response();
+        log.info("接收到的code:{}", code);
+        //根据code获取openid
+        try {
+            JSONObject jsonObject = WechatUtils.getInstance().getDriverAuthAccessToken(code);
+            log.info("获取到的openid等信息:{}", jsonObject);
+            WXData wxData = new WXData();
+            wxData.setOpenid(jsonObject.getString("openid"));
+            wxData.setSessionKey(jsonObject.getString("sessionKey"));
+            jr.setObj(wxData);
+        } catch (Exception e) {
+            log.info("出错:{}", e);
+        }
+        jr.setRes(ErrorCode.SUCCESS.code);
+        return jr;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 19:36 2018/6/25
+     * @Describe: 公众号支付封装
+     */
+    @RequestMapping(value = "/gzhPay", method = RequestMethod.POST)
+    public Response webPay(@RequestParam("totalFee") String totalFee,
+                           @RequestParam("account") String account,
+                           @RequestParam("openid") String openid,
+                           HttpServletRequest request) {
+        Response jr = new Response();
+        log.info("openid:{};金额:{};账号:{}", openid, totalFee, account);
+        String total_fee = totalFee.concat("00");
+        log.info("total_fee:{}", total_fee);
+
+        if (StrKit.isBlank(openid)) {
+            jr.setRes(ErrorCode.ERR_NOT_EXIST.code);
+            jr.setMsg("获取到的openid为空");
+            return jr;
+        }
+        String ip = IpUtil.getIpAddr(request);
+        if (StrKit.isBlank(ip)) {
+            ip = "127.0.0.1";
+        }
+        WxPayApiConfigKit.putApiConfig(getApiConfig());
+        log.info("获取到的ip:{}", ip);
+        Map<String, String> params = WxPayApiConfigKit.getWxPayApiConfig()
+                .setAttach(account)
+                .setBody("佳禾顺")
+                .setOpenId(openid)
+                .setSpbillCreateIp(ip)
+                .setTotalFee(total_fee)
+                .setTradeType(WxPayApi.TradeType.JSAPI)
+                .setNotifyUrl(configBean.getWxNotifyUrl())
+                .setOutTradeNo(String.valueOf(System.currentTimeMillis()))
+                .build();
+        String xmlResult = WxPayApi.pushOrder(false, params);
+        Map<String, String> resultMap = PaymentKit.xmlToMap(xmlResult);
+        log.info("封装后解析后的xml:{}", resultMap);
+        String return_code = resultMap.get("return_code");
+        if (!PaymentKit.codeIsOK(return_code)) {
+            jr.setRes(ErrorCode.FAIL.code);
+            jr.setMsg("return_code is not ok");
+            return jr;
+        }
+        String result_code = resultMap.get("result_code");
+        if (!PaymentKit.codeIsOK(result_code)) {
+            jr.setRes(ErrorCode.FAIL.code);
+            jr.setMsg("result_code is not ok");
+            return jr;
+        }
+
+        // 以下字段在return_code 和result_code都为SUCCESS的时候有返回
+        String prepay_id = resultMap.get("prepay_id");
+        String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
+        String nonce_str = String.valueOf(System.currentTimeMillis());
+        String packages = "prepay_id=" + prepay_id;
+        Map<String, String> packageParams = new HashMap<String, String>();
+        packageParams.put("appId", configBean.getWxAppId());
+        packageParams.put("timeStamp", timeStamp);
+        packageParams.put("nonceStr", nonce_str);
+        packageParams.put("package", "prepay_id=" + prepay_id);
+        packageParams.put("signType", "MD5");
+        String packageSign = PaymentKit.createSign(packageParams, WxPayApiConfigKit.getWxPayApiConfig().getPaternerKey());
+        packageParams.put("paySign", packageSign);
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("appid", configBean.getWxAppId());
+        map.put("timeStamp", timeStamp);
+        map.put("nonceStr", nonce_str);
+        map.put("packageValue", packages);
+        map.put("paySign", packageSign);
+        map.put("success", "ok");
+        jr.setRes(ErrorCode.SUCCESS.code);
+        jr.setObj(map);
+        return jr;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 21:10 2018/7/8
+     * @Describe: 支付回调
+     */
+    @RequestMapping(value = "/payNotify", method = {RequestMethod.POST, RequestMethod.GET})
+    public void pay_notify(HttpServletRequest request, HttpServletResponse response) {
+        // 支付结果通用通知文档: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7
+        log.info("---------------支付回调----------------");
+        String xmlMsg = HttpKit.readData(request);
+        Map<String, String> params = PaymentKit.xmlToMap(xmlMsg);
+        String resXml = "";
+        String result_code = params.get("result_code");
+        WxPayApiConfigKit.setThreadLocalWxPayApiConfig(getApiConfig());
+        if (PaymentKit.verifyNotify(params, WxPayApiConfigKit.getWxPayApiConfig().getPaternerKey())) {
+            if (("SUCCESS").equals(result_code)) {
+                log.info("验证成功,下面处理业务");
+                // 微信支付订单号
+                String transaction_id = params.get("transaction_id");
+                log.info("微信支付订单号={}", transaction_id);
+                // 商户订单号
+                String out_trade_no = params.get("out_trade_no");
+                log.info("商户订单号={}", out_trade_no);
+                String total_fee = params.get("total_fee");
+                total_fee = total_fee.substring(0, total_fee.length() - 2);
+                String account = params.get("attach");
+                log.info("账户:{};金额:{}", account, total_fee);
+
+                MtRecordPO mtRecordPO = new MtRecordPO();
+                mtRecordPO.setUsername(account);
+                mtRecordPO.setMoney(Integer.parseInt(total_fee));
+                mtRecordPO.setOrderSn(out_trade_no);
+                mtRecordPO.setPayOrderSn(transaction_id);
+                mtRecordPO.setStatus((byte) 0);
+                mtRecordPO.setAddTime(new Date());
+                log.info("下面记录insert");
+                int ret = batisService.insertSelective(mtRecordPO);
+                log.info("添加记录返回:{}", ret);
+                resXml = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>"
+                        + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
+            } else {
+                //TODO FAIL支付失败
+                log.debug("支付失败的回调消息");
+                resXml = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>"
+                        + "<return_msg><![CDATA[报文为空]]></return_msg>" + "</xml> ";
+            }
+            BufferedOutputStream out = null;
+            try {
+                log.info("闭嘴");
+                out = new BufferedOutputStream(
+                        response.getOutputStream());
+                out.write(resXml.getBytes());
+                out.flush();
+                out.close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        log.info("验证失败");
+    }
+}

+ 20 - 0
src/main/java/com/mtgg/dao/AMapper.java

@@ -0,0 +1,20 @@
+package com.mtgg.dao;
+
+import com.mtgg.bean.ADTO;
+import com.mtgg.bean.User;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+public interface AMapper extends BaseMapper<User> {
+	List<Long> getOne();
+
+	int updateById();
+
+	int insert();
+
+	List<ADTO> geta(@Param("pageNum") Integer pageNum,@Param("pageSize") Integer pageSize);
+
+	int getCount();
+}

+ 76 - 0
src/main/java/com/mtgg/dao/BaseMapper.java

@@ -0,0 +1,76 @@
+package com.mtgg.dao;
+
+public interface BaseMapper<T> {
+	/**
+	 * 插入数据
+	 *
+	 * @param entity
+	 * @return
+	 * @throws Exception
+	 * @throws
+	 */
+	public int insert(T entity) throws Exception;
+	
+	/**
+	 * 更新数据
+	 *
+	 * @param entity
+	 * @return
+	 * @throws Exception
+	 * @throws
+	 */
+	public int updateByPrimaryKey(T entity) throws Exception;
+	
+	/**
+	 * 删除数据
+	 *
+	 * @param id
+	 * @throws Exception
+	 * @throws
+	 */
+	public int deleteByPrimaryKey(int id) throws Exception;
+	
+	/**
+	 * 删除数据
+	 *
+	 * @param entity
+	 * @throws Exception
+	 * @throws
+	 */
+	public int delete(T entity) throws Exception;
+	
+	/**
+	 * 根据id查询单个记录
+	 *
+	 * @param id
+	 * @return
+	 * @throws Exception
+	 * @throws
+	 */
+	public T selectByPrimaryKey(int id);
+	
+	/**
+	 * 根据对象查询单个记录
+	 *
+	 * @param entity
+	 * @return
+	 * @throws Exception
+	 * @throws
+	 */
+	public T getOne(T entity);
+	
+	/**
+	 * 根据对象查询信息
+	 *
+	 * @param obj
+	 * @return
+	 * @throws Exception
+	 * @throws
+	 */
+	public Object getObject(Object obj);
+	
+	
+	
+	
+	
+}

+ 44 - 0
src/main/java/com/mtgg/dao/BatisMapper.java

@@ -0,0 +1,44 @@
+package com.mtgg.dao;
+
+import com.mtgg.entity.MtRecordPO;
+import com.mtgg.utils.PageDataDTO;
+
+import java.util.List;
+
+public interface BatisMapper extends BaseMapper<MtRecordPO> {
+
+    int getCount();
+
+    List<MtRecordPO> getList(PageDataDTO pageDataDTO);
+
+    int getCountByStatus();
+
+    /**
+     * @Author: MTGG
+     * @Date: 17:52 2018/7/20
+     * @Describe: 查询money  sum
+     */
+    int getTotalMoney();
+
+    /**
+     * @Author: MTGG
+     * @Date: 18:55 2018/7/20
+     * @Describe: 根据订单号查
+     */
+    MtRecordPO getByOrderSn(String orderSn);
+
+    /**
+     * @Author: MTGG
+     * @Date: 17:33 2018/7/20
+     * @Describe: 根据id更新
+     */
+    int updateById(MtRecordPO mtRecordPO);
+
+    /**
+     * @Author: MTGG
+     * @Date: 18:07 2018/7/20
+     * @Describe: insert
+     */
+    int insertSelective(MtRecordPO mtRecordPO);
+
+}

+ 21 - 0
src/main/java/com/mtgg/dto/MtRecordDTO.java

@@ -0,0 +1,21 @@
+package com.mtgg.dto;
+
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+@Data
+public class MtRecordDTO implements Serializable{
+    private static final long serialVersionUID = -3780055231427704994L;
+    private Long recordId;
+
+    private String username;
+
+    private Integer money;
+
+    private Byte status;
+
+    private String addTime;
+
+}

+ 100 - 0
src/main/java/com/mtgg/entity/MtRecordPO.java

@@ -0,0 +1,100 @@
+package com.mtgg.entity;
+
+import com.mtgg.dto.MtRecordDTO;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class MtRecordPO implements Serializable{
+    private static final long serialVersionUID = -3780055231427704994L;
+
+    private Long id;
+
+    private String username;
+
+    private Integer money;
+
+    private Byte status;
+
+    private String orderSn;
+
+    private String payOrderSn;
+
+    private Date addTime;
+
+    private Date updateTime;
+
+    public MtRecordDTO Entity2DTO(){
+        MtRecordDTO mtRecordDTO = new MtRecordDTO();
+        mtRecordDTO.setRecordId(id);
+        mtRecordDTO.setUsername(username);
+        mtRecordDTO.setMoney(money);
+        mtRecordDTO.setStatus(status);
+        return mtRecordDTO;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public Integer getMoney() {
+        return money;
+    }
+
+    public void setMoney(Integer money) {
+        this.money = money;
+    }
+
+    public Byte getStatus() {
+        return status;
+    }
+
+    public void setStatus(Byte status) {
+        this.status = status;
+    }
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+
+    public String getPayOrderSn() {
+        return payOrderSn;
+    }
+
+    public void setPayOrderSn(String payOrderSn) {
+        this.payOrderSn = payOrderSn;
+    }
+}

+ 19 - 0
src/main/java/com/mtgg/service/AService.java

@@ -0,0 +1,19 @@
+package com.mtgg.service;
+		
+import com.mtgg.bean.ADTO;
+import com.mtgg.bean.User;
+
+import java.util.List;
+
+public interface AService extends BaseService<User> {
+
+	List<Long> getOne();
+
+	int updateById();
+
+	int insert();
+
+	List<ADTO> geta(Integer pageNum,Integer pageSize);
+
+	int getCount();
+}

+ 8 - 0
src/main/java/com/mtgg/service/BaseService.java

@@ -0,0 +1,8 @@
+package com.mtgg.service;
+
+
+import com.mtgg.dao.BaseMapper;
+
+public interface BaseService<T> extends BaseMapper<T> {
+
+}

+ 51 - 0
src/main/java/com/mtgg/service/BatisService.java

@@ -0,0 +1,51 @@
+package com.mtgg.service;
+		
+import com.mtgg.bean.ADTO;
+import com.mtgg.bean.User;
+import com.mtgg.dto.MtRecordDTO;
+import com.mtgg.entity.MtRecordPO;
+import com.mtgg.utils.PageDataDTO;
+
+import java.util.List;
+
+public interface BatisService extends BaseService<MtRecordPO> {
+
+    int getCount();
+
+    /**
+     * @Author: MTGG
+     * @Date: 17:52 2018/7/20
+     * @Describe: 查询列表
+     */
+    List<MtRecordDTO> getList(PageDataDTO pageDataDTO);
+
+    int getCountByStatus();
+
+    /**
+     * @Author: MTGG
+     * @Date: 18:55 2018/7/20
+     * @Describe: 根据订单号查
+     */
+    MtRecordDTO getByOrderSn(String orderSn);
+
+    /**
+     * @Author: MTGG
+     * @Date: 17:52 2018/7/20
+     * @Describe: 更新状态
+     */
+    int updateById(MtRecordPO mtRecordPO);
+
+    /**
+     * @Author: MTGG
+     * @Date: 17:52 2018/7/20
+     * @Describe: 查询money  sum
+     */
+    int getTotalMoney();
+
+    /**
+     * @Author: MTGG
+     * @Date: 18:07 2018/7/20
+     * @Describe: insert
+     */
+    int insertSelective(MtRecordPO mtRecordPO);
+}

+ 51 - 0
src/main/java/com/mtgg/service/imp/AServiceImp.java

@@ -0,0 +1,51 @@
+package com.mtgg.service.imp;
+
+import com.mtgg.bean.ADTO;
+import com.mtgg.bean.User;
+import com.mtgg.dao.AMapper;
+import com.mtgg.dao.BaseMapper;
+import com.mtgg.service.AService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Transactional
+@Service
+public class AServiceImp extends BaseServiceImp<User> implements AService {
+	@Autowired
+	private AMapper aMapper;
+	
+	protected BaseMapper<User> getMapper(){
+		return this.aMapper;
+	}
+
+	@Override
+	public List<Long> getOne() {
+		List<Long> list = aMapper.getOne();
+		System.out.println("list:"+list);
+		return list;
+	}
+
+	@Override
+	public int updateById() {
+		return aMapper.updateById();
+	}
+
+	@Override
+	public int insert() {
+		return aMapper.insert();
+	}
+
+	@Override
+	public List<ADTO> geta(Integer pageNum,Integer pageSize) {
+		return aMapper.geta(pageNum,pageSize);
+	}
+
+	@Override
+	public int getCount() {
+		return aMapper.getCount();
+	}
+}

+ 75 - 0
src/main/java/com/mtgg/service/imp/BaseServiceImp.java

@@ -0,0 +1,75 @@
+package com.mtgg.service.imp;
+
+import com.mtgg.dao.BaseMapper;
+import com.mtgg.service.BaseService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+//用abstract可以自定义添加一些公共方法
+public abstract class BaseServiceImp<T> implements BaseService<T> {
+	private static final Logger logger= LoggerFactory.getLogger(BaseServiceImp.class);
+	protected abstract   BaseMapper<T> getMapper();
+	
+	@Override
+	public int insert(T entity) throws Exception {
+		int result = getMapper().insert(entity);
+		return result;
+	}
+	
+	
+	@Override
+	public int updateByPrimaryKey(T entity) throws Exception {
+		int result = getMapper().updateByPrimaryKey(entity);
+		return result;
+	}
+	
+	@Override
+	public int deleteByPrimaryKey(int id) throws Exception {
+		int result = getMapper().deleteByPrimaryKey(id);
+		return result;
+	}
+	
+	@Override
+	public int delete(T entity) throws Exception {
+		int result = getMapper().delete(entity);
+		return result;
+	}
+	
+	@Override
+	public T selectByPrimaryKey(int id) {
+		T obj = null;
+		try {
+			System.out.println(id);
+			obj = getMapper().selectByPrimaryKey(id);
+			System.out.println(obj);
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+		return obj;
+	}
+	
+	@Override
+	public T getOne(T entity) {
+		T obj = null;
+		try {
+			System.out.println("entity--"+entity);
+			obj = getMapper().getOne(entity);
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+		return obj;
+	}
+	
+	@Override
+	public Object getObject(Object obj) {
+		Object result = null;
+		try {
+			result = getMapper().getObject(obj);
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+		return result;
+	}
+	
+	
+}

+ 84 - 0
src/main/java/com/mtgg/service/imp/BatisServiceImp.java

@@ -0,0 +1,84 @@
+package com.mtgg.service.imp;
+
+import com.mtgg.dao.BaseMapper;
+import com.mtgg.dao.BatisMapper;
+import com.mtgg.dto.MtRecordDTO;
+import com.mtgg.entity.MtRecordPO;
+import com.mtgg.service.BatisService;
+import com.mtgg.utils.PageDataDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@Transactional
+@Service
+public class BatisServiceImp extends BaseServiceImp<MtRecordPO> implements BatisService {
+	@Autowired
+	private BatisMapper batisMapper;
+	
+	protected BaseMapper<MtRecordPO> getMapper(){
+		return this.batisMapper;
+	}
+
+	@Override
+	public int getCount() {
+		return batisMapper.getCount();
+	}
+
+	@Override
+	public List<MtRecordDTO> getList(PageDataDTO pageDataDTO) {
+		if (pageDataDTO == null){
+			return Collections.emptyList();
+		}
+		List<MtRecordPO> list = batisMapper.getList(pageDataDTO);
+		List<MtRecordDTO> dtoList = new ArrayList<MtRecordDTO>();
+		if (list == null || list.size() < 1){
+			return Collections.emptyList();
+		}
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		for (MtRecordPO mtRecordPO : list){
+			MtRecordDTO mtRecordDTO = mtRecordPO.Entity2DTO();
+			mtRecordDTO.setAddTime(sdf.format(mtRecordPO.getAddTime()));
+			dtoList.add(mtRecordDTO);
+		}
+		return dtoList;
+	}
+
+	@Override
+	public int getCountByStatus() {
+		return batisMapper.getCountByStatus();
+	}
+
+	@Override
+	public MtRecordDTO getByOrderSn(String orderSn) {
+		if (StringUtils.isBlank(orderSn)){
+			return null;
+		}
+		MtRecordPO mtRecordPO = batisMapper.getByOrderSn(orderSn);
+		if (mtRecordPO == null){
+			return null;
+		}
+		return mtRecordPO.Entity2DTO();
+	}
+
+	@Override
+	public int updateById(MtRecordPO mtRecordPO) {
+		return batisMapper.updateById(mtRecordPO);
+	}
+
+	@Override
+	public int getTotalMoney() {
+		return batisMapper.getTotalMoney();
+	}
+
+	@Override
+	public int insertSelective(MtRecordPO mtRecordPO) {
+		return batisMapper.insertSelective(mtRecordPO);
+	}
+}

+ 147 - 0
src/main/java/com/mtgg/utils/DownloadExcelUtil.java

@@ -0,0 +1,147 @@
+package com.mtgg.utils;
+
+import org.apache.poi.hssf.usermodel.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * @author zhangdi
+ * @date 2018/3/22
+ */
+public class DownloadExcelUtil<T> {
+
+
+    /**
+     * 这是一个通用的方法,利用了JAVA的反射机制,可以将放置在JAVA集合中并且符号一定条件的数据以EXCEL 的形式输出
+     *
+     * title         表格标题名
+     * headersName  表格属性列名数组
+     * headersId    表格属性列名对应的字段---你需要导出的字段名(为了更灵活控制你想要导出的字段)
+     *  dtoList     需要显示的数据集合,集合中一定要放置符合javabean风格的类的对象
+     *  out         与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
+     */
+    public  String exportExcel(String title, List<String> headersName,List<String> headersId,
+                             List<T> dtoList,HttpServletResponse response) {
+        /*(一)表头--标题栏*/
+        Map<Integer, String> headersNameMap = new HashMap<Integer, String>();
+        int key = 0;
+        for (int i = 0; i < headersName.size(); i++) {
+            if (!headersName.get(i).equals(null)) {
+                headersNameMap.put(key, headersName.get(i));
+                key++;
+            }
+        }
+        /*(二)字段*/
+        Map<Integer, String> titleFieldMap = new HashMap<Integer, String>();
+        int value = 0;
+        for (int i = 0; i < headersId.size(); i++) {
+            if (!headersId.get(i).equals(null)) {
+                titleFieldMap.put(value, headersId.get(i));
+                value++;
+            }
+        }
+        /* (三)声明一个工作薄:包括构建工作簿、表格、样式*/
+        HSSFWorkbook wb = new HSSFWorkbook();
+        HSSFSheet sheet = wb.createSheet(title);
+        sheet.setDefaultColumnWidth((short) 15);
+        // 生成一个样式
+        HSSFCellStyle style = wb.createCellStyle();
+        HSSFRow row = sheet.createRow(0);
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        HSSFCell cell;
+        //拿到表格所有标题的value的集合
+        Collection c = headersNameMap.values();
+        //表格标题的迭代器
+        Iterator<String> it = c.iterator();
+        /*(四)导出数据:包括导出标题栏以及内容栏*/
+        //根据选择的字段生成表头
+        short size = 0;
+        while (it.hasNext()) {
+            cell = row.createCell(size);
+            cell.setCellValue(it.next().toString());
+            cell.setCellStyle(style);
+            size++;
+        }
+        //表格标题一行的字段的集合
+        Collection zdC = titleFieldMap.values();
+        //总记录的迭代器
+        Iterator<T> labIt = dtoList.iterator();
+        //列序号
+        int zdRow = 0;
+        //记录的迭代器,遍历总记录
+        while (labIt.hasNext()) {
+            int zdCell = 0;
+            zdRow++;
+            row = sheet.createRow(zdRow);
+            T l = (T) labIt.next();
+            // 利用反射,根据javabean属性的先后顺序,动态调用getXxx()方法得到属性值
+            //获得JavaBean全部属性
+            Field[] fields = l.getClass().getDeclaredFields();
+            //一条字段的集合的迭代器
+            Iterator<String> zdIt = zdC.iterator();
+            while (zdIt.hasNext()) {
+                String fieldName = zdIt.next();
+                for(short i = 0; i < fields.length; i++){
+                    Field field = fields[i];
+                    //属性名
+                    if(fieldName.equals(field.getName())){{
+                        String getMethodName = "get"
+                                + fieldName.substring(0, 1).toUpperCase()
+                                //拿到属性的get方法
+                                + fieldName.substring(1);
+                        //拿到JavaBean对象
+                        Class tCls = l.getClass();
+                        try {
+                            Method getMethod = tCls.getMethod(getMethodName,
+                                    //通过JavaBean对象拿到该属性的get方法,从而进行操控
+                                    new Class[]{});
+                            //操控该对象属性的get方法,从而拿到属性值
+                            Object val = getMethod.invoke(l, new Object[]{});
+                            String textVal = null;
+                            if (val != null) {
+                                //转化成String
+                                textVal = String.valueOf(val);
+                            } else {
+                                textVal = null;
+                            }
+                            //写进excel对象
+                            row.createCell((short) zdCell).setCellValue(textVal);
+                            zdCell++;
+                        } catch (SecurityException e) {
+                            e.printStackTrace();
+                        } catch (IllegalArgumentException e) {
+                            e.printStackTrace();
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        }
+                    }
+
+                    }
+                }
+            }
+        }
+        try {
+            OutputStream out = response.getOutputStream();
+            wb.write(out);
+            out.flush();
+            out.close();
+            wb.close();
+            System.out.println("导出成功");
+            return "导出成功";
+        }catch (Exception e){
+            e.printStackTrace();
+            System.out.println("导出失败");
+            return "导出失败";
+        }
+
+    }
+}

+ 384 - 0
src/main/java/com/mtgg/utils/ExcelUtil.java

@@ -0,0 +1,384 @@
+package com.mtgg.utils;
+
+import com.mtgg.bean.PayLogDTO;
+import com.mtgg.bean.PoiExcelBean;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.*;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * Created by liuhaixiang on 2017/excels_station/5.
+ */
+public class ExcelUtil {
+    private final static String excel2003L =".xls";    //2003- 版本的excel
+    private final static String excel2007U =".xlsx";   //2007+ 版本的excel
+    /**
+     * Excel导入
+     */
+    public static  List<List<Object>> getBankListByExcel(InputStream in, String fileName) throws Exception{
+        List<List<Object>> list = null;
+        //1 根据流,获取workbook
+        Workbook work = getWorkbook(in,fileName);
+        if(null == work){ throw new Exception("创建Excel工作薄为空!"); }
+        //2 三要素,sheet,row,cell
+        Sheet sheet = null;
+        Row row = null;
+        Cell cell = null;
+        list = new ArrayList<List<Object>>();
+        //3 遍历sheet
+        for (int i = 0; i < work.getNumberOfSheets(); i++) {
+            sheet = work.getSheetAt(i);
+            if(sheet==null){continue;}
+            //遍历sheet中所有行,包含头部行
+            for (int j = sheet.getFirstRowNum(); j <= sheet.getLastRowNum(); j++) {
+                //读取一行
+                row = sheet.getRow(j);
+                //去掉空行和表头
+                if(row==null||row.getFirstCellNum()==j){continue;}
+                //遍历所有的列
+                List<Object> li = new ArrayList<Object>();
+                for (int y = row.getFirstCellNum(); y < row.getLastCellNum(); y++) {
+                    cell = row.getCell(y);
+                    li.add(getCellValue(cell));
+                }
+                list.add(li);
+            }
+        }
+        return list;
+    }
+    /**
+     * 描述:根据文件后缀,自适应上传文件的版本
+     */
+    public static Workbook getWorkbook(InputStream inStr, String fileName) throws Exception{
+        Workbook wb = null;
+        String fileType = fileName.substring(fileName.lastIndexOf("."));
+        if(excel2003L.equals(fileType)){
+            wb = new HSSFWorkbook(inStr);  //2003-
+        }else if(excel2007U.equals(fileType)){
+            wb = new XSSFWorkbook(inStr);  //2007+
+        }else{
+            throw new Exception("解析的文件格式有误!");
+        }
+        return wb;
+    }
+    /**
+     * 描述:对表格中数值进行格式化
+     */
+    public static  Object getCellValue(Cell cell){
+        Object value = null;
+        DecimalFormat df = new DecimalFormat("0");  //格式化字符类型的数字
+        SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");  //日期格式化
+        DecimalFormat df2 = new DecimalFormat("0.00");  //格式化数字
+        switch (cell.getCellType()) {
+            case Cell.CELL_TYPE_STRING:
+                value = cell.getRichStringCellValue().getString();
+                break;
+            case Cell.CELL_TYPE_NUMERIC:
+                if("General".equals(cell.getCellStyle().getDataFormatString())){
+                    value = df.format(cell.getNumericCellValue());
+                }else if("m/d/yy".equals(cell.getCellStyle().getDataFormatString())){
+                    value = sdf.format(cell.getDateCellValue());
+                }else{
+                    value = df2.format(cell.getNumericCellValue());
+                }
+                break;
+            case Cell.CELL_TYPE_BOOLEAN:
+                value = cell.getBooleanCellValue();
+                break;
+            case Cell.CELL_TYPE_BLANK:
+                value = "";
+                break;
+            default:
+                break;
+        }
+        return value;
+    }
+
+
+
+
+    /**
+     * 导入Excel表结束
+     * 导出Excel表开始
+     * @param sheetName 工作簿名称
+     * @param clazz  数据源model类型
+     * @param objs   excel标题列以及对应model字段名
+     * @param map  标题列行数以及cell字体样式
+     */
+    public static XSSFWorkbook createExcelFile(Class clazz, List objs, Map<Integer, List<PoiExcelBean>> map, String sheetName) throws
+            IllegalArgumentException,IllegalAccessException,InvocationTargetException,
+            ClassNotFoundException, IntrospectionException, ParseException {
+        // 创建新的Excel工作簿
+        XSSFWorkbook workbook = new XSSFWorkbook();
+        // 在Excel工作簿中建一工作表,其名为缺省值, 也可以指定Sheet名称
+        XSSFSheet sheet = workbook.createSheet(sheetName);
+        // 以下为excel的字体样式以及excel的标题与内容的创建,下面会具体分析;
+        createFont(workbook); //字体样式
+        createTableHeader(sheet, map); //创建标题(头)
+        createTableRows(sheet, map, objs, clazz); //创建内容
+        return workbook;
+    }
+    private static XSSFCellStyle fontStyle;
+    private static XSSFCellStyle fontStyle2;
+    public static void createFont(XSSFWorkbook workbook) {
+        // 表头
+        fontStyle = workbook.createCellStyle();
+        XSSFFont font1 = workbook.createFont();
+        font1.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
+        font1.setFontName("黑体");
+        font1.setFontHeightInPoints((short) 14);// 设置字体大小
+        fontStyle.setFont(font1);
+        fontStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN); // 下边框
+        fontStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);// 左边框
+        fontStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);// 上边框
+        fontStyle.setBorderRight(XSSFCellStyle.BORDER_THIN);// 右边框
+        fontStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER); // 居中
+        // 内容
+        fontStyle2=workbook.createCellStyle();
+        XSSFFont font2 = workbook.createFont();
+        font2.setFontName("宋体");
+        font2.setFontHeightInPoints((short) 10);// 设置字体大小
+        fontStyle2.setFont(font2);
+        fontStyle2.setBorderBottom(XSSFCellStyle.BORDER_THIN); // 下边框
+        fontStyle2.setBorderLeft(XSSFCellStyle.BORDER_THIN);// 左边框
+        fontStyle2.setBorderTop(XSSFCellStyle.BORDER_THIN);// 上边框
+        fontStyle2.setBorderRight(XSSFCellStyle.BORDER_THIN);// 右边框
+        fontStyle2.setAlignment(XSSFCellStyle.ALIGN_CENTER); // 居中
+    }
+    /**
+     * 根据ExcelMapping 生成列头(多行列头)
+     *
+     * @param sheet 工作簿
+     * @param map 每行每个单元格对应的列头信息
+     */
+    public static final void createTableHeader(XSSFSheet sheet, Map<Integer, List<PoiExcelBean>> map) {
+        int startIndex=0;//cell起始位置
+        int endIndex=0;//cell终止位置
+        for (Map.Entry<Integer, List<PoiExcelBean>> entry : map.entrySet()) {
+            XSSFRow row = sheet.createRow(entry.getKey());
+            List<PoiExcelBean> excels = entry.getValue();
+            for (int x = 0; x < excels.size(); x++) {
+                //合并单元格
+                if(excels.get(x).getCols()>1){
+                    if(x==0){
+                        endIndex+=excels.get(x).getCols()-1;
+                        CellRangeAddress range=new CellRangeAddress(0,0,startIndex,endIndex);
+                        sheet.addMergedRegion(range);
+                        startIndex+=excels.get(x).getCols();
+                    }else{
+                        endIndex+=excels.get(x).getCols();
+                        CellRangeAddress range=new CellRangeAddress(0,0,startIndex,endIndex);
+                        sheet.addMergedRegion(range);
+                        startIndex+=excels.get(x).getCols();
+                    }
+                    XSSFCell cell = row.createCell(startIndex-excels.get(x).getCols());
+                    cell.setCellValue(excels.get(x).getHeadTextName());// 设置内容
+                    if (excels.get(x).getCellStyle() != null) {
+                        cell.setCellStyle(excels.get(x).getCellStyle());// 设置格式
+                    }
+                    cell.setCellStyle(fontStyle);
+                }else{
+                    XSSFCell cell = row.createCell(x);
+                    cell.setCellValue(excels.get(x).getHeadTextName());// 设置内容
+                    if (excels.get(x).getCellStyle() != null) {
+                        cell.setCellStyle(excels.get(x).getCellStyle());// 设置格式
+                    }
+                    cell.setCellStyle(fontStyle);
+                }
+            }
+        }
+    }
+    public static void createTableRows(XSSFSheet sheet, Map<Integer, List<PoiExcelBean>> map, List objs, Class clazz)
+            throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, IntrospectionException,
+            ClassNotFoundException, ParseException {
+        int rowindex = map.size();
+        int maxKey = 0;
+        List<PoiExcelBean> ems = new ArrayList<PoiExcelBean>();
+        for (Map.Entry<Integer, List<PoiExcelBean>> entry : map.entrySet()) {
+            if (entry.getKey() > maxKey) {
+                maxKey = entry.getKey();
+            }
+        }
+        ems = map.get(maxKey);
+        List<Integer> widths = new ArrayList<Integer>(ems.size());
+        for (Object obj : objs) {
+            XSSFRow row = sheet.createRow(rowindex);
+            for (int i = 0; i < ems.size(); i++) {
+                PoiExcelBean em = (PoiExcelBean) ems.get(i);
+                // 获得get方法
+                PropertyDescriptor pd = new PropertyDescriptor(em.getPropertyName(), clazz);
+                Method getMethod = pd.getReadMethod();
+                Object rtn = getMethod.invoke(obj);
+                String value = "";
+                // 如果是日期类型进行转换
+                if (rtn != null) {
+                    if (rtn instanceof Date) {
+                        value = Double.toString(DateUtil.getExcelDate((Date)rtn));
+                    } else if(rtn instanceof BigDecimal){
+                        NumberFormat nf = new DecimalFormat("#,##0.00");
+                        value=nf.format((BigDecimal)rtn).toString();
+                    } else if((rtn instanceof Integer) && (Integer.valueOf(rtn.toString())<0 )){
+                        value="--";
+                    }else {
+                        value = rtn.toString();
+                    }
+                }
+                XSSFCell cell = row.createCell(i);
+                cell.setCellValue(value);
+                cell.setCellType(XSSFCell.CELL_TYPE_STRING);
+                cell.setCellStyle(fontStyle2);
+                // 获得最大列宽
+                int width = value.getBytes().length * 300;
+                // 还未设置,设置当前
+                if (widths.size() <= i) {
+                    widths.add(width);
+                    continue;
+                }
+                // 比原来大,更新数据
+                if (width > widths.get(i)) {
+                    widths.set(i, width);
+                }
+            }
+            rowindex++;
+        }
+        // 设置列宽
+        for (int index = 0; index < widths.size(); index++) {
+            Integer width = widths.get(index);
+            width = width < 2500 ? 2500 : width + 300;
+            width = width > 10000 ? 10000 + 300 : width + 300;
+            sheet.setColumnWidth(index, width);
+        }
+    }
+
+
+    /**
+     * @Author: MTGG
+     * @Date: 15:22 2018/5/9
+     * @Describe: 读取excel
+     */
+    public static List<List<String>> getExcel(String file_path) {
+        List<List<String>> list = new ArrayList<List<String>>();
+        try {
+            InputStream is = new FileInputStream(file_path);
+            Workbook wb = null;
+            if (file_path.endsWith("xls")) {
+                wb = new HSSFWorkbook(is);
+            } else if (file_path.endsWith("xlsx")) {
+                wb = new XSSFWorkbook(is);
+            }
+            int i = 0;
+            Sheet sheet = wb.getSheetAt(0);
+            Iterator rows = sheet.rowIterator();
+            String str = null;
+            while (rows.hasNext()) {
+                List<String> dataList = new ArrayList<String>();
+                PayLogDTO dataDoDTO = new PayLogDTO();
+                Row row = (Row) rows.next();
+                Iterator cells = row.cellIterator();
+                while (cells.hasNext()) {
+                    Cell cell = (Cell) cells.next();
+                    switch (cell.getCellType()) {
+                        case Cell.CELL_TYPE_NUMERIC://数字
+                            if (DateUtil.isCellDateFormatted(cell)) {
+                                SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
+                                str = sdf.format(DateUtil.getJavaDate(cell.getNumericCellValue()));
+                                break;
+                            }
+                            DecimalFormat format = new DecimalFormat("#");
+                            Number value = cell.getNumericCellValue();
+                            str = format.format(value);
+                            dataList.add(str);
+                            break;
+                        case Cell.CELL_TYPE_STRING://字符串
+                            if (i == 0){
+                                continue;
+                            }
+                            str = cell.getStringCellValue();
+                            dataList.add(str);
+                            break;
+                        case Cell.CELL_TYPE_BOOLEAN://Boolean
+                            System.out.print(cell.getBooleanCellValue() + "--boolean\t");
+                            break;
+                        case Cell.CELL_TYPE_FORMULA://公式
+                            System.out.print(cell.getCellFormula() + "\tb");
+                            break;
+                        default:
+                            System.out.print("unsuported sell type" + "\t");
+                            break;
+                    }
+                }
+                list.add(dataList);
+                i++;
+            }
+            is.close();
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        }
+        return list;
+    }
+
+
+    /**
+     * @Author: MTGG
+     * @Date: 15:25 2018/5/9
+     * @Describe: 写入excel  追加数据
+     */
+    public static boolean writeToExcel(PayLogDTO dataDoDTO,String filePath) {
+        try {
+            FileInputStream fs=new FileInputStream(filePath);  //获取d://test.xls
+            POIFSFileSystem ps=new POIFSFileSystem(fs);  //使用POI提供的方法得到excel的信息
+            HSSFWorkbook wb=new HSSFWorkbook(ps);
+            HSSFSheet sheet=wb.getSheetAt(0);  //获取到工作表,因为一个excel可能有多个工作表
+            sheet.setDefaultColumnWidth((short) 40);  //宽度制定
+
+            HSSFCellStyle style = wb.createCellStyle(); //制作样式
+            //设置 颜色
+            style.setFillForegroundColor(HSSFColor.WHITE.index);
+
+            //制作字体字号
+            HSSFFont font = wb.createFont();
+            font.setColor(HSSFColor.VIOLET.index);
+            font.setFontHeightInPoints((short) 15);
+            font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+            style.setFont(font);
+
+            HSSFRow row=sheet.getRow(0);  //获取第一行(excel中的行默认从0开始,所以这就是为什么,一个excel必须有字段列头),即,字段列头,便于赋值
+            System.out.println(sheet.getLastRowNum()+" "+row.getLastCellNum());  //分别得到最后一行的行号,和一条记录的最后一个单元格
+
+            FileOutputStream out=new FileOutputStream(filePath);  //向d://test.xls中写数据
+            row=sheet.createRow((short)(sheet.getLastRowNum()+1)); //在现有行号后追加数据
+            row.setRowStyle(style);
+
+            //追加数据
+            row.createCell(0).setCellValue(dataDoDTO.getAccount()); //设置第一个(从0开始)单元格的数据
+            row.createCell(1).setCellValue(dataDoDTO.getTotalFee()); //设置第二个(从0开始)单元格的数据
+            row.createCell(2).setCellValue(dataDoDTO.getDate());
+
+            out.flush();
+            wb.write(out);
+            out.close();
+            System.out.println(row.getPhysicalNumberOfCells()+" "+row.getLastCellNum());
+        }catch (Exception e){
+            System.out.println("写excel出错");
+        }
+        return true;
+    }
+}

+ 55 - 0
src/main/java/com/mtgg/utils/HttpUtils.java

@@ -0,0 +1,55 @@
+package com.mtgg.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author: MTGG
+ * @Date: 0:40 2018/7/6
+ * @Describe: http工具
+ */
+@Component
+public class HttpUtils {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+
+    /**
+     * @Author: MTGG
+     * @Date: 0:40 2018/7/6
+     * @Describe: 发送get请求
+     */
+    public JSONObject sendGet(String uri){
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+        HttpEntity<String> entity = new HttpEntity<String>(headers);
+        String strbody=restTemplate.exchange(uri, HttpMethod.GET, entity,String.class).getBody();
+        JSONObject jsonObject = JSONObject.parseObject(strbody);
+        return jsonObject;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 0:50 2018/7/6
+     * @Describe: post请求
+     */
+    public String post(String url, Map map)
+            throws Exception {
+        HttpHeaders headers=new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+//        MultiValueMap<String,String> map=new LinkedMultiValueMap<String,String>();
+        HttpEntity<Map> request=new HttpEntity<Map>(map,headers);
+        ResponseEntity<String> response=restTemplate.postForEntity(url,request,String.class);
+        return response.toString();
+    }
+}

+ 38 - 0
src/main/java/com/mtgg/utils/IOUtil.java

@@ -0,0 +1,38 @@
+package com.mtgg.utils;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+public class IOUtil {
+
+    public static String messageInsert(String str){
+        String path = "D:\\pay.txt";
+        FileOutputStream fos;
+        if (StringUtils.isBlank(str)){
+            return null;
+        }
+
+        try {
+            System.out.println("str:" +str);
+            str = new String(str.getBytes("UTF-8"));
+            System.out.println("str:"+str);
+            fos=new FileOutputStream(path,true);
+            OutputStreamWriter oStreamWriter = new OutputStreamWriter(fos, "utf-8");
+            oStreamWriter.append(str);
+            //推荐使用,具有良好的跨平台性
+            String newLine = System.getProperty("line.separator");
+            fos.write(newLine.getBytes());
+            oStreamWriter.close();
+            fos.close();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "success";
+    }
+}

+ 44 - 0
src/main/java/com/mtgg/utils/IpUtil.java

@@ -0,0 +1,44 @@
+package com.mtgg.utils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class IpUtil {
+
+    /**
+     * @Author: mtgg 我的心是旷野的鸟,在你的眼里找到了它的天空.
+     * @Date: 19:13 2018/3/1
+     * @Describe: 获取当前ip
+     */
+    public static String getIpAddr(HttpServletRequest request) {
+        String ipAddress = request.getHeader("x-forwarded-for");
+        if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
+            ipAddress = request.getHeader("Proxy-Client-IP");
+        }
+        if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
+            ipAddress = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
+            ipAddress = request.getRemoteAddr();
+            if (ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")) {
+                //根据网卡取本机配置的IP
+                InetAddress inet = null;
+                try {
+                    inet = InetAddress.getLocalHost();
+                } catch (UnknownHostException e) {
+                    e.printStackTrace();
+                }
+                ipAddress = inet.getHostAddress();
+            }
+        }
+        //对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
+        if (ipAddress != null && ipAddress.length() > 15) { //"***.***.***.***".length() = 15
+            if (ipAddress.indexOf(",") > 0) {
+                ipAddress = ipAddress.substring(0, ipAddress.indexOf(","));
+            }
+        }
+        return ipAddress;
+    }
+
+}

+ 52 - 0
src/main/java/com/mtgg/utils/IsNum.java

@@ -0,0 +1,52 @@
+package com.mtgg.utils;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static org.apache.commons.lang3.StringUtils.isBlank;
+
+public class IsNum {
+    public static boolean isNumeric(String str){
+        for (int i = str.length();--i>=0;){
+            if (!Character.isDigit(str.charAt(i))){
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 14:19 2018/4/18
+     * @Describe: 判断是否是正整数
+     */
+    public static boolean isPureDigital(String string) {
+        if (isBlank(string))
+            return false;
+        String regEx1 = "\\d+";
+        Pattern p;
+        Matcher m;
+        p = Pattern.compile(regEx1);
+        m = p.matcher(string);
+        if (m.matches())
+            return true;
+        else
+            return false;
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 10:52 2018/4/19
+     * @Describe: 判断是否是汉字
+     */
+    public static boolean isChinese(String str) {
+        String regEx = "[\u4e00-\u9fa5]";
+        Pattern pat = Pattern.compile(regEx);
+        Matcher matcher = pat.matcher(str);
+        boolean flg = false;
+        if (matcher.find())
+            flg = true;
+
+        return flg;
+    }
+}

+ 96 - 0
src/main/java/com/mtgg/utils/Page.java

@@ -0,0 +1,96 @@
+package com.mtgg.utils;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: MTGG   
+ * @Date: 22:16 2018/7/19
+ * @Describe: 
+ */
+public class Page<T> implements Serializable{
+    private static final long serialVersionUID = 1L;
+
+        // 当前页数
+        private Integer currentPage = 1;
+        // 每页显示记录的条数
+        private Integer pageSize = 10;
+        //总条数
+        private Integer total ;
+        //数据
+        private List<T> data;
+        //条件
+        private Map<T,T> conMap;
+        //起始位置
+        private Integer startPos;
+
+
+        public Page(){
+
+        }
+        public Page(Integer total, Integer currentPage, Integer pageSize) {
+            if (currentPage != null) {
+                this.currentPage = currentPage;
+            }
+            if (pageSize != null) {
+                this.pageSize = pageSize;
+            }
+            this.total = total;
+        }
+
+    public Integer getStartPos() {
+        return (pageSize * currentPage - pageSize);
+    }
+
+    public void setStartPos(Integer startPos) {
+        this.startPos = startPos;
+    }
+
+    /**
+         * 取得选择记录的初始位置
+         *
+         * @return
+         */
+
+
+        public Integer getCurrentPage() {
+            return currentPage;
+        }
+
+        public void setCurrentPage(Integer currentPage) {
+            this.currentPage = currentPage;
+        }
+
+        public Integer getPageSize() {
+            return pageSize;
+        }
+
+        public void setPageSize(Integer pageSize) {
+            this.pageSize = pageSize;
+        }
+
+        public Integer getTotal() {
+            return total;
+        }
+
+        public void setTotal(Integer total) {
+            this.total = total;
+        }
+
+        public List<T> getData() {
+            return data;
+        }
+
+        public void setData(List<T> data) {
+            this.data = data;
+        }
+
+    public Map<T, T> getConMap() {
+        return conMap;
+    }
+
+    public void setConMap(Map<T, T> conMap) {
+        this.conMap = conMap;
+    }
+}

+ 21 - 0
src/main/java/com/mtgg/utils/PageDataDTO.java

@@ -0,0 +1,21 @@
+package com.mtgg.utils;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class PageDataDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Long driverId;
+
+    private Long id;
+
+    private String str;
+
+    private Integer startPos;
+
+    private Integer pageSize;
+
+}

+ 94 - 0
src/main/java/com/mtgg/utils/VoiceUtil.java

@@ -0,0 +1,94 @@
+/**   
+* @Title: Voice.java 
+* @Package org.util 
+* @Description: TODO该方法的主要作用: 
+* @author A18ccms A18ccms_gmail_com   
+* @date 2017-7-3 下午9:03:45 
+* @version V1.0   
+*/  
+package com.mtgg.utils;
+
+
+
+import com.jacob.activeX.ActiveXComponent;
+import com.jacob.com.Dispatch;
+import com.jacob.com.Variant;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @Author: MTGG
+ * @Date: 22:37 2018/7/17
+ * @Describe:
+ */
+@Slf4j
+public class VoiceUtil {
+
+   /**
+    *
+   * @Title: strat
+   * @Description: 该方法的主要作用:朗读
+   * @param  @param content
+   * @param  @param type 设定文件   0:开始,1停止
+   * @return  返回类型:void
+   * @throws
+    */
+   public static void stratVoice(String content, int type) {
+       // ?? 这个Sapi.SpVoice是需要安装什么东西吗,感觉平白无故就来了
+       ActiveXComponent sap = new ActiveXComponent("Sapi.SpVoice");
+       // Dispatch是做什么的?
+       Dispatch sapo = sap.getObject();
+       if (type == 0) {
+           try {
+               // 音量 0-100
+               sap.setProperty("Volume", new Variant(100));
+               // 语音朗读速度 -10 到 +10
+               sap.setProperty("Rate", new Variant(0));
+               Variant defalutVoice = sap.getProperty("Voice");
+               Dispatch dispdefaultVoice = defalutVoice.toDispatch();
+               Variant allVoices = Dispatch.call(sapo, "GetVoices");
+               Dispatch dispVoices = allVoices.toDispatch();
+
+               Dispatch setvoice = Dispatch.call(dispVoices, "Item",
+                       new Variant(1)).toDispatch();
+               ActiveXComponent voiceActivex = new ActiveXComponent(
+                       dispdefaultVoice);
+               ActiveXComponent setvoiceActivex = new ActiveXComponent(
+                       setvoice);
+               Variant item = Dispatch.call(setvoiceActivex, "GetDescription");
+               // 执行朗读
+               Dispatch.call(sapo, "Speak", new Variant(content));
+           } catch (Exception e) {
+               log.info("错误:", e);
+               e.printStackTrace();
+           } finally {
+               sapo.safeRelease();
+               sap.safeRelease();
+           }
+       } else {
+           // 停止
+           try {
+               Dispatch.call(sapo, "Speak", new Variant(content), new Variant(
+                       2));
+           } catch (Exception e) {
+               System.out.println(e.getMessage());
+               e.printStackTrace();
+           }
+       }
+   }
+
+
+    /**
+    *
+   * @Title: test
+   * @Description: 该方法的主要作用:执行朗读内容
+   * @return  返回类型:void
+   * @throws
+    */
+   public static void main(String[] args) {
+       VoiceUtil.stratVoice("桃之夭夭,灼灼其华。之子于归,宜其室家。\n" +
+               "桃之夭夭,有蕡其实。之子于归,宜其家室。\n" +
+               "桃之夭夭,其叶蓁蓁。之子于归,宜其家人", 0);
+   }
+
+
+}

+ 173 - 0
src/main/java/com/mtgg/utils/WechatUtils.java

@@ -0,0 +1,173 @@
+package com.mtgg.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.mtgg.bean.ConfigBean;
+import com.mtgg.common.Constant;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 微信开发组件
+ * 单例, 线程安全
+ *
+ * @author bostin.wang
+ * @date 2017-12-26
+ */
+@Slf4j
+public class WechatUtils {
+
+    @Autowired
+    private ConfigBean configBean;
+
+    public String getDriverBaseAccessToken() {
+        return getBaseAccessToken(appId, secret);
+    }
+
+    public JSONObject getDriverAuthAccessToken(String code) {
+        return getAuthAccessToken(code, appId, secret);
+    }
+
+    /**
+     * 获取jsapi调用的tickt
+     *
+     * @param accessToken
+     * @return
+     */
+    public String getJsapiTicket(String accessToken) {
+        if (StringUtils.isBlank(accessToken)) {
+            return null;
+        }
+        String reqUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("access_token", accessToken);
+        params.put("type", "jsapi");
+        try {
+//            String jsonStr = HttpUtils.sendGet(reqUrl, params);
+//            JSONObject data = JSONObject.parseObject(jsonStr);
+//            if (data != null) {
+//                if (data.getInteger("errcode") == 0) {
+//                    return data.getString("ticket");
+//                } else if (data.getInteger("errcode").equals(Constant.ACCESS_TOKEN_ERR)) {
+//                    System.out.println("access_token过期{}");
+//                    //使用这个返回值通知调用方token失效了
+//                    return Constant.ACCESS_TOKEN_INVALID;
+//                } else {
+//                    System.out.println("获取ticket异常");
+//                }
+//            }
+        } catch (Exception e) {
+            System.out.println("获取ticket异常");
+        }
+        return null;
+    }
+
+    /**
+     * 获取微信用户信息
+     *
+     * @param access_token
+     * @param openid
+     * @return
+     */
+    public JSONObject getWXUserInfo(String access_token, String openid) {
+        String reqUrl = "https://api.weixin.qq.com/sns/userinfo";
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("access_token", access_token);
+        params.put("openid", openid);
+        params.put("lang", "zh_CN");
+        try {
+//            String jsonStr = HttpUtils.sendGet(reqUrl, params);
+//            JSONObject data = JSONObject.parseObject(jsonStr);
+//            if (data != null) {
+//                if (data.containsKey("errcode")) {
+//                    System.out.println("获取userinfo异常");
+//                } else {
+//                    return data;
+//                }
+//            }
+        } catch (Exception e) {
+            System.out.println("获取snsapi_base异常");
+        }
+        return null;
+    }
+
+    /**
+     * 微信公众号基础access token
+     *
+     * @param appId
+     * @param appSecret
+     * @return
+     */
+    private String getBaseAccessToken(String appId, String appSecret) {
+        String reqUrl = "https://api.weixin.qq.com/cgi-bin/token";
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("grant_type", "client_credential");
+        params.put("appid", appId);
+        params.put("secret", appSecret);
+        try {
+//            String jsonStr = HttpUtils.sendGet(reqUrl, params);
+//            JSONObject data = JSONObject.parseObject(jsonStr);
+//            if (data != null) {
+//                if (data.containsKey("errcode")) {
+//                    System.out.println("accesstoken");
+//                } else {
+//                    return data.getString("access_token");
+//                }
+//            }
+        } catch (Exception e) {
+            System.out.println("accesstoken");
+        }
+        return null;
+    }
+
+    /**
+     * 根据微信网页授权code,获取openid,access_token(网页授权接口调用凭证)等
+     *
+     * @param code
+     * @return
+     */
+    private JSONObject getAuthAccessToken(String code, String appId, String appSecret) {
+        String reqUrl = "https://api.weixin.qq.com/sns/oauth2/access_token";
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("code", code);
+        params.put("appid", appId);
+        params.put("secret", appSecret);
+        params.put("grant_type", "authorization_code");
+        try {
+//            String jsonStr = HttpUtils.sendGet(reqUrl, params);
+//            JSONObject data = JSONObject.parseObject(jsonStr);
+//            log.info("获取openid信息返回:{}",data);
+//            if (data != null) {
+//                if (data.containsKey("errcode")) {
+//                    log.info("获取snsapi_base异常");
+//                } else {
+//                    return data;
+//                }
+//            }
+        } catch (Exception e) {
+            log.info("获取snsapi_base异常");
+        }
+        return null;
+    }
+
+
+    private WechatUtils() {
+        appId = configBean.getWxAppId();
+        secret = configBean.getWxSecret();
+    }
+
+    private static class SingletonInstance {
+        private static final WechatUtils INSTANCE = new WechatUtils();
+    }
+
+    public static WechatUtils getInstance() {
+        return SingletonInstance.INSTANCE;
+    }
+
+    private String appId;
+    private String secret;
+
+}

+ 90 - 0
src/main/java/com/mtgg/utils/voice/ConnUtil.java

@@ -0,0 +1,90 @@
+package com.mtgg.utils.voice;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.URLEncoder;
+
+/**
+ * 与连接相关的Util类
+ */
+public class ConnUtil {
+
+    /**
+     * UrlEncode, UTF-8 编码
+     *
+     * @param str 原始字符串
+     * @return
+     */
+    public static String urlEncode(String str) {
+        String result = null;
+        try {
+            result = URLEncoder.encode(str, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    /**
+     * 从HttpURLConnection 获取返回的字符串
+     *
+     * @param conn
+     * @return
+     * @throws IOException
+     * @throws DemoException
+     */
+    public static String getResponseString(HttpURLConnection conn) throws IOException, DemoException {
+        return new String(getResponseBytes(conn));
+    }
+
+    /**
+     * 从HttpURLConnection 获取返回的bytes
+     * 注意 HttpURLConnection自身问题, 400类错误,会直接抛出异常。不能获取conn.getInputStream();
+     *
+     * @param conn
+     * @return
+     * @throws IOException   http请求错误
+     * @throws DemoException http 的状态码不是 200
+     */
+    public static byte[] getResponseBytes(HttpURLConnection conn) throws IOException, DemoException {
+        int responseCode = conn.getResponseCode();
+        if (responseCode != 200) {
+            System.err.println("http 请求返回的状态码错误,期望200, 当前是 " + responseCode);
+            if (responseCode == 401) {
+                System.err.println("可能是appkey appSecret 填错");
+            }
+            throw new DemoException("http response code is" + responseCode);
+        }
+
+        InputStream inputStream = conn.getInputStream();
+        byte[] result = getInputStreamContent(inputStream);
+        return result;
+    }
+
+    /**
+     * 将InputStream内的内容全部读取,作为bytes返回
+     *
+     * @param is
+     * @return
+     * @throws IOException @see InputStream.read()
+     */
+    public static byte[] getInputStreamContent(InputStream is) throws IOException {
+        byte[] b = new byte[1024];
+        // 定义一个输出流存储接收到的数据
+        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        // 开始接收数据
+        int len = 0;
+        while (true) {
+            len = is.read(b);
+            if (len == -1) {
+                // 数据读完
+                break;
+            }
+            byteArrayOutputStream.write(b, 0, len);
+        }
+        return byteArrayOutputStream.toByteArray();
+    }
+}

+ 10 - 0
src/main/java/com/mtgg/utils/voice/DemoException.java

@@ -0,0 +1,10 @@
+package com.mtgg.utils.voice;
+
+/**
+ * DEMO自带的Exception
+ */
+public class DemoException extends Exception {
+    public DemoException(String message) {
+        super(message);
+    }
+}

+ 122 - 0
src/main/java/com/mtgg/utils/voice/TokenHolder.java

@@ -0,0 +1,122 @@
+package com.mtgg.utils.voice;
+
+import lombok.extern.slf4j.Slf4j;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+/**
+ * token的获取类
+ * 将apiKey和secretKey换取token,注意有效期保存在expiresAt
+ */
+@Slf4j
+public class TokenHolder {
+
+
+    public static final String ASR_SCOPE = "audio_voice_assistant_get";
+
+    public static final String TTS_SCOPE = "audio_tts_post";
+
+    /**
+     * URL , Token的url,http可以改为https
+     */
+    private static final String URL = "http://openapi.baidu.com/oauth/2.0/token";
+
+    /**
+     * asr的权限 scope 是  "audio_voice_assistant_get"
+     * tts 的权限 scope 是 "audio_tts_post"
+     */
+    private String scope;
+
+    /**
+     * 网页上申请语音识别应用获取的apiKey
+     */
+    private String apiKey;
+
+    /**
+     * 网页上申请语音识别应用获取的secretKey
+     */
+    private String secretKey;
+
+    /**
+     * 保存访问接口获取的token
+     */
+    private String token;
+
+    /**
+     * 当前的时间戳,毫秒
+     */
+    private long expiresAt;
+
+    /**
+     * @param apiKey    网页上申请语音识别应用获取的apiKey
+     * @param secretKey 网页上申请语音识别应用获取的secretKey
+     */
+    public TokenHolder(String apiKey, String secretKey, String scope) {
+        this.apiKey = apiKey;
+        this.secretKey = secretKey;
+        this.scope = scope;
+    }
+
+    /**
+     * 获取token,refresh 方法后调用有效
+     *
+     * @return
+     */
+    public String getToken() {
+        return token;
+    }
+
+    /**
+     * 获取过期时间,refresh 方法后调用有效
+     *
+     * @return
+     */
+    public long getExpiresAt() {
+        return expiresAt;
+    }
+    /**
+     * 获取token
+     *
+     * @return
+     * @throws IOException   http请求错误
+     * @throws DemoException http接口返回不是 200, access_token未获取
+     */
+    public void refresh() throws IOException, DemoException, JSONException {
+        String getTokenURL = URL + "?grant_type=client_credentials"
+                + "&client_id=" + ConnUtil.urlEncode(apiKey) + "&client_secret=" + ConnUtil.urlEncode(secretKey);
+
+        // 打印的url出来放到浏览器内可以复现
+        log.info("token URL:" + getTokenURL);
+        URL urlconn = new URL(getTokenURL);
+        HttpURLConnection conn = (HttpURLConnection) urlconn.openConnection();
+        conn.setConnectTimeout(5000);
+        String result = ConnUtil.getResponseString(conn);
+        log.info("Token result json:" + result);
+        parseJson(result);
+    }
+
+    /**
+     * @param result token接口获得的result
+     * @throws DemoException
+     */
+    private void parseJson(String result) throws DemoException, JSONException {
+        JSONObject json = new JSONObject(result);
+        if (!json.has("access_token")) {
+            // 返回没有access_token字段
+            throw new DemoException("access_token not obtained, " + result);
+        }
+        if (!json.has("scope")) {
+            // 返回没有scope字段
+            throw new DemoException("scope not obtained, " + result);
+        }
+        if (!json.getString("scope").contains(scope)) {
+            throw new DemoException("scope not exist, " + scope + "," + result);
+        }
+        token = json.getString("access_token");
+        expiresAt = System.currentTimeMillis() + json.getLong("expires_in") * 1000;
+    }
+}

+ 126 - 0
src/main/java/com/mtgg/utils/voice/TtsMain.java

@@ -0,0 +1,126 @@
+package com.mtgg.utils.voice;
+
+import lombok.extern.slf4j.Slf4j;
+import org.json.JSONException;
+import sun.audio.AudioPlayer;
+import sun.audio.AudioStream;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+/**
+ * @Author: MTGG
+ * @Date: 15:04 2018/7/19
+ * @Describe:
+ */
+@Slf4j
+public class TtsMain {
+
+    //  填写网页上申请的appkey 如 $apiKey="g8eBUMSokVB1BHGmgxxxxxx"
+    private final String appKey = "xx";
+    // 填写网页上申请的APP SECRET 如 $secretKey="94dc99566550d87f8fa8ece112xxxxx"
+    private final String secretKey = "xx";
+    // text 的内容为"欢迎使用百度语音合成"的urlencode,utf-8 编码
+    // 可以百度搜索"urlencode"
+    private final String text = "您有入账哦,请注意查收!";
+    // 发音人选择, 0为普通女声,1为普通男生,3为情感合成-度逍遥,4为情感合成-度丫丫,默认为普通女声
+    private final int per = 0;
+    // 语速,取值0-15,默认为5中语速
+    private final int spd = 4;
+    // 音调,取值0-15,默认为5中语调
+    private final int pit = 5;
+    // 音量,取值0-9,默认为5中音量
+    private final int vol = 6;
+    // 下载的文件格式, 3:mp3(default) 4: pcm-16k 5: pcm-8k 6. wav
+    private final int aue = 6;
+    public final String url = "http://tsn.baidu.com/text2audio"; // 可以使用https
+    private final String cuid = "1234567JAVA";
+
+    public String voiceRun(HttpServletRequest request){
+        try {
+            TokenHolder holder = new TokenHolder(appKey, secretKey, TokenHolder.ASR_SCOPE);
+            holder.refresh();
+            String token = holder.getToken();
+            // 此处2次urlencode, 确保特殊字符被正确编码
+            String params = "tex=" + ConnUtil.urlEncode(ConnUtil.urlEncode(text));
+            params += "&per=" + per;
+            params += "&spd=" + spd;
+            params += "&pit=" + pit;
+            params += "&vol=" + vol;
+            params += "&cuid=" + cuid;
+            params += "&tok=" + token;
+            params += "&aue=" + aue;
+            params += "&lan=zh&ctp=1";
+            log.info("反馈请带上此url,浏览器上可以测试:{}", url + "?" + params); // 反馈请带上此url,浏览器上可以测试
+            HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
+            conn.setDoInput(true);
+            conn.setDoOutput(true);
+            conn.setConnectTimeout(5000);
+            PrintWriter printWriter = new PrintWriter(conn.getOutputStream());
+            printWriter.write(params);
+            printWriter.close();
+            String contentType = conn.getContentType();
+            if (contentType.contains("audio/")) {
+                byte[] bytes = ConnUtil.getResponseBytes(conn);
+                String format = getFormat(aue);
+                // 第二种:获取项目路径
+                File directory = new File("");// 参数为空
+                String path = request.getSession().getServletContext().getRealPath("/");
+                System.out.println(path);
+                File file = new File(path + "result." + format); // 打开mp3文件即可播放
+                FileOutputStream os = new FileOutputStream(file);
+                os.write(bytes);
+                os.close();
+                log.info("存储路径:{}", file.getAbsolutePath());
+//                boolean ret = voiceStart(format);
+//                log.info("播放结果:{}", ret);
+                return "success";
+            } else {
+                System.err.println("ERROR: content-type= " + contentType);
+                String res = ConnUtil.getResponseString(conn);
+                System.err.println(res);
+                return null;
+            }
+        }catch (Exception e){
+            return null;
+        }
+    }
+
+    // 下载的文件格式, 3:mp3(default) 4: pcm-16k 5: pcm-8k 6. wav
+    private String getFormat(int aue) {
+        String[] formats = {"mp3", "pcm", "pcm", "wav"};
+        return formats[aue - 3];
+    }
+
+    /**
+     * @Author: MTGG
+     * @Date: 22:57 2018/7/23
+     * @Describe: 播放wav文件
+     */
+    public static boolean voiceStart(String format) {
+        try {
+            log.info("播放开始,{}", System.getProperty("user.dir"));
+            // 1.wav 文件放在java project 下面 即可播放
+            FileInputStream fileau = new FileInputStream(
+                    System.getProperty("user.dir") + "\\result." + format);
+            AudioStream as = null;
+            as = new AudioStream(fileau);
+            AudioPlayer.player.start(as);
+            return true;
+        } catch (IOException e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    public static void main(String[] args) {
+//        try {
+//            (new TtsMain()).voiceRun();
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+    }
+
+}

+ 35 - 0
src/main/resources/application.yml

@@ -0,0 +1,35 @@
+spring:
+  datasource:
+    url: jdbc:mysql://xxx?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
+    driver-class-name: com.mysql.jdbc.Driver
+    username: xx
+    password: xxx
+    initial-size: 1
+    min-idle: 1
+    max-active: 20
+    test-on-borrow: true
+    max-wait: 6000
+    time-between-eviction-runs-millis: 300000
+    min-evictable-idle-time-millis: 1800000
+    validation-query: SELECT 1 FROM DUAL
+    test-While-Idle: true
+    test-on-return: false
+    pool-prepared-statements: false
+    max-pool-prepared-statement-per-connection-size: 20
+    filters: stat,wall,log4j,config
+
+#server:
+#  port: 8080
+#  session-timeout: 30
+#  tomcat:
+#    max-threads: 0
+#    uri-encoding: utf-8
+
+mybatis:
+  type-aliases-package: com.mtgg.bean
+  mapper-locations: classpath:mapper/*.xml
+logging:
+  level:
+    com.mtgg.dao:info
+
+

+ 25 - 0
src/main/resources/log4j.properties

@@ -0,0 +1,25 @@
+# LOG4J配置
+log4j.rootCategory=INFO,stdout,app,file
+
+#mybatis配置
+log4j.logger.org.springframework=INFO
+log4j.logger.com.mchange=ERROR
+log4j.logger.org.mybatis=ERROR
+log4j.logger.org.apache.ibatis=ERROR
+log4j.logger.com.mtgg=debug
+
+#console
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target = System.out
+log4j.appender.stdout.Encoding=UTF-8
+log4j.appender.stdout.Threshold = DEBUG
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} %F(Line:%L) - %m%n
+
+log4j.appender.app = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.app.Encoding=UTF-8
+log4j.appender.app.File = /data/logs/JHS/app.log
+log4j.appender.app.Append = true
+log4j.appender.app.Threshold = DEBUG
+log4j.appender.app.layout = org.apache.log4j.PatternLayout
+log4j.appender.app.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} %F(Line:%L) - %m%n

+ 32 - 0
src/main/resources/mapper/AMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.mtgg.dao.AMapper">
+    <resultMap id="BaseResultMap" type="com.mtgg.bean.ADTO" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="age" property="age" jdbcType="INTEGER" />
+    </resultMap>
+    <sql id="Base_Column_List">
+        id,name,age
+    </sql>
+
+    <select id="geta" resultMap="BaseResultMap">
+        select <include refid="Base_Column_List" />
+        from mt_a limit #{pageNum} , #{pageSize}
+    </select>
+
+    <select id="getCount" resultType="java.lang.Integer">
+        SELECT count(*) from mt_a
+    </select>
+
+    <select id="getOne" resultType="java.lang.Long">
+        SELECT driver_id from mgo_driver_app;
+    </select>
+    <update id="updateById" >
+        update mgo_driver_app set cid = 'aaa' where driver_id = 12
+    </update>
+
+    <insert id="insert" >
+        insert into mgo_driver_app(11,'23432','sldkfjlwe',0,'l2k3','ljksd1',now())
+    </insert>
+</mapper>

+ 102 - 0
src/main/resources/mapper/batisMapper.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.mtgg.dao.BatisMapper">
+    <resultMap id="BaseResultMap" type="com.mtgg.entity.MtRecordPO" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="username" property="username" jdbcType="VARCHAR" />
+        <result column="money" property="money" jdbcType="INTEGER" />
+        <result column="status" property="status" jdbcType="TINYINT" />
+        <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
+        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,username,money,status,add_time,update_time
+    </sql>
+
+    <select id="getCount" resultType="java.lang.Integer">
+        select count(*) from mt_jhs
+    </select>
+
+    <select id="getTotalMoney" resultType="java.lang.Integer">
+        select sum(money) from mt_jhs
+    </select>
+
+    <select id="getList" resultMap="BaseResultMap" parameterType="com.mtgg.utils.PageDataDTO">
+        SELECT <include refid="Base_Column_List" />
+        from mt_jhs order by add_time desc
+    </select>
+
+    <select id="getCountByStatus" resultType="java.lang.Integer">
+        select count(*) from mt_jhs where status = 0;
+    </select>
+
+    <select id="getByOrderSn" parameterType="java.lang.String">
+        select
+        <include refid="Base_Column_List" />
+        from mt_jhs where order_sn = #{orderSn, jdbcType=VARCHAR}
+    </select>
+
+    <insert id="insertSelective" parameterType="com.mtgg.entity.MtRecordPO">
+        insert into mt_jhs
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="username != null" >
+                username,
+            </if>
+            <if test="money != null" >
+                money,
+            </if>
+            <if test="status != null" >
+                status,
+            </if>
+            <if test="orderSn != null" >
+                order_sn,
+            </if>
+            <if test="payOrderSn != null" >
+                pay_order_sn,
+            </if>
+            <if test="addTime != null" >
+                add_time,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="username != null" >
+                #{username,jdbcType=VARCHAR},
+            </if>
+            <if test="money != null" >
+                #{money,jdbcType=INTEGER},
+            </if>
+            <if test="status != null" >
+                #{status,jdbcType=TINYINT},
+            </if>
+            <if test="orderSn != null" >
+                #{orderSn,jdbcType=VARCHAR},
+            </if>
+            <if test="payOrderSn != null" >
+                #{payOrderSn,jdbcType=VARCHAR},
+            </if>
+            <if test="addTime != null" >
+                #{addTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateById" parameterType="com.mtgg.entity.MtRecordPO" >
+        update mt_jhs
+        <set >
+            <if test="username != null" >
+                username = #{username,jdbcType=VARCHAR},
+            </if>
+            <if test="money != null" >
+                money = #{money,jdbcType=INTEGER},
+            </if>
+            <if test="status != null" >
+                status = #{status,jdbcType=TINYINT},
+            </if>
+            <if test="addTime != null" >
+                add_time = #{addTime,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+</mapper>

Файловите разлики са ограничени, защото са твърде много
+ 14 - 0
src/main/resources/source/config.properties


+ 22 - 0
src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://java.sun.com/xml/ns/javaee"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+         version="3.0">
+  <filter>
+    <filter-name>characterEncodingFilter</filter-name>
+    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
+    <init-param>
+      <param-name>encoding</param-name>
+      <param-value>UTF-8</param-value>
+    </init-param>
+    <init-param>
+      <param-name>forceEncoding</param-name>
+      <param-value>true</param-value>
+    </init-param>
+  </filter>
+  <filter-mapping>
+    <filter-name>characterEncodingFilter</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+</web-app>

+ 97 - 0
src/main/webapp/content/PayList.html

@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <title>列表</title>
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta http-equiv="Pragma" content="no-cache">
+    <meta http-equiv="Cache-Control" content="no-cache">
+    <meta http-equiv="Expires" content="0">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <link rel="stylesheet" href="../css/bootstap/bootstrap.min.css"/>
+    <link rel="stylesheet" href="../css/bootstap/bootstrap-responsive.min.css"/>
+    <link rel="stylesheet" href="../css/bootstap/jquery-ui.css"/>
+    <link rel="stylesheet" href="../css/bootstap/uniform.css"/>
+    <link rel="stylesheet" href="../css/bootstap/select2.css"/>
+    <link rel="stylesheet" href="../css/bootstap/unicorn.main.css"/>
+    <link rel="stylesheet" href="../css/bootstap/unicorn.grey.css" class="skin-color"/>
+</head>
+<body>
+<div class="container-fluid">
+    <div class="widget-box">
+        <div class="widget-title">
+            <h5>支付列表(点击V可倒序查看)</h5>
+        </div>
+        <div class="widget-content nopadding">
+            <table id="ta" class="table table-bordered table-striped table-hover data-table">
+                <thead>
+                <tr>
+                    <th>处理状态</th>
+                    <th>账户V</th>
+                    <th>支付金额V</th>
+                    <th>支付时间V</th>
+                    <th>记录id</th>
+                </tr>
+                </thead>
+                <tbody id="listBody">
+
+                </tbody>
+            </table>
+        </div>
+        <div class="modal-footer"></div>
+    </div>
+</div>
+<div id="emb"></div>
+
+
+<script src="../js/bootstap/jquery.min.js"></script>
+<script src="../js/bootstap/jquery.ui.custom.js"></script>
+<script src="../js/bootstap/bootstrap.min.js"></script>
+<script src="../js/bootstap/jquery-uniform.js"></script>
+<script src="../js/bootstap/select2.min.js"></script>
+<script src="../js/bootstap/jquery.dataTables.min.js"></script>
+<script src="../js/bootstap/unicorn.js"></script>
+<script src="../js/bootstap/unicorn.tables.js"></script>
+<script>
+    function myrefresh() {
+        $.ajax({
+            type: "GET",
+            url: "/JHS/server/status",
+            dataType: "json",
+            data: "",
+            success: function (data) {
+                var res = data.res;
+                if (res != 0) {
+                    //有数据,语音提醒
+                    var data = "<embed id=\"wavFileId\"\n" +
+                        "       src=\"/JHS/result.wav\"\n" +
+                        "       width=\"0\"\n" +
+                        "       height=\"0\"\n" +
+                        "       loop=\"false\"\n" +
+                        "       autostart=\"false\">\n" +
+                        "</embed>";
+                    $('#emb').html(data);
+                    console.log("语音提醒")
+                    try {
+                        var node = document.getElementById('wavFileId');
+                        if(node!=null){
+                            node.Play();
+                        }
+                    } catch (err) {
+                        console.log("err->" + err)
+                    }
+                }
+                setTimeout('myrefresh()', 5000); //指定5秒刷新一次
+            },
+            error: function () {
+                setTimeout('myrefresh()', 5000); //指定5秒刷新一次
+            }
+        });
+    }
+    setTimeout('myrefresh()', 5000);
+</script>
+</body>
+</html>

+ 91 - 0
src/main/webapp/content/login.html

@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <title>登陆</title>
+    <meta charset="UTF-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <link rel="stylesheet" href="../css/bootstap/bootstrap.min.css"/>
+    <link rel="stylesheet" href="../css/bootstap/bootstrap-responsive.min.css"/>
+    <link rel="stylesheet" href="../css/bootstap/unicorn.login.css"/>
+</head>
+<body>
+<div id="logo">
+
+</div>
+<div id="loginbox">
+    <form id="loginform" class="form-vertical" action="index.html">
+        <p>请输入用户名密码</p>
+        <div class="control-group">
+            <div class="controls">
+                <div class="input-prepend">
+                    <span class="add-on"><i class="icon-user"></i></span><input type="text" id="name"
+                                                                                placeholder="Username"/>
+                </div>
+            </div>
+        </div>
+        <div class="control-group">
+            <div class="controls">
+                <div class="input-prepend">
+                    <span class="add-on"><i class="icon-lock"></i></span><input type="password" id="pwd"
+                                                                                placeholder="Password"/>
+                </div>
+            </div>
+        </div>
+        <div class="form-actions">
+            <span class="pull-left">黑暗与光明的门户</span>
+            <span class="pull-right"><input type="button" class="btn btn-inverse" value="登陆" onclick="login()"/></span>
+        </div>
+
+    </form>
+</div>
+
+<script src="../js/bootstap/jquery.min.js"></script>
+<script src="../js/bootstap/unicorn.login.js"></script>
+<script>
+    //可以在login的时候生成一次wav
+    toFile();
+    function toFile() {
+        $.ajax({
+            type: "POST",
+            url: "/JHS/server/file",
+            dataType: "json",
+            data: "",
+            success: function (data) {
+            },
+            error: function () {
+                console.log("error------")
+            }
+        });
+    }
+
+    function login() {
+        var account = document.getElementById('name').value;
+        var pwd = document.getElementById('pwd').value;
+        if (account == null || account == '') {
+            return
+        }
+        if (pwd == null || pwd == '') {
+            return
+        }
+        $.ajax({
+            type: "POST",
+            url: "/JHS/server/login",
+            dataType: "json",
+            data: {"name": account, "pwd": pwd},
+            /* id为参数名,id_1为参数值,多个参数用","隔开
+            先清空标签,然后再赋值,如果不清空会叠加 */
+            success: function (data) {
+                if (!data) {
+                    alert("用户名或密码错误")
+                    return;
+                }
+                window.location.href = "PayList.html";
+            },
+            error: function () {
+                alert("请刷新重试!");
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 18 - 0
src/main/webapp/content/pay.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
+    <meta charset="UTF-8">
+    <title>支付</title>
+    <link rel="stylesheet"
+          href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
+    <link rel="stylesheet"
+          href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
+    <link rel="stylesheet" href="#(ctxPath)/static/css/demos.css">
+    <script id="script" src="/JHS/js/utils/require.min.js" defer async="true"
+            require-module="/JHS/js/html/pay.js" data-main="/JHS/js/utils/config"></script>
+</head>
+<body>
+</body>
+</html>

+ 46 - 0
src/main/webapp/content/test.html

@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>test</title>
+    <link rel="stylesheet"
+          href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
+    <link rel="stylesheet"
+          href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
+    <link rel="stylesheet" href="#(ctxPath)/static/css/demos.css">
+    <script id="script" src="/JHS/js/utils/require.min.js" defer async="true"
+            require-module="/JHS/js/html/test.js" data-main="/JHS/js/utils/config"></script>
+    <script src="../js/bootstap/jquery.min.js"></script>
+</head>
+<body>
+    <h1><a href="#" id="testA">怒发冲冠凭栏处</a> </h1>
+
+    <embed id="wavFileId"
+           src="/JHS/result.wav"
+           width="0"
+           height="0"
+           loop="false"
+           autostart="true">
+    </embed>
+
+    <script type="text/javascript">
+        playSound();
+        function playSound()
+        {
+            var node=document.getElementById('wavFileId');
+            if(node!=null)
+            {
+                node.Play();
+            }
+        }
+    </script>
+    <!--<script type="text/javascript">-->
+        <!--var zhText = "我很高兴,你是最棒的!";-->
+        <!--zhText = encodeURI(zhText);-->
+        <!--document.write("<audio autoplay=\"autoplay\">");-->
+        <!--document.write("<source src=\"http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=4&text="+ zhText +"\" type=\"audio/mpeg\">");-->
+        <!--document.write("<embed height=\"0\" width=\"0\" src=\"http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&per=0&spd=2&pit=5&vol=6&aue=6&text="+ zhText +"\">");-->
+        <!--document.write("</audio>");-->
+    <!--</script>-->
+</body>
+</html>

Файловите разлики са ограничени, защото са твърде много
+ 9 - 0
src/main/webapp/css/bootstap/bootstrap-responsive.min.css


Файловите разлики са ограничени, защото са твърде много
+ 9 - 0
src/main/webapp/css/bootstap/bootstrap.min.css


Файловите разлики са ограничени, защото са твърде много
+ 1614 - 0
src/main/webapp/css/bootstap/jquery-ui.css


+ 525 - 0
src/main/webapp/css/bootstap/select2.css

@@ -0,0 +1,525 @@
+/*
+Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
+*/
+.select2-container {
+    position: relative;
+    display: inline-block;
+    /* inline-block for ie7 */
+    zoom: 1;
+    *display: inline;
+    vertical-align: top;
+}
+
+.select2-container,
+.select2-drop,
+.select2-search,
+.select2-search input{
+  /*
+    Force border-box so that % widths fit the parent
+    container without overlap because of margin/padding.
+
+    More Info : http://www.quirksmode.org/css/box.html
+  */
+  -moz-box-sizing: border-box;    /* firefox */
+  -ms-box-sizing: border-box;     /* ie */
+  -webkit-box-sizing: border-box; /* webkit */
+  -khtml-box-sizing: border-box;  /* konqueror */
+  box-sizing: border-box;         /* css3 */
+}
+
+.select2-container .select2-choice {
+    background-color: #fff;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
+    background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
+    background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
+    background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
+    background-image: -ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#ffffff', GradientType = 0);
+    background-image: linear-gradient(top, #eeeeee 0%, #ffffff 50%);
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+    -moz-background-clip: padding;
+    -webkit-background-clip: padding-box;
+    background-clip: padding-box;
+    border: 1px solid #aaa;
+    display: block;
+    overflow: hidden;
+    white-space: nowrap;
+    position: relative;
+    height: 26px;
+    line-height: 26px;
+    padding: 0 0 0 8px;
+    color: #444;
+    text-decoration: none;
+}
+
+.select2-container.select2-drop-above .select2-choice
+{
+    border-bottom-color: #aaa;
+    -webkit-border-radius:0px 0px 4px 4px;
+    -moz-border-radius:0px 0px 4px 4px;
+    border-radius:0px 0px 4px 4px;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
+    background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
+    background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
+    background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
+    background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
+    background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
+}
+
+.select2-container .select2-choice span {
+    margin-right: 26px;
+    display: block;
+    overflow: hidden;
+    white-space: nowrap;
+    -o-text-overflow: ellipsis;
+    -ms-text-overflow: ellipsis;
+    text-overflow: ellipsis;
+}
+
+.select2-container .select2-choice abbr {
+  display: block;
+  position: absolute;
+  right: 26px;
+  top: 8px;
+  width: 12px;
+  height: 12px;
+  font-size: 1px;
+  background: url('../img/select2.png') right top no-repeat;
+  cursor: pointer;
+  text-decoration: none;
+  border:0;
+  outline: 0;
+}
+.select2-container .select2-choice abbr:hover {
+  background-position: right -11px;
+  cursor: pointer;
+}
+
+.select2-drop {
+    background: #fff;
+    color: #000;
+    border: 1px solid #aaa;
+    border-top: 0;
+    position: absolute;
+    top: 100%;
+    -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+    -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+    -o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+    box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+    z-index: 9999;
+    width:100%;
+    margin-top:-1px;
+
+  -webkit-border-radius: 0 0 4px 4px;
+  -moz-border-radius: 0 0 4px 4px;
+  border-radius: 0 0 4px 4px;
+}
+
+.select2-drop.select2-drop-above {
+    -webkit-border-radius: 4px 4px 0px 0px;
+    -moz-border-radius: 4px 4px 0px 0px;
+    border-radius: 4px 4px 0px 0px;
+    margin-top:1px;
+    border-top: 1px solid #aaa;
+    border-bottom: 0;
+
+    -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+    -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+    -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+    box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+}
+
+.select2-container .select2-choice div {
+    -webkit-border-radius: 0 4px 4px 0;
+    -moz-border-radius: 0 4px 4px 0;
+    border-radius: 0 4px 4px 0;
+    -moz-background-clip: padding;
+    -webkit-background-clip: padding-box;
+    background-clip: padding-box;
+    background: #ccc;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
+    background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
+    background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
+    background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
+    background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#cccccc', endColorstr = '#eeeeee', GradientType = 0);
+    background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
+    border-left: 1px solid #aaa;
+    position: absolute;
+    right: 0;
+    top: 0;
+    display: block;
+    height: 100%;
+    width: 18px;
+}
+
+.select2-container .select2-choice div b {
+    background: url('../img/select2.png') no-repeat 0 1px;
+    display: block;
+    width: 100%;
+    height: 100%;
+}
+
+.select2-search {
+  display: inline-block;
+    white-space: nowrap;
+    z-index: 10000;
+  min-height: 26px;
+  width: 100%;
+  margin: 0;
+  padding-left: 4px;
+  padding-right: 4px;
+}
+
+.select2-search-hidden {
+  display: block;
+  position: absolute;
+  left: -10000px;
+}
+
+.select2-search input {
+    background: #fff url('../img/select2.png') no-repeat 100% -22px;
+    background: url('../img/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
+    background: url('../img/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('../img/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('../img/select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
+    background: url('../img/select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+    background: url('../img/select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+    padding: 4px 20px 4px 5px;
+    outline: 0;
+    border: 1px solid #aaa;
+    font-family: sans-serif;
+    font-size: 1em;
+    width:100%;
+    margin:0;
+    height:auto !important;
+    min-height: 26px;
+    -webkit-box-shadow: none;
+    -moz-box-shadow: none;
+    box-shadow: none;
+    border-radius: 0;
+    -moz-border-radius: 0;
+    -webkit-border-radius: 0;
+}
+
+.select2-drop.select2-drop-above .select2-search input
+{
+    margin-top:4px;
+}
+
+.select2-search input.select2-active {
+    background: #fff url('../img/spinner.gif') no-repeat 100%;
+    background: url('../img/spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
+    background: url('../img/spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('../img/spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('../img/spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
+    background: url('../img/spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+    background: url('../img/spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+}
+
+
+.select2-container-active .select2-choice,
+.select2-container-active .select2-choices {
+    -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
+    -moz-box-shadow   : 0 0 5px rgba(0,0,0,.3);
+    -o-box-shadow     : 0 0 5px rgba(0,0,0,.3);
+    box-shadow        : 0 0 5px rgba(0,0,0,.3);
+    border: 1px solid #5897fb;
+    outline: none;
+}
+
+.select2-dropdown-open .select2-choice {
+  border: 1px solid #aaa;
+  border-bottom-color: transparent;
+  -webkit-box-shadow: 0 1px 0 #fff inset;
+  -moz-box-shadow   : 0 1px 0 #fff inset;
+  -o-box-shadow     : 0 1px 0 #fff inset;
+  box-shadow        : 0 1px 0 #fff inset;
+  background-color: #eee;
+  background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
+  background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
+  background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
+  background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
+  background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
+  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
+  background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
+  -webkit-border-bottom-left-radius : 0;
+  -webkit-border-bottom-right-radius: 0;
+  -moz-border-radius-bottomleft : 0;
+  -moz-border-radius-bottomright: 0;
+  border-bottom-left-radius : 0;
+  border-bottom-right-radius: 0;
+}
+
+.select2-dropdown-open .select2-choice div {
+  background: transparent;
+  border-left: none;
+}
+.select2-dropdown-open .select2-choice div b {
+  background-position: -18px 1px;
+}
+
+/* results */
+.select2-results {
+  margin: 4px 4px 4px 0;
+  padding: 0 0 0 4px;
+  position: relative;
+  overflow-x: hidden;
+  overflow-y: auto;
+  max-height: 200px;
+}
+
+.select2-results ul.select2-result-sub {
+  margin: 0 0 0 0;
+}
+
+.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
+.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
+
+.select2-results li {
+  list-style: none;
+  display: list-item;
+}
+
+.select2-results li.select2-result-with-children > .select2-result-label {
+  font-weight: bold;
+}
+
+.select2-results .select2-result-label {
+  padding: 3px 7px 4px;
+  margin: 0;
+  cursor: pointer;
+}
+
+.select2-results .select2-highlighted {
+  background: #3875d7;
+  color: #fff;
+}
+.select2-results li em {
+  background: #feffde;
+  font-style: normal;
+}
+.select2-results .select2-highlighted em {
+  background: transparent;
+}
+.select2-results .select2-no-results,
+.select2-results .select2-searching,
+.select2-results .select2-selection-limit {
+  background: #f4f4f4;
+  display: list-item;
+}
+
+/*
+disabled look for already selected choices in the results dropdown
+.select2-results .select2-disabled.select2-highlighted {
+    color: #666;
+    background: #f4f4f4;
+    display: list-item;
+    cursor: default;
+}
+.select2-results .select2-disabled {
+  background: #f4f4f4;
+  display: list-item;
+  cursor: default;
+}
+*/
+.select2-results .select2-disabled {
+    display: none;
+}
+
+.select2-more-results.select2-active {
+    background: #f4f4f4 url('../img/spinner.gif') no-repeat 100%;
+}
+
+.select2-more-results {
+  background: #f4f4f4;
+  display: list-item;
+}
+
+/* disabled styles */
+
+.select2-container.select2-container-disabled .select2-choice {
+    background-color: #f4f4f4;
+    background-image: none;
+    border: 1px solid #ddd;
+    cursor: default;
+}
+
+.select2-container.select2-container-disabled .select2-choice div {
+    background-color: #f4f4f4;
+    background-image: none;
+    border-left: 0;
+}
+
+
+/* multiselect */
+
+.select2-container-multi .select2-choices {
+    background-color: #fff;
+      background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
+      background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+      background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+      background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+      background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+      background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+      border: 1px solid #ccc;
+      margin: 0;
+      padding: 0;
+      cursor: text;
+      overflow: hidden;
+      height: auto !important;
+      height: 1%;
+      position: relative;
+      border-radius: 3px;
+}
+
+.select2-container-multi .select2-choices {
+    min-height: 26px;
+}
+
+.select2-container-multi.select2-container-active .select2-choices {
+    -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6);
+    -moz-box-shadow   : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6);
+    -o-box-shadow     : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6);
+    box-shadow        : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6);
+    border: 1px solid #5897fb;
+    outline: none;
+}
+.select2-container-multi .select2-choices li {
+  float: left;
+  list-style: none;
+}
+.select2-container-multi .select2-choices .select2-search-field {
+  white-space: nowrap;
+  margin: 0;
+  padding: 0;
+}
+
+.select2-container-multi .select2-choices .select2-search-field input {
+  color: #666;
+  background: transparent !important;
+  font-family: sans-serif;
+  font-size: 100%;
+  height: 15px;
+  padding: 5px;
+  margin: 1px 0;
+  outline: 0;
+  border: 0;
+  -webkit-box-shadow: none;
+  -moz-box-shadow   : none;
+  -o-box-shadow     : none;
+  box-shadow        : none;
+}
+
+.select2-container-multi .select2-choices .select2-search-field input.select2-active {
+    background: #fff url('../img/spinner.gif') no-repeat 100% !important;
+}
+
+.select2-default {
+  color: #999 !important;
+}
+
+.select2-container-multi .select2-choices .select2-search-choice {
+  -webkit-border-radius: 3px;
+  -moz-border-radius   : 3px;
+  border-radius        : 3px;
+  -moz-background-clip   : padding;
+  -webkit-background-clip: padding-box;
+  background-clip        : padding-box;
+  background-color: #e4e4e4;
+  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
+  background-image: -webkit-gradient(linear, 0% 0%, 0% 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: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+  background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+  -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
+  -moz-box-shadow   : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
+  box-shadow        : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
+  color: #333;
+  border: 1px solid #aaaaaa;
+  line-height: 13px;
+  padding: 3px 5px 3px 18px;
+  margin: 3px 0 3px 5px;
+  position: relative;
+  cursor: default;
+}
+.select2-container-multi .select2-choices .select2-search-choice span {
+  cursor: default;
+}
+.select2-container-multi .select2-choices .select2-search-choice-focus {
+  background: #d4d4d4;
+}
+
+.select2-search-choice-close {
+  display: block;
+  position: absolute;
+  right: 3px;
+  top: 4px;
+  width: 12px;
+  height: 13px;
+  font-size: 1px;
+  background: url('../img/select2.png') right top no-repeat;
+  outline: none;
+}
+
+.select2-container-multi .select2-search-choice-close {
+  left: 3px;
+}
+
+
+.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
+  background-position: right -11px;
+}
+.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
+  background-position: right -11px;
+}
+
+/* disabled styles */
+
+.select2-container-multi.select2-container-disabled .select2-choices{
+    background-color: #f4f4f4;
+    background-image: none;
+    border: 1px solid #ddd;
+    cursor: default;
+}
+
+.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
+    background-image: none;
+    background-color: #f4f4f4;
+    border: 1px solid #ddd;
+    padding: 3px 5px 3px 5px;
+}
+
+.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
+    display: none;
+}
+/* end multiselect */
+
+.select2-result-selectable .select2-match,
+.select2-result-unselectable .select2-result-selectable .select2-match { text-decoration: underline; }
+.select2-result-unselectable .select2-match { text-decoration: none; }
+
+.select2-offscreen { position: absolute; left: -10000px; }
+
+/* Retina-ize icons */
+
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
+	.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
+		background-image: url(../img/select2x2.png) !important;
+		background-repeat: no-repeat !important;
+		background-size: 60px 40px !important;
+	}
+	.select2-search input {
+		background-position: 100% -21px !important;
+	}
+}

+ 99 - 0
src/main/webapp/css/bootstap/unicorn.grey.css

@@ -0,0 +1,99 @@
+/**
+ * Unicorn Admin Template
+ * Diablo9983 -> diablo9983@gmail.com
+**/
+body {
+	background-color: #444444;
+}
+
+#header {
+    box-shadow: 0 1px 0 #333333;
+	background-color: #333333;
+    background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#3F3F3F), to(#222222));
+    background-image: -webkit-linear-gradient(top, #3F3F3F 0%, #222222 100%);
+    background-image: -moz-linear-gradient(top, #3F3F3F 0%, #222222 100%);
+	background-image: -ms-linear-gradient(top, #3F3F3F 0%, #222222 100%);
+	background-image: -o-linear-gradient(top, #3F3F3F 0%, #222222 100%);
+	background-image: linear-gradient(top, #3F3F3F 0%, #222222 100%);
+    border-bottom: 1px solid #555555;
+}
+
+#search input[type=text], #search button {
+	background-color: #222222;
+}
+#search input[type=text]:focus {
+	color: #777777;
+}
+
+#sidebar > ul {
+	border-top: 1px solid #393939;
+	border-bottom: 1px solid #4E4E4E;
+}
+#sidebar > ul > li {
+	border-top: 1px solid #4E4E4E;
+	border-bottom: 1px solid #393939;
+}
+#sidebar > ul > li.active {
+    background-color: #3a3a3a;
+	background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#333333), to(#3F3F3F));
+	background-image: -webkit-linear-gradient(top, #333333 0%, #3F3F3F 100%);
+	background-image: -moz-linear-gradient(top, #333333 0%, #3F3F3F 100%);
+	background-image: -ms-linear-gradient(top, #333333 0%, #3F3F3F 100%);
+	background-image: -o-linear-gradient(top, #333333 0%, #3F3F3F 100%);
+	background-image: linear-gradient(top, #333333 0%, #3F3F3F 100%);
+}
+
+#sidebar > ul > li.open.submenu > a {
+	border-bottom: 1px solid #393939;
+}
+#sidebar > ul > li.open.active.submenu > a {
+	border-bottom: 1px solid #2A2A2A;
+}
+#sidebar > ul > li > a > .label {
+	background-color: #333333;
+}
+#sidebar > ul > li > a:hover {
+	background-color: #4A4A4A;
+}
+#sidebar > ul ul {
+	border-top: 1px solid #4E4E4E;
+	background-color: #2A2A2A;
+}
+#sidebar > ul ul li a {
+	border-top: 1px solid #333333;
+	border-bottom: 1px solid #202020;
+}
+#sidebar > ul ul li a:hover, #sidebar > ul ul li.active a {
+	color: #CCCCCC;
+	background-color: #272727;
+}
+
+.dropdown-menu li a:hover, .dropdown-menu .active a, .dropdown-menu .active a:hover {
+    color: #eeeeee;
+	background-color: #444444;
+    background-image: -webkit-gradient(linear, 0 0%, 0 100%, #555555, #222222);
+    background-image: -webkit-linear-gradient(top, #555555 0%, #222222 100%);
+    background-image: -moz-linear-gradient(top, #555555 0%, #222222 100%);
+    background-image: -ms-linear-gradient(top, #555555 0%, #222222 100%);
+    background-image: -o-linear-gradient(top, #555555 0%, #222222 100%);
+    background-image: linear-gradient(top, #555555 0%, #222222 100%);
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#555555', endColorstr='#222222',GradientType=0 ); /* IE6-9 */
+}
+
+@media (max-width: 480px) {
+	#sidebar > a {
+		background-image: -moz-linear-gradient(top, #464646 0%, #404040 100%);
+		border-bottom: 1px solid #6e6e6e;
+	}
+	#sidebar > ul {
+		background-color: #444444;
+	}
+}
+@media (min-width: 481px) and (max-width: 767px) {
+	#sidebar > ul ul:before {
+		border-right: 7px solid rgba(0, 0, 0, 0.2);
+	}
+	#sidebar > ul ul:after {
+		border-right: 6px solid #222222;
+    }
+}

+ 91 - 0
src/main/webapp/css/bootstap/unicorn.login.css

@@ -0,0 +1,91 @@
+/**
+ * Unicorn Admin Template
+ * Diablo9983 -> diablo9983@gmail.com
+**/
+html, body {
+    width: 100%;
+    height: 100%;
+    overflow:hidden;
+}
+body {
+	background-color: #444444;
+	background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#555555), to(#111111));
+	background-image: -webkit-linear-gradient(top, #555555 0%, #111111 100%);
+    background-image: -moz-linear-gradient(top, #555555 0%, #111111 100%);
+    background-image: -ms-linear-gradient(top, #555555 0%, #111111 100%);
+    background-image: -o-linear-gradient(top, #555555 0%, #111111 100%);
+    background-image: linear-gradient(top, #555555 0%, #111111 100%);
+    padding: 0;
+    margin: 0;
+}
+
+#logo, #loginbox {
+    width: 400px;
+    margin-left: auto;
+    margin-right: auto;
+    position: relative;
+}
+#logo {
+    padding: 20px 0 20px 5px;
+}
+#logo img {
+    width: 215px;
+    margin: 0 auto;
+    display: block;
+}
+#loginbox {
+    height: 226px;
+	background: #ffffff;
+    box-shadow: 0 0 4px #000000;
+    border-radius: 7px;
+    overflow: hidden !important;
+    text-align: center;
+    position: relative;   
+}
+
+#loginbox form{
+	width:100%;
+	height:100%;
+	position:absolute;
+	top:0;
+	left:0;
+}
+#loginbox p {
+    margin-top: 20px;
+    padding: 0 20px;
+}
+
+#loginbox .form-actions {
+	padding: 14px 20px 15px;
+}
+#loginbox .form-actions .pull-left {
+	margin-top: 2px;
+}
+
+#loginbox form#loginform {
+	z-index: 200;
+}
+
+#loginbox form#recoverform {
+	z-index: 100;
+	opacity: 0;
+    display:none;
+}
+
+#loginbox form#recoverform .form-actions {
+    margin-top: 27px;
+}
+
+#loginbox form#recoverform .control-group {
+	margin: 23px 0;
+}
+
+.form-vertical, .form-actions {
+    margin-bottom: 0;
+}
+
+@media (max-width: 480px){
+    #logo, #loginbox {
+        width: 80%; 
+    }    
+}

Файловите разлики са ограничени, защото са твърде много
+ 1599 - 0
src/main/webapp/css/bootstap/unicorn.main.css


+ 611 - 0
src/main/webapp/css/bootstap/uniform.css

@@ -0,0 +1,611 @@
+/*
+
+Uniform Theme: Uniform Default
+Version: 1.6
+By: Josh Pyles
+License: MIT License
+---
+For use with the Uniform plugin:
+http://pixelmatrixdesign.com/uniform/
+---
+Generated by Uniform Theme Generator:
+http://pixelmatrixdesign.com/uniform/themer.html
+
+*/
+
+/* Global Declaration */
+
+div.selector, 
+div.selector span, 
+div.checker span,
+div.radio span, 
+div.uploader, 
+div.uploader span.action,
+div.button,
+div.button span {
+  background-image: url(../img/sprite.png);
+  background-repeat: no-repeat;
+  -webkit-font-smoothing: antialiased;
+}
+
+.selector, 
+.radio, 
+.checker, 
+.uploader,
+.button, 
+.selector *, 
+.radio *, 
+.checker *, 
+.uploader *,
+.button *{
+  margin: 0;
+  padding: 0;
+}
+
+/* INPUT & TEXTAREA */
+
+input.text,
+input.email, 
+input.password,
+textarea.uniform {
+  font-size: 12px;
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-weight: normal;
+  padding: 3px;
+  color: #777;
+  background: url('../img/bg-input-focus.png') repeat-x 0px 0px;
+  background: url('../img/bg-input.png') repeat-x 0px 0px;
+  border-top: solid 1px #aaa;
+  border-left: solid 1px #aaa;
+  border-bottom: solid 1px #ccc;
+  border-right: solid 1px #ccc;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  outline: 0;
+}
+
+input.text:focus,
+input.email:focus,
+input.password:focus,
+textarea.uniform:focus {
+  -webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
+  -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
+  box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
+  border-color: #999;
+  background: url('../img/bg-input-focus.png') repeat-x 0px 0px;
+}
+
+/* SPRITES */
+
+/* Select */
+
+div.selector {
+  background-position: -483px -130px;
+  line-height: 26px;
+  height: 26px;
+}
+
+div.selector span {
+  background-position: right 0px;
+  height: 26px;
+  line-height: 26px;
+}
+
+div.selector select {
+  /* change these to adjust positioning of select element */
+  top: 0px;
+  left: 0px;
+}
+
+div.selector:active, 
+div.selector.active {
+  background-position: -483px -156px;
+}
+
+div.selector:active span, 
+div.selector.active span {
+  background-position: right -26px;
+}
+
+div.selector.focus, div.selector.hover, div.selector:hover {
+  background-position: -483px -182px;
+}
+
+div.selector.focus span, div.selector.hover span, div.selector:hover span {
+  background-position: right -52px;
+}
+
+div.selector.focus:active,
+div.selector.focus.active,
+div.selector:hover:active,
+div.selector.active:hover {
+  background-position: -483px -208px;
+}
+
+div.selector.focus:active span,
+div.selector:hover:active span,
+div.selector.active:hover span,
+div.selector.focus.active span {
+  background-position: right -78px;
+}
+
+div.selector.disabled {
+  background-position: -483px -234px;
+}
+
+div.selector.disabled span {
+  background-position: right -104px;
+}
+
+/* Checkbox */
+
+div.checker {
+  width: 19px;
+  height: 19px;
+}
+
+div.checker input {
+  width: 19px;
+  height: 19px;
+}
+
+div.checker span {
+  background-position: 0px -260px;
+  height: 19px;
+  width: 19px;
+}
+
+div.checker:active span, 
+div.checker.active span {
+  background-position: -19px -260px;
+}
+
+div.checker.focus span,
+div.checker:hover span {
+  background-position: -38px -260px;
+}
+
+div.checker.focus:active span,
+div.checker:active:hover span,
+div.checker.active:hover span,
+div.checker.focus.active span {
+  background-position: -57px -260px;
+}
+
+div.checker span.checked {
+  background-position: -76px -260px;
+}
+
+div.checker:active span.checked, 
+div.checker.active span.checked {
+  background-position: -95px -260px;
+}
+
+div.checker.focus span.checked,
+div.checker:hover span.checked {
+  background-position: -114px -260px;
+}
+
+div.checker.focus:active span.checked,
+div.checker:hover:active span.checked,
+div.checker.active:hover span.checked,
+div.checker.active.focus span.checked {
+  background-position: -133px -260px;
+}
+
+div.checker.disabled span,
+div.checker.disabled:active span,
+div.checker.disabled.active span {
+  background-position: -152px -260px;
+}
+
+div.checker.disabled span.checked,
+div.checker.disabled:active span.checked,
+div.checker.disabled.active span.checked {
+  background-position: -171px -260px;
+}
+
+/* Radio */
+
+div.radio {
+  width: 18px;
+  height: 18px;
+}
+
+div.radio input {
+  width: 18px;
+  height: 18px;
+}
+
+div.radio span {
+  height: 18px;
+  width: 18px;
+  background-position: 0px -279px;
+}
+
+div.radio:active span, 
+div.radio.active span {
+  background-position: -18px -279px;
+}
+
+div.radio.focus span, 
+div.radio:hover span {
+  background-position: -36px -279px;
+}
+
+div.radio.focus:active span,
+div.radio:active:hover span,
+div.radio.active:hover span,
+div.radio.active.focus span {
+  background-position: -54px -279px;
+}
+
+div.radio span.checked {
+  background-position: -72px -279px;
+}
+
+div.radio:active span.checked,
+div.radio.active span.checked {
+  background-position: -90px -279px;
+}
+
+div.radio.focus span.checked, div.radio:hover span.checked {
+  background-position: -108px -279px;
+}
+
+div.radio.focus:active span.checked, 
+div.radio:hover:active span.checked,
+div.radio.focus.active span.checked,
+div.radio.active:hover span.checked {
+  background-position: -126px -279px;
+}
+
+div.radio.disabled span,
+div.radio.disabled:active span,
+div.radio.disabled.active span {
+  background-position: -144px -279px;
+}
+
+div.radio.disabled span.checked,
+div.radio.disabled:active span.checked,
+div.radio.disabled.active span.checked {
+  background-position: -162px -279px;
+}
+
+/* Uploader */
+
+div.uploader {
+  background-position: 0px -297px;
+  height: 28px;
+}
+
+div.uploader span.action {
+  background-position: right -409px;
+  height: 24px;
+  line-height: 24px;
+}
+
+div.uploader span.filename {
+  height: 24px;
+  /* change this line to adjust positioning of filename area */
+  margin: 2px 0px 2px 2px;
+  line-height: 24px;
+}
+
+div.uploader.focus,
+div.uploader.hover,
+div.uploader:hover {
+  background-position: 0px -353px;
+}
+
+div.uploader.focus span.action,
+div.uploader.hover span.action,
+div.uploader:hover span.action {
+  background-position: right -437px;
+}
+
+div.uploader.active span.action,
+div.uploader:active span.action {
+  background-position: right -465px;
+}
+
+div.uploader.focus.active span.action,
+div.uploader:focus.active span.action,
+div.uploader.focus:active span.action,
+div.uploader:focus:active span.action {
+  background-position: right -493px;
+}
+
+div.uploader.disabled {
+  background-position: 0px -325px;
+}
+
+div.uploader.disabled span.action {
+  background-position: right -381px;
+}
+
+div.button {
+  background-position: 0px -523px;
+}
+
+div.button span {
+  background-position: right -643px;
+}
+
+div.button.focus,
+div.button:focus,
+div.button:hover,
+div.button.hover {
+  background-position: 0px -553px;
+}
+
+div.button.focus span,
+div.button:focus span,
+div.button:hover span,
+div.button.hover span {
+  background-position: right -673px; 
+}
+
+div.button.active,
+div.button:active {
+  background-position: 0px -583px;
+}
+
+div.button.active span,
+div.button:active span {
+  background-position: right -703px;
+  color: #555;
+}
+
+div.button.disabled,
+div.button:disabled {
+  background-position: 0px -613px;
+}
+
+div.button.disabled span,
+div.button:disabled span {
+  background-position: right -733px;
+  color: #bbb;
+  cursor: default;
+}
+
+/* PRESENTATION */
+
+/* Button */
+
+div.button {
+  height: 30px;
+}
+
+div.button span {
+  margin-left: 13px;
+  height: 22px;
+  padding-top: 8px;
+  font-weight: bold;
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 12px;
+  letter-spacing: 1px;
+  text-transform: uppercase;
+  padding-left: 2px;
+  padding-right: 15px;
+}
+
+/* Select */
+div.selector {
+  width: 190px;
+  font-size: 12px;
+}
+
+div.selector select {
+  min-width: 190px;
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 12px;
+  border: solid 1px #fff;
+}
+
+div.selector span {
+  padding: 0px 25px 0px 2px;
+  cursor: pointer;
+}
+
+div.selector span {
+  color: #666;
+  width: 158px;
+  text-shadow: 0 1px 0 #fff;
+}
+
+div.selector.disabled span {
+  color: #bbb;
+}
+
+/* Checker */
+div.checker {
+  margin-right: 5px;
+}
+
+/* Radio */
+div.radio {
+  margin-right: 3px;
+}
+
+/* Uploader */
+div.uploader {
+  width: 190px;
+  cursor: pointer;
+}
+
+div.uploader span.action {
+  width: 85px;
+  text-align: center;
+  text-shadow: #fff 0px 1px 0px;
+  background-color: #fff;
+  font-size: 11px;
+  font-weight: bold;
+}
+
+div.uploader span.filename {
+  color: #777;
+  width: 82px;
+  border-right: solid 1px #bbb;
+  font-size: 11px;
+}
+
+div.uploader input {
+  width: 190px;
+}
+
+div.uploader.disabled span.action {
+  color: #aaa;
+}
+
+div.uploader.disabled span.filename {
+  border-color: #ddd;
+  color: #aaa;
+}
+/*
+
+CORE FUNCTIONALITY 
+
+Not advised to edit stuff below this line
+-----------------------------------------------------
+*/
+
+.selector, 
+.checker, 
+.button, 
+.radio, 
+.uploader {
+  display: -moz-inline-box;
+  display: inline-block;
+  vertical-align: middle;
+  zoom: 1;
+  *display: inline;
+}
+
+.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus {
+  outline: 0;
+}
+
+/* Button */
+
+div.button a,
+div.button button,
+div.button input {
+  position: absolute;
+}
+
+div.button {
+  cursor: pointer;
+  position: relative;
+}
+
+div.button span {
+  display: -moz-inline-box;
+  display: inline-block;
+  line-height: 1;
+  text-align: center;
+}
+
+/* Select */
+
+div.selector {
+  position: relative;
+  padding-left: 10px;
+  overflow: hidden;
+}
+
+div.selector span {
+  display: block;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+div.selector select {
+  position: absolute;
+  opacity: 0;
+  filter: alpha(opacity:0);
+  height: 25px;
+  border: none;
+  background: none;
+}
+
+/* Checker */
+
+div.checker {
+  position: relative;
+}
+
+div.checker span {
+  display: -moz-inline-box;
+  display: inline-block;
+  text-align: center;
+}
+
+div.checker input {
+  opacity: 0;
+  filter: alpha(opacity:0);
+  display: inline-block;
+  background: none;
+}
+
+/* Radio */
+
+div.radio {
+  position: relative;
+}
+
+div.radio span {
+  display: -moz-inline-box;
+  display: inline-block;
+  text-align: center;
+}
+
+div.radio input {
+  opacity: 0;
+  filter: alpha(opacity:0);
+  text-align: center;
+  display: inline-block;
+  background: none;
+}
+
+/* Uploader */
+
+div.uploader {
+  position: relative;
+  overflow: hidden;
+  cursor: default;
+}
+
+div.uploader span.action {
+  float: left;
+  display: inline;
+  padding: 2px 0px;
+  overflow: hidden;
+  cursor: pointer;
+}
+
+div.uploader span.filename {
+  padding: 0px 10px;
+  float: left;
+  display: block;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  cursor: default;
+  position:relative;
+}
+
+div.uploader input {
+  opacity: 0;
+  filter: alpha(opacity:0);
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  float: right;
+  height: 25px;
+  border: none;
+  cursor: default;
+}

BIN
src/main/webapp/img/dog.jpg


BIN
src/main/webapp/img/little_qrcode.jpg


+ 57 - 0
src/main/webapp/index.html

@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
+    <title></title>
+    <link rel="stylesheet"
+          href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
+    <link rel="stylesheet"
+          href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
+    <link rel="stylesheet" href="#(ctxPath)/static/css/demos.css">
+    <!--defer-->
+    <script id="script" src="/JHS/js/utils/require.min.js" defer async="true"
+            require-module="/JHS/js/html/index.js" data-main="/JHS/js/utils/config"></script>
+</head>
+<body>
+<div>
+    <div class="bd">
+        <div class="page__bd">
+            <header class='demos-header'>
+                <h1 class="demos-title"></h1>
+            </header>
+
+            <form action="#" method="get">
+                <div class="weui-cells weui-cells_form">
+                    <div class="weui-cell">
+                        <div class="weui-cell__hd"><label class="weui-label">会员账号</label></div>
+                        <div class="weui-cell__bd">
+                            <input class="weui-input" id="account" placeholder="请输入会员账号">
+                        </div>
+                    </div>
+                    <div class="weui-cell">
+                        <div class="weui-cell__hd"><label class="weui-label">充值金额</label></div>
+                        <div class="weui-cell__bd">
+                            <input class="weui-input" type="number" id="money" placeholder="请输入充值金额">
+                        </div>
+                    </div>
+                </div>
+                <div class="weui-btn-area">
+                    <a href="#" class="weui-btn weui-btn_primary" id="commi">提交</a><br>
+                </div>
+            </form>
+        </div>
+    </div>
+    <div class="header" style="visibility: hidden">
+        <div class="container black">
+            <div class="qrcode">
+                <div class="littlecode">
+                    <!-- 没有会报错ALI38173,可以将其隐藏 -->
+                    <img width="16px" src="img/little_qrcode.jpg" id="licode">
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+</body>
+</html>

Файловите разлики са ограничени, защото са твърде много
+ 6 - 0
src/main/webapp/js/bootstap/bootstrap.min.js


+ 672 - 0
src/main/webapp/js/bootstap/jquery-uniform.js

@@ -0,0 +1,672 @@
+/*
+
+Uniform v1.7.5
+Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC
+http://pixelmatrixdesign.com
+
+Requires jQuery 1.4 or newer
+
+Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this
+
+Disabling text selection is made possible by Mathias Bynens <http://mathiasbynens.be/>
+and his noSelect plugin. <http://github.com/mathiasbynens/noSelect-jQuery-Plugin>
+
+Also, thanks to David Kaneda and Eugene Bond for their contributions to the plugin
+
+License:
+MIT License - http://www.opensource.org/licenses/mit-license.php
+
+Enjoy!
+
+*/
+
+(function($) {
+  $.uniform = {
+    options: {
+      selectClass:   'selector',
+      radioClass: 'radio',
+      checkboxClass: 'checker',
+      fileClass: 'uploader',
+      filenameClass: 'filename',
+      fileBtnClass: 'action',
+      fileDefaultText: 'No file selected',
+      fileBtnText: 'Choose File',
+      checkedClass: 'checked',
+      focusClass: 'focus',
+      disabledClass: 'disabled',
+      buttonClass: 'button',
+      activeClass: 'active',
+      hoverClass: 'hover',
+      useID: true,
+      idPrefix: 'uniform',
+      resetSelector: false,
+      autoHide: true
+    },
+    elements: []
+  };
+
+  if($.browser.msie && $.browser.version < 7){
+    $.support.selectOpacity = false;
+  }else{
+    $.support.selectOpacity = true;
+  }
+
+  $.fn.uniform = function(options) {
+
+    options = $.extend($.uniform.options, options);
+
+    var el = this;
+    //code for specifying a reset button
+    if(options.resetSelector != false){
+      $(options.resetSelector).mouseup(function(){
+        function resetThis(){
+          $.uniform.update(el);
+        }
+        setTimeout(resetThis, 10);
+      });
+    }
+    
+    function doInput(elem){
+      $el = $(elem);
+      $el.addClass($el.attr("type"));
+      storeElement(elem);
+    }
+    
+    function doTextarea(elem){
+      $(elem).addClass("uniform");
+      storeElement(elem);
+    }
+    
+    function doButton(elem){
+      var $el = $(elem);
+      
+      var divTag = $("<div>"),
+          spanTag = $("<span>");
+      
+      divTag.addClass(options.buttonClass);
+      
+      if(options.useID && $el.attr("id") != "") divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
+      
+      var btnText;
+      
+      if($el.is("a") || $el.is("button")){
+        btnText = $el.text();
+      }else if($el.is(":submit") || $el.is(":reset") || $el.is("input[type=button]")){
+        btnText = $el.attr("value");
+      }
+      
+      btnText = btnText == "" ? $el.is(":reset") ? "Reset" : "Submit" : btnText;
+      
+      spanTag.html(btnText);
+      
+      $el.css("opacity", 0);
+      $el.wrap(divTag);
+      $el.wrap(spanTag);
+      
+      //redefine variables
+      divTag = $el.closest("div");
+      spanTag = $el.closest("span");
+      
+      if($el.is(":disabled")) divTag.addClass(options.disabledClass);
+      
+      divTag.bind({
+        "mouseenter.uniform": function(){
+          divTag.addClass(options.hoverClass);
+        },
+        "mouseleave.uniform": function(){
+          divTag.removeClass(options.hoverClass);
+          divTag.removeClass(options.activeClass);
+        },
+        "mousedown.uniform touchbegin.uniform": function(){
+          divTag.addClass(options.activeClass);
+        },
+        "mouseup.uniform touchend.uniform": function(){
+          divTag.removeClass(options.activeClass);
+        },
+        "click.uniform touchend.uniform": function(e){
+          if($(e.target).is("span") || $(e.target).is("div")){    
+            if(elem[0].dispatchEvent){
+              var ev = document.createEvent('MouseEvents');
+              ev.initEvent( 'click', true, true );
+              elem[0].dispatchEvent(ev);
+            }else{
+              elem[0].click();
+            }
+          }
+        }
+      });
+      
+      elem.bind({
+        "focus.uniform": function(){
+          divTag.addClass(options.focusClass);
+        },
+        "blur.uniform": function(){
+          divTag.removeClass(options.focusClass);
+        }
+      });
+      
+      $.uniform.noSelect(divTag);
+      storeElement(elem);
+      
+    }
+
+    function doSelect(elem){
+      var $el = $(elem);
+      
+      var divTag = $('<div />'),
+          spanTag = $('<span />');
+      
+      if(!$el.css("display") == "none" && options.autoHide){
+        divTag.hide();
+      }
+
+      divTag.addClass(options.selectClass);
+
+      if(options.useID && elem.attr("id") != ""){
+        divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
+      }
+      
+      var selected = elem.find(":selected:first");
+      if(selected.length == 0){
+        selected = elem.find("option:first");
+      }
+      spanTag.html(selected.html());
+      
+      elem.css('opacity', 0);
+      elem.wrap(divTag);
+      elem.before(spanTag);
+
+      //redefine variables
+      divTag = elem.parent("div");
+      spanTag = elem.siblings("span");
+
+      elem.bind({
+        "change.uniform": function() {
+          spanTag.text(elem.find(":selected").html());
+          divTag.removeClass(options.activeClass);
+        },
+        "focus.uniform": function() {
+          divTag.addClass(options.focusClass);
+        },
+        "blur.uniform": function() {
+          divTag.removeClass(options.focusClass);
+          divTag.removeClass(options.activeClass);
+        },
+        "mousedown.uniform touchbegin.uniform": function() {
+          divTag.addClass(options.activeClass);
+        },
+        "mouseup.uniform touchend.uniform": function() {
+          divTag.removeClass(options.activeClass);
+        },
+        "click.uniform touchend.uniform": function(){
+          divTag.removeClass(options.activeClass);
+        },
+        "mouseenter.uniform": function() {
+          divTag.addClass(options.hoverClass);
+        },
+        "mouseleave.uniform": function() {
+          divTag.removeClass(options.hoverClass);
+          divTag.removeClass(options.activeClass);
+        },
+        "keyup.uniform": function(){
+          spanTag.text(elem.find(":selected").html());
+        }
+      });
+      
+      //handle disabled state
+      if($(elem).attr("disabled")){
+        //box is checked by default, check our box
+        divTag.addClass(options.disabledClass);
+      }
+      $.uniform.noSelect(spanTag);
+      
+      storeElement(elem);
+
+    }
+
+    function doCheckbox(elem){
+      var $el = $(elem);
+      
+      var divTag = $('<div />'),
+          spanTag = $('<span />');
+      
+      if(!$el.css("display") == "none" && options.autoHide){
+        divTag.hide();
+      }
+      
+      divTag.addClass(options.checkboxClass);
+
+      //assign the id of the element
+      if(options.useID && elem.attr("id") != ""){
+        divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
+      }
+
+      //wrap with the proper elements
+      $(elem).wrap(divTag);
+      $(elem).wrap(spanTag);
+
+      //redefine variables
+      spanTag = elem.parent();
+      divTag = spanTag.parent();
+
+      //hide normal input and add focus classes
+      $(elem)
+      .css("opacity", 0)
+      .bind({
+        "focus.uniform": function(){
+          divTag.addClass(options.focusClass);
+        },
+        "blur.uniform": function(){
+          divTag.removeClass(options.focusClass);
+        },
+        "click.uniform touchend.uniform": function(){
+          if(!$(elem).attr("checked")){
+            //box was just unchecked, uncheck span
+            spanTag.removeClass(options.checkedClass);
+          }else{
+            //box was just checked, check span.
+            spanTag.addClass(options.checkedClass);
+          }
+        },
+        "mousedown.uniform touchbegin.uniform": function() {
+          divTag.addClass(options.activeClass);
+        },
+        "mouseup.uniform touchend.uniform": function() {
+          divTag.removeClass(options.activeClass);
+        },
+        "mouseenter.uniform": function() {
+          divTag.addClass(options.hoverClass);
+        },
+        "mouseleave.uniform": function() {
+          divTag.removeClass(options.hoverClass);
+          divTag.removeClass(options.activeClass);
+        }
+      });
+      
+      //handle defaults
+      if($(elem).attr("checked")){
+        //box is checked by default, check our box
+        spanTag.addClass(options.checkedClass);
+      }
+
+      //handle disabled state
+      if($(elem).attr("disabled")){
+        //box is checked by default, check our box
+        divTag.addClass(options.disabledClass);
+      }
+
+      storeElement(elem);
+    }
+
+    function doRadio(elem){
+      var $el = $(elem);
+      
+      var divTag = $('<div />'),
+          spanTag = $('<span />');
+          
+      if(!$el.css("display") == "none" && options.autoHide){
+        divTag.hide();
+      }
+
+      divTag.addClass(options.radioClass);
+
+      if(options.useID && elem.attr("id") != ""){
+        divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
+      }
+
+      //wrap with the proper elements
+      $(elem).wrap(divTag);
+      $(elem).wrap(spanTag);
+
+      //redefine variables
+      spanTag = elem.parent();
+      divTag = spanTag.parent();
+
+      //hide normal input and add focus classes
+      $(elem)
+      .css("opacity", 0)
+      .bind({
+        "focus.uniform": function(){
+          divTag.addClass(options.focusClass);
+        },
+        "blur.uniform": function(){
+          divTag.removeClass(options.focusClass);
+        },
+        "click.uniform touchend.uniform": function(){
+          if(!$(elem).attr("checked")){
+            //box was just unchecked, uncheck span
+            spanTag.removeClass(options.checkedClass);
+          }else{
+            //box was just checked, check span
+            var classes = options.radioClass.split(" ")[0];
+            $("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass);
+            spanTag.addClass(options.checkedClass);
+          }
+        },
+        "mousedown.uniform touchend.uniform": function() {
+          if(!$(elem).is(":disabled")){
+            divTag.addClass(options.activeClass);
+          }
+        },
+        "mouseup.uniform touchbegin.uniform": function() {
+          divTag.removeClass(options.activeClass);
+        },
+        "mouseenter.uniform touchend.uniform": function() {
+          divTag.addClass(options.hoverClass);
+        },
+        "mouseleave.uniform": function() {
+          divTag.removeClass(options.hoverClass);
+          divTag.removeClass(options.activeClass);
+        }
+      });
+
+      //handle defaults
+      if($(elem).attr("checked")){
+        //box is checked by default, check span
+        spanTag.addClass(options.checkedClass);
+      }
+      //handle disabled state
+      if($(elem).attr("disabled")){
+        //box is checked by default, check our box
+        divTag.addClass(options.disabledClass);
+      }
+
+      storeElement(elem);
+
+    }
+
+    function doFile(elem){
+      //sanitize input
+      var $el = $(elem);
+
+      var divTag = $('<div />'),
+          filenameTag = $('<span>'+options.fileDefaultText+'</span>'),
+          btnTag = $('<span>'+options.fileBtnText+'</span>');
+      
+      if(!$el.css("display") == "none" && options.autoHide){
+        divTag.hide();
+      }
+
+      divTag.addClass(options.fileClass);
+      filenameTag.addClass(options.filenameClass);
+      btnTag.addClass(options.fileBtnClass);
+
+      if(options.useID && $el.attr("id") != ""){
+        divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
+      }
+
+      //wrap with the proper elements
+      $el.wrap(divTag);
+      $el.after(btnTag);
+      $el.after(filenameTag);
+
+      //redefine variables
+      divTag = $el.closest("div");
+      filenameTag = $el.siblings("."+options.filenameClass);
+      btnTag = $el.siblings("."+options.fileBtnClass);
+
+      //set the size
+      if(!$el.attr("size")){
+        var divWidth = divTag.width();
+        //$el.css("width", divWidth);
+        $el.attr("size", divWidth/10);
+      }
+
+      //actions
+      var setFilename = function()
+      {
+        var filename = $el.val();
+        if (filename === '')
+        {
+          filename = options.fileDefaultText;
+        }
+        else
+        {
+          filename = filename.split(/[\/\\]+/);
+          filename = filename[(filename.length-1)];
+        }
+        filenameTag.text(filename);
+      };
+
+      // Account for input saved across refreshes
+      setFilename();
+
+      $el
+      .css("opacity", 0)
+      .bind({
+        "focus.uniform": function(){
+          divTag.addClass(options.focusClass);
+        },
+        "blur.uniform": function(){
+          divTag.removeClass(options.focusClass);
+        },
+        "mousedown.uniform": function() {
+          if(!$(elem).is(":disabled")){
+            divTag.addClass(options.activeClass);
+          }
+        },
+        "mouseup.uniform": function() {
+          divTag.removeClass(options.activeClass);
+        },
+        "mouseenter.uniform": function() {
+          divTag.addClass(options.hoverClass);
+        },
+        "mouseleave.uniform": function() {
+          divTag.removeClass(options.hoverClass);
+          divTag.removeClass(options.activeClass);
+        }
+      });
+
+      // IE7 doesn't fire onChange until blur or second fire.
+      if ($.browser.msie){
+        // IE considers browser chrome blocking I/O, so it
+        // suspends tiemouts until after the file has been selected.
+        $el.bind('click.uniform.ie7', function() {
+          setTimeout(setFilename, 0);
+        });
+      }else{
+        // All other browsers behave properly
+        $el.bind('change.uniform', setFilename);
+      }
+
+      //handle defaults
+      if($el.attr("disabled")){
+        //box is checked by default, check our box
+        divTag.addClass(options.disabledClass);
+      }
+      
+      $.uniform.noSelect(filenameTag);
+      $.uniform.noSelect(btnTag);
+      
+      storeElement(elem);
+
+    }
+    
+    $.uniform.restore = function(elem){
+      if(elem == undefined){
+        elem = $($.uniform.elements);
+      }
+      
+      $(elem).each(function(){
+        if($(this).is(":checkbox")){
+          //unwrap from span and div
+          $(this).unwrap().unwrap();
+        }else if($(this).is("select")){
+          //remove sibling span
+          $(this).siblings("span").remove();
+          //unwrap parent div
+          $(this).unwrap();
+        }else if($(this).is(":radio")){
+          //unwrap from span and div
+          $(this).unwrap().unwrap();
+        }else if($(this).is(":file")){
+          //remove sibling spans
+          $(this).siblings("span").remove();
+          //unwrap parent div
+          $(this).unwrap();
+        }else if($(this).is("button, :submit, :reset, a, input[type='button']")){
+          //unwrap from span and div
+          $(this).unwrap().unwrap();
+        }
+        
+        //unbind events
+        $(this).unbind(".uniform");
+        
+        //reset inline style
+        $(this).css("opacity", "1");
+        
+        //remove item from list of uniformed elements
+        var index = $.inArray($(elem), $.uniform.elements);
+        $.uniform.elements.splice(index, 1);
+      });
+    };
+
+    function storeElement(elem){
+      //store this element in our global array
+      elem = $(elem).get();
+      if(elem.length > 1){
+        $.each(elem, function(i, val){
+          $.uniform.elements.push(val);
+        });
+      }else{
+        $.uniform.elements.push(elem);
+      }
+    }
+    
+    //noSelect v1.0
+    $.uniform.noSelect = function(elem) {
+      function f() {
+       return false;
+      };
+      $(elem).each(function() {
+       this.onselectstart = this.ondragstart = f; // Webkit & IE
+       $(this)
+        .mousedown(f) // Webkit & Opera
+        .css({ MozUserSelect: 'none' }); // Firefox
+      });
+     };
+
+    $.uniform.update = function(elem){
+      if(elem == undefined){
+        elem = $($.uniform.elements);
+      }
+      //sanitize input
+      elem = $(elem);
+
+      elem.each(function(){
+        //do to each item in the selector
+        //function to reset all classes
+        var $e = $(this);
+
+        if($e.is("select")){
+          //element is a select
+          var spanTag = $e.siblings("span");
+          var divTag = $e.parent("div");
+
+          divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+
+          //reset current selected text
+          spanTag.html($e.find(":selected").html());
+
+          if($e.is(":disabled")){
+            divTag.addClass(options.disabledClass);
+          }else{
+            divTag.removeClass(options.disabledClass);
+          }
+
+        }else if($e.is(":checkbox")){
+          //element is a checkbox
+          var spanTag = $e.closest("span");
+          var divTag = $e.closest("div");
+
+          divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+          spanTag.removeClass(options.checkedClass);
+
+          if($e.is(":checked")){
+            spanTag.addClass(options.checkedClass);
+          }
+          if($e.is(":disabled")){
+            divTag.addClass(options.disabledClass);
+          }else{
+            divTag.removeClass(options.disabledClass);
+          }
+
+        }else if($e.is(":radio")){
+          //element is a radio
+          var spanTag = $e.closest("span");
+          var divTag = $e.closest("div");
+
+          divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+          spanTag.removeClass(options.checkedClass);
+
+          if($e.is(":checked")){
+            spanTag.addClass(options.checkedClass);
+          }
+
+          if($e.is(":disabled")){
+            divTag.addClass(options.disabledClass);
+          }else{
+            divTag.removeClass(options.disabledClass);
+          }
+        }else if($e.is(":file")){
+          var divTag = $e.parent("div");
+          var filenameTag = $e.siblings(options.filenameClass);
+          btnTag = $e.siblings(options.fileBtnClass);
+
+          divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+
+          filenameTag.text($e.val());
+
+          if($e.is(":disabled")){
+            divTag.addClass(options.disabledClass);
+          }else{
+            divTag.removeClass(options.disabledClass);
+          }
+        }else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){
+          var divTag = $e.closest("div");
+          divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+          
+          if($e.is(":disabled")){
+            divTag.addClass(options.disabledClass);
+          }else{
+            divTag.removeClass(options.disabledClass);
+          }
+          
+        }
+        
+      });
+    };
+
+    return this.each(function() {
+      if($.support.selectOpacity){
+        var elem = $(this);
+
+        if(elem.is("select")){
+          //element is a select
+          if(elem.attr("multiple") != true){
+            //element is not a multi-select
+            if(elem.attr("size") == undefined || elem.attr("size") <= 1){
+              doSelect(elem);
+            }
+          }
+        }else if(elem.is(":checkbox")){
+          //element is a checkbox
+          doCheckbox(elem);
+        }else if(elem.is(":radio")){
+          //element is a radio
+          doRadio(elem);
+        }else if(elem.is(":file")){
+          //element is a file upload
+          doFile(elem);
+        }else if(elem.is(":text, :password, input[type='email']")){
+          doInput(elem);
+        }else if(elem.is("textarea")){
+          doTextarea(elem);
+        }else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){
+          doButton(elem);
+        }
+          
+      }
+    });
+  };
+})(jQuery);

Файловите разлики са ограничени, защото са твърде много
+ 154 - 0
src/main/webapp/js/bootstap/jquery.dataTables.min.js


Файловите разлики са ограничени, защото са твърде много
+ 4 - 0
src/main/webapp/js/bootstap/jquery.min.js


Файловите разлики са ограничени, защото са твърде много
+ 14850 - 0
src/main/webapp/js/bootstap/jquery.ui.custom.js


Файловите разлики са ограничени, защото са твърде много
+ 82 - 0
src/main/webapp/js/bootstap/select2.min.js


+ 134 - 0
src/main/webapp/js/bootstap/unicorn.js

@@ -0,0 +1,134 @@
+/**
+ * Unicorn Admin Template
+ * Diablo9983 -> diablo9983@gmail.com
+**/
+$(document).ready(function(){
+
+	
+	
+	// === Sidebar navigation === //
+	
+	$('.submenu > a').click(function(e)
+	{
+		e.preventDefault();
+		var submenu = $(this).siblings('ul');
+		var li = $(this).parents('li');
+		var submenus = $('#sidebar li.submenu ul');
+		var submenus_parents = $('#sidebar li.submenu');
+		if(li.hasClass('open'))
+		{
+			if(($(window).width() > 768) || ($(window).width() < 479)) {
+				submenu.slideUp();
+			} else {
+				submenu.fadeOut(250);
+			}
+			li.removeClass('open');
+		} else 
+		{
+			if(($(window).width() > 768) || ($(window).width() < 479)) {
+				submenus.slideUp();			
+				submenu.slideDown();
+			} else {
+				submenus.fadeOut(250);			
+				submenu.fadeIn(250);
+			}
+			submenus_parents.removeClass('open');		
+			li.addClass('open');	
+		}
+	});
+	
+	var ul = $('#sidebar > ul');
+	
+	$('#sidebar > a').click(function(e)
+	{
+		e.preventDefault();
+		var sidebar = $('#sidebar');
+		if(sidebar.hasClass('open'))
+		{
+			sidebar.removeClass('open');
+			ul.slideUp(250);
+		} else 
+		{
+			sidebar.addClass('open');
+			ul.slideDown(250);
+		}
+	});
+	
+	// === Resize window related === //
+	$(window).resize(function()
+	{
+		if($(window).width() > 479)
+		{
+			ul.css({'display':'block'});	
+			$('#content-header .btn-group').css({width:'auto'});		
+		}
+		if($(window).width() < 479)
+		{
+			ul.css({'display':'none'});
+			fix_position();
+		}
+		if($(window).width() > 768)
+		{
+			$('#user-nav > ul').css({width:'auto',margin:'0'});
+            $('#content-header .btn-group').css({width:'auto'});
+		}
+	});
+	
+	if($(window).width() < 468)
+	{
+		ul.css({'display':'none'});
+		fix_position();
+	}
+	if($(window).width() > 479)
+	{
+	   $('#content-header .btn-group').css({width:'auto'});
+		ul.css({'display':'block'});
+	}
+	
+	// === Tooltips === //
+	$('.tip').tooltip();	
+	$('.tip-left').tooltip({ placement: 'left' });	
+	$('.tip-right').tooltip({ placement: 'right' });	
+	$('.tip-top').tooltip({ placement: 'top' });	
+	$('.tip-bottom').tooltip({ placement: 'bottom' });	
+	
+	// === Search input typeahead === //
+	$('#search input[type=text]').typeahead({
+		source: ['Dashboard','Form elements','Common Elements','Validation','Wizard','Buttons','Icons','Interface elements','Support','Calendar','Gallery','Reports','Charts','Graphs','Widgets'],
+		items: 4
+	});
+	
+	// === Fixes the position of buttons group in content header and top user navigation === //
+	function fix_position()
+	{
+		var uwidth = $('#user-nav > ul').width();
+		$('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});
+        
+        var cwidth = $('#content-header .btn-group').width();
+        $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});
+	}
+	
+	// === Style switcher === //
+	$('#style-switcher i').click(function()
+	{
+		if($(this).hasClass('open'))
+		{
+			$(this).parent().animate({marginRight:'-=220'});
+			$(this).removeClass('open');
+		} else 
+		{
+			$(this).parent().animate({marginRight:'+=220'});
+			$(this).addClass('open');
+		}
+		$(this).toggleClass('icon-arrow-left');
+		$(this).toggleClass('icon-arrow-right');
+	});
+	
+	$('#style-switcher a').click(function()
+	{
+		var style = $(this).attr('href').replace('#','');
+		$('.skin-color').attr('href','css/unicorn.'+style+'.css');
+		$(this).siblings('a').css({'border-color':'transparent'});
+		$(this).css({'border-color':'#aaaaaa'});
+	});
+});

+ 44 - 0
src/main/webapp/js/bootstap/unicorn.login.js

@@ -0,0 +1,44 @@
+/**
+ * Unicorn Admin Template
+ * Diablo9983 -> diablo9983@gmail.com
+**/
+$(document).ready(function(){
+
+	var login = $('#loginform');
+	var recover = $('#recoverform');
+	var speed = 400;
+
+	$('#to-recover').click(function(){
+		login.fadeTo(speed,0.01).css('z-index','100');
+		recover.fadeTo(speed,1).css('z-index','200');
+	});
+
+	$('#to-login').click(function(){
+		recover.fadeTo(speed,0.01).css('z-index','100');
+		login.fadeTo(speed,1).css('z-index','200');
+	});
+    
+    if($.browser.msie == true && $.browser.version.slice(0,3) < 10) {
+        $('input[placeholder]').each(function(){ 
+       
+        var input = $(this);       
+       
+        $(input).val(input.attr('placeholder'));
+               
+        $(input).focus(function(){
+             if (input.val() == input.attr('placeholder')) {
+                 input.val('');
+             }
+        });
+       
+        $(input).blur(function(){
+            if (input.val() == '' || input.val() == input.attr('placeholder')) {
+                input.val(input.attr('placeholder'));
+            }
+        });
+    });
+
+        
+        
+    }
+});

+ 102 - 0
src/main/webapp/js/bootstap/unicorn.tables.js

@@ -0,0 +1,102 @@
+$(document).ready(function () {
+    $.ajax({
+        type: "GET",
+        url: "/JHS/server/lists",
+        dataType: "json",
+        async: false,
+        data: "",
+        /* id为参数名,id_1为参数值,多个参数用","隔开
+        先清空标签,然后再赋值,如果不清空会叠加 */
+        success: function (data) {
+            var totalMoney = data.msg;
+            $('.modal-footer').html("汇总:" + totalMoney + "元");
+            data = data.obj;
+            var table = '';
+            $.each(data, function (index) {
+                var recordId = data[index].recordId;
+                var username = data[index].username;
+                var money = data[index].money;
+                var addTime = data[index].addTime;
+                var status = data[index].status;
+                var statusStr = '';
+                if (status == 0) {
+                    statusStr = '<a>1.确定</a>';
+                } else if (status == 1) {
+                    statusStr = '2.已确认';
+                }
+                table =table + '<tr class="gradeA">\n' +
+                '                <td >' + statusStr + '</td>\n' +
+                '                <td>' + username + '</td>\n' +
+                '                <td>' + money + '</td>\n' +
+                '                <td class="center">' + addTime + '</td>\n' +
+                '                <td>' + recordId + '</td>\n' +
+                '            </tr>\n';
+            })
+            $('#listBody').html(table);
+
+
+            //为列表添加click事件
+            var lis = document.getElementsByTagName('tr');
+            for (var i = 1; i < data.length + 1; i++) {
+                lis[i].cells[0].index = i; //给每个li定义一个属性索引值,赋
+                var rt = lis[i].cells[0];
+                rt.onclick = function () {
+                    if (this.innerHTML == '2.已确认') {
+                        return;
+                    }
+                    var nodeId = this.parentNode.cells[4].innerText;
+                    console.log("id-->" + nodeId)  //换行  索引值从0开始
+                    singleSure(nodeId);
+                    this.innerHTML = '2.已确认';
+                }
+            }
+        },
+        error: function () {
+            alert("请刷新重试!");
+        }
+    });
+
+    function singleSure(theId) {
+        $.ajax({
+            type: "POST",
+            url: "/JHS/server/update/" + theId,
+            dataType: "json",
+            data: "",
+            success: function (data) {
+                var res = data.res;
+                console.log("update res:" + res)
+                if (res != 0) {
+                    window.location.reload();
+                }
+            },
+            error: function () {
+                alert("请重试!");
+            }
+        });
+    }
+
+
+    $('.data-table').dataTable({
+        "bJQueryUI": true,
+        "sPaginationType": "full_numbers",
+        "sDom": '<""l>t<"F"fp>'
+    });
+
+    $('input[type=checkbox],input[type=radio],input[type=file]').uniform();
+
+    $('select').select2();
+
+    $("span.icon input:checkbox, th input:checkbox").click(function () {
+        var checkedStatus = this.checked;
+        var checkbox = $(this).parents('.widget-box').find('tr td:first-child input:checkbox');
+        checkbox.each(function () {
+            this.checked = checkedStatus;
+            if (checkedStatus == this.checked) {
+                $(this).closest('.checker > span').removeClass('checked');
+            }
+            if (this.checked) {
+                $(this).closest('.checker > span').addClass('checked');
+            }
+        });
+    });
+});

+ 32 - 0
src/main/webapp/js/html/index.js

@@ -0,0 +1,32 @@
+define(['jquery', "template", "components", "weui"], function (jquery, template, components, weui) {
+
+    $("#commi").click(function () {
+        var reg = /^\+?[1-9][0-9]*$/;
+        var account = document.getElementById("account").value;
+        var money = document.getElementById("money").value;
+        console.log("account:" + account)
+        console.log("money:" + money)
+        if (account == null || account == '') {
+            $.toast("账号不可为空", "text");
+            return;
+        }
+        if (money == null || money == '') {
+            $.toast("金额不可为空", "text");
+            return;
+        }
+        if (!reg.test(money)) {
+            $.toast("金额请输入正整数", "text");
+            return;
+        }
+
+        $.confirm("是否确认充值", function () {
+            //点击确认后的回调函数
+            var weixinUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appId + "&redirect_uri=" + encodeURI(notifyUrl) + "&response_type=code&scope=snsapi_userinfo&state=" + account + "-" + money + "&connect_redirect=1#wechat_redirect";
+            window.location.href = encodeURI(weixinUrl);
+        }, function () {
+            //点击取消后的回调函数
+            return;
+        });
+    })
+
+})

+ 67 - 0
src/main/webapp/js/html/pay.js

@@ -0,0 +1,67 @@
+define(['jquery', "template", "components", "weui"], function (jquery, template, components, weui) {
+
+    pay();
+
+    function pay() {
+        var code = components.GetQueryString("code");
+        if (code == null || code == "") {
+            return;
+        }
+        $.showLoading("加载中");
+        // 根据code获取openid
+        components.getMsg(apiUrl + "/oauth/openid", "code=" + code, "get").done(function (msg) {
+            var obj = msg.obj;
+            var state = components.GetQueryString('state');
+            var str = new Array();
+            str = state.split('-');
+            var jsonData = {
+                "totalFee": str[1],
+                "account": str[0],
+                "openid": obj.openid
+            }
+
+            //根据openid封装支付参数
+            components.getMsg(apiUrl + "/wx/gzhPay", jsonData, "post").done(function (msg) {
+                if (typeof WeixinJSBridge == "undefined") {
+                    if (document.addEventListener) {
+                        document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
+                    } else if (document.attachEvent) {
+                        document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
+                        document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
+                    }
+                } else {
+                    $.hideLoading();
+                    onBridgeReady(msg);
+                }
+            });
+        });
+    }
+
+    function onBridgeReady(msg) {
+        var appid = msg.obj.appid;
+        var timeStamp = msg.obj.timeStamp;
+        var nonceStr = msg.obj.nonceStr;
+        var packageValue = msg.obj.packageValue;
+        var paySign = msg.obj.paySign;
+        WeixinJSBridge.invoke(
+            'getBrandWCPayRequest', {
+                "appId": appid,     //公众号名称,由商户传入
+                "timeStamp": timeStamp,         //时间戳,自1970年以来的秒数
+                "nonceStr": nonceStr, //随机串
+                "package": packageValue,
+                "signType": "MD5",         //微信签名方式:
+                "paySign": paySign    //微信签名
+            }, function (res) {
+                if (res.err_msg == "get_brand_wcpay_request:ok") {
+                    $.toast("支付成功");
+                    location.href = apiUrl;
+                } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+                    $.toast("取消操作", "cancel");
+                    location.href = apiUrl;
+                } else {
+                    $.toast("支付失败", "forbidden");
+                    location.href = apiUrl;
+                }
+            });
+    }
+})

+ 16 - 0
src/main/webapp/js/html/test.js

@@ -0,0 +1,16 @@
+define(['jquery', "template","components","weui","cookie"], function(jquery, template, components, weui,cookie) {
+
+    $("#testA").click(function () {
+        components.getMsg(apiUrl+"/one","","get").done(function (msg) {
+            $.showLoading("加载中");
+            console.log(msg.res);
+            console.log(msg.obj.userID);
+            $.hideLoading();
+        });
+        // setCookie('a','2',1);
+        // var ret = getCookie('a');
+        // alert(ret)
+        // removeCookie('a');
+        // console.log("删除后cookie:"+getCookie('a'))
+    })
+})

Файловите разлики са ограничени, защото са твърде много
+ 7 - 0
src/main/webapp/js/utils/bootstrap.min.js


+ 148 - 0
src/main/webapp/js/utils/components.js

@@ -0,0 +1,148 @@
+define(["jquery", "bootstrap"], function (jquery, bootstrap) {
+    return {
+        getMsg: function (url, param, type) { //ajax请求
+            return $.ajax({
+                url: url,
+                data: param || {},
+                type: type || 'post',
+                xhrFields: {
+                    withCredentials: true
+                },
+                crossDomain: true,
+                dataType: "json",
+            }).then(function (msg) {
+                console.log("res:"+msg.res);
+                if (msg.res == 301) {
+                    var href = location.href;
+                    if (url.indexOf("admin") > -1) {
+                        $.cookie("preHrefB", href, {
+                            path: '/'
+                        });
+                        location.href = "/page/manage_login.html";
+                    } else {
+                        $.cookie("preHrefA", href, {
+                            path: '/'
+                        });
+                        $.cookie("username", null, {
+                            path: "/"
+                        });
+                        location.href = "/page/login.html";
+                    }
+                } else {
+                    return msg;
+                }
+            }, function (err) {
+                console.log(err.status);
+            });
+        },
+        logout: function (url) { //安全注销
+            $("#logout").bind("click", function () {
+                $.ajax({
+                    type: 'post',
+                    url: url,
+                    dataType: "json",
+                    success: function (msg, textStatus) {
+                        var res = msg.res;
+                        if (res == 1) {
+                            $.cookie("username", null, {
+                                path: "/"
+                            });
+                            location.href = "/";
+                        } else if (res == 301) {
+                            location.href = skipLinkObj.loginUrl;
+                        }
+                    }
+                });
+            });
+        },
+        Alert: function (type, msg) { //提示框
+            var $alert = $("#alert");
+            if (type == "success") {
+                $alert.removeClass("alert-warning").addClass("alert-success").text(msg);
+            } else {
+                $alert.removeClass("alert-success").addClass("alert-warning").text(msg);
+            }
+            $alert.fadeIn();
+            setTimeout(function () {
+                $alert.fadeOut();
+            }, 1000);
+        },
+        GetQueryString: function (name) { //获取url参数
+            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+            var r = location.search.substr(1).match(reg);
+            if (r != null) return decodeURI(r[2]);
+            return null;
+        },
+        centerblock: function () {
+            var maxHeight = 0;
+            var boxTop = 0;
+
+            function myBrowser() {
+                var userAgent = navigator.userAgent;
+                var isOpera = userAgent.indexOf("Opera") > -1;
+                if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
+                    return "IE";
+                }
+            }
+
+            var mb = myBrowser();
+            if ("IE" == mb) {
+                maxHeight = (document.body.offsetHeight) + "px";
+                pwdBoxTop = ((document.body.offsetHeight) - $(".center-box").height() - 88) / 2 + "px";
+            } else {
+                maxHeight = (window.innerHeight) + "px";
+                pwdBoxTop = ((window.innerHeight) - $(".center-box").height() - 88) / 2 + "px";
+            }
+            $("body").css("max-height", maxHeight);
+            $(".center-box").css("margin-top", pwdBoxTop);
+            $(".center-box").css("margin-bottom", pwdBoxTop);
+        },
+        formatDate: function (str) {
+            function checkTime(i) {
+                if (i < 10) {
+                    i = "0" + i;
+                }
+                return i;
+            }
+
+            if (str && str !== "") {
+                str = str.replace(/-/g, "/");
+                var date = new Date(str);
+                var year = date.getFullYear();
+                var month = date.getMonth() + 1;
+                var day = date.getDate();
+                year = checkTime(year);
+                month = checkTime(month);
+                day = checkTime(day);
+                str = year + "-" + (month) + "-" + day;
+                return str;
+            }
+        },
+        addActiveClass: function (index) {
+            var childrens = $("#footer_tabbar").children();
+            childrens.each(function (index1, element1) {
+                $(element1).removeClass("weui-bar__item_on");
+                var imgAndp = $(element1).children();
+                var str = imgAndp.attr('class');
+                var test = new RegExp("-", "g");
+                var result = str.match(test);
+                if (result.length > 1) {
+                    var k = result.indexOf('-lv');
+                    var newCls = result.substring(0, k);
+                    imgAndp.attr('class', newCls);
+                }
+                if (index == index1) {
+                    //字体变色
+                    $(element1).addClass("weui-bar__item_on");
+                    var str = imgAndp.attr('class') + '-lv';
+                    imgAndp.css({
+                        'font-weight': 'normal',
+                        'color': '#2CC27B'
+                    });
+                    $(imgAndp[0]).attr("class", str);
+                }
+            });
+        }
+
+    };
+});

Файловите разлики са ограничени, защото са твърде много
+ 38 - 0
src/main/webapp/js/utils/config.js


+ 36 - 0
src/main/webapp/js/utils/cookieUtil.js

@@ -0,0 +1,36 @@
+/**
+ * @Author: MTGG
+ * @Date: 16:09 2018/7/4
+ * @Describe: cookie类  -- 设置cookie
+ */
+function setCookie(key, value, iDay) {
+    var oDate = new Date();
+    console.log("date:"+oDate.getDate())
+    oDate.setDate(oDate.getDate() + iDay);
+    document.cookie = key + '=' + value + ';expires=' + oDate;
+}
+
+/**
+ * @Author: MTGG
+ * @Date: 16:12 2018/7/4
+ * @Describe: 删除cookie
+ */
+function removeCookie(key) {
+    setCookie(key, '', -1);//这里只需要把Cookie保质期退回一天便可以删除
+}
+
+/**
+ * @Author: MTGG
+ * @Date: 16:13 2018/7/4
+ * @Describe: 获取cookie
+ */
+function getCookie(key) {
+    var cookieArr = document.cookie.split('; ');
+    for (var i = 0; i < cookieArr.length; i++) {
+        var arr = cookieArr[i].split('=');
+        if (arr[0] === key) {
+            return arr[1];
+        }
+    }
+    return false;
+}

Файловите разлики са ограничени, защото са твърде много
+ 6253 - 0
src/main/webapp/js/utils/jquery-weui.js


Файловите разлики са ограничени, защото са твърде много
+ 6 - 0
src/main/webapp/js/utils/jquery-weui.min.css


Файловите разлики са ограничени, защото са твърде много
+ 13 - 0
src/main/webapp/js/utils/jquery-weui.min.js


Файловите разлики са ограничени, защото са твърде много
+ 10253 - 0
src/main/webapp/js/utils/jquery.min.js


Файловите разлики са ограничени, защото са твърде много
+ 36 - 0
src/main/webapp/js/utils/require.min.js


Файловите разлики са ограничени, защото са твърде много
+ 2 - 0
src/main/webapp/js/utils/template.js


Файловите разлики са ограничени, защото са твърде много
+ 2836 - 0
src/main/webapp/js/utils/weui.css


Файловите разлики са ограничени, защото са твърде много
+ 6 - 0
src/main/webapp/js/utils/weui.min.js