zhs 3 jaren geleden
bovenliggende
commit
ab85e3b796

+ 5 - 0
src/main/java/com/supplier/controller/PersonalController.java

@@ -3,6 +3,7 @@ package com.supplier.controller;
 import com.supplier.jwt.JWTUtil;
 import com.supplier.model.Supplier;
 import com.supplier.service.PersonalServce;
+import com.supplier.service.SupplierReleaseService;
 import com.supplier.util.DesDecry;
 import com.supplier.util.DesEncry;
 import com.supplier.util.ParsingToken;
@@ -23,6 +24,9 @@ public class PersonalController {
     @Autowired
     private PersonalServce personalServce;
 
+    @Autowired
+    private SupplierReleaseService supplierReleaseService;
+
     /**
      * 查询个人信息
      * @param request 获取头信息
@@ -40,6 +44,7 @@ public class PersonalController {
             map.put("msg", "200");
             map.put("data", supplier);
             map.put("payments", personalServce.balanceOfPayments(code));
+            map.put("system", supplierReleaseService.getSitesInfo());
         } catch (Exception e){
             e.printStackTrace();
             map.put("msg", "500");

+ 1 - 4
src/main/java/com/supplier/controller/WxRefundContoller.java

@@ -41,6 +41,7 @@ public class WxRefundContoller extends WxPayUtils {
     /**
      * 微信退款
      * @param money 金额
+     *
      * @param wxPay 报价单编号
      * @return 返回结果
      * @throws Exception 异常
@@ -115,10 +116,6 @@ public class WxRefundContoller extends WxPayUtils {
         return wxPayService.getAuditRefund(wxRefund);
     }
 
-    public static void main(String[] args) {
-        System.out.println(AmountUtil.formatMoney("10000.32656565"));
-    }
-
     /**
      * 退款审批
      * @param wxRefund 参数

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

@@ -16,6 +16,10 @@ spring:
       enabled: true
       max-file-size: 100MB
       max-request-size: 100MB
+  task:
+    scheduling:
+      pool:
+        size: 8 #配置Scheduled定时任务为多线程 否则默认为单线程同一时间段不执行
 logging:
   level:
     com:

+ 3 - 1
src/main/resources/static/js/personal/function.js

@@ -8,6 +8,7 @@ function load(){
         headers: {"token": localStorage.getItem("token")},
         dataType: "json",
         success: (data) => {
+            console.log(data)
             if(data.msg == "200"){
                 $(".name_div_val").find("div").html(data.data.name);
                 $(".buy_account").html("充值人:    " + data.data.name);
@@ -22,10 +23,11 @@ function load(){
                 $.each(data.payments.data, (index, item) => {
                     var totalFee = item.total_fee;//付款金额
                     var refund_fee = item.refund_fee == undefined ? 0 : item.refund_fee;//退款金额
+                    var percentageFee = data.system.percentage_fee;//平台手续费,付款金额 - (付款金额 * 平台手续费) - 退款金额 = 实际收入
                     $(".bottom_content").append("<div class=\"content_div_font\" uuid=\""+ item.uuid +"\">\n" +
                         "                    <div class=\"date_detail\">"+ item.jdrq +"</div>\n" +
                         "                    <div class=\"content_detail\">"+ item.offer_name +"</div>\n" +
-                        "                    <div class=\"amount_detail\">¥"+ (totalFee - refund_fee) +"</div>\n" +
+                        "                    <div class=\"amount_detail\">¥"+ (totalFee - (totalFee * percentageFee) - refund_fee) +"</div>\n" +
                         "                </div>");
                 });
             }

+ 15 - 24
src/main/resources/templates/personal/ceshi.html

@@ -2,11 +2,9 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>测试支付</title>
+    <title>支付成功</title>
     <link rel="stylesheet" href="/layui/css/layui.css">
     <script src="/layui/layui.js"></script>
-    <script src="/js/qrcode.js"></script>
-    <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
     <script type="text/javascript">
         var $ = null;
         var form = null;
@@ -16,28 +14,21 @@
             $ = layui.$;
             form = layui.form;
             layer = layui.layer;
-            $.ajax({
-                url: "http://localhost:9600/pay/toPay",
-                type: "get",
-                data: {
-                    "price": "0.01",
-                    "attach": "111111"
-                },
-                dateType: "json",
-                headers: {"token": localStorage.getItem("token")},
-                success: (data) => {
-                    const div = document.createElement('divform');
-                    div.innerHTML = data; // data就是接口返回的form 表单字符串
-                    document.body.appendChild(div);
-                    let len = document.forms.length - 1;
-                    document.forms[len].setAttribute('target', '_blank'); // 新开窗口跳转
-                    document.forms[len].submit();
-                },
-                error: () => {
-                    layer.alert("服务器异常,请联系管理员", {icon: 2});
-                    layer.closeAll("loading");
+            if (navigator.userAgent.indexOf("MSIE") > 0) {
+                if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {    //适用于ie6不带提示关闭窗口
+                    window.opener = null;
+                    window.close();
+                } else {
+                    window.open('', '_top');         //ie7之后不提示关闭窗口
+                    window.top.close();
                 }
-            })
+            } else if (navigator.userAgent.indexOf("Firefox") > 0) {        //Firefox不提示关闭窗口
+                window.location.href = 'about:blank ';
+            } else {
+                window.opener = null;
+                window.open('', '_self', '');        //其他浏览器
+                window.close();
+            }
         })
     </script>
 </head>