1
0
suochencheng 7 лет назад
Родитель
Сommit
259b8de185
24 измененных файлов с 3315 добавлено и 339 удалено
  1. 4 0
      log.txt
  2. 56 41
      src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java
  3. 2 0
      src/main/java/com/izouma/awesomeadmin/dao/UserAddressMapper.java
  4. 228 205
      src/main/java/com/izouma/awesomeadmin/dao/UserAddressMapper.xml
  5. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/WxpayTempMapper.java
  6. 573 0
      src/main/java/com/izouma/awesomeadmin/dao/WxpayTempMapper.xml
  7. 233 0
      src/main/java/com/izouma/awesomeadmin/dto/WxPayRefundData.java
  8. 293 0
      src/main/java/com/izouma/awesomeadmin/dto/WxPaySendData.java
  9. 195 0
      src/main/java/com/izouma/awesomeadmin/model/WxpayTemp.java
  10. 6 3
      src/main/java/com/izouma/awesomeadmin/service/UserAddressService.java
  11. 7 0
      src/main/java/com/izouma/awesomeadmin/service/UserOrderService.java
  12. 27 0
      src/main/java/com/izouma/awesomeadmin/service/WxpayTempService.java
  13. 42 18
      src/main/java/com/izouma/awesomeadmin/service/impl/UserAddressServiceImpl.java
  14. 198 1
      src/main/java/com/izouma/awesomeadmin/service/impl/UserOrderServiceImpl.java
  15. 137 0
      src/main/java/com/izouma/awesomeadmin/service/impl/WxpayTempServiceImpl.java
  16. 7 23
      src/main/java/com/izouma/awesomeadmin/util/MbappUtil.java
  17. 130 0
      src/main/java/com/izouma/awesomeadmin/util/UnifiedorderService.java
  18. 59 44
      src/main/java/com/izouma/awesomeadmin/web/UserAddressController.java
  19. 179 3
      src/main/java/com/izouma/awesomeadmin/web/WeiXinController.java
  20. 169 0
      src/main/java/com/izouma/awesomeadmin/web/WxpayTempController.java
  21. 6 1
      src/main/resources/properties/outsidews.properties
  22. 138 0
      src/main/vue/src/pages/WxpayTemp.vue
  23. 583 0
      src/main/vue/src/pages/WxpayTemps.vue
  24. 10 0
      src/main/vue/src/router/index.js

+ 4 - 0
log.txt

@@ -28,3 +28,7 @@
 [2018-08-08 19:03:57] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
 [2018-08-08 19:04:18] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
 [2018-08-08 19:08:49] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-27 14:25:47] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-27 14:30:57] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-27 14:31:13] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-27 14:32:17] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.

+ 56 - 41
src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java

@@ -8,20 +8,20 @@ package com.izouma.awesomeadmin.constant;
 public interface AppConstant {
 
 
-    /**
-     * 商户号
-     */
-    String MCH_ID = "1379284802";
-
-    /**
-     * 子商户号
-     */
-    String SUB_MCH_ID = "";
-
-    /**
-     * 商户密钥
-     */
-    String MCH_SECRET = "R4q0yoo5GXh9A3CDiKJ6v7hgiE0aT0rM";
+//    /**
+//     * 商户号
+//     */
+//    String MCH_ID = "1379284802";
+//
+//    /**
+//     * 子商户号
+//     */
+//    String SUB_MCH_ID = "";
+//
+//    /**
+//     * 商户密钥
+//     */
+//    String MCH_SECRET = "R4q0yoo5GXh9A3CDiKJ6v7hgiE0aT0rM";
 
     /**
      * 货币类型
@@ -29,44 +29,54 @@ public interface AppConstant {
     String FEE_TYPE = "CNY";
 
     /**
-     * 交易类型
-     */
-    String TRADE_TYPE = "JSAPI";
-
-    /**
-     * 设备号 PC网页或公众号内支付请传"WEB"
-     */
-    String DEVICE_INFO = "WEB";
-
-    /**
-     * 标题
+     * 交易类型 扫码
      */
-    String BODY = "工蜂家服产品";
+    String TRADE_TYPE_NATIVE = "NATIVE";
 
     /**
-     * 标题
+     * 交易类型 公众号H5
      */
-    String BODY_RECHARGE = "工蜂家服充值";
+    String TRADE_TYPE_JSAPI = "JSAPI";
 
     /**
-     * 通知地址
+     * 交易类型 APP
      */
-    String NOTIFY_URL = "http://www.gfjiafu.com/wxpay/notify";
+    String TRADE_TYPE_APP = "APP";
 
     /**
-     * 通知地址
-     */
-    String GXNOTIFY_URL = "http://www.gfjiafu.com/GXwxpay/notify";
-
-    /**
-     * 通知地址
+     * 设备号 PC网页或公众号内支付请传"WEB"
      */
-    String NOTIFY_URL_RECHARGE = "http://www.gfjiafu.com/wxpay/notifyRecharge";
+    String DEVICE_INFO = "WEB";
 
-    /**
-     * 商户名称
-     */
-    String SEND_NAME = "工蜂家服";
+//    /**
+//     * 标题
+//     */
+//    String BODY = "工蜂家服产品";
+//
+//    /**
+//     * 标题
+//     */
+//    String BODY_RECHARGE = "工蜂家服充值";
+//
+//    /**
+//     * 通知地址
+//     */
+//    String NOTIFY_URL = "http://www.gfjiafu.com/wxpay/notify";
+//
+//    /**
+//     * 通知地址
+//     */
+//    String GXNOTIFY_URL = "http://www.gfjiafu.com/GXwxpay/notify";
+//
+//    /**
+//     * 通知地址
+//     */
+//    String NOTIFY_URL_RECHARGE = "http://www.gfjiafu.com/wxpay/notifyRecharge";
+//
+//    /**
+//     * 商户名称
+//     */
+//    String SEND_NAME = "工蜂家服";
 
     String PAGE = "page";
 
@@ -249,5 +259,10 @@ public interface AppConstant {
          */
         Integer RECHARGE = 1;
 
+        /**
+         * 押金
+         */
+        Integer CASH_PLEDGE = 2;
+
     }
 }

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/dao/UserAddressMapper.java

@@ -29,5 +29,7 @@ public interface UserAddressMapper{
     UserAddress queryUserAddress(UserAddress record);
 
     List<UserAddress> query(UserAddress record);
+
+    int setDefaultUserAddress(Map<String,Object> parameter);
 }
 

+ 228 - 205
src/main/java/com/izouma/awesomeadmin/dao/UserAddressMapper.xml

@@ -1,23 +1,23 @@
 <?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.izouma.awesomeadmin.dao.UserAddressMapper" >
-    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.UserAddress" >
-                <id column="id" property="id" jdbcType="INTEGER" />
-                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
-                                <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
-                                <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
-                                <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-                                <result column="create_user" property="createUser" jdbcType="VARCHAR" />
-                                <result column="user_id" property="userId" jdbcType="INTEGER" />
-                                <result column="real_name" property="realName" jdbcType="VARCHAR" />
-                                <result column="telephone" property="telephone" jdbcType="VARCHAR" />
-                                <result column="postcode" property="postcode" jdbcType="VARCHAR" />
-                                <result column="address" property="address" jdbcType="VARCHAR" />
-                                <result column="address_detail" property="addressDetail" jdbcType="VARCHAR" />
-                                <result column="default_flag" property="defaultFlag" jdbcType="CHAR" />
-            </resultMap>
-    <sql id="Base_Column_List" >
-        <trim  suffixOverrides="," >
+<mapper namespace="com.izouma.awesomeadmin.dao.UserAddressMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.UserAddress">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
+        <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
+        <result column="user_id" property="userId" jdbcType="INTEGER"/>
+        <result column="real_name" property="realName" jdbcType="VARCHAR"/>
+        <result column="telephone" property="telephone" jdbcType="VARCHAR"/>
+        <result column="postcode" property="postcode" jdbcType="VARCHAR"/>
+        <result column="address" property="address" jdbcType="VARCHAR"/>
+        <result column="address_detail" property="addressDetail" jdbcType="VARCHAR"/>
+        <result column="default_flag" property="defaultFlag" jdbcType="CHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
             id,
 
             del_flag,
@@ -44,202 +44,206 @@
 
             default_flag,
 
-            </trim>
+        </trim>
     </sql>
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
         select
-        <include refid="Base_Column_List" />
+        <include refid="Base_Column_List"/>
         from user_address
         where id = #{id,jdbcType=INTEGER}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
         delete from user_address
         where id = #{id,jdbcType=INTEGER}
     </delete>
-    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.UserAddress" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.UserAddress" useGeneratedKeys="true"
+            keyProperty="id">
         insert into user_address
-        <trim prefix="(" suffix=")" suffixOverrides="," >
-                <if test="id!= null" >
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
                 id,
             </if>
-                <if test="delFlag!= null" >
+            <if test="delFlag!= null">
                 del_flag,
             </if>
-                <if test="updateTime!= null" >
+            <if test="updateTime!= null">
                 update_time,
             </if>
-                <if test="updateUser!= null" >
+            <if test="updateUser!= null">
                 update_user,
             </if>
-                <if test="createTime!= null" >
+            <if test="createTime!= null">
                 create_time,
             </if>
-                <if test="createUser!= null" >
+            <if test="createUser!= null">
                 create_user,
             </if>
-                <if test="userId!= null" >
+            <if test="userId!= null">
                 user_id,
             </if>
-                <if test="realName!= null" >
+            <if test="realName!= null">
                 real_name,
             </if>
-                <if test="telephone!= null" >
+            <if test="telephone!= null">
                 telephone,
             </if>
-                <if test="postcode!= null" >
+            <if test="postcode!= null">
                 postcode,
             </if>
-                <if test="address!= null" >
+            <if test="address!= null">
                 address,
             </if>
-                <if test="addressDetail!= null" >
+            <if test="addressDetail!= null">
                 address_detail,
             </if>
-                <if test="defaultFlag!= null" >
+            <if test="defaultFlag!= null">
                 default_flag,
             </if>
-            </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-                    <if test="id != null" >
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
                 #{id,jdbcType=INTEGER},
             </if>
-                    <if test="delFlag != null" >
+            <if test="delFlag != null">
                 #{delFlag,jdbcType=CHAR},
             </if>
-                    <if test="updateTime != null" >
+            <if test="updateTime != null">
                 #{updateTime,jdbcType=TIMESTAMP},
             </if>
-                    <if test="updateUser != null" >
+            <if test="updateUser != null">
                 #{updateUser,jdbcType=VARCHAR},
             </if>
-                    <if test="createTime != null" >
+            <if test="createTime != null">
                 #{createTime,jdbcType=TIMESTAMP},
             </if>
-                    <if test="createUser != null" >
+            <if test="createUser != null">
                 #{createUser,jdbcType=VARCHAR},
             </if>
-                    <if test="userId != null" >
+            <if test="userId != null">
                 #{userId,jdbcType=INTEGER},
             </if>
-                    <if test="realName != null" >
+            <if test="realName != null">
                 #{realName,jdbcType=VARCHAR},
             </if>
-                    <if test="telephone != null" >
+            <if test="telephone != null">
                 #{telephone,jdbcType=VARCHAR},
             </if>
-                    <if test="postcode != null" >
+            <if test="postcode != null">
                 #{postcode,jdbcType=VARCHAR},
             </if>
-                    <if test="address != null" >
+            <if test="address != null">
                 #{address,jdbcType=VARCHAR},
             </if>
-                    <if test="addressDetail != null" >
+            <if test="addressDetail != null">
                 #{addressDetail,jdbcType=VARCHAR},
             </if>
-                    <if test="defaultFlag != null" >
+            <if test="defaultFlag != null">
                 #{defaultFlag,jdbcType=CHAR},
             </if>
-                </trim>
+        </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.UserAddress" >
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.UserAddress">
         update user_address
-        <set >
-                    <if test="id != null" >
-               id= #{id,jdbcType=INTEGER},
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
             </if>
-                     <if test="delFlag != null" >
-               del_flag= #{delFlag,jdbcType=CHAR},
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
             </if>
-                     <if test="updateTime != null" >
-               update_time= #{updateTime,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                update_time= #{updateTime,jdbcType=TIMESTAMP},
             </if>
-                     <if test="updateUser != null" >
-               update_user= #{updateUser,jdbcType=VARCHAR},
+            <if test="updateUser != null">
+                update_user= #{updateUser,jdbcType=VARCHAR},
             </if>
-                     <if test="createTime != null" >
-               create_time= #{createTime,jdbcType=TIMESTAMP},
+            <if test="createTime != null">
+                create_time= #{createTime,jdbcType=TIMESTAMP},
             </if>
-                     <if test="createUser != null" >
-               create_user= #{createUser,jdbcType=VARCHAR},
+            <if test="createUser != null">
+                create_user= #{createUser,jdbcType=VARCHAR},
             </if>
-                     <if test="userId != null" >
-               user_id= #{userId,jdbcType=INTEGER},
+            <if test="userId != null">
+                user_id= #{userId,jdbcType=INTEGER},
             </if>
-                     <if test="realName != null" >
-               real_name= #{realName,jdbcType=VARCHAR},
+            <if test="realName != null">
+                real_name= #{realName,jdbcType=VARCHAR},
             </if>
-                     <if test="telephone != null" >
-               telephone= #{telephone,jdbcType=VARCHAR},
+            <if test="telephone != null">
+                telephone= #{telephone,jdbcType=VARCHAR},
             </if>
-                     <if test="postcode != null" >
-               postcode= #{postcode,jdbcType=VARCHAR},
+            <if test="postcode != null">
+                postcode= #{postcode,jdbcType=VARCHAR},
             </if>
-                     <if test="address != null" >
-               address= #{address,jdbcType=VARCHAR},
+            <if test="address != null">
+                address= #{address,jdbcType=VARCHAR},
             </if>
-                     <if test="addressDetail != null" >
-               address_detail= #{addressDetail,jdbcType=VARCHAR},
+            <if test="addressDetail != null">
+                address_detail= #{addressDetail,jdbcType=VARCHAR},
             </if>
-                     <if test="defaultFlag != null" >
-               default_flag= #{defaultFlag,jdbcType=CHAR},
+            <if test="defaultFlag != null">
+                default_flag= #{defaultFlag,jdbcType=CHAR},
             </if>
-                 </set>
+        </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
-    <select id="queryUserAddressByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserAddress">
-        select <include refid="Base_Column_List"/> from user_address
+    <select id="queryUserAddressByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.UserAddress">
+        select
+        <include refid="Base_Column_List"/>
+        from user_address
         <where>
             and del_flag = 'N'
-                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
-                and  id = #{record.id}
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
             </if>
-                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
-                and  del_flag = #{record.delFlag}
+            <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
+                and update_time = #{record.updateTime}
             </if>
-                     <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
-                and  update_time = #{record.updateTime}
+            <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
+                and update_user = #{record.updateUser}
             </if>
-                     <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
-                and  update_user = #{record.updateUser}
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
             </if>
-                     <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
-                and  create_time = #{record.createTime}
+            <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
+                and create_user = #{record.createUser}
             </if>
-                     <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
-                and  create_user = #{record.createUser}
+            <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
+                and user_id = #{record.userId}
             </if>
-                     <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
-                and  user_id = #{record.userId}
+            <if test="record.realName != null and !&quot;&quot;.equals(record.realName)">
+                and real_name = #{record.realName}
             </if>
-                     <if test="record.realName != null and !&quot;&quot;.equals(record.realName)">
-                and  real_name = #{record.realName}
+            <if test="record.telephone != null and !&quot;&quot;.equals(record.telephone)">
+                and telephone = #{record.telephone}
             </if>
-                     <if test="record.telephone != null and !&quot;&quot;.equals(record.telephone)">
-                and  telephone = #{record.telephone}
+            <if test="record.postcode != null and !&quot;&quot;.equals(record.postcode)">
+                and postcode = #{record.postcode}
             </if>
-                     <if test="record.postcode != null and !&quot;&quot;.equals(record.postcode)">
-                and  postcode = #{record.postcode}
+            <if test="record.address != null and !&quot;&quot;.equals(record.address)">
+                and address = #{record.address}
             </if>
-                     <if test="record.address != null and !&quot;&quot;.equals(record.address)">
-                and  address = #{record.address}
+            <if test="record.addressDetail != null and !&quot;&quot;.equals(record.addressDetail)">
+                and address_detail = #{record.addressDetail}
             </if>
-                     <if test="record.addressDetail != null and !&quot;&quot;.equals(record.addressDetail)">
-                and  address_detail = #{record.addressDetail}
+            <if test="record.defaultFlag != null and !&quot;&quot;.equals(record.defaultFlag)">
+                and default_flag = #{record.defaultFlag}
             </if>
-                     <if test="record.defaultFlag != null and !&quot;&quot;.equals(record.defaultFlag)">
-                and  default_flag = #{record.defaultFlag}
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR user_id LIKE concat('%',#{record.searchKey},'%')
+                    OR real_name LIKE concat('%',#{record.searchKey},'%')
+                    OR telephone LIKE concat('%',#{record.searchKey},'%')
+                    OR postcode LIKE concat('%',#{record.searchKey},'%')
+                    OR address LIKE concat('%',#{record.searchKey},'%')
+                    OR address_detail LIKE concat('%',#{record.searchKey},'%')
+                    OR default_flag LIKE concat('%',#{record.searchKey},'%')
+                </trim>
             </if>
-                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
-             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                                                                                                                                                                                                    OR  user_id LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  real_name LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  telephone LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  postcode LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  address LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  address_detail LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  default_flag LIKE concat('%',#{record.searchKey},'%')
-                                                             </trim>
-         </if>
 
             <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
                 <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
@@ -291,96 +295,99 @@
             </trim>
             ,
         </if>
-        id desc
+        user_id , default_flag DESC , id desc
     </select>
-    <select id="queryAllUserAddress" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserAddress">
-        select <include refid="Base_Column_List"/> from user_address
+    <select id="queryAllUserAddress" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.UserAddress">
+        select
+        <include refid="Base_Column_List"/>
+        from user_address
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
-                and  id = #{id}
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
             </if>
-                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-                and  del_flag = #{delFlag}
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
             </if>
-                    <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
-                and  update_time = #{updateTime}
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+                and update_time = #{updateTime}
             </if>
-                    <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
-                and  update_user = #{updateUser}
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+                and update_user = #{updateUser}
             </if>
-                    <if test="createTime != null and !&quot;&quot;.equals(createTime)">
-                and  create_time = #{createTime}
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
             </if>
-                    <if test="createUser != null and !&quot;&quot;.equals(createUser)">
-                and  create_user = #{createUser}
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and create_user = #{createUser}
             </if>
-                    <if test="userId != null and !&quot;&quot;.equals(userId)">
-                and  user_id = #{userId}
+            <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and user_id = #{userId}
             </if>
-                    <if test="realName != null and !&quot;&quot;.equals(realName)">
-                and  real_name = #{realName}
+            <if test="realName != null and !&quot;&quot;.equals(realName)">
+                and real_name = #{realName}
             </if>
-                    <if test="telephone != null and !&quot;&quot;.equals(telephone)">
-                and  telephone = #{telephone}
+            <if test="telephone != null and !&quot;&quot;.equals(telephone)">
+                and telephone = #{telephone}
             </if>
-                    <if test="postcode != null and !&quot;&quot;.equals(postcode)">
-                and  postcode = #{postcode}
+            <if test="postcode != null and !&quot;&quot;.equals(postcode)">
+                and postcode = #{postcode}
             </if>
-                    <if test="address != null and !&quot;&quot;.equals(address)">
-                and  address = #{address}
+            <if test="address != null and !&quot;&quot;.equals(address)">
+                and address = #{address}
             </if>
-                    <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
-                and  address_detail = #{addressDetail}
+            <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
+                and address_detail = #{addressDetail}
             </if>
-                    <if test="defaultFlag != null and !&quot;&quot;.equals(defaultFlag)">
-                and  default_flag = #{defaultFlag}
+            <if test="defaultFlag != null and !&quot;&quot;.equals(defaultFlag)">
+                and default_flag = #{defaultFlag}
             </if>
-                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
-                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                OR  user_id LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  real_name LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  telephone LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  postcode LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  address LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  address_detail LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  default_flag LIKE concat('%',#{searchKey},'%')
-                                                                                        </trim>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR user_id LIKE concat('%',#{searchKey},'%')
+                    OR real_name LIKE concat('%',#{searchKey},'%')
+                    OR telephone LIKE concat('%',#{searchKey},'%')
+                    OR postcode LIKE concat('%',#{searchKey},'%')
+                    OR address LIKE concat('%',#{searchKey},'%')
+                    OR address_detail LIKE concat('%',#{searchKey},'%')
+                    OR default_flag LIKE concat('%',#{searchKey},'%')
+                </trim>
             </if>
-<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
-    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
-        <choose>
-            <when test="item.indexOf('like') != -1">
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        concat('%',#{itemDetail},'%')
-                    </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
 
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
-                </foreach>
-            </when>
-            <otherwise>
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        #{itemDetail}
-                    </if>
-
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
 
-                </foreach>
-            </otherwise>
-        </choose>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
+                            </foreach>
+                        </otherwise>
+                    </choose>
 
-    </foreach>
+
+                </foreach>
 
 
-</if>
+            </if>
         </where>
         order by
 
@@ -397,52 +404,54 @@
             ,
         </if>
 
-        id desc
+        user_id , default_flag DESC , id desc
     </select>
     <select id="queryUserAddress" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserAddress">
-        select <include refid="Base_Column_List"/> from user_address
+        select
+        <include refid="Base_Column_List"/>
+        from user_address
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
+            <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
-                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                 and del_flag = #{delFlag}
             </if>
-                     <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
                 and update_time = #{updateTime}
             </if>
-                     <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
                 and update_user = #{updateUser}
             </if>
-                     <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                 and create_time = #{createTime}
             </if>
-                     <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
                 and create_user = #{createUser}
             </if>
-                     <if test="userId != null and !&quot;&quot;.equals(userId)">
+            <if test="userId != null and !&quot;&quot;.equals(userId)">
                 and user_id = #{userId}
             </if>
-                     <if test="realName != null and !&quot;&quot;.equals(realName)">
+            <if test="realName != null and !&quot;&quot;.equals(realName)">
                 and real_name = #{realName}
             </if>
-                     <if test="telephone != null and !&quot;&quot;.equals(telephone)">
+            <if test="telephone != null and !&quot;&quot;.equals(telephone)">
                 and telephone = #{telephone}
             </if>
-                     <if test="postcode != null and !&quot;&quot;.equals(postcode)">
+            <if test="postcode != null and !&quot;&quot;.equals(postcode)">
                 and postcode = #{postcode}
             </if>
-                     <if test="address != null and !&quot;&quot;.equals(address)">
+            <if test="address != null and !&quot;&quot;.equals(address)">
                 and address = #{address}
             </if>
-                     <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
+            <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
                 and address_detail = #{addressDetail}
             </if>
-                     <if test="defaultFlag != null and !&quot;&quot;.equals(defaultFlag)">
+            <if test="defaultFlag != null and !&quot;&quot;.equals(defaultFlag)">
                 and default_flag = #{defaultFlag}
             </if>
-         
+
         </where>
         LIMIT 1
     </select>
@@ -452,11 +461,25 @@
             AND id = #{id}
         </where>
     </update>
+    <update id="setDefaultUserAddress">
+    UPDATE user_address
+    SET default_flag = CASE
+    WHEN id = #{addressId} THEN
+        'Y'
+    ELSE
+        'N'
+    END
+    WHERE
+        del_flag = 'N'
+    AND user_id = #{userId};
+    </update>
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserAddress">
-        select <include refid="Base_Column_List"/> from user_address
+        select
+        <include refid="Base_Column_List"/>
+        from user_address
         <where>
             and del_flag = 'N'
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        </where>
         order by id desc
     </select>
 </mapper>

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/WxpayTempMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.WxpayTemp;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.WxpayTempMapper")
+public interface WxpayTempMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(WxpayTemp record);
+
+    WxpayTemp selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(WxpayTemp record);
+
+    List<WxpayTemp> queryAllWxpayTemp(WxpayTemp record);
+
+    List<WxpayTemp> queryWxpayTempByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    WxpayTemp queryWxpayTemp(WxpayTemp record);
+
+    List<WxpayTemp> query(WxpayTemp record);
+}
+

Разница между файлами не показана из-за своего большого размера
+ 573 - 0
src/main/java/com/izouma/awesomeadmin/dao/WxpayTempMapper.xml


+ 233 - 0
src/main/java/com/izouma/awesomeadmin/dto/WxPayRefundData.java

@@ -0,0 +1,233 @@
+package com.izouma.awesomeadmin.dto;
+
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+@JsonAutoDetect
+// 表明忽略为null的属性
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+public class WxPayRefundData {
+
+    /**
+     * 公众账号ID
+     */
+    private String appid;
+
+    /**
+     * 商户号
+     */
+    private String mch_id;
+
+    /**
+     * 设备号
+     */
+    private String device_info;
+
+    /**
+     * 随机字符串
+     */
+    private String nonce_str;
+
+    /**
+     * 签名
+     */
+    private String sign;
+
+    /**
+     * 微信订单号
+     */
+    private String transaction_id;
+
+    /**
+     * 商户订单号
+     */
+    private String out_trade_no;
+
+    /**
+     * 商户退款单号
+     */
+    private String out_refund_no;
+
+    /**
+     * 订单金额
+     */
+    private int total_fee;
+
+    /**
+     * 退款金额
+     */
+    private int refund_fee;
+
+    /**
+     * 货币种类
+     */
+    private String refund_fee_type;
+
+    /**
+     * 操作员
+     */
+    private String op_user_id;
+
+    /**
+     * 退款资金来源
+     */
+    private String refund_account;
+
+
+    public String getAppid() {
+
+        return appid;
+    }
+
+
+    public void setAppid(String appid) {
+
+        this.appid = appid;
+    }
+
+
+    public String getMch_id() {
+
+        return mch_id;
+    }
+
+
+    public void setMch_id(String mch_id) {
+
+        this.mch_id = mch_id;
+    }
+
+
+    public String getDevice_info() {
+
+        return device_info;
+    }
+
+
+    public void setDevice_info(String device_info) {
+
+        this.device_info = device_info;
+    }
+
+
+    public String getNonce_str() {
+
+        return nonce_str;
+    }
+
+
+    public void setNonce_str(String nonce_str) {
+
+        this.nonce_str = nonce_str;
+    }
+
+
+    public String getSign() {
+
+        return sign;
+    }
+
+
+    public void setSign(String sign) {
+
+        this.sign = sign;
+    }
+
+
+    public String getTransaction_id() {
+
+        return transaction_id;
+    }
+
+
+    public void setTransaction_id(String transaction_id) {
+
+        this.transaction_id = transaction_id;
+    }
+
+
+    public String getOut_trade_no() {
+
+        return out_trade_no;
+    }
+
+
+    public void setOut_trade_no(String out_trade_no) {
+
+        this.out_trade_no = out_trade_no;
+    }
+
+
+    public String getOut_refund_no() {
+
+        return out_refund_no;
+    }
+
+
+    public void setOut_refund_no(String out_refund_no) {
+
+        this.out_refund_no = out_refund_no;
+    }
+
+
+    public int getTotal_fee() {
+
+        return total_fee;
+    }
+
+
+    public void setTotal_fee(int total_fee) {
+
+        this.total_fee = total_fee;
+    }
+
+
+    public int getRefund_fee() {
+
+        return refund_fee;
+    }
+
+
+    public void setRefund_fee(int refund_fee) {
+
+        this.refund_fee = refund_fee;
+    }
+
+
+    public String getRefund_fee_type() {
+
+        return refund_fee_type;
+    }
+
+
+    public void setRefund_fee_type(String refund_fee_type) {
+
+        this.refund_fee_type = refund_fee_type;
+    }
+
+
+    public String getOp_user_id() {
+
+        return op_user_id;
+    }
+
+
+    public void setOp_user_id(String op_user_id) {
+
+        this.op_user_id = op_user_id;
+    }
+
+
+    public String getRefund_account() {
+
+        return refund_account;
+    }
+
+
+    public void setRefund_account(String refund_account) {
+
+        this.refund_account = refund_account;
+    }
+
+}

+ 293 - 0
src/main/java/com/izouma/awesomeadmin/dto/WxPaySendData.java

@@ -0,0 +1,293 @@
+package com.izouma.awesomeadmin.dto;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+import java.util.Date;
+
+@JsonAutoDetect
+// 表明忽略为null的属性
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+public class WxPaySendData {
+
+    private String appid;
+
+    private String mch_id;
+
+    private String sub_appid;
+
+    private String sub_mch_id;
+
+    private String device_info;
+
+    private String nonce_str;
+
+    private String sign;
+
+    private String body;
+
+    private Date createDate;
+
+    private String detail;
+
+    private String attach;
+
+    private String out_trade_no;
+
+    private String fee_type;
+
+    private int total_fee;
+
+    private String spbill_create_ip;
+
+    private String time_start;
+
+    private String time_expire;
+
+    private String notify_url;
+
+    private String trade_type;
+
+    private String openid;
+
+
+    public String getAppid() {
+
+        return appid;
+    }
+
+
+    public void setAppid(String appid) {
+
+        this.appid = appid;
+    }
+
+
+    public String getMch_id() {
+
+        return mch_id;
+    }
+
+
+    public void setMch_id(String mch_id) {
+
+        this.mch_id = mch_id;
+    }
+
+
+    public String getSub_appid() {
+
+        return sub_appid;
+    }
+
+
+    public void setSub_appid(String sub_appid) {
+
+        this.sub_appid = sub_appid;
+    }
+
+
+    public String getSub_mch_id() {
+
+        return sub_mch_id;
+    }
+
+
+    public void setSub_mch_id(String sub_mch_id) {
+
+        this.sub_mch_id = sub_mch_id;
+    }
+
+
+    public String getDevice_info() {
+
+        return device_info;
+    }
+
+
+    public void setDevice_info(String device_info) {
+
+        this.device_info = device_info;
+    }
+
+
+    public String getNonce_str() {
+
+        return nonce_str;
+    }
+
+
+    public void setNonce_str(String nonce_str) {
+
+        this.nonce_str = nonce_str;
+    }
+
+
+    public String getSign() {
+
+        return sign;
+    }
+
+
+    public void setSign(String sign) {
+
+        this.sign = sign;
+    }
+
+
+    public String getBody() {
+
+        return body;
+    }
+
+
+    public void setBody(String body) {
+
+        this.body = body;
+    }
+
+
+    public Date getCreateDate() {
+
+        return createDate;
+    }
+
+
+    public void setCreateDate(Date createDate) {
+
+        this.createDate = createDate;
+    }
+
+
+    public String getDetail() {
+
+        return detail;
+    }
+
+
+    public void setDetail(String detail) {
+
+        this.detail = detail;
+    }
+
+
+    public String getAttach() {
+
+        return attach;
+    }
+
+
+    public void setAttach(String attach) {
+
+        this.attach = attach;
+    }
+
+
+    public String getOut_trade_no() {
+
+        return out_trade_no;
+    }
+
+
+    public void setOut_trade_no(String out_trade_no) {
+
+        this.out_trade_no = out_trade_no;
+    }
+
+
+    public String getFee_type() {
+
+        return fee_type;
+    }
+
+
+    public void setFee_type(String fee_type) {
+
+        this.fee_type = fee_type;
+    }
+
+
+    public int getTotal_fee() {
+
+        return total_fee;
+    }
+
+
+    public void setTotal_fee(int total_fee) {
+
+        this.total_fee = total_fee;
+    }
+
+
+    public String getSpbill_create_ip() {
+
+        return spbill_create_ip;
+    }
+
+
+    public void setSpbill_create_ip(String spbill_create_ip) {
+
+        this.spbill_create_ip = spbill_create_ip;
+    }
+
+
+    public String getTime_start() {
+
+        return time_start;
+    }
+
+
+    public void setTime_start(String time_start) {
+
+        this.time_start = time_start;
+    }
+
+
+    public String getTime_expire() {
+
+        return time_expire;
+    }
+
+
+    public void setTime_expire(String time_expire) {
+
+        this.time_expire = time_expire;
+    }
+
+
+    public String getNotify_url() {
+
+        return notify_url;
+    }
+
+
+    public void setNotify_url(String notify_url) {
+
+        this.notify_url = notify_url;
+    }
+
+
+    public String getTrade_type() {
+
+        return trade_type;
+    }
+
+
+    public void setTrade_type(String trade_type) {
+
+        this.trade_type = trade_type;
+    }
+
+
+    public String getOpenid() {
+
+        return openid;
+    }
+
+
+    public void setOpenid(String openid) {
+
+        this.openid = openid;
+    }
+
+}

+ 195 - 0
src/main/java/com/izouma/awesomeadmin/model/WxpayTemp.java

@@ -0,0 +1,195 @@
+package com.izouma.awesomeadmin.model;
+
+import java.math.BigDecimal;
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class WxpayTemp{
+    private Integer id;
+    private String delFlag;
+    private Date updateTime;
+    private String updateUser;
+    private Date createTime;
+    private String createUser;
+    private String orderId;
+    private String userId;
+    private BigDecimal totalAmount;
+    private String outTradeNo;
+    private String transactionId;
+    private Integer typeFlag;
+    private String outRefundNo;
+    private BigDecimal refundAmount;
+    private BigDecimal coin;
+    private BigDecimal point;
+    private BigDecimal cash;
+    private String openId;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+/**
+* column_name_,desc_;column_name_,asc
+*/
+private String orderByStr;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public Date getUpdateTime(){
+        return this.updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime){
+        this.updateTime = updateTime;
+    }
+    public String getUpdateUser(){
+        return this.updateUser;
+    }
+
+    public void setUpdateUser(String updateUser){
+        this.updateUser = updateUser;
+    }
+    public Date getCreateTime(){
+        return this.createTime;
+    }
+
+    public void setCreateTime(Date createTime){
+        this.createTime = createTime;
+    }
+    public String getCreateUser(){
+        return this.createUser;
+    }
+
+    public void setCreateUser(String createUser){
+        this.createUser = createUser;
+    }
+    public String getOrderId(){
+        return this.orderId;
+    }
+
+    public void setOrderId(String orderId){
+        this.orderId = orderId;
+    }
+    public String getUserId(){
+        return this.userId;
+    }
+
+    public void setUserId(String userId){
+        this.userId = userId;
+    }
+    public BigDecimal getTotalAmount(){
+        return this.totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount){
+        this.totalAmount = totalAmount;
+    }
+    public String getOutTradeNo(){
+        return this.outTradeNo;
+    }
+
+    public void setOutTradeNo(String outTradeNo){
+        this.outTradeNo = outTradeNo;
+    }
+    public String getTransactionId(){
+        return this.transactionId;
+    }
+
+    public void setTransactionId(String transactionId){
+        this.transactionId = transactionId;
+    }
+    public Integer getTypeFlag(){
+        return this.typeFlag;
+    }
+
+    public void setTypeFlag(Integer typeFlag){
+        this.typeFlag = typeFlag;
+    }
+    public String getOutRefundNo(){
+        return this.outRefundNo;
+    }
+
+    public void setOutRefundNo(String outRefundNo){
+        this.outRefundNo = outRefundNo;
+    }
+    public BigDecimal getRefundAmount(){
+        return this.refundAmount;
+    }
+
+    public void setRefundAmount(BigDecimal refundAmount){
+        this.refundAmount = refundAmount;
+    }
+    public BigDecimal getCoin(){
+        return this.coin;
+    }
+
+    public void setCoin(BigDecimal coin){
+        this.coin = coin;
+    }
+    public BigDecimal getPoint(){
+        return this.point;
+    }
+
+    public void setPoint(BigDecimal point){
+        this.point = point;
+    }
+    public BigDecimal getCash(){
+        return this.cash;
+    }
+
+    public void setCash(BigDecimal cash){
+        this.cash = cash;
+    }
+    public String getOpenId(){
+        return this.openId;
+    }
+
+    public void setOpenId(String openId){
+        this.openId = openId;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+public String getOrderByStr() {
+    return orderByStr;
+}
+
+public void setOrderByStr(String orderByStr) {
+    this.orderByStr = orderByStr;
+}
+
+}
+

+ 6 - 3
src/main/java/com/izouma/awesomeadmin/service/UserAddressService.java

@@ -1,14 +1,15 @@
 package com.izouma.awesomeadmin.service;
 
 import java.util.*;
+
 import com.izouma.awesomeadmin.dto.Page;
 import com.izouma.awesomeadmin.model.UserAddress;
 
 
 /**
-*  service接口类
-*/
-public interface UserAddressService{
+ * service接口类
+ */
+public interface UserAddressService {
 
     List<UserAddress> getUserAddressList(UserAddress record);
 
@@ -23,5 +24,7 @@ public interface UserAddressService{
     boolean deleteUserAddress(String id);
 
     boolean updateUserAddress(UserAddress record);
+
+    boolean setDefaultUserAddress(String userId, String addressId);
 }
 

+ 7 - 0
src/main/java/com/izouma/awesomeadmin/service/UserOrderService.java

@@ -6,6 +6,9 @@ import com.izouma.awesomeadmin.dto.Page;
 import com.izouma.awesomeadmin.dto.Result;
 import com.izouma.awesomeadmin.model.UserOrder;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 
 /**
  * service接口类
@@ -28,8 +31,12 @@ public interface UserOrderService {
 
     Result payOrder(String orderId, double coin, double point, double cash, int payMode);
 
+    Result payOrder(HttpServletRequest request, HttpServletResponse response);
+
     double calculatedPrice(String orderId, double coin, double point);
 
     void alipaySuccess(String tradeNo, String tradeStatus);
+
+    Result recharge(HttpServletRequest request, HttpServletResponse response);
 }
 

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/WxpayTempService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.WxpayTemp;
+
+
+/**
+*  service接口类
+*/
+public interface WxpayTempService{
+
+    List<WxpayTemp> getWxpayTempList(WxpayTemp record);
+
+    List<WxpayTemp> getWxpayTempByPage(Page page, WxpayTemp record);
+
+    WxpayTemp getWxpayTempById(String id);
+
+    WxpayTemp getWxpayTemp(WxpayTemp record);
+
+    boolean createWxpayTemp(WxpayTemp record);
+
+    boolean deleteWxpayTemp(String id);
+
+    boolean updateWxpayTemp(WxpayTemp record);
+}
+

+ 42 - 18
src/main/java/com/izouma/awesomeadmin/service/impl/UserAddressServiceImpl.java

@@ -1,6 +1,7 @@
 package com.izouma.awesomeadmin.service.impl;
 
 import java.util.*;
+
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -11,10 +12,10 @@ import com.izouma.awesomeadmin.service.UserAddressService;
 import com.izouma.awesomeadmin.dao.UserAddressMapper;
 
 /**
-*  service接口实现类
-*/
+ * service接口实现类
+ */
 @Service
-public class UserAddressServiceImpl implements UserAddressService{
+public class UserAddressServiceImpl implements UserAddressService {
 
     private static Logger logger = Logger.getLogger(UserAddressServiceImpl.class);
 
@@ -27,26 +28,27 @@ public class UserAddressServiceImpl implements UserAddressService{
         logger.info("getUserAddressList");
         try {
 
-        return userAddressMapper.queryAllUserAddress(record);
+            return userAddressMapper.queryAllUserAddress(record);
         } catch (Exception e) {
-        logger.error("getUserAddressList", e);
+            logger.error("getUserAddressList", e);
         }
 
         return null;
     }
+
     @Override
     public List<UserAddress> getUserAddressByPage(Page page, UserAddress record) {
 
         logger.info("getUserAddressByPage");
         try {
 
-        Map<String, Object> parameter = new HashMap<String, Object>();
-        parameter.put("record", record);
-        parameter.put(AppConstant.PAGE, page);
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
 
-        return userAddressMapper.queryUserAddressByPage(parameter);
+            return userAddressMapper.queryUserAddressByPage(parameter);
         } catch (Exception e) {
-        logger.error("getUserAddressByPage", e);
+            logger.error("getUserAddressByPage", e);
         }
 
         return null;
@@ -60,7 +62,7 @@ public class UserAddressServiceImpl implements UserAddressService{
 
             return userAddressMapper.selectByPrimaryKey(Integer.valueOf(id));
         } catch (Exception e) {
-        logger.error("getUserAddressById", e);
+            logger.error("getUserAddressById", e);
         }
 
         return null;
@@ -74,7 +76,7 @@ public class UserAddressServiceImpl implements UserAddressService{
 
             return userAddressMapper.queryUserAddress(record);
         } catch (Exception e) {
-        logger.error("getUserAddress", e);
+            logger.error("getUserAddress", e);
         }
 
         return null;
@@ -89,7 +91,7 @@ public class UserAddressServiceImpl implements UserAddressService{
             int updates = userAddressMapper.insertSelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
             logger.error("createUserAddress", e);
@@ -104,13 +106,13 @@ public class UserAddressServiceImpl implements UserAddressService{
         logger.info("deleteUserAddress");
         try {
 
-             int updates = userAddressMapper.delete(id);
+            int updates = userAddressMapper.delete(id);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("deleteUserAddress", e);
+            logger.error("deleteUserAddress", e);
         }
 
         return false;
@@ -125,10 +127,32 @@ public class UserAddressServiceImpl implements UserAddressService{
             int updates = userAddressMapper.updateByPrimaryKeySelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
+            }
+        } catch (Exception e) {
+            logger.error("updateUserAddress", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean setDefaultUserAddress(String userId, String addressId) {
+
+        logger.info("updateUserAddress");
+        try {
+
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("userId", userId);
+            parameter.put("addressId", addressId);
+
+            int updates = userAddressMapper.setDefaultUserAddress(parameter);
+
+            if (updates > 0) {
+                return true;
             }
         } catch (Exception e) {
-             logger.error("updateUserAddress", e);
+            logger.error("updateUserAddress", e);
         }
 
         return false;

+ 198 - 1
src/main/java/com/izouma/awesomeadmin/service/impl/UserOrderServiceImpl.java

@@ -1,20 +1,32 @@
 package com.izouma.awesomeadmin.service.impl;
 
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.StringReader;
 import java.math.BigDecimal;
 import java.util.*;
 
 import com.izouma.awesomeadmin.dao.AlipayTempMapper;
 import com.izouma.awesomeadmin.dao.UserInfoMapper;
+import com.izouma.awesomeadmin.dao.WxpayTempMapper;
 import com.izouma.awesomeadmin.dto.Result;
 import com.izouma.awesomeadmin.model.*;
 import com.izouma.awesomeadmin.service.*;
 import com.izouma.awesomeadmin.util.MbappUtil;
 import org.apache.log4j.Logger;
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.izouma.awesomeadmin.constant.AppConstant;
 import com.izouma.awesomeadmin.dto.Page;
 import com.izouma.awesomeadmin.dao.UserOrderMapper;
+import org.xml.sax.InputSource;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
 
 /**
  * service接口实现类
@@ -31,7 +43,7 @@ public class UserOrderServiceImpl implements UserOrderService {
     private UserInfoService userInfoService;
 
     @Autowired
-    private StoreInfoService storeInfoService;
+    private WxpayTempMapper wxpayTempMapper;
 
     @Autowired
     private MemberPointService memberPointService;
@@ -299,6 +311,191 @@ public class UserOrderServiceImpl implements UserOrderService {
     }
 
 
+    @Override
+    public Result payOrder(HttpServletRequest request, HttpServletResponse response) {
+
+        logger.info("payOrder:支付订单");
+        try {
+
+            System.out.print("微信支付回调数据开始");
+            String inputLine;
+            String notityXml = "";
+            String resXml = "";
+
+            try {
+                while ((inputLine = request.getReader().readLine()) != null) {
+                    notityXml += inputLine;
+                }
+                request.getReader().close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+            System.out.println("接收到的报文:" + notityXml);
+
+            Map m = parseXmlToList2(notityXml);
+
+            if ("SUCCESS".equals(m.get("result_code").toString())) {
+                //支付成功
+                resXml = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
+                String attach = m.get("attach").toString();
+                JSONObject attachJson = new JSONObject(attach);
+
+                payOrder(attachJson.getString("orderId"), attachJson.getDouble("coin"),
+                        attachJson.getDouble("point"), attachJson.getDouble("cash"), AppConstant.PayMode.WEI_XIN);
+
+                WxpayTemp wxpayTemp = new WxpayTemp();
+
+                wxpayTemp.setOrderId(attachJson.getString("orderId"));
+                wxpayTemp.setCoin(BigDecimal.valueOf(attachJson.getDouble("coin")));
+                wxpayTemp.setPoint(BigDecimal.valueOf(attachJson.getDouble("point")));
+                wxpayTemp.setCash(BigDecimal.valueOf(attachJson.getDouble("cash")));
+                wxpayTemp.setTotalAmount(BigDecimal.valueOf(attachJson.getInt("total") / 100.0));
+                wxpayTemp.setOutTradeNo(m.get("out_trade_no").toString());
+                wxpayTemp.setTransactionId(m.get("transaction_id").toString());
+                wxpayTemp.setTypeFlag(AppConstant.Aliapi.BUY);
+
+                wxpayTempMapper.insertSelective(wxpayTemp);
+
+            } else {
+                resXml = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[报文为空]]></return_msg>" + "</xml> ";
+            }
+            System.out.println("微信支付回调数据结束");
+
+            HttpSession seesion = request.getSession();
+            seesion.setAttribute("notify", "微信支付回调");
+            try {
+                BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
+                out.write(resXml.getBytes());
+                out.flush();
+                out.close();
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+
+        } catch (Exception e) {
+            logger.error("payOrder:支付订单异常", e);
+        }
+        return new Result(false, "支付失败");
+    }
+
+    @Override
+    public Result recharge(HttpServletRequest request, HttpServletResponse response) {
+
+        logger.info("recharge:支付充值");
+        try {
+
+            System.out.print("微信支付回调数据开始 支付充值");
+            String inputLine;
+            String notityXml = "";
+            String resXml = "";
+
+            try {
+                while ((inputLine = request.getReader().readLine()) != null) {
+                    notityXml += inputLine;
+                }
+                request.getReader().close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+            System.out.println("接收到的报文:" + notityXml);
+
+            Map m = parseXmlToList2(notityXml);
+
+            if ("SUCCESS".equals(m.get("result_code").toString())) {
+                //支付成功
+                resXml = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
+                String attach = m.get("attach").toString();
+                JSONObject attachJson = new JSONObject(attach);
+
+                Integer userId = attachJson.getInt("userId");
+                Integer money = attachJson.getInt("money") / 100;
+
+                UserInfo userInfo = userInfoService.getUserInfoById(userId + "");
+
+
+                /**
+                 * 余额
+                 */
+                double moneyCoin = userInfo.getMoneyCoin();
+                UserInfo updateUser = new UserInfo();
+                updateUser.setId(userId);
+                updateUser.setMoneyCoin(moneyCoin + money);
+                userInfoService.updateUserInfo(updateUser);
+
+
+                MemberCoin memberCoin = new MemberCoin();
+                memberCoin.setCreateUser("微信充值");
+                memberCoin.setUserId(userId + "");
+                memberCoin.setMoney(String.valueOf(money));
+                memberCoin.setBalance(String.valueOf(moneyCoin + money));
+                memberCoin.setTypeFlag(AppConstant.CoinType.RECHARGE);
+                memberCoin.setRemark("微信充值," + money);
+                memberCoinService.createMemberCoin(memberCoin);
+
+
+                WxpayTemp wxpayTemp = new WxpayTemp();
+
+                wxpayTemp.setUserId(String.valueOf(userId));
+                wxpayTemp.setOutTradeNo(m.get("out_trade_no").toString());
+                wxpayTemp.setTransactionId(m.get("transaction_id").toString());
+                wxpayTemp.setTotalAmount(BigDecimal.valueOf(money));
+                wxpayTemp.setTypeFlag(AppConstant.Aliapi.RECHARGE);
+
+                wxpayTempMapper.insertSelective(wxpayTemp);
+
+            } else {
+                resXml = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[报文为空]]></return_msg>" + "</xml> ";
+            }
+            System.out.println("微信支付回调数据结束");
+
+            HttpSession seesion = request.getSession();
+            seesion.setAttribute("notify", "微信支付回调");
+            try {
+                BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
+                out.write(resXml.getBytes());
+                out.flush();
+                out.close();
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+
+        } catch (Exception e) {
+            logger.error("payOrder:支付订单异常", e);
+        }
+        return new Result(false, "支付失败");
+    }
+
+
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    private Map parseXmlToList2(String xml) {
+
+        Map retMap = new HashMap();
+        try {
+            StringReader read = new StringReader(xml);
+            // 创建新的输入源SAX 解析器将使用 InputSource 对象来确定如何读取 XML 输入
+            InputSource source = new InputSource(read);
+            // 创建一个新的SAXBuilder
+            SAXBuilder sb = new SAXBuilder();
+            // 通过输入源构造一个Document
+            org.jdom.Document doc = sb.build(source);
+            Element root = (Element) doc.getRootElement();// 指向根节点
+            List<Element> es = root.getChildren();
+            if (es != null && es.size() != 0) {
+                for (Element element : es) {
+                    retMap.put(element.getName(), element.getValue());
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return retMap;
+    }
+
+
     /**
      * <p>支付宝支付成功回调接口。</p>
      *

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/WxpayTempServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.WxpayTemp;
+import com.izouma.awesomeadmin.service.WxpayTempService;
+import com.izouma.awesomeadmin.dao.WxpayTempMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class WxpayTempServiceImpl implements WxpayTempService{
+
+    private static Logger logger = Logger.getLogger(WxpayTempServiceImpl.class);
+
+    @Autowired
+    private WxpayTempMapper wxpayTempMapper;
+
+    @Override
+    public List<WxpayTemp> getWxpayTempList(WxpayTemp record) {
+
+        logger.info("getWxpayTempList");
+        try {
+
+        return wxpayTempMapper.queryAllWxpayTemp(record);
+        } catch (Exception e) {
+        logger.error("getWxpayTempList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<WxpayTemp> getWxpayTempByPage(Page page, WxpayTemp record) {
+
+        logger.info("getWxpayTempByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return wxpayTempMapper.queryWxpayTempByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getWxpayTempByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public WxpayTemp getWxpayTempById(String id) {
+
+        logger.info("getWxpayTempyId");
+        try {
+
+            return wxpayTempMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getWxpayTempById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public WxpayTemp getWxpayTemp(WxpayTemp record) {
+
+        logger.info("getWxpayTemp");
+        try {
+
+            return wxpayTempMapper.queryWxpayTemp(record);
+        } catch (Exception e) {
+        logger.error("getWxpayTemp", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createWxpayTemp(WxpayTemp record) {
+
+        logger.info("createWxpayTemp");
+        try {
+
+            int updates = wxpayTempMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createWxpayTemp", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteWxpayTemp(String id) {
+
+        logger.info("deleteWxpayTemp");
+        try {
+
+             int updates = wxpayTempMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteWxpayTemp", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateWxpayTemp(WxpayTemp record) {
+
+        logger.info("updateWxpayTemp");
+        try {
+
+            int updates = wxpayTempMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateWxpayTemp", e);
+        }
+
+        return false;
+    }
+}
+

+ 7 - 23
src/main/java/com/izouma/awesomeadmin/util/MbappUtil.java

@@ -1,5 +1,9 @@
 package com.izouma.awesomeadmin.util;
 
+import org.json.JSONObject;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -10,23 +14,7 @@ import java.net.URLConnection;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Formatter;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.UUID;
-
-import org.json.JSONObject;
-import org.springframework.stereotype.Service;
-
-import com.izouma.awesomeadmin.constant.AppConstant;
-
-import javax.servlet.http.HttpServletRequest;
+import java.util.*;
 
 @Service
 public class MbappUtil {
@@ -56,10 +44,8 @@ public class MbappUtil {
      * @param token     票据
      * @param timestamp 时间戳
      * @param nonce     随机字符串
-     * @param encrypt   密文
      * @return 安全签名
      * @throws NoSuchAlgorithmException
-     * @throws AesException
      */
     public String getSHA1(String token, String timestamp, String nonce) throws NoSuchAlgorithmException {
 
@@ -121,7 +107,6 @@ public class MbappUtil {
 
 
     /**
-     * @param args
      */
     //  public static void main(String[] args) {
     public void xxx() {
@@ -182,7 +167,7 @@ public class MbappUtil {
                 sb.append(k + "=" + v + "&");
             }
         }
-        sb.append("key=" + AppConstant.MCH_SECRET);
+        sb.append("key=" + PropertiesFileLoader.getProperties("weixin_mch_secret"));
         System.out.println("连接商户key:" + sb.toString());
         String sign = MD5Encode(sb.toString(), characterEncoding).toUpperCase();
         return sign;
@@ -255,7 +240,6 @@ public class MbappUtil {
     /**
      * 生成商户订单号
      *
-     * @param mch_id 商户号
      * @param userId 该用户的userID
      * @return
      */
@@ -268,7 +252,7 @@ public class MbappUtil {
         SimpleDateFormat df = new SimpleDateFormat("yyyymmdd");
         String nowTime = df.format(dt);
         int length = 10 - userId.length();
-        return AppConstant.MCH_ID + nowTime + userId + getRandomNum(length);
+        return PropertiesFileLoader.getProperties("weixin_mch_id") + nowTime + userId + getRandomNum(length);
     }
 
 

+ 130 - 0
src/main/java/com/izouma/awesomeadmin/util/UnifiedorderService.java

@@ -0,0 +1,130 @@
+package com.izouma.awesomeadmin.util;
+
+import com.izouma.awesomeadmin.dto.WxPaySendData;
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+import java.io.InputStream;
+import java.util.*;
+
+/**
+ * <p>微信统一下单相关服务类。</p>
+ *
+ * @author 索晨成 <br />
+ * 更新履历 <br />
+ * 日期 : 姓名: 更新内容<br />
+ * @version 1.0
+ */
+public class UnifiedorderService {
+
+    /**
+     * 日志对象
+     */
+    private static Logger logger = Logger.getLogger(UnifiedorderService.class);
+
+
+    public static Map<String, String> unifiedOrder(WxPaySendData data, String key) {
+
+        //统一下单支付
+        // 将解析结果存储在HashMap中
+        Map<String, String> map = new HashMap<String, String>();
+        try {
+            //生成sign签名
+            SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+            parameters.put("appid", data.getAppid());
+            parameters.put("mch_id", data.getMch_id());
+            parameters.put("device_info", data.getDevice_info());
+            parameters.put("nonce_str", data.getNonce_str());
+            parameters.put("body", data.getBody());
+            parameters.put("out_trade_no", data.getOut_trade_no());
+            parameters.put("notify_url", data.getNotify_url());
+            parameters.put("total_fee", data.getTotal_fee());
+            parameters.put("trade_type", data.getTrade_type());
+            parameters.put("spbill_create_ip", data.getSpbill_create_ip());
+            if (data.getOpenid() != null) {
+
+                parameters.put("openid", data.getOpenid());
+            }
+            parameters.put("attach", data.getAttach());
+
+            /*
+             * System.out.println("appid:" + data.getAppid() + ",mch_id:" + data.getMch_id() + ",device_info:" + data.getDevice_info() + ",nonce_str:"
+                     + data.getNonce_str() + ",body:" + data.getBody() + ",out_trade_no:" + data.getOut_trade_no() + ",notify_url:"
+                     + data.getNotify_url() + ",total_fee:" + data.getTotal_fee() + ",trade_type:" + data.getTrade_type() + ",spbill_create_ip:"
+                     + data.getSpbill_create_ip() + ",openid:" + data.getOpenid());
+            */
+            String mySign = MbappUtil.createSign(key, parameters);
+            logger.info("SIGN:" + mySign);
+            // System.out.println("SIGN:" + mySign);
+            data.setSign(mySign);
+            XStream xs = new XStream(new DomDriver("UTF-8", new XmlFriendlyNameCoder("__", "_")));
+            xs.alias("xml", WxPaySendData.class);
+            String xml = xs.toXML(data);
+            logger.info("统一下单xml为:\n" + xml);
+
+            CloseableHttpClient httpclient = HttpClients.createDefault();
+            HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/pay/unifiedorder");
+
+            StringEntity reqEntity = new StringEntity(xml, "utf-8");
+
+            // 设置类型 
+            reqEntity.setContentType("application/x-www-form-urlencoded");
+
+            httpPost.setEntity(reqEntity);
+
+            System.out.println("executing request" + httpPost.getRequestLine());
+
+            HttpResponse response = httpclient.execute(httpPost);
+
+            try {
+                HttpEntity entity = response.getEntity();
+                System.out.println(response.getStatusLine());
+                if (entity != null) {
+
+                    // 从request中取得输入流
+                    InputStream inputStream = entity.getContent();
+                    // 读取输入流
+                    SAXReader reader = new SAXReader();
+                    Document document = reader.read(inputStream);
+                    // 得到xml根元素
+                    Element root = document.getRootElement();
+                    // 得到根元素的所有子节点
+                    @SuppressWarnings("unchecked")
+                    List<Element> elementList = root.elements();
+
+                    // 遍历所有子节点
+                    for (Element e : elementList) {
+                        map.put(e.getName(), e.getText());
+
+                        System.out.println(e.getName() + ":" + e.getText());
+                    }
+                    // 释放资源
+                    inputStream.close();
+                    inputStream = null;
+
+                }
+                EntityUtils.consume(entity);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return map;
+    }
+
+}

+ 59 - 44
src/main/java/com/izouma/awesomeadmin/web/UserAddressController.java

@@ -18,8 +18,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 /**
-*  controller类
-*/
+ * controller类
+ */
 @Controller
 @RequestMapping("/userAddress")
 public class UserAddressController {
@@ -28,8 +28,8 @@ public class UserAddressController {
     private UserAddressService userAddressService;
 
     /**
-    * <p>获取全部记录。</p>
-    */
+     * <p>获取全部记录。</p>
+     */
     @RequiresAuthentication
     @RequestMapping(value = "/all", method = RequestMethod.GET)
     @ResponseBody
@@ -39,8 +39,8 @@ public class UserAddressController {
     }
 
     /**
-    * <p>根据Id。</p>
-    */
+     * <p>根据Id。</p>
+     */
     @RequestMapping(value = "/getUserAddress", method = RequestMethod.GET)
     @ResponseBody
     public Result getUserAddress(@RequestParam(required = false, value = "id") String id) {
@@ -49,8 +49,8 @@ public class UserAddressController {
     }
 
     /**
-    * <p>根据条件获取。</p>
-    */
+     * <p>根据条件获取。</p>
+     */
     @RequestMapping(value = "/getOne", method = RequestMethod.GET)
     @ResponseBody
     public Result getOne(UserAddress record) {
@@ -60,14 +60,14 @@ public class UserAddressController {
 
 
     /**
-    * <p>分页查询。</p>
-    */
+     * <p>分页查询。</p>
+     */
     @RequestMapping(value = "/page", method = RequestMethod.GET)
     @ResponseBody
     public Result page(Page page, UserAddress record) {
         Map<String, Object> result = new HashMap<>();
 
-        List<UserAddress> pp =userAddressService.getUserAddressByPage(page, record);
+        List<UserAddress> pp = userAddressService.getUserAddressByPage(page, record);
 
         result.put(AppConstant.PAGE, page);
         result.put("pp", pp);
@@ -76,89 +76,104 @@ public class UserAddressController {
 
 
     /**
-    * <p>保存。</p>
-    */
+     * <p>保存。</p>
+     */
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @ResponseBody
     public Result save(UserAddress record) {
         boolean num = userAddressService.createUserAddress(record);
         if (num) {
-        return new Result(true, record.getId());
+            return new Result(true, record.getId());
         }
         return new Result(false, "保存异常");
     }
 
     /**
-    * <p>更新信息。</p>
-    */
+     * <p>更新信息。</p>
+     */
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @ResponseBody
     public Result updateUserAddress(UserAddress record) {
         boolean num = userAddressService.updateUserAddress(record);
         if (num) {
-        return new Result(true, "保存成功");
+            return new Result(true, "保存成功");
         }
         return new Result(false, "保存异常");
     }
 
     /**
-    * <p>删除。</p>
-    */
+     * <p>删除。</p>
+     */
     @RequestMapping(value = "/del", method = RequestMethod.POST)
     @ResponseBody
     public Result deleteUserAddress(@RequestParam(required = true, value = "id") String id) {
 
         boolean num = userAddressService.deleteUserAddress(id);
         if (num) {
-        return new Result(true, "删除成功");
+            return new Result(true, "删除成功");
         }
         return new Result(false, "删除异常");
     }
 
     /**
-    * 导出Excel
-    * @param request
-    * @param response
-    * @param record
-    * @throws Exception
-    */
+     * 导出Excel
+     *
+     * @param request
+     * @param response
+     * @param record
+     * @throws Exception
+     */
     @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
     @ResponseBody
     public void exportExcel(HttpServletRequest request, HttpServletResponse response, UserAddress record) throws Exception {
 
-    List<UserAddress> userAddresss = userAddressService.getUserAddressList(record);
+        List<UserAddress> userAddresss = userAddressService.getUserAddressList(record);
 
 
         String sheetName = "user_address";
         String titleName = "用户收货地址数据表";
         String fileName = "用户收货地址表";
         int columnNumber = 13;
-        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
-        String[] columnName = {  "" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "用户ID" ,   "收货人" ,   "电话" ,   "邮编" ,   "地址" ,   "详细地址" ,   "默认"  };
+        int[] columnWidth = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20};
+        String[] columnName = {"", "删除标识", "更新时间", "更新人", "创建时间", "创建人", "用户ID", "收货人", "电话", "邮编", "地址", "详细地址", "默认"};
         String[][] dataList = new String[userAddresss.size()][13];
 
         for (int i = 0; i < userAddresss.size(); i++) {
 
-                        dataList[i][0] = String.valueOf(userAddresss.get(i).getId());
-                        dataList[i][1] = String.valueOf(userAddresss.get(i).getDelFlag());
-                        dataList[i][2] = String.valueOf(userAddresss.get(i).getUpdateTime());
-                        dataList[i][3] = String.valueOf(userAddresss.get(i).getUpdateUser());
-                        dataList[i][4] = String.valueOf(userAddresss.get(i).getCreateTime());
-                        dataList[i][5] = String.valueOf(userAddresss.get(i).getCreateUser());
-                        dataList[i][6] = String.valueOf(userAddresss.get(i).getUserId());
-                        dataList[i][7] = String.valueOf(userAddresss.get(i).getRealName());
-                        dataList[i][8] = String.valueOf(userAddresss.get(i).getTelephone());
-                        dataList[i][9] = String.valueOf(userAddresss.get(i).getPostcode());
-                        dataList[i][10] = String.valueOf(userAddresss.get(i).getAddress());
-                        dataList[i][11] = String.valueOf(userAddresss.get(i).getAddressDetail());
-                        dataList[i][12] = String.valueOf(userAddresss.get(i).getDefaultFlag());
-                    }
+            dataList[i][0] = String.valueOf(userAddresss.get(i).getId());
+            dataList[i][1] = String.valueOf(userAddresss.get(i).getDelFlag());
+            dataList[i][2] = String.valueOf(userAddresss.get(i).getUpdateTime());
+            dataList[i][3] = String.valueOf(userAddresss.get(i).getUpdateUser());
+            dataList[i][4] = String.valueOf(userAddresss.get(i).getCreateTime());
+            dataList[i][5] = String.valueOf(userAddresss.get(i).getCreateUser());
+            dataList[i][6] = String.valueOf(userAddresss.get(i).getUserId());
+            dataList[i][7] = String.valueOf(userAddresss.get(i).getRealName());
+            dataList[i][8] = String.valueOf(userAddresss.get(i).getTelephone());
+            dataList[i][9] = String.valueOf(userAddresss.get(i).getPostcode());
+            dataList[i][10] = String.valueOf(userAddresss.get(i).getAddress());
+            dataList[i][11] = String.valueOf(userAddresss.get(i).getAddressDetail());
+            dataList[i][12] = String.valueOf(userAddresss.get(i).getDefaultFlag());
+        }
 
 
         ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
-        columnNumber, columnWidth, columnName, dataList, response);
+                columnNumber, columnWidth, columnName, dataList, response);
+
+
+    }
 
 
+    @RequestMapping(value = "/setDefault", method = RequestMethod.POST)
+    @ResponseBody
+    public Result setDefault(@RequestParam(required = true, value = "userId") String userId,
+                             @RequestParam(required = true, value = "addressId") String addressId) {
+
+        boolean num = userAddressService.setDefaultUserAddress(userId, addressId);
+        if (num) {
+            return new Result(true, "设置默认成功");
         }
+        return new Result(false, "设置默认地址异常");
     }
 
+}
+

+ 179 - 3
src/main/java/com/izouma/awesomeadmin/web/WeiXinController.java

@@ -1,13 +1,14 @@
 package com.izouma.awesomeadmin.web;
 
+import com.izouma.awesomeadmin.constant.AppConstant;
 import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.dto.WxPaySendData;
 import com.izouma.awesomeadmin.model.UserInfo;
 import com.izouma.awesomeadmin.service.UserInfoService;
+import com.izouma.awesomeadmin.service.UserOrderService;
 import com.izouma.awesomeadmin.service.WeiXinService;
 import com.izouma.awesomeadmin.shiro.WechatToken;
-import com.izouma.awesomeadmin.util.Base64;
-import com.izouma.awesomeadmin.util.PropertiesFileLoader;
-import com.izouma.awesomeadmin.util.WeixinUtil;
+import com.izouma.awesomeadmin.util.*;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.shiro.SecurityUtils;
@@ -19,7 +20,17 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.HashMap;
 import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
 
 @Controller
 @RequestMapping("/wx")
@@ -33,6 +44,9 @@ public class WeiXinController {
     @Autowired
     private UserInfoService userInfoService;
 
+    @Autowired
+    private UserOrderService userOrderService;
+
     @RequestMapping(value = "/auth", method = RequestMethod.GET)
     @ResponseBody
     public ModelAndView auth(@RequestParam("redirectUri") String redirectUri) {
@@ -101,4 +115,166 @@ public class WeiXinController {
         }
         return new Result(false, null);
     }
+
+    public static JSONObject loadJSON(String url) {
+
+        StringBuilder json = new StringBuilder();
+        try {
+            URL oracle = new URL(url);
+            URLConnection yc = oracle.openConnection();
+            BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "UTF-8"));
+            String inputLine = null;
+            while ((inputLine = in.readLine()) != null) {
+                json.append(inputLine);
+            }
+            in.close();
+        } catch (MalformedURLException e) {
+        } catch (IOException e) {
+        }
+        System.out.println("xxxxxxxxxxxx:" + json.toString());
+        return new JSONObject(json.toString());
+    }
+
+
+    @RequestMapping(value = "/notify", method = RequestMethod.POST)
+    @ResponseBody
+    public ModelAndView notify(HttpServletRequest request, HttpServletResponse response) {
+
+        userOrderService.payOrder(request, response);
+        return null;
+    }
+
+    @RequestMapping(value = "/notifyRecharge", method = RequestMethod.POST)
+    @ResponseBody
+    public ModelAndView notifyRecharge(HttpServletRequest request, HttpServletResponse response) {
+
+        userOrderService.recharge(request, response);
+        return null;
+    }
+
+
+    @RequestMapping(value = "/recharge", method = RequestMethod.POST)
+    @ResponseBody
+    public Map recharge(@RequestParam(required = true, value = "userId") Integer userId, @RequestParam(required = true, value = "money") Integer money) {
+        Map<String, String> result = new HashMap<String, String>();
+
+        int total = money;
+
+        //测试为一分
+//     /*   total = 1;
+
+        JSONObject attach = new JSONObject();
+        attach.put("userId", userId);
+        attach.put("money", money);
+
+        WxPaySendData data = new WxPaySendData();
+        data.setAppid(PropertiesFileLoader.getProperties("weixinappid"));
+        data.setMch_id(PropertiesFileLoader.getProperties("weixin_mch_id"));
+        data.setDevice_info(AppConstant.DEVICE_INFO);
+        data.setNonce_str(MbappUtil.create_nonce_str());
+        data.setBody("充值");
+        data.setOut_trade_no(MbappUtil.create_out_trade_no());
+        data.setNotify_url(PropertiesFileLoader.getProperties("weixin_notify_url_recharge"));
+        data.setTotal_fee(total);
+        data.setTrade_type(AppConstant.TRADE_TYPE_NATIVE);
+        //data.setSpbill_create_ip("117.62.182.63");
+        data.setSpbill_create_ip(MbappUtil.getHostAdderss());
+        //扫码支付不需要openId
+        //data.setOpenid(openId);
+
+        data.setAttach(attach.toString());
+
+        @SuppressWarnings("static-access")
+        Map<String, String> unified = UnifiedorderService.unifiedOrder(data, "UTF-8");
+
+        String timeStamp = MbappUtil.create_timestamp();
+        String nonceStr = MbappUtil.create_nonce_str();
+        String packageStr = "prepay_id=" + unified.get("prepay_id");
+        //生成sign签名
+        SortedMap<Object, Object> params = new TreeMap<Object, Object>();
+
+        params.put("appId", PropertiesFileLoader.getProperties("weixinappid"));
+        params.put("timeStamp", timeStamp);
+        params.put("nonceStr", nonceStr);
+        params.put("package", packageStr);
+        params.put("signType", "MD5");
+
+        result.put("appId", PropertiesFileLoader.getProperties("weixinappid"));
+        result.put("timeStamp", timeStamp);
+        result.put("nonceStr", nonceStr);
+        result.put("myPackage", packageStr);
+        result.put("signType", "MD5");
+        result.put("paySign", MbappUtil.createSign("UTF-8", params));
+
+        result.put("prepay_id", unified.get("prepay_id"));
+        result.put("code_url",unified.get("code_url"));
+
+        return result;
+    }
+
+    @RequestMapping(value = "/unifiedOrder", method = RequestMethod.GET)
+    @ResponseBody
+    public Map<String, String> unifiedOrder(@RequestParam(required = true, value = "orderId") String orderId, @RequestParam(required = true, value = "coin") double coin,
+                                            @RequestParam(required = true, value = "point") double point) {
+
+        Map<String, String> result = new HashMap<String, String>();
+
+        double cash = userOrderService.calculatedPrice(orderId, coin, point);
+        int total = 0;
+
+        //测试为一分
+        //cash = 0.01;
+
+        total = (int) (cash * 100);
+
+        JSONObject attach = new JSONObject();
+        attach.put("orderId", orderId);
+        attach.put("coin", coin);
+        attach.put("point", point);
+        attach.put("cash", cash);
+        attach.put("total", total);
+
+        WxPaySendData data = new WxPaySendData();
+        data.setAppid(PropertiesFileLoader.getProperties("weixinappid"));
+        data.setMch_id(PropertiesFileLoader.getProperties("weixin_mch_id"));
+        data.setDevice_info(AppConstant.DEVICE_INFO);
+        data.setNonce_str(MbappUtil.create_nonce_str());
+        data.setBody("商品");
+        data.setOut_trade_no(MbappUtil.create_out_trade_no());
+        data.setNotify_url(PropertiesFileLoader.getProperties("weixin_notify_url"));
+        data.setTotal_fee(total);
+        data.setTrade_type(AppConstant.TRADE_TYPE_NATIVE);
+        //data.setSpbill_create_ip("117.62.182.63");
+        data.setSpbill_create_ip(MbappUtil.getHostAdderss());
+        //data.setOpenid(openId);
+        data.setAttach(attach.toString());
+
+        @SuppressWarnings("static-access")
+        Map<String, String> unified = UnifiedorderService.unifiedOrder(data, "UTF-8");
+
+        String timeStamp = MbappUtil.create_timestamp();
+        String nonceStr = MbappUtil.create_nonce_str();
+        String packageStr = "prepay_id=" + unified.get("prepay_id");
+        //生成sign签名
+        SortedMap<Object, Object> params = new TreeMap<Object, Object>();
+
+        params.put("appId", PropertiesFileLoader.getProperties("weixinappid"));
+        params.put("timeStamp", timeStamp);
+        params.put("nonceStr", nonceStr);
+        params.put("package", packageStr);
+        params.put("signType", "MD5");
+
+        result.put("appId", PropertiesFileLoader.getProperties("weixinappid"));
+        result.put("timeStamp", timeStamp);
+        result.put("nonceStr", nonceStr);
+        result.put("myPackage", packageStr);
+        result.put("signType", "MD5");
+        result.put("paySign", MbappUtil.createSign("UTF-8", params));
+
+        result.put("prepay_id", unified.get("prepay_id"));
+        result.put("code_url",unified.get("code_url"));
+
+        return result;
+
+    }
 }

+ 169 - 0
src/main/java/com/izouma/awesomeadmin/web/WxpayTempController.java

@@ -0,0 +1,169 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.WxpayTemp;
+import com.izouma.awesomeadmin.service.WxpayTempService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/wxpayTemp")
+public class WxpayTempController {
+
+    @Autowired
+    private WxpayTempService wxpayTempService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(WxpayTemp record) {
+        List<WxpayTemp> pp = wxpayTempService.getWxpayTempList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getWxpayTemp", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getWxpayTemp(@RequestParam(required = false, value = "id") String id) {
+        WxpayTemp data = wxpayTempService.getWxpayTempById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(WxpayTemp record) {
+        WxpayTemp data = wxpayTempService.getWxpayTemp(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, WxpayTemp record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<WxpayTemp> pp =wxpayTempService.getWxpayTempByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(WxpayTemp record) {
+        boolean num = wxpayTempService.createWxpayTemp(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateWxpayTemp(WxpayTemp record) {
+        boolean num = wxpayTempService.updateWxpayTemp(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteWxpayTemp(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = wxpayTempService.deleteWxpayTemp(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, WxpayTemp record) throws Exception {
+
+    List<WxpayTemp> wxpayTemps = wxpayTempService.getWxpayTempList(record);
+
+
+        String sheetName = "wxpay_temp";
+        String titleName = "微信支付记录数据表";
+        String fileName = "微信支付记录表";
+        int columnNumber = 18;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "订单" ,   "用户" ,   "金额" ,   "订单" ,   "微信订单" ,   "类型" ,   "退款单" ,   "退款数量" ,   "余额" ,   "积分" ,   "现金" ,   "openId"  };
+        String[][] dataList = new String[wxpayTemps.size()][18];
+
+        for (int i = 0; i < wxpayTemps.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(wxpayTemps.get(i).getId());
+                        dataList[i][1] = String.valueOf(wxpayTemps.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(wxpayTemps.get(i).getUpdateTime());
+                        dataList[i][3] = String.valueOf(wxpayTemps.get(i).getUpdateUser());
+                        dataList[i][4] = String.valueOf(wxpayTemps.get(i).getCreateTime());
+                        dataList[i][5] = String.valueOf(wxpayTemps.get(i).getCreateUser());
+                        dataList[i][6] = String.valueOf(wxpayTemps.get(i).getOrderId());
+                        dataList[i][7] = String.valueOf(wxpayTemps.get(i).getUserId());
+                        dataList[i][8] = String.valueOf(wxpayTemps.get(i).getTotalAmount());
+                        dataList[i][9] = String.valueOf(wxpayTemps.get(i).getOutTradeNo());
+                        dataList[i][10] = String.valueOf(wxpayTemps.get(i).getTransactionId());
+                        dataList[i][11] = String.valueOf(wxpayTemps.get(i).getTypeFlag());
+                        dataList[i][12] = String.valueOf(wxpayTemps.get(i).getOutRefundNo());
+                        dataList[i][13] = String.valueOf(wxpayTemps.get(i).getRefundAmount());
+                        dataList[i][14] = String.valueOf(wxpayTemps.get(i).getCoin());
+                        dataList[i][15] = String.valueOf(wxpayTemps.get(i).getPoint());
+                        dataList[i][16] = String.valueOf(wxpayTemps.get(i).getCash());
+                        dataList[i][17] = String.valueOf(wxpayTemps.get(i).getOpenId());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 6 - 1
src/main/resources/properties/outsidews.properties

@@ -17,4 +17,9 @@ ALIPAY_APP_PRIVATE_KEY=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDNbcuW0
 ALIPAY_CHARSET=utf-8
 ALIPAY_ALIPAY_PUBLIC_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzW3LltIo9Jjns7PpkQGKMl5TeY2c6/FmjuKtZF08u17vfgt/r7q2IK6m/Y/iHlbKYeK4chfT/fB9HBUAAZ7poleo2mN/8JHv/Wo/LgVec7xwtxq5Eg1EKLTwJhPm5cKhXaH0LGqDrhzkdRX7LS4NvYzmlYqaDb5EhpjianyIwBmjBEMu6dktoyyKsihjI+9U76CEwDApJMG4ptJJmzeK3oeVzyk3k9rqTmvuuBTZ2Ct5ideNXtizVjcdhwCIWsPPPilIhzV1EtywPmhsNIp2T91HUjwHrbBGoDXg/jVzbVn+w3gAZ/9CvEhoFJEnDg3gvE3rDqUuZXJlY+VucPYSuwIDAQAB
 ALIPAY_SELLER=2088102179082444
-ALIPAY_GATEWAY=https://openapi.alipaydev.com/gateway.do
+ALIPAY_GATEWAY=https://openapi.alipaydev.com/gateway.do
+weixin_mch_id=1480639272
+weixin_mch_secret=
+weixin_notify_url=
+weixin_cert_path=
+weixin_notify_url_recharge=

+ 138 - 0
src/main/vue/src/pages/WxpayTemp.vue

@@ -0,0 +1,138 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                                                                                                                                                                    <el-form-item prop="orderId" label="订单">
+                <el-input v-model="formData.orderId" :disabled="'orderId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="userId" label="用户">
+                <el-input v-model="formData.userId" :disabled="'userId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="totalAmount" label="金额">
+                <el-input v-model="formData.totalAmount" :disabled="'totalAmount'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="outTradeNo" label="订单">
+                <el-input v-model="formData.outTradeNo" :disabled="'outTradeNo'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="transactionId" label="微信订单">
+                <el-input v-model="formData.transactionId" :disabled="'transactionId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="typeFlag" label="类型">
+                <el-input v-model="formData.typeFlag" :disabled="'typeFlag'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="outRefundNo" label="退款单">
+                <el-input v-model="formData.outRefundNo" :disabled="'outRefundNo'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="refundAmount" label="退款数量">
+                <el-input v-model="formData.refundAmount" :disabled="'refundAmount'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="coin" label="余额">
+                <el-input v-model="formData.coin" :disabled="'coin'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="point" label="积分">
+                <el-input v-model="formData.point" :disabled="'point'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="cash" label="现金">
+                <el-input v-model="formData.cash" :disabled="'cash'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="openId" label="openId">
+                <el-input v-model="formData.openId" :disabled="'openId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                        <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.column) {
+                this.subColumn = this.$route.query.column.split(',')[1];
+                this.subValue = this.$route.query.column.split(',')[0];
+            }
+
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/wxpayTemp/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
+                        this.formData = res.data;
+
+                    if (this.$route.query.column) {
+                        this.formData[this.subColumn] = this.subValue;
+                    }
+                    }
+                })
+            }else {
+                if (this.$route.query.column) {
+                    this.formData[this.subColumn] = this.subValue;
+                }
+            }
+
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            },
+                                                                                                                                                            subColumn: '',
+            subValue: '',
+        }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/wxpayTemp/update' : '/wxpayTemp/save',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败')
+                    }
+                });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/wxpayTemp/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 583 - 0
src/main/vue/src/pages/WxpayTemps.vue

@@ -0,0 +1,583 @@
+<template>
+    <div>
+        <div class="filters-container">
+        
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
+                       icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
+                       icon="el-icon-sort" class="filter-item">排序
+            </el-button>
+            <el-button @click="$router.push({path:'/wxpayTemp',query:{column:$route.query.column}})" type="primary"
+                       size="small" icon="el-icon-edit"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                                                                                                                                                                                                    
+                                            <el-table-column
+                                v-if="isColumnShow('orderId')"
+                                prop="orderId"
+                                label="订单"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('userId')"
+                                prop="userId"
+                                label="用户"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('totalAmount')"
+                                prop="totalAmount"
+                                label="金额"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('outTradeNo')"
+                                prop="outTradeNo"
+                                label="订单"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('transactionId')"
+                                prop="transactionId"
+                                label="微信订单"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('typeFlag')"
+                                prop="typeFlag"
+                                label="类型"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('outRefundNo')"
+                                prop="outRefundNo"
+                                label="退款单"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('refundAmount')"
+                                prop="refundAmount"
+                                label="退款数量"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('coin')"
+                                prop="coin"
+                                label="余额"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('point')"
+                                prop="point"
+                                label="积分"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('cash')"
+                                prop="cash"
+                                label="现金"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('openId')"
+                                prop="openId"
+                                label="openId"
+                                min-width="100">
+                        </el-table-column>
+                                                            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150"
+            >
+                <template slot-scope="scope">
+                            <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper" v-if="0">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item"
+                                       :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="排序" :visible.sync="showTableSortDialog">
+            <el-button @click="addSortField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="tableSortFields">
+
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="order" label="排序" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.order">
+                            <el-option label="降序" value="desc">
+                            </el-option>
+                            <el-option label="升序" value="asc">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeSortField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="tableSortQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="查看图片" :visible.sync="imageDialogVisible" size="small">
+            <img width="100%" :src="imgSrc" alt="">
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+    import {format} from 'date-fns'
+    import zh from 'date-fns/locale/zh_cn'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                                                                                                                                                                                                                                                                                                                {
+                                label: '订单',
+                                value: 'orderId',
+                                show: true
+                            },
+                                                                                                {
+                                label: '用户',
+                                value: 'userId',
+                                show: true
+                            },
+                                                                                                {
+                                label: '金额',
+                                value: 'totalAmount',
+                                show: true
+                            },
+                                                                                                {
+                                label: '订单',
+                                value: 'outTradeNo',
+                                show: true
+                            },
+                                                                                                {
+                                label: '微信订单',
+                                value: 'transactionId',
+                                show: true
+                            },
+                                                                                                {
+                                label: '类型',
+                                value: 'typeFlag',
+                                show: true
+                            },
+                                                                                                {
+                                label: '退款单',
+                                value: 'outRefundNo',
+                                show: true
+                            },
+                                                                                                {
+                                label: '退款数量',
+                                value: 'refundAmount',
+                                show: true
+                            },
+                                                                                                {
+                                label: '余额',
+                                value: 'coin',
+                                show: true
+                            },
+                                                                                                {
+                                label: '积分',
+                                value: 'point',
+                                show: true
+                            },
+                                                                                                {
+                                label: '现金',
+                                value: 'cash',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'openId',
+                                value: 'openId',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                                                                                                                                                                                                                                                                                                {
+                                label: '订单',
+                                value: 'order_id'
+                            },
+                                                                                                {
+                                label: '用户',
+                                value: 'user_id'
+                            },
+                                                                                                {
+                                label: '金额',
+                                value: 'total_amount'
+                            },
+                                                                                                {
+                                label: '订单',
+                                value: 'out_trade_no'
+                            },
+                                                                                                {
+                                label: '微信订单',
+                                value: 'transaction_id'
+                            },
+                                                                                                {
+                                label: '类型',
+                                value: 'type_flag'
+                            },
+                                                                                                {
+                                label: '退款单',
+                                value: 'out_refund_no'
+                            },
+                                                                                                {
+                                label: '退款数量',
+                                value: 'refund_amount'
+                            },
+                                                                                                {
+                                label: '余额',
+                                value: 'coin'
+                            },
+                                                                                                {
+                                label: '积分',
+                                value: 'point'
+                            },
+                                                                                                {
+                                label: '现金',
+                                value: 'cash'
+                            },
+                                                                                                {
+                                label: 'openId',
+                                value: 'open_id'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+                orderByStr: '',
+                imgSrc: '',
+                imageDialogVisible: false,
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+
+                var data = {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                    orderByStr: this.orderByStr,
+                }
+
+                if (this.$route.query.column) {
+                    var tempColumn = this.$route.query.column;
+                    data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
+                }
+
+                this.$http.get({
+                    url: '/wxpayTemp/page',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/wxpayTemp',
+                    query: {
+                        id: row.id,
+                        column: this.$route.query.column,
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            addSortField() {
+                this.tableSortFields.push({
+                    name: '',
+                    order: 'asc',
+                });
+            },
+            removeSortField(i) {
+                if (this.tableSortFields.length > 0) {
+                    this.tableSortFields.splice(i, 1);
+                }
+            },
+            tableSortQuery() {
+
+                this.orderByStr = '';
+
+                if (this.tableSortFields.length > 0) {
+
+                    var templist = [];
+
+                    this.tableSortFields.forEach(item => {
+                        if (item.name && item.order) {
+                            var tempItem = item.name + '_,' + item.order;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.orderByStr = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showTableSortDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/wxpayTemp/exportExcel?searchKey="
+                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post({
+                        url: '/wxpayTemp/del',
+                        data: {id: row.id}
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+            DateTimeFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
+                }
+
+            },
+            DateFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
+                }
+
+            },
+            showImg(img) {
+                this.imgSrc = img;
+                this.imageDialogVisible = true;
+            },
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

+ 10 - 0
src/main/vue/src/router/index.js

@@ -564,6 +564,16 @@ const router = new Router({
                     path: '/alipayTemps',
                     name: 'AlipayTemps',
                     component: () => import('../pages/AlipayTemps')
+                },
+                {
+                    path: '/wxpayTemp',
+                    name: 'WxpayTemp',
+                    component: () => import('../pages/WxpayTemp')
+                },
+                {
+                    path: '/wxpayTemps',
+                    name: 'WxpayTemps',
+                    component: () => import('../pages/WxpayTemps')
                 }
                 /**INSERT_LOCATION**/
             ]

Некоторые файлы не были показаны из-за большого количества измененных файлов