Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3b22ec82
authored
Aug 04, 2018
by
chongli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信小程序
parent
147382ac
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
15 deletions
fun-common-soa/src/main/java/com/ctrip/fun/golf/api/payment/NotifyController.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/payment/NotifyService.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VoucherGetLogBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/CommuneOrderBean.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/api/payment/NotifyController.java
View file @
3b22ec82
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
*/
*/
package
com
.
ctrip
.
fun
.
golf
.
api
.
payment
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -10,11 +14,11 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -10,11 +14,11 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ctrip.fun.common.vo.payment.NotifyResponseBean
;
import
com.ctrip.fun.common.vo.payment.NotifyResponseBean
;
import
com.ctrip.fun.common.vo.payment.PaymentResponse
;
import
com.ctrip.fun.common.vo.payment.PaymentResponse
;
import
com.ctrip.fun.golf.service.payment.NotifyService
;
import
com.ctrip.fun.golf.service.payment.NotifyService
;
/**
/**
* @author zgsong
* @author zgsong
* @version 1.0.0
* @version 1.0.0
...
@@ -40,15 +44,26 @@ public class NotifyController {
...
@@ -40,15 +44,26 @@ public class NotifyController {
}
}
/**
/**
* 支付通知
* 微信支付通知
*
* @param createPayOrderRequestBean CreatePayOrderRequestBean
*/
*/
@RequestMapping
(
value
=
"/notifyForMiniApp"
,
produces
=
"application/json;charset=UTF-8"
)
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/miniApp"
,
method
=
RequestMethod
.
POST
)
public
String
notifyForMiniApp
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
public
Object
notifyForMiniApp
(
@RequestBody
PaymentResponse
paymentResponse
,
@PathVariable
String
orderType
)
{
BufferedReader
reader
=
null
;
NotifyResponseBean
notifyResponseBean
=
this
.
notifyService
.
notify
(
paymentResponse
,
orderType
);
reader
=
request
.
getReader
();
return
notifyResponseBean
;
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
;
}
}
...
...
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/payment/NotifyService.java
View file @
3b22ec82
...
@@ -37,6 +37,18 @@ public class NotifyService {
...
@@ -37,6 +37,18 @@ public class NotifyService {
return
response
;
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
()
{
public
RestTemplate
getRestTemplate
()
{
return
restTemplate
;
return
restTemplate
;
}
}
...
...
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VoucherGetLogBean.java
View file @
3b22ec82
...
@@ -28,7 +28,7 @@ public class VoucherGetLogBean implements Serializable {
...
@@ -28,7 +28,7 @@ public class VoucherGetLogBean implements Serializable {
/**
/**
* 抢券时间
* 抢券时间
*/
*/
private
Date
get
Time
;
private
Date
create
Time
;
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
...
@@ -46,10 +46,6 @@ public class VoucherGetLogBean implements Serializable {
...
@@ -46,10 +46,6 @@ public class VoucherGetLogBean implements Serializable {
return
voucherid
;
return
voucherid
;
}
}
public
Date
getGetTime
()
{
return
getTime
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
...
@@ -66,7 +62,13 @@ public class VoucherGetLogBean implements Serializable {
...
@@ -66,7 +62,13 @@ public class VoucherGetLogBean implements Serializable {
this
.
voucherid
=
voucherid
;
this
.
voucherid
=
voucherid
;
}
}
public
void
setGetTime
(
Date
getTime
)
{
public
Date
getCreateTime
()
{
this
.
getTime
=
getTime
;
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
}
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/CommuneOrderBean.java
View file @
3b22ec82
...
@@ -55,6 +55,11 @@ public class CommuneOrderBean extends AbstractOrderBean<CommuneOrderResourceBean
...
@@ -55,6 +55,11 @@ public class CommuneOrderBean extends AbstractOrderBean<CommuneOrderResourceBean
*
*
*/
*/
private
Integer
communeYears
;
private
Integer
communeYears
;
/**
*
* 推荐人uid
*/
private
String
recommendUid
;
public
String
getRecommendCode
()
{
public
String
getRecommendCode
()
{
return
recommendCode
;
return
recommendCode
;
...
@@ -137,4 +142,12 @@ public class CommuneOrderBean extends AbstractOrderBean<CommuneOrderResourceBean
...
@@ -137,4 +142,12 @@ public class CommuneOrderBean extends AbstractOrderBean<CommuneOrderResourceBean
this
.
communeYears
=
communeYears
;
this
.
communeYears
=
communeYears
;
}
}
public
String
getRecommendUid
()
{
return
recommendUid
;
}
public
void
setRecommendUid
(
String
recommendUid
)
{
this
.
recommendUid
=
recommendUid
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment