|
@@ -1,6 +1,8 @@
|
|
package com.ym.mec.collectfee.controller;
|
|
package com.ym.mec.collectfee.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.ym.mec.collectfee.entity.Order;
|
|
import com.ym.mec.collectfee.entity.Order;
|
|
|
|
+import com.ym.mec.collectfee.service.OrderService;
|
|
import com.ym.mec.collectfee.service.YqPayService;
|
|
import com.ym.mec.collectfee.service.YqPayService;
|
|
import com.ym.mec.collectfee.service.YqQueryService;
|
|
import com.ym.mec.collectfee.service.YqQueryService;
|
|
import com.ym.mec.collectfee.service.impl.OrderServiceImpl;
|
|
import com.ym.mec.collectfee.service.impl.OrderServiceImpl;
|
|
@@ -8,11 +10,13 @@ import com.ym.mec.collectfee.utils.GenerateNum;
|
|
import com.ym.mec.collectfee.utils.yqpay.Msg;
|
|
import com.ym.mec.collectfee.utils.yqpay.Msg;
|
|
import com.ym.mec.collectfee.utils.yqpay.YqPayUtil;
|
|
import com.ym.mec.collectfee.utils.yqpay.YqPayUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -25,7 +29,7 @@ public class YqPayController {
|
|
@Autowired
|
|
@Autowired
|
|
private YqQueryService yqQueryService;
|
|
private YqQueryService yqQueryService;
|
|
@Autowired
|
|
@Autowired
|
|
- private OrderServiceImpl orderService;
|
|
|
|
|
|
+ private OrderService orderService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -37,12 +41,9 @@ public class YqPayController {
|
|
@RequestMapping("/toPay")
|
|
@RequestMapping("/toPay")
|
|
@Transactional
|
|
@Transactional
|
|
public Msg toPay(@ModelAttribute Order order) throws Exception {
|
|
public Msg toPay(@ModelAttribute Order order) throws Exception {
|
|
-
|
|
|
|
String orderNo = GenerateNum.getInstance().GenerateOrderNo();
|
|
String orderNo = GenerateNum.getInstance().GenerateOrderNo();
|
|
- System.out.println(order);
|
|
|
|
orderService.insert(order);
|
|
orderService.insert(order);
|
|
|
|
|
|
-
|
|
|
|
/*卖家双乾商户号*/
|
|
/*卖家双乾商户号*/
|
|
String sellerNo = "0022652"; //某笔定义到某个商户
|
|
String sellerNo = "0022652"; //某笔定义到某个商户
|
|
/*支付渠道*/
|
|
/*支付渠道*/
|
|
@@ -87,7 +88,12 @@ public class YqPayController {
|
|
resultMap.put("clientIp", "27.18.213.149"); //客户端ip地址(银联H5必填)
|
|
resultMap.put("clientIp", "27.18.213.149"); //客户端ip地址(银联H5必填)
|
|
resultMap.put("goodsDetail", goodsDetail);
|
|
resultMap.put("goodsDetail", goodsDetail);
|
|
Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
|
|
Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
|
|
- return yqPayService.toPay(requestMap);
|
|
|
|
|
|
+ Msg msg = yqPayService.toPay(requestMap);
|
|
|
|
+ if(!msg.getResponseParameters().isEmpty()){
|
|
|
|
+ Object parse = JSON.parse(msg.getResponseParameters());
|
|
|
|
+ }
|
|
|
|
+ System.out.println(parse);
|
|
|
|
+ return msg;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|