支付模型,初版
This commit is contained in:
parent
ff22f93d3d
commit
8859a72a61
14
pom.xml
14
pom.xml
|
|
@ -36,11 +36,25 @@
|
|||
<ali-sdk.version>4.5.3</ali-sdk.version>
|
||||
<ali-sms.version>2.0.1</ali-sms.version>
|
||||
<ali-oss.version>3.10.2</ali-oss.version>
|
||||
<adapay.version>1.2.10</adapay.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/com.huifu.adapay.core/adapay-core-sdk -->
|
||||
<dependency>
|
||||
<groupId>com.huifu.adapay.core</groupId>
|
||||
<artifactId>adapay-core-sdk</artifactId>
|
||||
<version>${adapay.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.huifu.adapay/adapay-java-sdk -->
|
||||
<dependency>
|
||||
<groupId>com.huifu.adapay</groupId>
|
||||
<artifactId>adapay-java-sdk</artifactId>
|
||||
<version>${adapay.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--阿里云核心API-->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,17 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.huifu.adapay.core</groupId>
|
||||
<artifactId>adapay-core-sdk</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.huifu.adapay/adapay-java-sdk -->
|
||||
<dependency>
|
||||
<groupId>com.huifu.adapay</groupId>
|
||||
<artifactId>adapay-java-sdk</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--阿里云核心API-->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import com.ruoyi.common.core.domain.Result;
|
||||
import com.ruoyi.web.request.AdapayReq;
|
||||
import com.ruoyi.web.response.AdapayResp;
|
||||
import com.ruoyi.web.service.AdapayService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>开通合伙人相关接口</p>
|
||||
* @author clunt
|
||||
*/
|
||||
@Api(tags = "App*开通合伙人相关接口")
|
||||
@RestController
|
||||
@RequestMapping(value = "/app/matchOrder")
|
||||
public class TbUserMatchOrderAppController {
|
||||
|
||||
@Autowired
|
||||
private AdapayService adapayService;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/pay")
|
||||
@ApiOperation(value = "支付接口", response = AdapayResp.class)
|
||||
public Result<AdapayResp> loginByPhone(@RequestBody @NotNull AdapayReq adapayReq){
|
||||
try {
|
||||
return Result.success(adapayService.pay(adapayReq));
|
||||
}catch (Exception e){
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.TbUserMatchOrder;
|
||||
import com.ruoyi.system.service.ITbUserMatchOrderService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 合伙人开通订单Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/order")
|
||||
public class TbUserMatchOrderController extends BaseController
|
||||
{
|
||||
private String prefix = "system/order";
|
||||
|
||||
@Autowired
|
||||
private ITbUserMatchOrderService tbUserMatchOrderService;
|
||||
|
||||
@RequiresPermissions("system:order:view")
|
||||
@GetMapping()
|
||||
public String order()
|
||||
{
|
||||
return prefix + "/order";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合伙人开通订单列表
|
||||
*/
|
||||
@RequiresPermissions("system:order:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
startPage();
|
||||
List<TbUserMatchOrder> list = tbUserMatchOrderService.selectTbUserMatchOrderList(tbUserMatchOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出合伙人开通订单列表
|
||||
*/
|
||||
@RequiresPermissions("system:order:export")
|
||||
@Log(title = "合伙人开通订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
List<TbUserMatchOrder> list = tbUserMatchOrderService.selectTbUserMatchOrderList(tbUserMatchOrder);
|
||||
ExcelUtil<TbUserMatchOrder> util = new ExcelUtil<TbUserMatchOrder>(TbUserMatchOrder.class);
|
||||
return util.exportExcel(list, "合伙人开通订单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合伙人开通订单
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存合伙人开通订单
|
||||
*/
|
||||
@RequiresPermissions("system:order:add")
|
||||
@Log(title = "合伙人开通订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
return toAjax(tbUserMatchOrderService.insertTbUserMatchOrder(tbUserMatchOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合伙人开通订单
|
||||
*/
|
||||
@RequiresPermissions("system:order:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
TbUserMatchOrder tbUserMatchOrder = tbUserMatchOrderService.selectTbUserMatchOrderById(id);
|
||||
mmap.put("tbUserMatchOrder", tbUserMatchOrder);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存合伙人开通订单
|
||||
*/
|
||||
@RequiresPermissions("system:order:edit")
|
||||
@Log(title = "合伙人开通订单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
return toAjax(tbUserMatchOrderService.updateTbUserMatchOrder(tbUserMatchOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合伙人开通订单
|
||||
*/
|
||||
@RequiresPermissions("system:order:remove")
|
||||
@Log(title = "合伙人开通订单", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(tbUserMatchOrderService.deleteTbUserMatchOrderByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ruoyi.web.core.config;
|
||||
|
||||
import com.huifu.adapay.Adapay;
|
||||
import com.huifu.adapay.model.MerConfig;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties("adapay")
|
||||
public class AdapayConfig {
|
||||
|
||||
/**
|
||||
* 是否打印调用日志,默认不打印
|
||||
*/
|
||||
private boolean debug = false;
|
||||
|
||||
/**
|
||||
* 是否是prod_mode 默认为 true
|
||||
*/
|
||||
private boolean prodMode = true;
|
||||
|
||||
private String notifyUrl;
|
||||
|
||||
private String appId;
|
||||
|
||||
private String apiKey;
|
||||
|
||||
private String mockApiKey;
|
||||
|
||||
private String rsaPrivateKey;
|
||||
|
||||
@PostConstruct
|
||||
public void initAdapay() throws Exception{
|
||||
MerConfig merConfig = new MerConfig();
|
||||
merConfig.setApiKey(apiKey);
|
||||
merConfig.setApiMockKey(mockApiKey);
|
||||
merConfig.setRSAPrivateKey(rsaPrivateKey);
|
||||
Adapay.initWithMerConfig(merConfig);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.ruoyi.web.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "支付请求对象")
|
||||
public class AdapayReq {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "订单类型 0.初级合伙人 1.高级合伙人 2.区域合伙人")
|
||||
private Long orderType;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.ruoyi.web.response;
|
||||
|
||||
public class AdapayResp {
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.web.service;
|
||||
|
||||
import com.ruoyi.web.request.AdapayReq;
|
||||
import com.ruoyi.web.response.AdapayResp;
|
||||
|
||||
public interface AdapayService {
|
||||
|
||||
/**
|
||||
* <P>发起支付</P>
|
||||
* @param adapayReq 支付对象
|
||||
* @return 响应对象
|
||||
*/
|
||||
public AdapayResp pay(AdapayReq adapayReq);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ruoyi.web.service.impl;
|
||||
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.huifu.adapay.model.Payment;
|
||||
import com.ruoyi.common.json.JSONObject;
|
||||
import com.ruoyi.web.core.config.AdapayConfig;
|
||||
import com.ruoyi.web.request.AdapayReq;
|
||||
import com.ruoyi.web.response.AdapayResp;
|
||||
import com.ruoyi.web.service.AdapayService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AdapayServiceImpl implements AdapayService {
|
||||
|
||||
@Autowired
|
||||
private AdapayConfig adapayConfig;
|
||||
|
||||
@Override
|
||||
public AdapayResp pay(AdapayReq adapayReq) {
|
||||
//创建支付对象的参数,全部参数请参考 https://docs.adapay.tech/api/index.html
|
||||
Map<String, Object> paymentParams = new HashMap<>(10);
|
||||
|
||||
// 设置超时时间 单位毫秒 类型 int
|
||||
// adapay_connection_request_timeout 类型 int, 单位:毫秒 ms
|
||||
// 非必须, 默认 10000 指从连接池获取连接的 timeout
|
||||
paymentParams.put("adapay_connection_request_timeout", 1500);
|
||||
// adapay_connect_timeout 单位:毫秒 ms
|
||||
// 非必须, 默认 30000 指客户端和服务器建立连接的timeout
|
||||
paymentParams.put("adapay_connect_timeout", 1500);
|
||||
// adapay_socket_timeout 单位:毫秒 ms
|
||||
// 非必须, 默认 30000 指客户端从服务器读取数据的timeout,超出后会抛出SocketTimeOutException
|
||||
paymentParams.put("adapay_socket_timeout", 1500);
|
||||
|
||||
// 设置网络区域
|
||||
// 非必须, 默认 shanghai, 如果要使用其他区域请提交工单备注服务器公网出口IP地址申请开通(如:beijing)
|
||||
// paymentParams.put("adapay_region", "beijing");
|
||||
|
||||
|
||||
paymentParams.put("app_id", adapayConfig.getAppId());
|
||||
paymentParams.put("order_no", "jsdk_payment_" + System.currentTimeMillis());
|
||||
paymentParams.put("pay_channel", "alipay");
|
||||
paymentParams.put("pay_amt", "0.01");
|
||||
|
||||
paymentParams.put("goods_title", "your goods title");
|
||||
paymentParams.put("goods_desc", "your goods desc");
|
||||
|
||||
paymentParams.put("div_members", "");
|
||||
|
||||
|
||||
//调用sdk方法,创建支付,得到支付对象
|
||||
Map<String, Object> payment = new HashMap<>();
|
||||
try {
|
||||
log.info("支付交易,请求参数:" + JSONObject.valueAsStr(payment));
|
||||
payment = Payment.create(paymentParams);
|
||||
|
||||
} catch (BaseAdaPayException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
log.info("支付交易,返回参数:" + JSONObject.valueAsStr(payment));
|
||||
log.info("=======execute payment end=======");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -174,3 +174,10 @@ aliyun:
|
|||
endpoint: http://oss-cn-shenzhen.aliyuncs.com
|
||||
url-prefix: http://youban2023.oss-cn-shenzhen.aliyuncs.com/
|
||||
|
||||
adapay:
|
||||
app-id: app_77b944f9-99f5-4e62-94c1-ce1cc1ead4bc
|
||||
rsa-private-key: MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALGI62YjX8UbBiupWPLYeck9TMNZVSLE09M8ZoSfe7yC3ZHO0S3Vq+q9aRsk9hOiOxiTA1tMtp5+5MvZyVK7mIC8FkTbSk3r4sJ+WtPkogOgFJ2xSljS4fu2wIVPYeGyOuWbB6npzJ121vFE91uhNIbK4K2QfJUqMYnWwYCCqyQHAgMBAAECgYBRUmqhyqpf21UkQtpfwxFmQRIcmZsJ5icxp4U+Ut+XJkrgM2BWIn4xdLnkmTWvIKz5QL5U3/r29yFOz2AM6amc6nHUuf9ArFqMFZ/2FgXu1y7UGU2cKq+ZZ2afyuG3EuxTycxxXEw/pekO94mSvjuGLxX/XzS+zb4Uzb9/J3xKwQJBAOk+pzsfdUR9dK1hrDZkgVmvq9tEi9yn0rteT5UW66lVOcypa3k9eZ6cTCv4CGJpl1wktr0l6pLi3JU27VNfZ28CQQDC2uW8pl9B9RxJR+s4QGaiySI0J0AmmRbPPol9kCegSPpg+Tcq9bYGNEI9dPy+EvkqejZLixPEU2V9IUSRigDpAkEAppls46sNnPUrUOhyFIvnZIM48q5cZCivOcwcdfZgL5xDY68jp/7EDwm+0q0geALJ7TQAHsylZ3OJcT9BdwqvGwJBAK+GuETEKjMkNaLdoko92TbysFkCsosShLWTxA7T+J4unz0Twlp0lM/p63GpHLOsK7/T720Fj3zfEyExAq+H/WECQQDc9MLEjO3CuEZ8PBPtC3krKglBK3XzXjqelb95bI+6YrI7I65V5sPYWYJBiOONczuWaD+SzEWMq2pIIustO2zW
|
||||
api-key: api_live_759f9dbb-1048-4816-bb67-93281a6b2dd7
|
||||
mock-api-key: api_test_e016292e-2b66-4891-8353-7e640407fe15
|
||||
notify-url: http://www.quanmingtuodan.xyz:18000
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增合伙人开通订单')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="userId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderMoney" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderNo" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付款id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="paymentId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="remark" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/order"
|
||||
$("#form-order-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-order-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改合伙人开通订单')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-edit" th:object="${tbUserMatchOrder}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="userId" th:field="*{userId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderMoney" th:field="*{orderMoney}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderNo" th:field="*{orderNo}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付款id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="paymentId" th:field="*{paymentId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="remark" th:field="*{remark}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/order";
|
||||
$("#form-order-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('合伙人开通订单列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>用户id:</label>
|
||||
<input type="text" name="userId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>支付金额:</label>
|
||||
<input type="text" name="orderMoney"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>订单号:</label>
|
||||
<input type="text" name="orderNo"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>付款id:</label>
|
||||
<input type="text" name="paymentId"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:order:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:order:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:order:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:order:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:order:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:order:remove')}]];
|
||||
var prefix = ctx + "system/order";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "合伙人开通订单",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '主键id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'userId',
|
||||
title: '用户id'
|
||||
},
|
||||
{
|
||||
field: 'orderType',
|
||||
title: '订单类型 0.初级 1.高级 2.区域'
|
||||
},
|
||||
{
|
||||
field: 'orderMoney',
|
||||
title: '支付金额'
|
||||
},
|
||||
{
|
||||
field: 'orderNo',
|
||||
title: '订单号'
|
||||
},
|
||||
{
|
||||
field: 'paymentId',
|
||||
title: '付款id'
|
||||
},
|
||||
{
|
||||
field: 'payStatus',
|
||||
title: '付款状态'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -308,6 +308,8 @@ public class ShiroConfig
|
|||
filterChainDefinitionMap.put("/app/img/**", "anon");
|
||||
// app关注接口
|
||||
filterChainDefinitionMap.put("/app/follow/**", "anon");
|
||||
// app支付接口
|
||||
filterChainDefinitionMap.put("/app/matchOrder/**", "anon");
|
||||
// 系统权限列表
|
||||
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 合伙人开通订单对象 tb_user_match_order
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "tb_user_match_order")
|
||||
public class TbUserMatchOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 订单类型 0.初级 1.高级 2.区域 */
|
||||
@Excel(name = "订单类型 0.初级 1.高级 2.区域")
|
||||
private Long orderType;
|
||||
|
||||
/** 支付金额 */
|
||||
@Excel(name = "支付金额")
|
||||
private BigDecimal orderMoney;
|
||||
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
/** 付款id */
|
||||
@Excel(name = "付款id")
|
||||
private String paymentId;
|
||||
|
||||
/** 付款状态 */
|
||||
@Excel(name = "付款状态")
|
||||
private String payStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.TbUserMatchOrder;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 合伙人开通订单Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
public interface TbUserMatchOrderMapper extends BaseMapper<TbUserMatchOrder>
|
||||
{
|
||||
/**
|
||||
* 查询合伙人开通订单
|
||||
*
|
||||
* @param id 合伙人开通订单主键
|
||||
* @return 合伙人开通订单
|
||||
*/
|
||||
public TbUserMatchOrder selectTbUserMatchOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询合伙人开通订单列表
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 合伙人开通订单集合
|
||||
*/
|
||||
public List<TbUserMatchOrder> selectTbUserMatchOrderList(TbUserMatchOrder tbUserMatchOrder);
|
||||
|
||||
/**
|
||||
* 新增合伙人开通订单
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbUserMatchOrder(TbUserMatchOrder tbUserMatchOrder);
|
||||
|
||||
/**
|
||||
* 修改合伙人开通订单
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbUserMatchOrder(TbUserMatchOrder tbUserMatchOrder);
|
||||
|
||||
/**
|
||||
* 删除合伙人开通订单
|
||||
*
|
||||
* @param id 合伙人开通订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserMatchOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除合伙人开通订单
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserMatchOrderByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.TbUserMatchOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 合伙人开通订单Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
public interface ITbUserMatchOrderService extends IService<TbUserMatchOrder>
|
||||
{
|
||||
/**
|
||||
* 查询合伙人开通订单
|
||||
*
|
||||
* @param id 合伙人开通订单主键
|
||||
* @return 合伙人开通订单
|
||||
*/
|
||||
public TbUserMatchOrder selectTbUserMatchOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询合伙人开通订单列表
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 合伙人开通订单集合
|
||||
*/
|
||||
public List<TbUserMatchOrder> selectTbUserMatchOrderList(TbUserMatchOrder tbUserMatchOrder);
|
||||
|
||||
/**
|
||||
* 新增合伙人开通订单
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbUserMatchOrder(TbUserMatchOrder tbUserMatchOrder);
|
||||
|
||||
/**
|
||||
* 修改合伙人开通订单
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbUserMatchOrder(TbUserMatchOrder tbUserMatchOrder);
|
||||
|
||||
/**
|
||||
* 批量删除合伙人开通订单
|
||||
*
|
||||
* @param ids 需要删除的合伙人开通订单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserMatchOrderByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除合伙人开通订单信息
|
||||
*
|
||||
* @param id 合伙人开通订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserMatchOrderById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.TbUserMatchOrderMapper;
|
||||
import com.ruoyi.system.domain.TbUserMatchOrder;
|
||||
import com.ruoyi.system.service.ITbUserMatchOrderService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* 合伙人开通订单Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
@Service
|
||||
public class TbUserMatchOrderServiceImpl extends ServiceImpl<TbUserMatchOrderMapper, TbUserMatchOrder> implements ITbUserMatchOrderService
|
||||
{
|
||||
@Autowired
|
||||
private TbUserMatchOrderMapper tbUserMatchOrderMapper;
|
||||
|
||||
/**
|
||||
* 查询合伙人开通订单
|
||||
*
|
||||
* @param id 合伙人开通订单主键
|
||||
* @return 合伙人开通订单
|
||||
*/
|
||||
@Override
|
||||
public TbUserMatchOrder selectTbUserMatchOrderById(Long id)
|
||||
{
|
||||
return tbUserMatchOrderMapper.selectTbUserMatchOrderById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合伙人开通订单列表
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 合伙人开通订单
|
||||
*/
|
||||
@Override
|
||||
public List<TbUserMatchOrder> selectTbUserMatchOrderList(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
return tbUserMatchOrderMapper.selectTbUserMatchOrderList(tbUserMatchOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合伙人开通订单
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbUserMatchOrder(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
tbUserMatchOrder.setCreateTime(DateUtils.getNowDate());
|
||||
return tbUserMatchOrderMapper.insertTbUserMatchOrder(tbUserMatchOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合伙人开通订单
|
||||
*
|
||||
* @param tbUserMatchOrder 合伙人开通订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbUserMatchOrder(TbUserMatchOrder tbUserMatchOrder)
|
||||
{
|
||||
tbUserMatchOrder.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbUserMatchOrderMapper.updateTbUserMatchOrder(tbUserMatchOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合伙人开通订单
|
||||
*
|
||||
* @param ids 需要删除的合伙人开通订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbUserMatchOrderByIds(String ids)
|
||||
{
|
||||
return tbUserMatchOrderMapper.deleteTbUserMatchOrderByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合伙人开通订单信息
|
||||
*
|
||||
* @param id 合伙人开通订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbUserMatchOrderById(Long id)
|
||||
{
|
||||
return tbUserMatchOrderMapper.deleteTbUserMatchOrderById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?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.ruoyi.system.mapper.TbUserMatchOrderMapper">
|
||||
|
||||
<resultMap type="TbUserMatchOrder" id="TbUserMatchOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="orderMoney" column="order_money" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="paymentId" column="payment_id" />
|
||||
<result property="payStatus" column="pay_status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbUserMatchOrderVo">
|
||||
select id, user_id, order_type, order_money, order_no, payment_id, pay_status, create_time, update_time, remark from tb_user_match_order
|
||||
</sql>
|
||||
|
||||
<select id="selectTbUserMatchOrderList" parameterType="TbUserMatchOrder" resultMap="TbUserMatchOrderResult">
|
||||
<include refid="selectTbUserMatchOrderVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="orderType != null "> and order_type = #{orderType}</if>
|
||||
<if test="orderMoney != null "> and order_money = #{orderMoney}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
|
||||
<if test="paymentId != null and paymentId != ''"> and payment_id = #{paymentId}</if>
|
||||
<if test="payStatus != null and payStatus != ''"> and pay_status = #{payStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbUserMatchOrderById" parameterType="Long" resultMap="TbUserMatchOrderResult">
|
||||
<include refid="selectTbUserMatchOrderVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbUserMatchOrder" parameterType="TbUserMatchOrder" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_user_match_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
<if test="orderMoney != null">order_money,</if>
|
||||
<if test="orderNo != null">order_no,</if>
|
||||
<if test="paymentId != null">payment_id,</if>
|
||||
<if test="payStatus != null">pay_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
<if test="orderMoney != null">#{orderMoney},</if>
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
<if test="paymentId != null">#{paymentId},</if>
|
||||
<if test="payStatus != null">#{payStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbUserMatchOrder" parameterType="TbUserMatchOrder">
|
||||
update tb_user_match_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="orderType != null">order_type = #{orderType},</if>
|
||||
<if test="orderMoney != null">order_money = #{orderMoney},</if>
|
||||
<if test="orderNo != null">order_no = #{orderNo},</if>
|
||||
<if test="paymentId != null">payment_id = #{paymentId},</if>
|
||||
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbUserMatchOrderById" parameterType="Long">
|
||||
delete from tb_user_match_order where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbUserMatchOrderByIds" parameterType="String">
|
||||
delete from tb_user_match_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue