From 6d87da9e3bd191d0046769c0a31762316d5e0205 Mon Sep 17 00:00:00 2001 From: vone Date: Tue, 26 Feb 2019 11:41:43 +0800 Subject: [PATCH] V1.4 --- README.md | 7 ++ .../vone/mq/controller/AdminController.java | 25 +++++ .../java/com/vone/mq/dao/PayOrderDao.java | 11 +++ .../com/vone/mq/service/AdminService.java | 39 +++++++- src/main/webapp/admin/orderlist.html | 93 +++++++++++++++++++ src/main/webapp/api.html | 38 +++++++- 6 files changed, 208 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 494df70..b6b783d 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,13 @@ V免签 是基于SpringBoot 2.1.1 实现的一套免签支付程序,主要包 ## 更新记录 + + + v1.4(2019.02.26) + + 增加订单删除功能 + + 增加一键删除过期订单功能 + + 增加一键删除7天前订单功能 + + 增加PHP异步回调示例代码,请在 API说明->回调参数说明 中参考使用 + + v1.3(2019.02.25) + 修复监控端安卓7.0以上系统监控App闪退问题 + 修复监控端检测服务状态无法正确检测是否正常问题 diff --git a/src/main/java/com/vone/mq/controller/AdminController.java b/src/main/java/com/vone/mq/controller/AdminController.java index 8cc24fa..8e25805 100644 --- a/src/main/java/com/vone/mq/controller/AdminController.java +++ b/src/main/java/com/vone/mq/controller/AdminController.java @@ -172,4 +172,29 @@ public CommonRes getMain(HttpSession session){ return adminService.getMain(); } + @RequestMapping("/admin/delOrder") + public CommonRes delOrder(HttpSession session,Long id){ + if (session.getAttribute("login")==null){ + return ResUtil.error("未登录"); + } + + return adminService.delOrder(id); + } + + @RequestMapping("/admin/delGqOrder") + public CommonRes delGqOrder(HttpSession session){ + if (session.getAttribute("login")==null){ + return ResUtil.error("未登录"); + } + + return adminService.delGqOrder(); + } + @RequestMapping("/admin/delLastOrder") + public CommonRes delLastOrder(HttpSession session){ + if (session.getAttribute("login")==null){ + return ResUtil.error("未登录"); + } + + return adminService.delLastOrder(); + } } diff --git a/src/main/java/com/vone/mq/dao/PayOrderDao.java b/src/main/java/com/vone/mq/dao/PayOrderDao.java index 9142688..6f785e7 100644 --- a/src/main/java/com/vone/mq/dao/PayOrderDao.java +++ b/src/main/java/com/vone/mq/dao/PayOrderDao.java @@ -52,4 +52,15 @@ public interface PayOrderDao extends JpaRepository, JpaSpecifica @Query(value = "select sum(price) from pay_order where state = ?1", nativeQuery = true) double getCountMoney(int state); + + + @Transactional + int deleteByState(int state); + + + @Transactional + @Modifying + @Query(value = "delete from pay_order where create_date +
@@ -63,6 +71,7 @@ elem: '#demo' ,height: 'full-160' ,url: '/admin/getOrders' + ,toolbar: '#toolbarDemo' ,where: { state:$("#state").val(), type:$("#type").val() @@ -146,6 +155,32 @@ + }); + + console.log(data.id); + }); + }else if(layEvent === 'del'){ + layer.confirm('确定要删除订单吗?', function(index){ + layer.msg('操作中', { + icon: 16 + ,shade: 0.01 + }); + + $.post("/admin/delOrder","id="+data.id,function (data) { + if (data.code==1){ + layer.msg("操作成功!"); + myTable.reload({ + where: { + state:$("#state").val(), + type:$("#type").val() + } + }); + }else{ + layer.msg(data.msg); + } + + + }); console.log(data.id); @@ -172,6 +207,64 @@ }); + + //头工具栏事件 + table.on('toolbar(test)', function(obj){ + var checkStatus = table.checkStatus(obj.config.id); + switch(obj.event){ + case 'delGq': + layer.confirm('确定要删除所有过期订单吗?', function(index){ + layer.msg('操作中', { + icon: 16 + ,shade: 0.01 + }); + + $.post("/admin/delGqOrder",function (data) { + if (data.code==1){ + layer.msg("操作成功!"); + myTable.reload({ + where: { + state:$("#state").val(), + type:$("#type").val() + } + }); + }else{ + layer.msg(data.msg); + } + + }); + + }); + + break; + case 'delLast': + layer.confirm('确定要删除七天前的所有订单吗?', function(index){ + layer.msg('操作中', { + icon: 16 + ,shade: 0.01 + }); + + $.post("/admin/delLastOrder",function (data) { + if (data.code==1){ + layer.msg("操作成功!"); + myTable.reload({ + where: { + state:$("#state").val(), + type:$("#type").val() + } + }); + }else{ + layer.msg(data.msg); + } + + }); + + }); + break; + }; + }); + + form.render(); }); diff --git a/src/main/webapp/api.html b/src/main/webapp/api.html index d2180bc..3a6c810 100644 --- a/src/main/webapp/api.html +++ b/src/main/webapp/api.html @@ -759,8 +759,41 @@

回调参数说明

+ + +
+
+<?php
+
+ini_set("error_reporting","E_ALL & ~E_NOTICE");
+
+$key = "83d551f0b3609781a22536ca2658473d";//通讯密钥
+
+
+$payId = $_GET['payId'];//商户订单号
+$param = $_GET['param'];//创建订单的时候传入的参数
+$type = $_GET['type'];//支付方式 :微信支付为1 支付宝支付为2
+$price = $_GET['price'];//订单金额
+$reallyPrice = $_GET['reallyPrice'];//实际支付金额
+$sign = $_GET['sign'];//校验签名,计算方式 = md5(payId + param + type + price + reallyPrice + 通讯密钥)
+
+//开始校验签名
+$_sign =  md5($payId . $param . $type . $price . $reallyPrice . $key);
+if ($_sign != $sign) {
+    echo "error_sign";//sign校验不通过
+    exit();
+}
+
+
+echo "success";
+//继续业务流程
+//echo "商户订单号:".$payId ."<br>自定义参数:". $param ."<br>支付方式:". $type ."<br>订单金额:". $price ."<br>实际支付金额:". $reallyPrice;
+
+?>
+            
+ @@ -775,9 +808,12 @@

回调参数说明