|
@@ -2,8 +2,13 @@ package com.ygj.yuemum.controller.pay;
|
|
|
|
|
|
|
|
|
import com.ygj.yuemum.component.Constant;
|
|
|
+import com.ygj.yuemum.domain.order.YSOrder;
|
|
|
+import com.ygj.yuemum.domain.pay.CustomerPay;
|
|
|
+import com.ygj.yuemum.domain.pay.PayMents;
|
|
|
+import com.ygj.yuemum.service.order.YSOrderService;
|
|
|
import com.ygj.yuemum.service.pay.CustomerPayService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import sun.misc.BASE64Encoder;
|
|
@@ -20,6 +25,8 @@ public class CreatePayQrCodeController {
|
|
|
public static final String RESUMEFILE = Constant.RESUMEFILE;
|
|
|
@Autowired
|
|
|
private CustomerPayService customerPayService;
|
|
|
+ @Autowired
|
|
|
+ private YSOrderService ysOrderService;
|
|
|
|
|
|
@RequestMapping(value = "/createPayQrCode", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
|
|
@ResponseBody
|
|
@@ -33,6 +40,17 @@ public class CreatePayQrCodeController {
|
|
|
Integer productId= Integer.parseInt(params.get("productId"));
|
|
|
String payment_steps = params.get("payment_steps");
|
|
|
String out_trade_no = orderNo + "SEQ" + payment_steps;
|
|
|
+ //check 本流水号是否已经付过款
|
|
|
+ CustomerPay customerPay = customerPayService.checkTrade(out_trade_no);
|
|
|
+ if (customerPay != null) {
|
|
|
+ //check 订单是否已经支付完成
|
|
|
+ YSOrder ysOrder = ysOrderService.selectByOdNo(orderNo);
|
|
|
+ if (ysOrder.getOd_order_pay_amount() == 0) {
|
|
|
+ return "all";
|
|
|
+ } else {
|
|
|
+ out_trade_no = orderNo + "SEQ" + (Integer.parseInt(params.get("payment_steps")) + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
BufferedImage bufferedImage = customerPayService.createPayQrCode(out_trade_no,channel,price,originPrice,title,productName,productId);
|
|
|
//保存一下
|
|
|
// ByteArrayOutputStream os = new ByteArrayOutputStream();
|