|
|
@@ -1,85 +1,85 @@
|
|
|
-package com.zhongshu.card.server.core.controller.openAPI;
|
|
|
-
|
|
|
-import com.github.microservice.net.ResultContent;
|
|
|
-import com.github.microservice.types.payment.PaymentType;
|
|
|
-import com.zhongshu.card.client.openApi.params.PayParam;
|
|
|
-import com.zhongshu.card.client.openApi.params.RefundParam;
|
|
|
-import com.zhongshu.card.server.core.service.pay.BalancePayService;
|
|
|
-import com.zhongshu.card.server.core.service.pay.ChinaumsSenselessPayService;
|
|
|
-import com.zhongshu.card.server.core.service.pay.PayAccountService;
|
|
|
-import io.swagger.v3.oas.annotations.Operation;
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.util.Assert;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import javax.validation.Valid;
|
|
|
-
|
|
|
-@RestController
|
|
|
-@RequestMapping("/openAPI/v1/pay")
|
|
|
-@Tag(name = "openAPI-支付管理")
|
|
|
-public class PayOpenApiController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- BalancePayService balancePayService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ChinaumsSenselessPayService chinaumsSenselessPayService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- PayAccountService payAccountService;
|
|
|
-
|
|
|
- @Operation(summary = "查询个人钱包账户余额", description = "查询个人钱包账户余额")
|
|
|
- @RequestMapping(value = "queryDeviceBindUsers", method = {RequestMethod.GET})
|
|
|
- public ResultContent<Long> queryUserWallet(@RequestParam("projectOid") String projectOid,
|
|
|
- @RequestParam("userId") String userId){
|
|
|
- return balancePayService.queryUserBalance(projectOid, userId);
|
|
|
- }
|
|
|
-
|
|
|
- @Operation(summary = "支付", description = "支付")
|
|
|
- @RequestMapping(value = "pay", method = {RequestMethod.POST})
|
|
|
- public ResultContent pay(@RequestBody @Valid PayParam param){
|
|
|
-
|
|
|
- if (param.getPaymentType()==null){
|
|
|
- return ResultContent.buildFail("paymentType is null");
|
|
|
- }
|
|
|
-
|
|
|
- if (param.getPaymentType().equals(PaymentType.UserWallet)){
|
|
|
- return balancePayService.balancePay(param.getProjectOid(), param.getOid(), param.getUserId(), param.getTotal(), param.getOrderNo(), param.getRemark());
|
|
|
- }else if (param.getPaymentType().equals(PaymentType.UnionFrictionlessPay)){
|
|
|
- return chinaumsSenselessPayService.senselessPay(param.getProjectOid(), param.getOid(), param.getUserId(), param.getTotal(), param.getOrderNo(), param.getRemark());
|
|
|
- }
|
|
|
- return ResultContent.buildFail("参数传入错误,paymentType");
|
|
|
- }
|
|
|
-
|
|
|
- @Operation(summary = "退款", description = "退款")
|
|
|
- @RequestMapping(value = "refund", method = {RequestMethod.POST})
|
|
|
- public ResultContent refund(@RequestBody @Valid RefundParam param){
|
|
|
- if (param.getPaymentType()==null){
|
|
|
- return ResultContent.buildFail("paymentType is null");
|
|
|
- }
|
|
|
-
|
|
|
- if (param.getPaymentType().equals(PaymentType.UserWallet)){
|
|
|
- return balancePayService.refund(param.getProjectOid(), param.getOid(), param.getUserId(), param.getOrderNo(), param.getTotal(), param.getRemark());
|
|
|
- }else if (param.getPaymentType().equals(PaymentType.UnionFrictionlessPay)){
|
|
|
- return chinaumsSenselessPayService.refund(param.getProjectOid(), param.getOid(), param.getUserId(), param.getTotal(), param.getOrderNo(), param.getRefundOrderNo(), param.getRemark(), param.getTargetOrderId());
|
|
|
- }
|
|
|
- return ResultContent.buildFail("参数传入错误,paymentType");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 退款结果查询
|
|
|
- */
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询账本
|
|
|
- */
|
|
|
-// public ResultContent queryGeneralLedger(String projectOid, String oid, String userId) {
|
|
|
-// payAccountService.get
|
|
|
+//package com.zhongshu.card.server.core.controller.openAPI;
|
|
|
+//
|
|
|
+//import com.github.microservice.net.ResultContent;
|
|
|
+//import com.github.microservice.types.payment.PaymentType;
|
|
|
+//import com.zhongshu.card.client.openApi.params.PayParam;
|
|
|
+//import com.zhongshu.card.client.openApi.params.RefundParam;
|
|
|
+//import com.zhongshu.card.server.core.service.pay.BalancePayService;
|
|
|
+//import com.zhongshu.card.server.core.service.pay.ChinaumsSenselessPayService;
|
|
|
+//import com.zhongshu.card.server.core.service.pay.PayAccountService;
|
|
|
+//import io.swagger.v3.oas.annotations.Operation;
|
|
|
+//import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.util.Assert;
|
|
|
+//import org.springframework.web.bind.annotation.*;
|
|
|
+//
|
|
|
+//import javax.validation.Valid;
|
|
|
+//
|
|
|
+//@RestController
|
|
|
+//@RequestMapping("/openAPI/v1/pay")
|
|
|
+//@Tag(name = "openAPI-支付管理")
|
|
|
+//public class PayOpenApiController {
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// BalancePayService balancePayService;
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// ChinaumsSenselessPayService chinaumsSenselessPayService;
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// PayAccountService payAccountService;
|
|
|
+//
|
|
|
+// @Operation(summary = "查询个人钱包账户余额", description = "查询个人钱包账户余额")
|
|
|
+// @RequestMapping(value = "queryDeviceBindUsers", method = {RequestMethod.GET})
|
|
|
+// public ResultContent<Long> queryUserWallet(@RequestParam("projectOid") String projectOid,
|
|
|
+// @RequestParam("userId") String userId){
|
|
|
+// return balancePayService.queryUserBalance(projectOid, userId);
|
|
|
// }
|
|
|
-
|
|
|
- /**
|
|
|
- *
|
|
|
- */
|
|
|
-// public
|
|
|
-}
|
|
|
+//
|
|
|
+// @Operation(summary = "支付", description = "支付")
|
|
|
+// @RequestMapping(value = "pay", method = {RequestMethod.POST})
|
|
|
+// public ResultContent pay(@RequestBody @Valid PayParam param){
|
|
|
+//
|
|
|
+// if (param.getPaymentType()==null){
|
|
|
+// return ResultContent.buildFail("paymentType is null");
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (param.getPaymentType().equals(PaymentType.UserWallet)){
|
|
|
+// return balancePayService.balancePay(param.getProjectOid(), param.getOid(), param.getUserId(), param.getTotal(), param.getOrderNo(), param.getRemark());
|
|
|
+// }else if (param.getPaymentType().equals(PaymentType.UnionFrictionlessPay)){
|
|
|
+// return chinaumsSenselessPayService.senselessPay(param.getProjectOid(), param.getOid(), param.getUserId(), param.getTotal(), param.getOrderNo(), param.getRemark());
|
|
|
+// }
|
|
|
+// return ResultContent.buildFail("参数传入错误,paymentType");
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Operation(summary = "退款", description = "退款")
|
|
|
+// @RequestMapping(value = "refund", method = {RequestMethod.POST})
|
|
|
+// public ResultContent refund(@RequestBody @Valid RefundParam param){
|
|
|
+// if (param.getPaymentType()==null){
|
|
|
+// return ResultContent.buildFail("paymentType is null");
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (param.getPaymentType().equals(PaymentType.UserWallet)){
|
|
|
+// return balancePayService.refund(param.getProjectOid(), param.getOid(), param.getUserId(), param.getOrderNo(), param.getTotal(), param.getRemark());
|
|
|
+// }else if (param.getPaymentType().equals(PaymentType.UnionFrictionlessPay)){
|
|
|
+// return chinaumsSenselessPayService.refund(param.getProjectOid(), param.getOid(), param.getUserId(), param.getTotal(), param.getOrderNo(), param.getRefundOrderNo(), param.getRemark(), param.getTargetOrderId());
|
|
|
+// }
|
|
|
+// return ResultContent.buildFail("参数传入错误,paymentType");
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 退款结果查询
|
|
|
+// */
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 查询账本
|
|
|
+// */
|
|
|
+//// public ResultContent queryGeneralLedger(String projectOid, String oid, String userId) {
|
|
|
+//// payAccountService.get
|
|
|
+//// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// *
|
|
|
+// */
|
|
|
+//// public
|
|
|
+//}
|