Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
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
ee1a9627
authored
Sep 10, 2018
by
chongli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序继续下单接口
parent
19626b37
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletions
src/main/java/com/ctrip/fun/golf/api/order/AbstractOrderController.java
src/main/java/com/ctrip/fun/golf/service/order/AbstractOrderService.java
src/main/java/com/ctrip/fun/golf/api/order/AbstractOrderController.java
View file @
ee1a9627
...
...
@@ -52,6 +52,19 @@ public abstract class AbstractOrderController<H extends AbstractOrderBean<T>, T,
return
response
;
}
@SuppressWarnings
(
"unchecked"
)
@ResponseBody
@RequestMapping
(
value
=
"/continueWeiXinPay"
,
method
=
RequestMethod
.
POST
)
public
Response
<
JSONObject
>
continueWeiXinPay
(
@RequestBody
Request
<
H
>
request
)
{
Response
<
JSONObject
>
response
=
new
Response
<
JSONObject
>();
try
{
response
=
this
.
getOrderService
().
continueWeiXinPay
(
request
.
getBody
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
response
;
}
@SuppressWarnings
(
"unchecked"
)
@ResponseBody
...
...
src/main/java/com/ctrip/fun/golf/service/order/AbstractOrderService.java
View file @
ee1a9627
...
...
@@ -243,6 +243,29 @@ public abstract class AbstractOrderService<H extends AbstractOrderBean<T>, T> ex
}
protected
void
checkContinuePayParameters
(
H
abstractOrderBean
)
{
if
(
null
==
abstractOrderBean
.
getOrderNo
())
{
throw
new
OrderException
(-
11
,
"订单参数有误"
);
}
if
(
abstractOrderBean
.
getUid
()==
null
||
""
.
equals
(
abstractOrderBean
.
getUid
()))
{
throw
new
OrderException
(-
11
,
"订单参数有误"
);
}
}
public
Response
<
JSONObject
>
continueWeiXinPay
(
H
abstractOrderBean
)
throws
Exception
{
this
.
checkContinuePayParameters
(
abstractOrderBean
);
UserExt
userExt
=
getUserExtDao
().
getByUid
(
abstractOrderBean
.
getUid
());
Order
order
=
this
.
getOrderDao
().
getOrderByOrderNo
(
abstractOrderBean
.
getOrderNo
());
Response
<
JSONObject
>
response
=
new
Response
<
JSONObject
>();
JSONObject
jSONObject
=
new
JSONObject
();
response
.
setBody
(
jSONObject
);
try
{
jSONObject
=
WeiXinAtcion
.
weixinPlay
(
userExt
.
getMiniAppOpenId
(),
order
.
getAmount
().
multiply
(
new
BigDecimal
(
"100"
)).
intValue
(),
order
.
getOrderNo
()+
""
,
this
.
getNotifyUrlForWeiXinPay
(
order
),
"dingqiu"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
response
;
}
protected
void
adjustOrderPayAmount
(
H
abstractOrderBean
)
{
...
...
@@ -1122,7 +1145,7 @@ public abstract class AbstractOrderService<H extends AbstractOrderBean<T>, T> ex
//调用微信下单的逻辑
UserExt
userExt
=
getUserExtDao
().
getByUid
(
abstractOrderBean
.
getUid
());
try
{
jSONObject
=
WeiXinAtcion
.
weixinPlay
(
userExt
.
getMiniAppOpenId
(),
needPayAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
(),
order
.
getOrder
Id
()+
""
,
this
.
getNotifyUrlForWeiXinPay
(
order
),
"dingqiu"
);
jSONObject
=
WeiXinAtcion
.
weixinPlay
(
userExt
.
getMiniAppOpenId
(),
needPayAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
(),
order
.
getOrder
No
()+
""
,
this
.
getNotifyUrlForWeiXinPay
(
order
),
"dingqiu"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
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