pay notify
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ buildNumber.properties
|
|||||||
/.idea/
|
/.idea/
|
||||||
/src/test/
|
/src/test/
|
||||||
peanut_book.iml
|
peanut_book.iml
|
||||||
|
weChatConfig.properties
|
||||||
|
|||||||
916
pom.xml
916
pom.xml
@@ -1,499 +1,499 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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"
|
<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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.peanut</groupId>
|
<groupId>com.peanut</groupId>
|
||||||
<artifactId>peanut_book</artifactId>
|
<artifactId>peanut_book</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.0.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>peanut_book</description>
|
<description>peanut_book</description>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.6.6</version>
|
<version>2.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<mybatisplus.version>3.3.1</mybatisplus.version>
|
<mybatisplus.version>3.3.1</mybatisplus.version>
|
||||||
<mysql.version>8.0.28</mysql.version>
|
<mysql.version>8.0.28</mysql.version>
|
||||||
<mssql.version>4.0</mssql.version>
|
<mssql.version>4.0</mssql.version>
|
||||||
<oracle.version>11.2.0.3</oracle.version>
|
<oracle.version>11.2.0.3</oracle.version>
|
||||||
<druid.version>1.1.13</druid.version>
|
<druid.version>1.1.13</druid.version>
|
||||||
<quartz.version>2.3.0</quartz.version>
|
<quartz.version>2.3.0</quartz.version>
|
||||||
<commons.lang.version>2.6</commons.lang.version>
|
<commons.lang.version>2.6</commons.lang.version>
|
||||||
<commons.fileupload.version>1.2.2</commons.fileupload.version>
|
<commons.fileupload.version>1.2.2</commons.fileupload.version>
|
||||||
<commons.io.version>2.5</commons.io.version>
|
<commons.io.version>2.5</commons.io.version>
|
||||||
<commons.codec.version>1.10</commons.codec.version>
|
<commons.codec.version>1.10</commons.codec.version>
|
||||||
<commons.configuration.version>1.10</commons.configuration.version>
|
<commons.configuration.version>1.10</commons.configuration.version>
|
||||||
<shiro.version>1.9.0</shiro.version>
|
<shiro.version>1.9.0</shiro.version>
|
||||||
<jwt.version>0.7.0</jwt.version>
|
<jwt.version>0.7.0</jwt.version>
|
||||||
<kaptcha.version>0.0.9</kaptcha.version>
|
<kaptcha.version>0.0.9</kaptcha.version>
|
||||||
<qiniu.version>7.2.23</qiniu.version>
|
<qiniu.version>7.2.23</qiniu.version>
|
||||||
<aliyun.oss.version>3.10.2</aliyun.oss.version>
|
<aliyun.oss.version>3.10.2</aliyun.oss.version>
|
||||||
<qcloud.cos.version>4.4</qcloud.cos.version>
|
<qcloud.cos.version>4.4</qcloud.cos.version>
|
||||||
<swagger.version>2.7.0</swagger.version>
|
<swagger.version>2.7.0</swagger.version>
|
||||||
<joda.time.version>2.9.9</joda.time.version>
|
<joda.time.version>2.9.9</joda.time.version>
|
||||||
<gson.version>2.8.5</gson.version>
|
<gson.version>2.8.5</gson.version>
|
||||||
<fastjson.version>1.2.79</fastjson.version>
|
<fastjson.version>1.2.79</fastjson.version>
|
||||||
<hutool.version>5.7.22</hutool.version>
|
<hutool.version>5.7.22</hutool.version>
|
||||||
<lombok.version>1.18.4</lombok.version>
|
<lombok.version>1.18.4</lombok.version>
|
||||||
<expiringmap.varsion>0.5.10</expiringmap.varsion>
|
<expiringmap.varsion>0.5.10</expiringmap.varsion>
|
||||||
<aspectjweaverversion>1.9.4</aspectjweaverversion>
|
<aspectjweaverversion>1.9.4</aspectjweaverversion>
|
||||||
|
|
||||||
<!-- <IJPay.version>2.2.0</IJPay.version>-->
|
<!-- <IJPay.version>2.2.0</IJPay.version>-->
|
||||||
|
|
||||||
<!--wagon plugin 配置-->
|
<!--wagon plugin 配置-->
|
||||||
<service-path>/work/renren</service-path>
|
<service-path>/work/renren</service-path>
|
||||||
<pack-name>${project.artifactId}-${project.version}.jar</pack-name>
|
<pack-name>${project.artifactId}-${project.version}.jar</pack-name>
|
||||||
<remote-addr>192.168.1.10:22</remote-addr>
|
<remote-addr>192.168.1.10:22</remote-addr>
|
||||||
<remote-username>root</remote-username>
|
<remote-username>root</remote-username>
|
||||||
<remote-passwd>123456</remote-passwd>
|
<remote-passwd>123456</remote-passwd>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.aspectj</groupId>
|
<groupId>org.aspectj</groupId>
|
||||||
<artifactId>aspectjweaver</artifactId>
|
<artifactId>aspectjweaver</artifactId>
|
||||||
<version>${aspectjweaverversion}</version>
|
<version>${aspectjweaverversion}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.jodah</groupId>
|
<groupId>net.jodah</groupId>
|
||||||
<artifactId>expiringmap</artifactId>
|
<artifactId>expiringmap</artifactId>
|
||||||
<version>${expiringmap.varsion}</version>
|
<version>${expiringmap.varsion}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mars</groupId>
|
<groupId>mars</groupId>
|
||||||
<artifactId>eh-sdk</artifactId>
|
<artifactId>eh-sdk</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.songxinqiang</groupId>
|
<groupId>cn.songxinqiang</groupId>
|
||||||
<artifactId>com.baidu.ueditor</artifactId>
|
<artifactId>com.baidu.ueditor</artifactId>
|
||||||
<version>1.1.2-offical</version>
|
<version>1.1.2-offical</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
<!--<dependency>-->
|
||||||
<!--<groupId>org.springframework.boot</groupId>-->
|
<!--<groupId>org.springframework.boot</groupId>-->
|
||||||
<!--<artifactId>spring-boot-devtools</artifactId>-->
|
<!--<artifactId>spring-boot-devtools</artifactId>-->
|
||||||
<!--<optional>true</optional>-->
|
<!--<optional>true</optional>-->
|
||||||
<!--</dependency>-->
|
<!--</dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
<version>${mybatisplus.version}</version>
|
<version>${mybatisplus.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-generator</artifactId>
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>${mysql.version}</version>
|
<version>${mysql.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.redisson</groupId>
|
<groupId>org.redisson</groupId>
|
||||||
<artifactId>redisson</artifactId>
|
<artifactId>redisson</artifactId>
|
||||||
<version>3.12.5</version>
|
<version>3.12.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--阿里短信服务-->
|
<!--阿里短信服务-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
<artifactId>dysmsapi20170525</artifactId>
|
<artifactId>dysmsapi20170525</artifactId>
|
||||||
<version>2.0.18</version>
|
<version>2.0.18</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--rabbitmq-->
|
<!--rabbitmq-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- poi -->
|
<!-- poi -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>e-iceblue</groupId>
|
<groupId>e-iceblue</groupId>
|
||||||
<artifactId>spire.doc</artifactId>
|
<artifactId>spire.doc</artifactId>
|
||||||
<version>10.9.8</version>
|
<version>10.9.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi</artifactId>
|
<artifactId>poi</artifactId>
|
||||||
<version>3.17</version>
|
<version>3.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>3.17</version>
|
<version>3.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-scratchpad</artifactId>
|
<artifactId>poi-scratchpad</artifactId>
|
||||||
<version>3.17</version>
|
<version>3.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>ooxml-schemas</artifactId>
|
<artifactId>ooxml-schemas</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml-schemas</artifactId>
|
<artifactId>poi-ooxml-schemas</artifactId>
|
||||||
<version>3.17</version>
|
<version>3.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aspose.words</groupId>
|
<groupId>com.aspose.words</groupId>
|
||||||
<artifactId>aspose-words</artifactId>
|
<artifactId>aspose-words</artifactId>
|
||||||
<version>aspose-words-22.10-jdk16</version>
|
<version>aspose-words-22.10-jdk16</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/src/main/resources/lib/aspose-words-22.10-jdk16.jar</systemPath>
|
<systemPath>${project.basedir}/src/main/resources/lib/aspose-words-22.10-jdk16.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jsoup</groupId>
|
<groupId>org.jsoup</groupId>
|
||||||
<artifactId>jsoup</artifactId>
|
<artifactId>jsoup</artifactId>
|
||||||
<version>1.14.3</version>
|
<version>1.14.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--阿里支付-->
|
<!--阿里支付-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alipay.sdk</groupId>
|
<groupId>com.alipay.sdk</groupId>
|
||||||
<artifactId>alipay-sdk-java</artifactId>
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
<version>4.15.20.ALL</version>
|
<version>4.15.20.ALL</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--oracle驱动-->
|
<!--oracle驱动-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.oracle</groupId>
|
<groupId>com.oracle</groupId>
|
||||||
<artifactId>ojdbc6</artifactId>
|
<artifactId>ojdbc6</artifactId>
|
||||||
<version>${oracle.version}</version>
|
<version>${oracle.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--mssql驱动-->
|
<!--mssql驱动-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.microsoft.sqlserver</groupId>
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
<artifactId>sqljdbc4</artifactId>
|
<artifactId>sqljdbc4</artifactId>
|
||||||
<version>${mssql.version}</version>
|
<version>${mssql.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--postgresql驱动-->
|
<!--postgresql驱动-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--集成 微信 登录 -->
|
<!--集成 微信 登录 -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid.version}</version>
|
<version>${druid.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
<groupId>org.quartz-scheduler</groupId>
|
||||||
<artifactId>quartz</artifactId>
|
<artifactId>quartz</artifactId>
|
||||||
<version>${quartz.version}</version>
|
<version>${quartz.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.mchange</groupId>
|
<groupId>com.mchange</groupId>
|
||||||
<artifactId>c3p0</artifactId>
|
<artifactId>c3p0</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-lang</groupId>
|
<groupId>commons-lang</groupId>
|
||||||
<artifactId>commons-lang</artifactId>
|
<artifactId>commons-lang</artifactId>
|
||||||
<version>${commons.lang.version}</version>
|
<version>${commons.lang.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>${commons.fileupload.version}</version>
|
<version>${commons.fileupload.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>${commons.io.version}</version>
|
<version>${commons.io.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-codec</groupId>
|
<groupId>commons-codec</groupId>
|
||||||
<artifactId>commons-codec</artifactId>
|
<artifactId>commons-codec</artifactId>
|
||||||
<version>${commons.codec.version}</version>
|
<version>${commons.codec.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-configuration</groupId>
|
<groupId>commons-configuration</groupId>
|
||||||
<artifactId>commons-configuration</artifactId>
|
<artifactId>commons-configuration</artifactId>
|
||||||
<version>${commons.configuration.version}</version>
|
<version>${commons.configuration.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-core</artifactId>
|
<artifactId>shiro-core</artifactId>
|
||||||
<version>${shiro.version}</version>
|
<version>${shiro.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-spring</artifactId>
|
<artifactId>shiro-spring</artifactId>
|
||||||
<version>${shiro.version}</version>
|
<version>${shiro.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt</artifactId>
|
<artifactId>jjwt</artifactId>
|
||||||
<version>${jwt.version}</version>
|
<version>${jwt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.axet</groupId>
|
<groupId>com.github.axet</groupId>
|
||||||
<artifactId>kaptcha</artifactId>
|
<artifactId>kaptcha</artifactId>
|
||||||
<version>${kaptcha.version}</version>
|
<version>${kaptcha.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger2</artifactId>
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.qiniu</groupId>
|
<groupId>com.qiniu</groupId>
|
||||||
<artifactId>qiniu-java-sdk</artifactId>
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
<version>${qiniu.version}</version>
|
<version>${qiniu.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun.oss</groupId>
|
<groupId>com.aliyun.oss</groupId>
|
||||||
<artifactId>aliyun-sdk-oss</artifactId>
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
<version>${aliyun.oss.version}</version>
|
<version>${aliyun.oss.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.qcloud</groupId>
|
<groupId>com.qcloud</groupId>
|
||||||
<artifactId>cos_api</artifactId>
|
<artifactId>cos_api</artifactId>
|
||||||
<version>${qcloud.cos.version}</version>
|
<version>${qcloud.cos.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
<artifactId>joda-time</artifactId>
|
<artifactId>joda-time</artifactId>
|
||||||
<version>${joda.time.version}</version>
|
<version>${joda.time.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- json 处理器-->
|
<!-- json 处理器-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>${gson.version}</version>
|
<version>${gson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>${hutool.version}</version>
|
<version>${hutool.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>${lombok.version}</version>
|
<version>${lombok.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-test</artifactId>
|
<artifactId>spring-test</artifactId>
|
||||||
<version>5.3.19</version>
|
<version>5.3.19</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--微信支付-->
|
<!--微信支付-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||||
<version>0.4.9</version>
|
<version>0.4.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.twelvemonkeys.common</groupId>
|
<groupId>com.twelvemonkeys.common</groupId>
|
||||||
<artifactId>common-lang</artifactId>
|
<artifactId>common-lang</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.yulichang</groupId>
|
<groupId>com.github.yulichang</groupId>
|
||||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||||
<version>1.4.6</version>
|
<version>1.4.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
<extensions>
|
<extensions>
|
||||||
<extension>
|
<extension>
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
<artifactId>wagon-ssh</artifactId>
|
<artifactId>wagon-ssh</artifactId>
|
||||||
<version>2.8</version>
|
<version>2.8</version>
|
||||||
</extension>
|
</extension>
|
||||||
</extensions>
|
</extensions>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<fork>true</fork>
|
<fork>true</fork>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- 跳过单元测试 -->
|
<!-- 跳过单元测试 -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<skipTests>true</skipTests>
|
<skipTests>true</skipTests>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>wagon-maven-plugin</artifactId>
|
<artifactId>wagon-maven-plugin</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<fromFile>target/${pack-name}</fromFile>
|
<fromFile>target/${pack-name}</fromFile>
|
||||||
<url><![CDATA[scp://${remote-username}:${remote-passwd}@${remote-addr}${service-path}]]></url>
|
<url><![CDATA[scp://${remote-username}:${remote-passwd}@${remote-addr}${service-path}]]></url>
|
||||||
<commands>
|
<commands>
|
||||||
<!-- Kill Old Process -->
|
<!-- Kill Old Process -->
|
||||||
<command>kill -9 `ps -ef |grep ${project.artifactId}.jar|grep -v "grep" |awk '{print $2}'`</command>
|
<command>kill -9 `ps -ef |grep ${project.artifactId}.jar|grep -v "grep" |awk '{print $2}'`</command>
|
||||||
<!-- Restart jar package,write result into renren.log -->
|
<!-- Restart jar package,write result into renren.log -->
|
||||||
<command><![CDATA[nohup java -jar ${service-path}/${pack-name} --spring.profiles.active=test > ${service-path}/renren.log 2>&1 & ]]></command>
|
<command><![CDATA[nohup java -jar ${service-path}/${pack-name} --spring.profiles.active=test > ${service-path}/renren.log 2>&1 & ]]></command>
|
||||||
<command><![CDATA[netstat -nptl]]></command>
|
<command><![CDATA[netstat -nptl]]></command>
|
||||||
<command><![CDATA[ps -ef | grep java | grep -v grep]]></command>
|
<command><![CDATA[ps -ef | grep java | grep -v grep]]></command>
|
||||||
</commands>
|
</commands>
|
||||||
<!-- 运行命令 mvn clean package wagon:upload-single wagon:sshexec-->
|
<!-- 运行命令 mvn clean package wagon:upload-single wagon:sshexec-->
|
||||||
<displayCommandOutputs>true</displayCommandOutputs>
|
<displayCommandOutputs>true</displayCommandOutputs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.spotify</groupId>
|
<groupId>com.spotify</groupId>
|
||||||
<artifactId>docker-maven-plugin</artifactId>
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
<version>0.4.14</version>
|
<version>0.4.14</version>
|
||||||
<!--<executions>-->
|
<!--<executions>-->
|
||||||
<!--<execution>-->
|
<!--<execution>-->
|
||||||
<!--<phase>package</phase>-->
|
<!--<phase>package</phase>-->
|
||||||
<!--<goals>-->
|
<!--<goals>-->
|
||||||
<!--<goal>build</goal>-->
|
<!--<goal>build</goal>-->
|
||||||
<!--</goals>-->
|
<!--</goals>-->
|
||||||
<!--</execution>-->
|
<!--</execution>-->
|
||||||
<!--</executions>-->
|
<!--</executions>-->
|
||||||
<configuration>
|
<configuration>
|
||||||
<imageName>renren/fast</imageName>
|
<imageName>renren/fast</imageName>
|
||||||
<dockerDirectory>${project.basedir}</dockerDirectory>
|
<dockerDirectory>${project.basedir}</dockerDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<targetPath>/</targetPath>
|
<targetPath>/</targetPath>
|
||||||
<directory>${project.build.directory}</directory>
|
<directory>${project.build.directory}</directory>
|
||||||
<include>${project.build.finalName}.jar</include>
|
<include>${project.build.finalName}.jar</include>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
</configuration>
|
</configuration>
|
||||||
<!-- 运行命令 mvn clean package docker:build 打包并生成docker镜像 -->
|
<!-- 运行命令 mvn clean package docker:build 打包并生成docker镜像 -->
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
<version>1.6.0</version>
|
<version>1.6.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>java</goal>
|
<goal>java</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<classpathScope>test</classpathScope>
|
<classpathScope>test</classpathScope>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>public</id>
|
<id>public</id>
|
||||||
<name>aliyun nexus</name>
|
<name>aliyun nexus</name>
|
||||||
<url>https://maven.aliyun.com/repository/public/</url>
|
<url>https://maven.aliyun.com/repository/public/</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>com.e-iceblue</id>
|
<id>com.e-iceblue</id>
|
||||||
<url>http://repo.e-iceblue.cn/repository/maven-public/</url>
|
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>public</id>
|
<id>public</id>
|
||||||
<name>aliyun nexus</name>
|
<name>aliyun nexus</name>
|
||||||
<url>https://maven.aliyun.com/repository/public/</url>
|
<url>https://maven.aliyun.com/repository/public/</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
<snapshots>
|
<snapshots>
|
||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -9,6 +9,5 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface ShopProudictBookDao extends BaseMapper<ShopProudictBookEntity> {
|
public interface ShopProudictBookDao extends BaseMapper<ShopProudictBookEntity> {
|
||||||
|
|
||||||
|
List<Integer> getOrderBookId(String orderSn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,17 @@ import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户购买书籍表
|
* 用户购买书籍表
|
||||||
*
|
*
|
||||||
* @author yl
|
* @author yl
|
||||||
* @email yl328572838@163.com
|
* @email yl328572838@163.com
|
||||||
* @date 2022-10-18 16:28:20
|
* @date 2022-10-18 16:28:20
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface UserEbookBuyDao extends MPJBaseMapper<UserEbookBuyEntity> {
|
public interface UserEbookBuyDao extends MPJBaseMapper<UserEbookBuyEntity> {
|
||||||
|
|
||||||
|
List<Integer> getUserBookId(Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,6 @@ public interface ShopProudictBookService extends IService<ShopProudictBookEntity
|
|||||||
|
|
||||||
Integer getProductByBookId(Integer bookId);
|
Integer getProductByBookId(Integer bookId);
|
||||||
|
|
||||||
|
List<Integer> getOrderBookId(String orderSn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
import com.peanut.common.utils.PageUtils;
|
import com.peanut.common.utils.PageUtils;
|
||||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,6 +20,8 @@ public interface UserEbookBuyService extends IService<UserEbookBuyEntity> {
|
|||||||
|
|
||||||
PageUtils queryPages(Map<String, Object> params);
|
PageUtils queryPages(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<Integer> getUserBookId(Integer userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,36 @@ import com.aliyun.oss.OSS;
|
|||||||
import com.aliyun.oss.OSSClientBuilder;
|
import com.aliyun.oss.OSSClientBuilder;
|
||||||
import com.aliyun.oss.OSSException;
|
import com.aliyun.oss.OSSException;
|
||||||
import com.aliyun.oss.model.OSSObject;
|
import com.aliyun.oss.model.OSSObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.peanut.common.utils.*;
|
import com.peanut.common.utils.ConstantPropertiesUtils;
|
||||||
|
import com.peanut.common.utils.FileDownloadUtil;
|
||||||
|
import com.peanut.common.utils.PageUtils;
|
||||||
|
import com.peanut.common.utils.Query;
|
||||||
|
import com.peanut.modules.book.dao.BookDao;
|
||||||
import com.peanut.modules.book.entity.*;
|
import com.peanut.modules.book.entity.*;
|
||||||
import com.peanut.modules.book.entity.SysDictDataEntity;
|
import com.peanut.modules.book.service.BookChapterService;
|
||||||
import com.peanut.modules.book.service.*;
|
import com.peanut.modules.book.service.BookForumArticlesService;
|
||||||
import com.peanut.modules.book.vo.BookIndexVo;
|
import com.peanut.modules.book.service.BookService;
|
||||||
|
import com.peanut.modules.book.service.PublisherService;
|
||||||
import com.peanut.modules.sys.service.SysDictDataService;
|
import com.peanut.modules.sys.service.SysDictDataService;
|
||||||
import com.spire.doc.Document;
|
import com.spire.doc.Document;
|
||||||
import com.spire.doc.Section;
|
import com.spire.doc.Section;
|
||||||
import com.spire.doc.documents.Paragraph;
|
import com.spire.doc.documents.Paragraph;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import com.peanut.modules.book.dao.BookDao;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
|
|
||||||
@Service("bookService")
|
@Service("bookService")
|
||||||
public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements BookService {
|
public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements BookService {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package com.peanut.modules.book.service.impl;
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -15,17 +16,20 @@ import com.peanut.modules.book.service.ShopProudictBookService;
|
|||||||
import com.peanut.modules.book.vo.ProudictBookqueryVO;
|
import com.peanut.modules.book.vo.ProudictBookqueryVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service("shopProudictBookService")
|
@Service("shopProudictBookService")
|
||||||
public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDao,ShopProudictBookEntity> implements ShopProudictBookService {
|
public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDao, ShopProudictBookEntity> implements ShopProudictBookService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductService shopProductService;
|
private ShopProductService shopProductService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BookService bookService;
|
private BookService bookService;
|
||||||
|
@Autowired
|
||||||
|
private ShopProudictBookDao shopProudictBookDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils queryPage(Map<String, Object> params) {
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
@@ -42,7 +46,7 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
|
|||||||
Object proudictId = params.get("proudictId");
|
Object proudictId = params.get("proudictId");
|
||||||
IPage<ShopProudictBookEntity> page = this.page(
|
IPage<ShopProudictBookEntity> page = this.page(
|
||||||
new Query<ShopProudictBookEntity>().getPage(params),
|
new Query<ShopProudictBookEntity>().getPage(params),
|
||||||
new QueryWrapper<ShopProudictBookEntity>().eq("proudict_id",proudictId)
|
new QueryWrapper<ShopProudictBookEntity>().eq("proudict_id", proudictId)
|
||||||
);
|
);
|
||||||
List<ShopProudictBookEntity> records = page.getRecords();
|
List<ShopProudictBookEntity> records = page.getRecords();
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
@@ -66,7 +70,7 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
|
|||||||
BookEntity bookbyId = bookService.getById(bookId1);
|
BookEntity bookbyId = bookService.getById(bookId1);
|
||||||
prList.add(bookbyId);
|
prList.add(bookbyId);
|
||||||
ShopProductEntity shopProductbyId = shopProductService.getById(proudictId1);
|
ShopProductEntity shopProductbyId = shopProductService.getById(proudictId1);
|
||||||
shopProductbyId.setBookidsimages(prList);
|
shopProductbyId.setBookidsimages(prList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shopProductEntity.setBookidsimages(prList);
|
shopProductEntity.setBookidsimages(prList);
|
||||||
@@ -75,9 +79,9 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> getBookidsByProductId(Integer productId) {
|
public List<Integer> getBookidsByProductId(Integer productId) {
|
||||||
List<ShopProudictBookEntity> spbs = this.list(new QueryWrapper<ShopProudictBookEntity>().eq("del_flag",0).eq("proudict_id",productId));
|
List<ShopProudictBookEntity> spbs = this.list(new QueryWrapper<ShopProudictBookEntity>().eq("del_flag", 0).eq("proudict_id", productId));
|
||||||
List<Integer> ids = new ArrayList();
|
List<Integer> ids = new ArrayList();
|
||||||
for (ShopProudictBookEntity s : spbs){
|
for (ShopProudictBookEntity s : spbs) {
|
||||||
ids.add(s.getBookId());
|
ids.add(s.getBookId());
|
||||||
}
|
}
|
||||||
return ids;
|
return ids;
|
||||||
@@ -86,21 +90,21 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
|
|||||||
@Override
|
@Override
|
||||||
public Integer getProductByBookId(Integer bookId) {
|
public Integer getProductByBookId(Integer bookId) {
|
||||||
LambdaQueryWrapper<ShopProudictBookEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShopProudictBookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(ShopProudictBookEntity::getBookId,bookId);
|
wrapper.eq(ShopProudictBookEntity::getBookId, bookId);
|
||||||
wrapper.eq(ShopProudictBookEntity::getDelFlag,0);
|
wrapper.eq(ShopProudictBookEntity::getDelFlag, 0);
|
||||||
wrapper.groupBy(ShopProudictBookEntity::getProudictId);
|
wrapper.groupBy(ShopProudictBookEntity::getProudictId);
|
||||||
List<ShopProudictBookEntity> shopProudictBookEntities = this.getBaseMapper().selectList(wrapper);
|
List<ShopProudictBookEntity> shopProudictBookEntities = this.getBaseMapper().selectList(wrapper);
|
||||||
List ids = new ArrayList();
|
List ids = new ArrayList();
|
||||||
for (ShopProudictBookEntity s : shopProudictBookEntities){
|
for (ShopProudictBookEntity s : shopProudictBookEntities) {
|
||||||
ids.add(s.getProudictId());
|
ids.add(s.getProudictId());
|
||||||
}
|
}
|
||||||
if(ids.size()==0){
|
if (ids.size() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
LambdaQueryWrapper<ShopProductEntity> wrapper1 = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShopProductEntity> wrapper1 = new LambdaQueryWrapper<>();
|
||||||
wrapper1.eq(ShopProductEntity::getDelFlag,0);
|
wrapper1.eq(ShopProductEntity::getDelFlag, 0);
|
||||||
wrapper1.in(ShopProductEntity::getProductId,ids);
|
wrapper1.in(ShopProductEntity::getProductId, ids);
|
||||||
wrapper1.orderByAsc(ShopProductEntity::getPrice);
|
wrapper1.orderByAsc(ShopProductEntity::getPrice);
|
||||||
wrapper1.last("limit 1");
|
wrapper1.last("limit 1");
|
||||||
List<ShopProductEntity> shopProductEntities = shopProductService.getBaseMapper().selectList(wrapper1);
|
List<ShopProductEntity> shopProductEntities = shopProductService.getBaseMapper().selectList(wrapper1);
|
||||||
@@ -108,5 +112,10 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
|
|||||||
return shopProductEntity.getProductId();
|
return shopProductEntity.getProductId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Integer> getOrderBookId(String orderSn) {
|
||||||
|
return shopProudictBookDao.getOrderBookId(orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
package com.peanut.modules.book.service.impl;
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
import com.peanut.modules.book.entity.BuyOrderEntity;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.peanut.common.utils.PageUtils;
|
import com.peanut.common.utils.PageUtils;
|
||||||
import com.peanut.common.utils.Query;
|
import com.peanut.common.utils.Query;
|
||||||
|
|
||||||
import com.peanut.modules.book.dao.UserEbookBuyDao;
|
import com.peanut.modules.book.dao.UserEbookBuyDao;
|
||||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||||
import com.peanut.modules.book.service.UserEbookBuyService;
|
import com.peanut.modules.book.service.UserEbookBuyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@Service("userEbookBuyService")
|
@Service("userEbookBuyService")
|
||||||
public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEbookBuyEntity> implements UserEbookBuyService {
|
public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEbookBuyEntity> implements UserEbookBuyService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserEbookBuyDao userEbookBuyDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils queryPage(Map<String, Object> params) {
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
String userId = (String) params.get("userId");
|
String userId = (String) params.get("userId");
|
||||||
IPage<UserEbookBuyEntity> page = this.page(
|
IPage<UserEbookBuyEntity> page = this.page(
|
||||||
new Query<UserEbookBuyEntity>().getPage(params),
|
new Query<UserEbookBuyEntity>().getPage(params),
|
||||||
new QueryWrapper<UserEbookBuyEntity>().eq("user_id",userId)
|
new QueryWrapper<UserEbookBuyEntity>().eq("user_id", userId)
|
||||||
);
|
);
|
||||||
|
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
@@ -36,7 +38,7 @@ public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEb
|
|||||||
IPage<UserEbookBuyEntity> page = this.page(
|
IPage<UserEbookBuyEntity> page = this.page(
|
||||||
new Query<UserEbookBuyEntity>().getPage(params),
|
new Query<UserEbookBuyEntity>().getPage(params),
|
||||||
new QueryWrapper<UserEbookBuyEntity>()
|
new QueryWrapper<UserEbookBuyEntity>()
|
||||||
.eq("user_id",userid)
|
.eq("user_id", userid)
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
@@ -44,24 +46,10 @@ public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEb
|
|||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Integer> getUserBookId(Integer userId) {
|
||||||
|
return userEbookBuyDao.getUserBookId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
package com.peanut.modules.pay.weChatPay.controller;
|
package com.peanut.modules.pay.weChatPay.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
@@ -6,10 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.book.entity.*;
|
import com.peanut.modules.book.entity.*;
|
||||||
import com.peanut.modules.book.service.*;
|
import com.peanut.modules.book.service.*;
|
||||||
import com.peanut.modules.pay.weChatPay.dto.WechatDto;
|
|
||||||
import com.peanut.modules.pay.weChatPay.config.WechatPayConfig;
|
import com.peanut.modules.pay.weChatPay.config.WechatPayConfig;
|
||||||
|
import com.peanut.modules.pay.weChatPay.dto.WechatDto;
|
||||||
import com.peanut.modules.pay.weChatPay.util.HttpUtils;
|
import com.peanut.modules.pay.weChatPay.util.HttpUtils;
|
||||||
import com.peanut.modules.book.entity.BookBuyConfigEntity;
|
|
||||||
import com.peanut.modules.pay.weChatPay.util.WechatPayValidator;
|
import com.peanut.modules.pay.weChatPay.util.WechatPayValidator;
|
||||||
import com.peanut.modules.pay.weChatPay.util.WxPayUtil;
|
import com.peanut.modules.pay.weChatPay.util.WxPayUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -24,10 +24,9 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.xml.soap.Text;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@@ -37,14 +36,7 @@ import java.security.NoSuchAlgorithmException;
|
|||||||
import java.security.PrivateKey;
|
import java.security.PrivateKey;
|
||||||
import java.security.spec.InvalidKeySpecException;
|
import java.security.spec.InvalidKeySpecException;
|
||||||
import java.security.spec.PKCS8EncodedKeySpec;
|
import java.security.spec.PKCS8EncodedKeySpec;
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.time.temporal.ChronoUnit;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@@ -53,9 +45,11 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class WeChatPayController {
|
public class WeChatPayController {
|
||||||
|
|
||||||
@Autowired private MyUserService userService;
|
@Autowired
|
||||||
|
private MyUserService userService;
|
||||||
|
|
||||||
@Autowired private BuyOrderService buyOrderService;
|
@Autowired
|
||||||
|
private BuyOrderService buyOrderService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -74,17 +68,18 @@ public class WeChatPayController {
|
|||||||
private TransactionDetailsService transactionDetailsService;
|
private TransactionDetailsService transactionDetailsService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BuyOrderDetailService buyOrderDetailService;
|
private ShopProudictBookService shopProudictBookService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CloseableHttpClient wxPayNoSignClient; //无需应答签名
|
private UserEbookBuyService userEbookBuyService;
|
||||||
|
|
||||||
|
//无需应答签名
|
||||||
@Autowired
|
@Autowired
|
||||||
private CloseableHttpClient wxPayClient;
|
private CloseableHttpClient wxPayClient;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxPayUtil wxPayUtil;
|
private WxPayUtil wxPayUtil;
|
||||||
private final ReentrantLock lock = new ReentrantLock();
|
|
||||||
// 由微信生成的应用ID,全局唯一。
|
// 由微信生成的应用ID,全局唯一。
|
||||||
public static final String appId= "wx47134a8f15083734";
|
public static final String appId = "wx47134a8f15083734";
|
||||||
// 直连商户的商户号,由微信支付生成并下发。
|
// 直连商户的商户号,由微信支付生成并下发。
|
||||||
public static final String mchId = "1612860909";
|
public static final String mchId = "1612860909";
|
||||||
// 商户证书序列号 7B5676E3CDF56680D0414A009CE501C844DBE2D6 679AECB2F7AC4183033F713828892BA640E4EEE3
|
// 商户证书序列号 7B5676E3CDF56680D0414A009CE501C844DBE2D6 679AECB2F7AC4183033F713828892BA640E4EEE3
|
||||||
@@ -102,78 +97,76 @@ public class WeChatPayController {
|
|||||||
|
|
||||||
@RequestMapping(value = "/placeAnOrder/app")
|
@RequestMapping(value = "/placeAnOrder/app")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public R pay(@RequestBody WechatDto dto ) throws Exception{
|
public R pay(@RequestBody WechatDto dto) throws Exception {
|
||||||
log.info("微信生成订单");
|
log.info("微信生成订单");
|
||||||
List<BuyOrderEntity> one = this.buyOrderService.getBaseMapper().selectList(new QueryWrapper<BuyOrderEntity>().eq("order_sn", dto.getOrderSn()));
|
List<BuyOrderEntity> one = this.buyOrderService.getBaseMapper().selectList(new QueryWrapper<BuyOrderEntity>().eq("order_sn", dto.getOrderSn()));
|
||||||
BuyOrderEntity order = one.get(0);
|
BuyOrderEntity order = one.get(0);
|
||||||
// 获取订单
|
// 获取订单
|
||||||
Map<String,Object> paramMap = new HashMap<>();
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
paramMap.put("appid",appId);
|
paramMap.put("appid", appId);
|
||||||
paramMap.put("mchid",mchId);
|
paramMap.put("mchid", mchId);
|
||||||
paramMap.put("description","微信充值");
|
paramMap.put("description", "微信充值");
|
||||||
// 订单编号
|
// 订单编号
|
||||||
paramMap.put("out_trade_no",order.getOrderSn());
|
paramMap.put("out_trade_no", order.getOrderSn());
|
||||||
// paramMap.put("attach",""); //自定义数据 支付完成后才能显示 在查询API和支付通知中原样返回,可作为自定义参数使用
|
// paramMap.put("attach",""); //自定义数据 支付完成后才能显示 在查询API和支付通知中原样返回,可作为自定义参数使用
|
||||||
paramMap.put("notify_url",wechatPayConfig.getNotifyUrl());
|
paramMap.put("notify_url", wechatPayConfig.getNotifyUrl());
|
||||||
|
|
||||||
// paramMap.put("time_expire",afterString);
|
// paramMap.put("time_expire",afterString);
|
||||||
// 实收金额0.38乘100=38
|
// 实收金额0.38乘100=38
|
||||||
BigDecimal realsmoney= order.getRealMoney();
|
BigDecimal realsmoney = order.getRealMoney();
|
||||||
BigDecimal hand=new BigDecimal("100");
|
BigDecimal hand = new BigDecimal("100");
|
||||||
realsmoney =realsmoney.multiply(hand) ;
|
realsmoney = realsmoney.multiply(hand);
|
||||||
Map<String,Object> amountMap = new HashMap<>();
|
Map<String, Object> amountMap = new HashMap<>();
|
||||||
amountMap.put("total",realsmoney);
|
amountMap.put("total", realsmoney);
|
||||||
amountMap.put("currency","CNY");
|
amountMap.put("currency", "CNY");
|
||||||
|
|
||||||
|
|
||||||
BigDecimal money= order.getRealMoney();
|
BigDecimal money = order.getRealMoney();
|
||||||
BigDecimal han=new BigDecimal("100");
|
BigDecimal han = new BigDecimal("100");
|
||||||
realsmoney =realsmoney.multiply(han) ;
|
realsmoney = realsmoney.multiply(han);
|
||||||
Map<String,Object> amount = new HashMap<>();
|
Map<String, Object> amount = new HashMap<>();
|
||||||
amount.put("total",realsmoney);
|
amount.put("total", realsmoney);
|
||||||
amount.put("currency","CNY");
|
amount.put("currency", "CNY");
|
||||||
|
|
||||||
if (dto.getTotalAmount()!=order.getRealMoney()) {
|
if (dto.getTotalAmount() != order.getRealMoney()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
paramMap.put("amount", amountMap);
|
||||||
|
|
||||||
paramMap.put("amount",amountMap);
|
|
||||||
|
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(paramMap));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(paramMap));
|
||||||
log.info("请求参数"+paramMap);
|
log.info("请求参数" + paramMap);
|
||||||
com.alibaba.fastjson.JSONObject jsonObject1 = wxPayUtil.doPostWexinV3("https://api.mch.weixin.qq.com/v3/pay/transactions/app", json.toJSONString());
|
com.alibaba.fastjson.JSONObject jsonObject1 = wxPayUtil.doPostWexinV3("https://api.mch.weixin.qq.com/v3/pay/transactions/app", json.toJSONString());
|
||||||
String prepayid = jsonObject1.getString("prepay_id");
|
String prepayid = jsonObject1.getString("prepay_id");
|
||||||
// 传入参数 payUrl 发送post请求
|
// 传入参数 payUrl 发送post请求
|
||||||
HttpPost httpPost = new HttpPost(payUrl);
|
HttpPost httpPost = new HttpPost(payUrl);
|
||||||
// 将json数据转换成字符串
|
// 将json数据转换成字符串
|
||||||
StringEntity entity = new StringEntity(json.toString(),"utf-8");
|
StringEntity entity = new StringEntity(json.toString(), "utf-8");
|
||||||
// 设置该请求的Content-Type为application/json 都是json格式
|
// 设置该请求的Content-Type为application/json 都是json格式
|
||||||
entity.setContentType("application/json");
|
entity.setContentType("application/json");
|
||||||
// 将实体对象设置到HttpPost表示要传递该数据到服务器端。
|
// 将实体对象设置到HttpPost表示要传递该数据到服务器端。
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
// 设置请求头部的Accept属性为"application/json"表示客户端希望接收的为json。
|
// 设置请求头部的Accept属性为"application/json"表示客户端希望接收的为json。
|
||||||
httpPost.setHeader("Accept", "application/json");
|
httpPost.setHeader("Accept", "application/json");
|
||||||
CloseableHttpResponse response = wxPayClient.execute(httpPost);
|
CloseableHttpResponse response = wxPayClient.execute(httpPost);
|
||||||
// 向微信支付平台发送请求,处理响应结果,并将订单信息保存到数据库中。
|
// 向微信支付平台发送请求,处理响应结果,并将订单信息保存到数据库中。
|
||||||
String bodyAsString = EntityUtils.toString(response.getEntity());//响应体
|
String bodyAsString = EntityUtils.toString(response.getEntity());//响应体
|
||||||
// 时间戳
|
// 时间戳
|
||||||
Long timestamp = System.currentTimeMillis()/1000;
|
Long timestamp = System.currentTimeMillis() / 1000;
|
||||||
// 随机串
|
// 随机串
|
||||||
String nonceStr = UUID.randomUUID().toString().replace("-","");
|
String nonceStr = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
|
||||||
String sign = wxPayUtil.getSign(WxPayUtil.appId,timestamp,nonceStr,prepayid);
|
String sign = wxPayUtil.getSign(WxPayUtil.appId, timestamp, nonceStr, prepayid);
|
||||||
log.info("签名:"+sign);
|
log.info("签名:" + sign);
|
||||||
|
|
||||||
Map Map = new HashMap();
|
Map Map = new HashMap();
|
||||||
Map.put("prepayid",prepayid);
|
Map.put("prepayid", prepayid);
|
||||||
Map.put("timestamp",timestamp+"");
|
Map.put("timestamp", timestamp + "");
|
||||||
Map.put("noncestr",nonceStr);
|
Map.put("noncestr", nonceStr);
|
||||||
Map.put("sign",sign);
|
Map.put("sign", sign);
|
||||||
Map.put("appid",appId);
|
Map.put("appid", appId);
|
||||||
Map.put("package","Sign=WXPay");
|
Map.put("package", "Sign=WXPay");
|
||||||
Map.put("extData","sign");
|
Map.put("extData", "sign");
|
||||||
Map.put("partnerid",mchId);
|
Map.put("partnerid", mchId);
|
||||||
try {
|
try {
|
||||||
int statusCode = response.getStatusLine().getStatusCode(); //响应状态码
|
int statusCode = response.getStatusLine().getStatusCode(); //响应状态码
|
||||||
if (statusCode == 200) { //处理成功
|
if (statusCode == 200) { //处理成功
|
||||||
@@ -198,13 +191,14 @@ public class WeChatPayController {
|
|||||||
System.out.println("下单失败 = " + statusCode + ",返回结果 = " + bodyAsString);
|
System.out.println("下单失败 = " + statusCode + ",返回结果 = " + bodyAsString);
|
||||||
throw new IOException("request failed");
|
throw new IOException("request failed");
|
||||||
}
|
}
|
||||||
}finally {
|
} finally {
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
// 返回url和订单号
|
// 返回url和订单号
|
||||||
return R.ok().put("paramMap" ,paramMap).put("Map",Map);
|
return R.ok().put("paramMap", paramMap).put("Map", Map);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取私钥。
|
* 获取私钥。
|
||||||
*
|
*
|
||||||
@@ -227,8 +221,8 @@ public class WeChatPayController {
|
|||||||
throw new RuntimeException("无效的密钥格式");
|
throw new RuntimeException("无效的密钥格式");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 微信支付回调
|
* 微信支付回调
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
@@ -236,121 +230,119 @@ public class WeChatPayController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/payNotify")
|
@PostMapping("/payNotify")
|
||||||
|
@Transactional
|
||||||
public R payNotify(HttpServletRequest request, HttpServletResponse response) {
|
public R payNotify(HttpServletRequest request, HttpServletResponse response) {
|
||||||
log.info("##############################微信支付回调#######################");
|
log.info("微信支付回调");
|
||||||
|
// 处理通知参数
|
||||||
|
Map<String, Object> bodyMap = getNotifyBody(request);
|
||||||
// 处理通知参数
|
if (bodyMap == null) {
|
||||||
Map<String,Object> bodyMap = getNotifyBody(request);
|
|
||||||
if(bodyMap==null){
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(lock.tryLock()) {
|
// 解密resource中的通知数据
|
||||||
try {
|
String resource = bodyMap.get("resource").toString();
|
||||||
// 解密resource中的通知数据
|
Map<String, Object> resourceMap = WechatPayValidator.decryptFromResource(resource, wechatPayConfig.getApiV3Key(), 1);
|
||||||
String resource = bodyMap.get("resource").toString();
|
String orderNo = resourceMap.get("out_trade_no").toString();
|
||||||
Map<String, Object> resourceMap = WechatPayValidator.decryptFromResource(resource, wechatPayConfig.getApiV3Key(),1);
|
// 根据订单号,做幂等处理,并且在对业务数据进行状态检查和处理之前,要采用数据锁进行并发控制,以避免函数重入造成的数据混乱
|
||||||
String orderNo = resourceMap.get("out_trade_no").toString();
|
BuyOrderEntity order = this.buyOrderService.getOne(new QueryWrapper<BuyOrderEntity>().eq("order_sn", orderNo));
|
||||||
String transactionId = resourceMap.get("transaction_id").toString();
|
PayWechatOrderEntity wechatEntity;
|
||||||
// 根据订单号,做幂等处理,并且在对业务数据进行状态检查和处理之前,要采用数据锁进行并发控制,以避免函数重入造成的数据混乱
|
if (!ObjectUtils.isEmpty(order)) {
|
||||||
BuyOrderEntity order = this.buyOrderService.getOne(new QueryWrapper<BuyOrderEntity>().eq("order_sn", orderNo));
|
wechatEntity = this.payWechatOrderService.getOne(new QueryWrapper<PayWechatOrderEntity>().eq("order_sn", order.getOrderSn()));
|
||||||
PayWechatOrderEntity wechatEntity = new PayWechatOrderEntity();
|
} else {
|
||||||
if(!ObjectUtils.isEmpty(order)){
|
log.error("无效订单!");
|
||||||
wechatEntity = this.payWechatOrderService.getOne(new QueryWrapper<PayWechatOrderEntity>().eq("order_sn", order.getOrderSn()));
|
return R.error(500, "无效订单!");
|
||||||
}else{
|
}
|
||||||
log.error("无效订单!");
|
// 1.根据订单id获取订单信息
|
||||||
return R.error(500,"无效订单!");
|
if ("order".equals(order.getOrderType())) {
|
||||||
}
|
BuyOrderEntity orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>().eq("order_sn", wechatEntity.getOrderSn()));
|
||||||
// 1.根据订单id获取订单信息
|
BigDecimal realMoney = orderEntity.getRealMoney();
|
||||||
if("order".equals(order.getOrderType())){
|
System.out.println("=========== 获取到 orderSn==================" + order.getOrderSn());
|
||||||
BuyOrderEntity orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>().eq("order_sn", wechatEntity.getOrderSn()));
|
// 查询订单的所有 book_id
|
||||||
BigDecimal realMoney = orderEntity.getRealMoney();
|
List<Integer> orderBookIdList = shopProudictBookService.getOrderBookId(order.getOrderSn());
|
||||||
|
System.out.println("=========== 获取到 orderBookIdList==========" + orderBookIdList);
|
||||||
//更新 订单 记录
|
// 去重
|
||||||
// 1. 根据订单 ID 查询订单详情
|
Set<Integer> set = new HashSet<>(orderBookIdList);
|
||||||
// 2. 由订单详情获取商品信息
|
orderBookIdList.clear();
|
||||||
// 3. 查询商品信息得到 book_id
|
orderBookIdList.addAll(set);
|
||||||
// 4. 查询用户的所有 book_id
|
// 查询用户的所有 book_id
|
||||||
// 5. 取差集
|
System.out.println("==============去重后orderBookIdList=========" + orderBookIdList);
|
||||||
/*
|
List<Integer> userBookIdList = userEbookBuyService.getUserBookId(order.getUserId());
|
||||||
list1.removeAll(list2)
|
System.out.println("==============userBookIdList===============" + userBookIdList);
|
||||||
*/
|
// 取差集
|
||||||
// 6. 为用户添加书籍
|
orderBookIdList.removeAll(userBookIdList);
|
||||||
|
System.out.println("============== 差集========================" + orderBookIdList);
|
||||||
if (wechatEntity.getTotalAmount().compareTo(realMoney) == 0) {
|
// 为用户添加书籍
|
||||||
buyOrderService.updateOrderStatus(Integer.valueOf(order.getUserId()),order.getOrderSn(),"0");
|
List<UserEbookBuyEntity> userEbookBuyEntities = new ArrayList<>();
|
||||||
}
|
for (Integer bookId : orderBookIdList) {
|
||||||
}
|
UserEbookBuyEntity entity = new UserEbookBuyEntity();
|
||||||
if("point".equals(order.getOrderType())){
|
entity.setUserId(order.getUserId());
|
||||||
PayWechatOrderEntity buy_order_id = payWechatOrderService.getBaseMapper().selectOne(new QueryWrapper<PayWechatOrderEntity>().eq("order_sn", order.getOrderSn()));
|
entity.setBookId(bookId);
|
||||||
Integer buyorder= buy_order_id.getBuyOrderId();
|
userEbookBuyEntities.add(entity);
|
||||||
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(buyorder);
|
}
|
||||||
String realMoney =bookBuyConfigEntity.getRealMoney();
|
System.out.println("============userEbookBuyEntities===========" + userEbookBuyEntities);
|
||||||
Integer money = Integer.valueOf(realMoney);
|
boolean b = userEbookBuyService.saveBatch(userEbookBuyEntities);
|
||||||
userService.rechargeHSPoint(Integer.valueOf(order.getUserId()),money);
|
System.out.println("============result========================" + b);
|
||||||
TransactionDetailsEntity transactionDetailsEntity = new TransactionDetailsEntity();
|
if (wechatEntity.getTotalAmount().compareTo(realMoney) == 0) {
|
||||||
transactionDetailsEntity.setUserId(order.getUserId());
|
buyOrderService.updateOrderStatus(order.getUserId(), order.getOrderSn(), "0");
|
||||||
transactionDetailsEntity.setChangeAmount(new BigDecimal(money));
|
|
||||||
transactionDetailsEntity.setOrderType("充值");
|
|
||||||
transactionDetailsEntity.setRelationId(buy_order_id.getId().intValue());
|
|
||||||
transactionDetailsEntity.setRemark("充值");
|
|
||||||
|
|
||||||
MyUserEntity user = userService.getById(Integer.valueOf(order.getUserId()));
|
|
||||||
BigDecimal peanutCoin = user.getPeanutCoin();
|
|
||||||
transactionDetailsEntity.setUserBalance(peanutCoin);
|
|
||||||
transactionDetailsEntity.setUserName(user.getNickname());
|
|
||||||
transactionDetailsEntity.setTel(user.getTel());
|
|
||||||
transactionDetailsService.save(transactionDetailsEntity);
|
|
||||||
// 插入 花生币 充值记录
|
|
||||||
PayPaymentOrderEntity payPaymentOrderEntity = new PayPaymentOrderEntity();
|
|
||||||
payPaymentOrderEntity.setUserId(Integer.valueOf(order.getUserId()));
|
|
||||||
payPaymentOrderEntity.setOrderId(String.valueOf(buy_order_id.getId()));
|
|
||||||
payPaymentOrderEntity.setRealAmount(new BigDecimal(bookBuyConfigEntity.getRealMoney()));
|
|
||||||
payPaymentOrderEntity.setRechargeAmount(new BigDecimal(bookBuyConfigEntity.getMoney()));
|
|
||||||
payPaymentOrderEntity.setRechargeChannel(bookBuyConfigEntity.getQudao());
|
|
||||||
payPaymentOrderEntity.setRechargeStatus("success");
|
|
||||||
payPaymentOrderEntity.setSuccessTime(new Date());
|
|
||||||
payPaymentOrderEntity.setUserName(user.getNickname());
|
|
||||||
payPaymentOrderEntity.setTel(user.getTel());
|
|
||||||
payPaymentOrderService.save(payPaymentOrderEntity);
|
|
||||||
buyOrderService.updateOrderStatus(Integer.valueOf(order.getUserId()),order.getOrderSn(),"2");
|
|
||||||
}
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
// 要主动释放锁
|
|
||||||
lock.unlock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ("point".equals(order.getOrderType())) {
|
||||||
|
PayWechatOrderEntity buy_order_id = payWechatOrderService.getBaseMapper().selectOne(new QueryWrapper<PayWechatOrderEntity>().eq("order_sn", order.getOrderSn()));
|
||||||
|
Integer buyorder = buy_order_id.getBuyOrderId();
|
||||||
|
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(buyorder);
|
||||||
|
String realMoney = bookBuyConfigEntity.getRealMoney();
|
||||||
|
int money = Integer.parseInt(realMoney);
|
||||||
|
userService.rechargeHSPoint(order.getUserId(), money);
|
||||||
|
TransactionDetailsEntity transactionDetailsEntity = new TransactionDetailsEntity();
|
||||||
|
transactionDetailsEntity.setUserId(order.getUserId());
|
||||||
|
transactionDetailsEntity.setChangeAmount(new BigDecimal(money));
|
||||||
|
transactionDetailsEntity.setOrderType("充值");
|
||||||
|
transactionDetailsEntity.setRelationId(buy_order_id.getId().intValue());
|
||||||
|
transactionDetailsEntity.setRemark("充值");
|
||||||
|
|
||||||
// 成功应答
|
MyUserEntity user = userService.getById(order.getUserId());
|
||||||
|
BigDecimal peanutCoin = user.getPeanutCoin();
|
||||||
|
transactionDetailsEntity.setUserBalance(peanutCoin);
|
||||||
|
transactionDetailsEntity.setUserName(user.getNickname());
|
||||||
|
transactionDetailsEntity.setTel(user.getTel());
|
||||||
|
transactionDetailsService.save(transactionDetailsEntity);
|
||||||
|
// 插入 花生币 充值记录
|
||||||
|
PayPaymentOrderEntity payPaymentOrderEntity = new PayPaymentOrderEntity();
|
||||||
|
payPaymentOrderEntity.setUserId(order.getUserId());
|
||||||
|
payPaymentOrderEntity.setOrderId(String.valueOf(buy_order_id.getId()));
|
||||||
|
payPaymentOrderEntity.setRealAmount(new BigDecimal(bookBuyConfigEntity.getRealMoney()));
|
||||||
|
payPaymentOrderEntity.setRechargeAmount(new BigDecimal(bookBuyConfigEntity.getMoney()));
|
||||||
|
payPaymentOrderEntity.setRechargeChannel(bookBuyConfigEntity.getQudao());
|
||||||
|
payPaymentOrderEntity.setRechargeStatus("success");
|
||||||
|
payPaymentOrderEntity.setSuccessTime(new Date());
|
||||||
|
payPaymentOrderEntity.setUserName(user.getNickname());
|
||||||
|
payPaymentOrderEntity.setTel(user.getTel());
|
||||||
|
payPaymentOrderService.save(payPaymentOrderEntity);
|
||||||
|
buyOrderService.updateOrderStatus(order.getUserId(), order.getOrderSn(), "2");
|
||||||
|
}
|
||||||
|
// 成功应答
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Map<String, Object> getNotifyBody(HttpServletRequest request) {
|
||||||
|
// 处理通知参数
|
||||||
private Map<String,Object> getNotifyBody(HttpServletRequest request ){
|
|
||||||
// 处理通知参数
|
|
||||||
String body = HttpUtils.readData(request);
|
String body = HttpUtils.readData(request);
|
||||||
log.info("zhifu回调参数:{}",body);
|
log.info("支付回调参数:{}", body);
|
||||||
|
// 转换为Map
|
||||||
// 转换为Map
|
Map<String, Object> bodyMap = JSONObject.parseObject(body, new TypeReference<Map<String, Object>>() {
|
||||||
Map<String, Object> bodyMap = JSONObject.parseObject(body, new TypeReference<Map<String, Object>>(){});
|
});
|
||||||
// 微信的通知ID(通知的唯一ID)
|
// 微信的通知ID(通知的唯一ID)
|
||||||
String notifyId = bodyMap.get("id").toString();
|
String notifyId = bodyMap.get("id").toString();
|
||||||
|
// 验证签名信息
|
||||||
// 验证签名信息
|
|
||||||
try {
|
try {
|
||||||
WechatPayValidator wechatPayValidator
|
WechatPayValidator wechatPayValidator = new WechatPayValidator(wechatPayConfig.getVerifier(), notifyId, body);
|
||||||
= new WechatPayValidator(wechatPayConfig.getVerifier(), notifyId, body);
|
if (!wechatPayValidator.validate(request)) {
|
||||||
if(!wechatPayValidator.validate(request)){
|
|
||||||
|
|
||||||
log.error("通知验签失败");
|
log.error("通知验签失败");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
log.info("通知验签成功");
|
log.info("通知验签成功");
|
||||||
}catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return bodyMap;
|
return bodyMap;
|
||||||
}
|
}
|
||||||
@@ -358,66 +350,58 @@ public class WeChatPayController {
|
|||||||
|
|
||||||
@RequestMapping(value = "/placeAnOrder/shoppingpay")
|
@RequestMapping(value = "/placeAnOrder/shoppingpay")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public R shoppingpay(@RequestBody WechatDto dto ) throws Exception{
|
public R shoppingpay(@RequestBody WechatDto dto) throws Exception {
|
||||||
log.info("生成订单");
|
log.info("生成订单");
|
||||||
List<BuyOrderEntity> one = this.buyOrderService.getBaseMapper().selectList(new QueryWrapper<BuyOrderEntity>().eq("order_sn", dto.getOrderSn()));
|
List<BuyOrderEntity> one = this.buyOrderService.getBaseMapper().selectList(new QueryWrapper<BuyOrderEntity>().eq("order_sn", dto.getOrderSn()));
|
||||||
BuyOrderEntity order = one.get(0);
|
BuyOrderEntity order = one.get(0);
|
||||||
|
|
||||||
// 获取订单
|
// 获取订单
|
||||||
Map<String,Object> paramMap = new HashMap<>();
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
paramMap.put("appid",appId);
|
paramMap.put("appid", appId);
|
||||||
paramMap.put("mchid",mchId);
|
paramMap.put("mchid", mchId);
|
||||||
paramMap.put("description","微信充值");
|
paramMap.put("description", "微信充值");
|
||||||
// 订单编号
|
// 订单编号
|
||||||
paramMap.put("out_trade_no",order.getOrderSn());
|
paramMap.put("out_trade_no", order.getOrderSn());
|
||||||
// paramMap.put("attach",""); //自定义数据 支付完成后才能显示 在查询API和支付通知中原样返回,可作为自定义参数使用
|
paramMap.put("notify_url", wechatPayConfig.getNotifyUrl());
|
||||||
paramMap.put("notify_url",wechatPayConfig.getNotifyUrl());
|
BigDecimal realsmoney = dto.getTotalAmount();
|
||||||
BigDecimal realsmoney= dto.getTotalAmount();
|
BigDecimal hand = new BigDecimal("100");
|
||||||
BigDecimal hand=new BigDecimal("100");
|
realsmoney = realsmoney.multiply(hand);
|
||||||
realsmoney =realsmoney.multiply(hand) ;
|
Map<String, Object> amountMap = new HashMap<>();
|
||||||
Map<String,Object> amountMap = new HashMap<>();
|
amountMap.put("total", realsmoney);
|
||||||
amountMap.put("total",realsmoney);
|
amountMap.put("currency", "CNY");
|
||||||
amountMap.put("currency","CNY");
|
paramMap.put("amount", amountMap);
|
||||||
|
|
||||||
|
|
||||||
paramMap.put("amount",amountMap);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(paramMap));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(paramMap));
|
||||||
log.info("请求参数"+paramMap);
|
log.info("请求参数" + paramMap);
|
||||||
com.alibaba.fastjson.JSONObject jsonObject1 = wxPayUtil.doPostWexinV3("https://api.mch.weixin.qq.com/v3/pay/transactions/app", json.toJSONString());
|
com.alibaba.fastjson.JSONObject jsonObject1 = wxPayUtil.doPostWexinV3("https://api.mch.weixin.qq.com/v3/pay/transactions/app", json.toJSONString());
|
||||||
String prepayid = jsonObject1.getString("prepay_id");
|
String prepayid = jsonObject1.getString("prepay_id");
|
||||||
// 传入参数 payUrl 发送post请求
|
// 传入参数 payUrl 发送post请求
|
||||||
HttpPost httpPost = new HttpPost(payUrl);
|
HttpPost httpPost = new HttpPost(payUrl);
|
||||||
// 将json数据转换成字符串
|
// 将json数据转换成字符串
|
||||||
StringEntity entity = new StringEntity(json.toString(),"utf-8");
|
StringEntity entity = new StringEntity(json.toString(), "utf-8");
|
||||||
// 设置该请求的Content-Type为application/json 都是json格式
|
// 设置该请求的Content-Type为application/json 都是json格式
|
||||||
entity.setContentType("application/json");
|
entity.setContentType("application/json");
|
||||||
// 将实体对象设置到HttpPost表示要传递该数据到服务器端。
|
// 将实体对象设置到HttpPost表示要传递该数据到服务器端。
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
// 设置请求头部的Accept属性为"application/json"表示客户端希望接收的为json。
|
// 设置请求头部的Accept属性为"application/json"表示客户端希望接收的为json。
|
||||||
httpPost.setHeader("Accept", "application/json");
|
httpPost.setHeader("Accept", "application/json");
|
||||||
CloseableHttpResponse response = wxPayClient.execute(httpPost);
|
CloseableHttpResponse response = wxPayClient.execute(httpPost);
|
||||||
// 向微信支付平台发送请求,处理响应结果,并将订单信息保存到数据库中。
|
// 向微信支付平台发送请求,处理响应结果,并将订单信息保存到数据库中。
|
||||||
String bodyAsString = EntityUtils.toString(response.getEntity());//响应体
|
String bodyAsString = EntityUtils.toString(response.getEntity());//响应体
|
||||||
// 时间戳
|
// 时间戳
|
||||||
Long timestamp = System.currentTimeMillis()/1000;
|
long timestamp = System.currentTimeMillis() / 1000;
|
||||||
// 随机串
|
// 随机串
|
||||||
String nonceStr = UUID.randomUUID().toString().replace("-","");
|
String nonceStr = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
String sign = wxPayUtil.getSign(WxPayUtil.appId, timestamp, nonceStr, prepayid);
|
||||||
String sign = wxPayUtil.getSign(WxPayUtil.appId,timestamp,nonceStr,prepayid);
|
log.info("签名:" + sign);
|
||||||
log.info("签名:"+sign);
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("prepayid", prepayid);
|
||||||
Map Map = new HashMap();
|
map.put("timestamp", timestamp + "");
|
||||||
Map.put("prepayid",prepayid);
|
map.put("noncestr", nonceStr);
|
||||||
Map.put("timestamp",timestamp+"");
|
map.put("sign", sign);
|
||||||
Map.put("noncestr",nonceStr);
|
map.put("appid", appId);
|
||||||
Map.put("sign",sign);
|
map.put("package", "Sign=WXPay");
|
||||||
Map.put("appid",appId);
|
map.put("extData", "sign");
|
||||||
Map.put("package","Sign=WXPay");
|
map.put("partnerid", mchId);
|
||||||
Map.put("extData","sign");
|
|
||||||
Map.put("partnerid",mchId);
|
|
||||||
try {
|
try {
|
||||||
int statusCode = response.getStatusLine().getStatusCode(); //响应状态码
|
int statusCode = response.getStatusLine().getStatusCode(); //响应状态码
|
||||||
if (statusCode == 200) { //处理成功
|
if (statusCode == 200) { //处理成功
|
||||||
@@ -433,22 +417,17 @@ public class WeChatPayController {
|
|||||||
wechat.setPayType(order.getOrderType()); //交易类型
|
wechat.setPayType(order.getOrderType()); //交易类型
|
||||||
wechat.setOrderId(order.getOrderSn()); //订单号
|
wechat.setOrderId(order.getOrderSn()); //订单号
|
||||||
wechat.setBuyOrderId(dto.getBuyOrderId()); //购买配置id
|
wechat.setBuyOrderId(dto.getBuyOrderId()); //购买配置id
|
||||||
// wechat.setEndtime(after);
|
|
||||||
this.payWechatOrderService.save(wechat); //微信订单表拿到数据保存数据库
|
this.payWechatOrderService.save(wechat); //微信订单表拿到数据保存数据库
|
||||||
|
|
||||||
} else if (statusCode == 204) { //处理成功,无返回Body
|
} else if (statusCode == 204) { //处理成功,无返回Body
|
||||||
System.out.println("成功");
|
System.out.println("成功");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("下单失败 = " + statusCode + ",返回结果 = " + bodyAsString);
|
System.out.println("下单失败 = " + statusCode + ",返回结果 = " + bodyAsString);
|
||||||
throw new IOException("request failed");
|
throw new IOException("request failed");
|
||||||
}
|
}
|
||||||
}finally {
|
} finally {
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
// 返回url和订单号
|
// 返回url和订单号
|
||||||
return R.ok().put("paramMap" ,paramMap).put("Map",Map);
|
return R.ok().put("paramMap", paramMap).put("Map", map);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ import java.util.Base64;
|
|||||||
|
|
||||||
public static final String apiV3Key = "4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF"; // apiV3秘钥
|
public static final String apiV3Key = "4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF"; // apiV3秘钥
|
||||||
//商户私钥路径
|
//商户私钥路径
|
||||||
public static final String privateKeyUrl = "/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem";
|
// public static final String privateKeyUrl = "/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem";
|
||||||
// public static final String privateKeyUrl = "C:/Users/Administrator/IdeaProjects/peanut_book/src/main/resources/cent/apiclient_key.pem";
|
public static final String privateKeyUrl = "C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem";
|
||||||
|
|
||||||
//平台证书路径
|
//平台证书路径
|
||||||
public static final String wechatPayCertificateUrl = "/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
// public static final String wechatPayCertificateUrl = "/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
||||||
// public static final String wechatPayCertificateUrl = "C:/Users/Administrator/IdeaProjects/peanut_book/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
public static final String wechatPayCertificateUrl = "C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
||||||
//第一步申请完证书后,在API证书哪里点击管理证书就能看到
|
//第一步申请完证书后,在API证书哪里点击管理证书就能看到
|
||||||
public static final String mchSerialNo = "679AECB2F7AC4183033F713828892BA640E4EEE3"; // 商户证书序列号
|
public static final String mchSerialNo = "679AECB2F7AC4183033F713828892BA640E4EEE3"; // 商户证书序列号
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +1,59 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
# url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||||
url: jdbc:mysql://59.110.212.44:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://59.110.212.44:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: HSXY1234hsxy
|
password: HSXY1234hsxy
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
max-active: 100
|
max-active: 100
|
||||||
min-idle: 10
|
min-idle: 10
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
pool-prepared-statements: true
|
pool-prepared-statements: true
|
||||||
max-pool-prepared-statement-per-connection-size: 20
|
max-pool-prepared-statement-per-connection-size: 20
|
||||||
time-between-eviction-runs-millis: 60000
|
time-between-eviction-runs-millis: 60000
|
||||||
min-evictable-idle-time-millis: 300000
|
min-evictable-idle-time-millis: 300000
|
||||||
#Oracle需要打开注释
|
#Oracle需要打开注释
|
||||||
#validation-query: SELECT 1 FROM DUAL
|
#validation-query: SELECT 1 FROM DUAL
|
||||||
test-while-idle: true
|
test-while-idle: true
|
||||||
test-on-borrow: false
|
test-on-borrow: false
|
||||||
test-on-return: false
|
test-on-return: false
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: true
|
enabled: true
|
||||||
url-pattern: /druid/*
|
url-pattern: /druid/*
|
||||||
#login-username: admin
|
#login-username: admin
|
||||||
#login-password: admin
|
#login-password: admin
|
||||||
filter:
|
filter:
|
||||||
stat:
|
stat:
|
||||||
log-slow-sql: true
|
log-slow-sql: true
|
||||||
slow-sql-millis: 1000
|
slow-sql-millis: 1000
|
||||||
merge-sql: false
|
merge-sql: false
|
||||||
wall:
|
wall:
|
||||||
config:
|
config:
|
||||||
multi-statement-allow: true
|
multi-statement-allow: true
|
||||||
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
host: 59.110.212.44
|
host: 59.110.212.44
|
||||||
port: 5672
|
port: 5672
|
||||||
username: admin
|
username: admin
|
||||||
password: 751019
|
password: 751019
|
||||||
virtualHost: /
|
virtualHost: /
|
||||||
|
|
||||||
aliyun:
|
aliyun:
|
||||||
oss:
|
oss:
|
||||||
file:
|
file:
|
||||||
endpoint: oss-cn-beijing.aliyuncs.com
|
endpoint: oss-cn-beijing.aliyuncs.com
|
||||||
keyid: LTAIiSMeo8ztauV5
|
keyid: LTAIiSMeo8ztauV5
|
||||||
keysecret: pVIYAOIFSUGg61lYfE8cjg2ZNpnLJA
|
keysecret: pVIYAOIFSUGg61lYfE8cjg2ZNpnLJA
|
||||||
bucketname: ehh-private-01
|
bucketname: ehh-private-01
|
||||||
sms:
|
sms:
|
||||||
accessKeyId: LTAI5tJbbw5fY97pnw635yq3
|
accessKeyId: LTAI5tJbbw5fY97pnw635yq3
|
||||||
accessKeySecret: LTXQ9v3OYVwNVbDWWfVpbbcVDKErKi
|
accessKeySecret: LTXQ9v3OYVwNVbDWWfVpbbcVDKErKi
|
||||||
singName: 疯子读书
|
singName: 疯子读书
|
||||||
|
|
||||||
templateCode: SMS_248840040
|
templateCode: SMS_248840040
|
||||||
|
|
||||||
##多数据源的配置
|
##多数据源的配置
|
||||||
#dynamic:
|
#dynamic:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ connection-timeout: 6000000ms
|
|||||||
spring:
|
spring:
|
||||||
# 环境 dev|test|prod
|
# 环境 dev|test|prod
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: prod
|
||||||
# jackson时间格式化
|
# jackson时间格式化
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
|
|||||||
@@ -13,18 +13,13 @@
|
|||||||
<result property="bookdIds" column="book_ids"/>
|
<result property="bookdIds" column="book_ids"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!--
|
<select id="getOrderBookId" parameterType="string" resultType="int">
|
||||||
SELECT
|
SELECT spb.book_id
|
||||||
spb.*
|
FROM shop_proudict_book spb
|
||||||
FROM
|
LEFT JOIN buy_order_detail bod ON spb.proudict_id = bod.product_id
|
||||||
shop_proudict_book spb
|
LEFT JOIN buy_order bo ON bo.order_id = bod.order_id
|
||||||
LEFT JOIN buy_order_detail bod ON spb.proudict_id = bod.product_id
|
WHERE bo.order_sn = #{orderSn}
|
||||||
LEFT JOIN buy_order bo ON bo.order_id = bod.order_id
|
</select>
|
||||||
WHERE
|
|
||||||
bo.order_sn = '202305291720149121663113008012001282'
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<mapper namespace="com.peanut.modules.book.dao.UserEbookBuyDao">
|
<mapper namespace="com.peanut.modules.book.dao.UserEbookBuyDao">
|
||||||
|
|
||||||
<!-- 可根据自己的需求,是否要使用 -->
|
<!-- 可根据自己的需求,是否要使用 -->
|
||||||
<resultMap type="com.peanut.modules.book.entity.UserEbookBuyEntity" id="userEbookBuyMap">
|
<resultMap type="com.peanut.modules.book.entity.UserEbookBuyEntity" id="userEbookBuyMap">
|
||||||
<result property="buyId" column="buy_id"/>
|
<result property="buyId" column="buy_id"/>
|
||||||
<result property="userId" column="user_id"/>
|
<result property="userId" column="user_id"/>
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
<result property="author" column="author"/>
|
<result property="author" column="author"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!--
|
<select id="getUserBookId" parameterType="int" resultType="int">
|
||||||
select book_id from user_ebook_buy where user_id = '10169'
|
SELECT book_id
|
||||||
-->
|
FROM user_ebook_buy
|
||||||
|
WHERE user_id = #{userId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,50 +1,48 @@
|
|||||||
wxpay:
|
wxpay:
|
||||||
#应用编号
|
# ????
|
||||||
wxpay.appId: wx47134a8f15083734
|
wxpay.appId: wx47134a8f15083734
|
||||||
#商户号
|
# ???
|
||||||
wxpay.mchId: 1612860909
|
wxpay.mchId: 1612860909
|
||||||
# APIv3密钥
|
# API v3 ??
|
||||||
wxpay.apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
wxpay.apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
||||||
# 微信支付V3-url前缀
|
# v3 - url
|
||||||
wxpay.baseUrl: https://api.mch.weixin.qq.com/v3
|
wxpay.baseUrl: https://api.mch.weixin.qq.com/v3
|
||||||
#po9k1ezoyexk.ngrok.xiaomiqiu123.top 内网穿透地址 测试ok 正式环境下切换服务器地址
|
#po9k1ezoyexk.ngrok.xiaomiqiu123.top # ????????
|
||||||
#wxpay.notifyUrl: http://101.201.146.165:9100
|
#wxpay.notifyUrl: http://101.201.146.165:9100
|
||||||
|
|
||||||
wxpay.notifyUrl: http://59.110.212.44:9100/pb/pay/payNotify
|
wxpay.notifyUrl: http://59.110.212.44:9100/pb/pay/payNotify
|
||||||
|
|
||||||
# 退款通知回调, pjm6m9.natappfree.cc 为内网穿透地址
|
# ??????
|
||||||
wxpay.refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify
|
wxpay.refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify
|
||||||
# 密钥路径,resources下 /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
# ???? /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||||
|
|
||||||
wxpay.keyPemPath:C:/Users/Administrator/IdeaProjects/peanut_book/src/main/resources/cent/apiclient_key.pem
|
wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||||
#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||||
#商户证书序列号
|
#???????
|
||||||
wxpay.serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3
|
wxpay.serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3
|
||||||
#微信服务器地址
|
#???????
|
||||||
wxpay.domain: https://api.mch.weixin.qq.com
|
wxpay.domain: https://api.mch.weixin.qq.com
|
||||||
|
|
||||||
|
|
||||||
#wxpay:
|
#wxpay:
|
||||||
##应用编号
|
##????
|
||||||
#wxpay.appId: wx47134a8f15083734
|
#wxpay.appId: wx47134a8f15083734
|
||||||
##商户号
|
##???
|
||||||
#wxpay.mchId: 1612860909
|
#wxpay.mchId: 1612860909
|
||||||
## APIv3密钥
|
## APIv3??
|
||||||
#wxpay.apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
#wxpay.apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
||||||
## 微信支付V3-url前缀
|
## ????V3-url??
|
||||||
#wxpay.baseUrl: https://api.mch.weixin.qq.com/v3
|
#wxpay.baseUrl: https://api.mch.weixin.qq.com/v3
|
||||||
##po9k1ezoyexk.ngrok.xiaomiqiu123.top 内网穿透地址 测试ok 正式环境下切换服务器地址
|
##po9k1ezoyexk.ngrok.xiaomiqiu123.top ?????? ??ok ????????????
|
||||||
#
|
#
|
||||||
##wxpay.notifyUrl: http://101.201.146.165:9100
|
##wxpay.notifyUrl: http://101.201.146.165:9100
|
||||||
#
|
#
|
||||||
#wxpay.notifyUrl: http://59.110.212.44:9100/pb/pay/payNotify
|
#wxpay.notifyUrl: http://59.110.212.44:9100/pb/pay/payNotify
|
||||||
#
|
#
|
||||||
## 退款通知回调, pjm6m9.natappfree.cc 为内网穿透地址
|
## ??????, pjm6m9.natappfree.cc ???????
|
||||||
#wxpay.refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify
|
#wxpay.refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify
|
||||||
## 密钥路径,resources下 /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
## ????,resources? /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||||
#
|
#
|
||||||
#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||||
##商户证书序列号
|
##???????
|
||||||
#wxpay.serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3
|
#wxpay.serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3
|
||||||
##微信服务器地址
|
##???????
|
||||||
#wxpay.domain: https://api.mch.weixin.qq.com
|
#wxpay.domain: https://api.mch.weixin.qq.com
|
||||||
Reference in New Issue
Block a user