Commit 3b22ec82 by chongli

微信小程序

parent 147382ac
......@@ -3,6 +3,10 @@
*/
package com.ctrip.fun.golf.api.payment;
import java.io.BufferedReader;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -10,11 +14,11 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ctrip.fun.common.vo.payment.NotifyResponseBean;
import com.ctrip.fun.common.vo.payment.PaymentResponse;
import com.ctrip.fun.golf.service.payment.NotifyService;
/**
* @author zgsong
* @version 1.0.0
......@@ -40,15 +44,26 @@ public class NotifyController {
}
/**
* 支付通知
*
* @param createPayOrderRequestBean CreatePayOrderRequestBean
* 微信支付通知
*/
@RequestMapping(value = "/notifyForMiniApp", produces = "application/json;charset=UTF-8")
@ResponseBody
@RequestMapping(value = "/miniApp", method = RequestMethod.POST)
public Object notifyForMiniApp(@RequestBody PaymentResponse paymentResponse,@PathVariable String orderType) {
NotifyResponseBean notifyResponseBean = this.notifyService.notify(paymentResponse,orderType);
return notifyResponseBean;
public String notifyForMiniApp(HttpServletRequest request,HttpServletResponse response) throws Exception{
BufferedReader reader = null;
reader = request.getReader();
String line = "";
String xmlString = null;
StringBuffer inputString = new StringBuffer();
while ((line = reader.readLine()) != null) {
inputString.append(line);
}
xmlString = inputString.toString();
request.getReader().close();
System.out.println("----接收到的数据如下:---" + xmlString);
this.notifyService.notifyForMiniApp(xmlString);
response.getWriter().write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
return null;
}
......
......@@ -37,6 +37,18 @@ public class NotifyService {
return response;
}
/**
* @param paymentResponse
* @return
*/
public String notifyForMiniApp(String xml) {
HttpEntity<String> entity = new HttpEntity<String>(xml);
String response = restTemplate.exchange(this.getServerBaseNotifyPath()+"/communeOrder/notifyForMiniApp", HttpMethod.POST, entity, new ParameterizedTypeReference<String>() {
}).getBody();
return response;
}
public RestTemplate getRestTemplate() {
return restTemplate;
}
......
......@@ -28,7 +28,7 @@ public class VoucherGetLogBean implements Serializable {
/**
* 抢券时间
*/
private Date getTime;
private Date createTime;
public Integer getId() {
return id;
......@@ -46,10 +46,6 @@ public class VoucherGetLogBean implements Serializable {
return voucherid;
}
public Date getGetTime() {
return getTime;
}
public void setId(Integer id) {
this.id = id;
}
......@@ -66,7 +62,13 @@ public class VoucherGetLogBean implements Serializable {
this.voucherid = voucherid;
}
public void setGetTime(Date getTime) {
this.getTime = getTime;
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
......@@ -55,6 +55,11 @@ public class CommuneOrderBean extends AbstractOrderBean<CommuneOrderResourceBean
*
*/
private Integer communeYears;
/**
*
* 推荐人uid
*/
private String recommendUid;
public String getRecommendCode() {
return recommendCode;
......@@ -137,4 +142,12 @@ public class CommuneOrderBean extends AbstractOrderBean<CommuneOrderResourceBean
this.communeYears = communeYears;
}
public String getRecommendUid() {
return recommendUid;
}
public void setRecommendUid(String recommendUid) {
this.recommendUid = recommendUid;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment