支付流程结束,查询结果接口结束
This commit is contained in:
parent
88062638de
commit
5579df31bb
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.app;
|
||||||
import com.huifu.adapay.core.AdapayCore;
|
import com.huifu.adapay.core.AdapayCore;
|
||||||
import com.huifu.adapay.core.util.AdapaySign;
|
import com.huifu.adapay.core.util.AdapaySign;
|
||||||
import com.ruoyi.common.core.domain.Result;
|
import com.ruoyi.common.core.domain.Result;
|
||||||
|
import com.ruoyi.system.domain.TbUserMatchOrder;
|
||||||
import com.ruoyi.web.request.AdapayReq;
|
import com.ruoyi.web.request.AdapayReq;
|
||||||
import com.ruoyi.web.request.Event;
|
import com.ruoyi.web.request.Event;
|
||||||
import com.ruoyi.web.response.AdapayResp;
|
import com.ruoyi.web.response.AdapayResp;
|
||||||
|
|
@ -33,6 +34,19 @@ public class TbUserMatchOrderAppController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CallBackService callBackService;
|
private CallBackService callBackService;
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping(value = "/checkPayResult")
|
||||||
|
@ApiOperation(value = "查询用户开通结果,无返回则证明没有开通记录", response = TbUserMatchOrder.class)
|
||||||
|
public Result<TbUserMatchOrder> checkPayResult(@RequestBody @NotNull AdapayReq adapayReq){
|
||||||
|
try {
|
||||||
|
return Result.success(adapayService.checkPayResult(adapayReq));
|
||||||
|
}catch (Exception e){
|
||||||
|
return Result.error(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping(value = "/pay")
|
@PostMapping(value = "/pay")
|
||||||
@ApiOperation(value = "支付接口", response = AdapayResp.class)
|
@ApiOperation(value = "支付接口", response = AdapayResp.class)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.web.service;
|
package com.ruoyi.web.service;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.TbUserMatchOrder;
|
||||||
import com.ruoyi.web.request.AdapayReq;
|
import com.ruoyi.web.request.AdapayReq;
|
||||||
import com.ruoyi.web.response.AdapayResp;
|
import com.ruoyi.web.response.AdapayResp;
|
||||||
|
|
||||||
|
|
@ -14,4 +15,11 @@ public interface AdapayService {
|
||||||
*/
|
*/
|
||||||
public AdapayResp pay(AdapayReq adapayReq) throws Exception;
|
public AdapayResp pay(AdapayReq adapayReq) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param adapayReq 支付查询
|
||||||
|
* @return 支付结果
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
TbUserMatchOrder checkPayResult(AdapayReq adapayReq) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,4 +74,13 @@ public class AdapayServiceImpl implements AdapayService {
|
||||||
tbUserMatchOrderService.insertTbUserMatchOrder(tbUserMatchOrder);
|
tbUserMatchOrderService.insertTbUserMatchOrder(tbUserMatchOrder);
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TbUserMatchOrder checkPayResult(AdapayReq adapayReq) {
|
||||||
|
return tbUserMatchOrderService.lambdaQuery()
|
||||||
|
.eq(TbUserMatchOrder::getUserId, adapayReq.getUserId())
|
||||||
|
.eq(TbUserMatchOrder::getOrderType, adapayReq.getOrderType())
|
||||||
|
.eq(TbUserMatchOrder::getPayStatus, "succeeded")
|
||||||
|
.one();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue