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
4df50558
authored
Sep 14, 2018
by
chongli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复重复注册问题;微信退款通知调整
parent
d1732c0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
51 deletions
src/main/java/com/ctrip/fun/golf/api/payment/AbstractNotifyController.java
src/main/java/com/ctrip/fun/golf/service/payment/AbstractNotifyService.java
src/main/java/com/ctrip/fun/golf/service/user/UserService.java
src/main/java/com/ctrip/fun/golf/api/payment/AbstractNotifyController.java
View file @
4df50558
...
@@ -46,8 +46,8 @@ public abstract class AbstractNotifyController {
...
@@ -46,8 +46,8 @@ public abstract class AbstractNotifyController {
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/weiXinRefoundNotifyUrl"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/weiXinRefoundNotifyUrl"
,
method
=
RequestMethod
.
POST
)
public
String
weiXinRefoundNotify
Url
(
@RequestBody
String
xml
)
throws
Exception
{
public
String
weiXinRefoundNotify
(
@RequestBody
String
xml
)
throws
Exception
{
return
this
.
getNotifyService
().
notifyForWeiXinRefound
(
xml
);
return
this
.
getNotifyService
().
weiXinRefoundNotify
(
xml
);
}
}
}
}
src/main/java/com/ctrip/fun/golf/service/payment/AbstractNotifyService.java
View file @
4df50558
...
@@ -34,6 +34,8 @@ import com.ctrip.fun.golf.domain.integral.UserMemberIntegralLog;
...
@@ -34,6 +34,8 @@ import com.ctrip.fun.golf.domain.integral.UserMemberIntegralLog;
import
com.ctrip.fun.golf.domain.order.Invoiceinfo
;
import
com.ctrip.fun.golf.domain.order.Invoiceinfo
;
import
com.ctrip.fun.golf.domain.order.Order
;
import
com.ctrip.fun.golf.domain.order.Order
;
import
com.ctrip.fun.golf.domain.order.OrderProcessLog
;
import
com.ctrip.fun.golf.domain.order.OrderProcessLog
;
import
com.ctrip.fun.golf.domain.payment.AESUtil
;
import
com.ctrip.fun.golf.domain.payment.Configure
;
import
com.ctrip.fun.golf.domain.payment.PaymentResult
;
import
com.ctrip.fun.golf.domain.payment.PaymentResult
;
import
com.ctrip.fun.golf.domain.payment.WXUtil
;
import
com.ctrip.fun.golf.domain.payment.WXUtil
;
import
com.ctrip.fun.golf.exceptions.OrderException
;
import
com.ctrip.fun.golf.exceptions.OrderException
;
...
@@ -124,47 +126,6 @@ public abstract class AbstractNotifyService extends CorePaymentService {
...
@@ -124,47 +126,6 @@ public abstract class AbstractNotifyService extends CorePaymentService {
logger
.
info
(
"sign="
+
notifyResponseBean
.
getSign
());
logger
.
info
(
"sign="
+
notifyResponseBean
.
getSign
());
return
notifyResponseBean
;
return
notifyResponseBean
;
}
}
public
String
weiXinRefoundNotifyUrl
(
String
xml
)
throws
Exception
{
System
.
out
.
println
(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
);
System
.
out
.
println
(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
);
System
.
out
.
println
(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
);
System
.
out
.
println
(
xml
);
Map
<
String
,
Object
>
notifyMap
=
WXUtil
.
doXMLParse
(
xml
);
if
(
notifyMap
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)){
String
orderNo
=
notifyMap
.
get
(
"out_trade_no"
).
toString
();
//商户订单号
int
settlement_refund_fee
=
(
Integer
)
notifyMap
.
get
(
"settlement_refund_fee"
);
//实际退款金额*100
Order
order
=
this
.
orderDao
.
getAndLockOrderByOrderNo
(
Long
.
parseLong
(
orderNo
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
settlement_refund_fee
);
NotifyRequestBean
notifyRequestBean
=
new
NotifyRequestBean
();
notifyRequestBean
.
setAmount
(
bigDecimal
.
divide
(
new
BigDecimal
(
"100"
),
2
));
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
REFUNDED
.
getValue
());
order
.
setOrderStatus
(
"U"
);
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
UNSUBSCRIBED
.
getValue
());
if
(
this
.
isAllRefund
(
notifyRequestBean
,
order
))
{
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
ALL_UNSUBSCRIBED
.
getValue
());
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
BARGAINED
.
getValue
());
updateEventCustomersInvalid
(
order
.
getOrderId
());
order
.
setOrderUserStatus
(
6
);
}
else
{
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
PART_UNSUBSCRIBED
.
getValue
());
order
.
setOrderUserStatus
(
6
);
}
BigDecimal
oldRefundAmount
=
BigDecimal
.
ZERO
;
if
(
order
.
getRefundAmount
()
!=
null
)
{
oldRefundAmount
=
oldRefundAmount
.
add
(
order
.
getRefundAmount
());
}
order
.
setRefundAmount
(
oldRefundAmount
.
add
(
notifyRequestBean
.
getAmount
()));
this
.
doSuccessRefund
(
order
);
}
return
xml
;
}
public
String
notifyForWeiXinPay
(
String
xml
)
throws
Exception
{
public
String
notifyForWeiXinPay
(
String
xml
)
throws
Exception
{
Map
<
String
,
Object
>
notifyMap
=
WXUtil
.
doXMLParse
(
xml
);
Map
<
String
,
Object
>
notifyMap
=
WXUtil
.
doXMLParse
(
xml
);
if
(
notifyMap
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)){
if
(
notifyMap
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)){
...
@@ -207,11 +168,44 @@ public abstract class AbstractNotifyService extends CorePaymentService {
...
@@ -207,11 +168,44 @@ public abstract class AbstractNotifyService extends CorePaymentService {
public
String
notifyForWeiXinRefound
(
String
xml
)
throws
Exception
{
public
String
weiXinRefoundNotify
(
String
xml
)
throws
Exception
{
logger
.
error
(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
);
Map
<
String
,
Object
>
notifyMap
=
WXUtil
.
doXMLParse
(
xml
);
logger
.
error
(
xml
);
if
(
notifyMap
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)){
Map
<
String
,
Object
>
notifyMap
=
WXUtil
.
doXMLParse
(
xml
);
Map
<
String
,
Object
>
reqInfoMap
=
WXUtil
.
doXMLParse
(
AESUtil
.
getRefundDecrypt
(
notifyMap
.
get
(
"req_info"
).
toString
(),
Configure
.
getKey
()));
return
null
;
String
orderNo
=
reqInfoMap
.
get
(
"out_trade_no"
).
toString
();
//商户订单号
int
settlement_refund_fee
=
(
Integer
)
reqInfoMap
.
get
(
"settlement_refund_fee"
);
//实际退款金额*100
Order
order
=
this
.
orderDao
.
getAndLockOrderByOrderNo
(
Long
.
parseLong
(
orderNo
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
settlement_refund_fee
);
NotifyRequestBean
notifyRequestBean
=
new
NotifyRequestBean
();
notifyRequestBean
.
setAmount
(
bigDecimal
.
divide
(
new
BigDecimal
(
"100"
),
2
));
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
REFUNDED
.
getValue
());
order
.
setOrderStatus
(
"U"
);
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
UNSUBSCRIBED
.
getValue
());
if
(
this
.
isAllRefund
(
notifyRequestBean
,
order
))
{
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
ALL_UNSUBSCRIBED
.
getValue
());
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
BARGAINED
.
getValue
());
updateEventCustomersInvalid
(
order
.
getOrderId
());
order
.
setOrderUserStatus
(
6
);
}
else
{
order
.
setProcessStatus
(
order
.
getProcessStatus
()
|
OrderStatusBitEnum
.
PART_UNSUBSCRIBED
.
getValue
());
order
.
setOrderUserStatus
(
6
);
}
BigDecimal
oldRefundAmount
=
BigDecimal
.
ZERO
;
if
(
order
.
getRefundAmount
()
!=
null
)
{
oldRefundAmount
=
oldRefundAmount
.
add
(
order
.
getRefundAmount
());
}
order
.
setRefundAmount
(
oldRefundAmount
.
add
(
notifyRequestBean
.
getAmount
()));
this
.
doSuccessRefund
(
order
);
}
return
null
;
}
}
/**
/**
...
...
src/main/java/com/ctrip/fun/golf/service/user/UserService.java
View file @
4df50558
...
@@ -1054,9 +1054,9 @@ public class UserService {
...
@@ -1054,9 +1054,9 @@ public class UserService {
userExt
.
setHandicap
(
23
);
userExt
.
setHandicap
(
23
);
if
(
checkValidMobileNo
(
request
.
getMobilePhone
()))
{
if
(
checkValidMobileNo
(
request
.
getMobilePhone
()))
{
try
{
try
{
UserPhoneBean
userPhoneBean
=
this
.
getCity
(
request
.
getMobilePhone
());
//
UserPhoneBean userPhoneBean = this.getCity(request.getMobilePhone());
userExt
.
setCity
(
userPhoneBean
.
getCity
()
);
userExt
.
setCity
(
"其它"
);
userExt
.
setProvince
(
userPhoneBean
.
getProvince
()
);
userExt
.
setProvince
(
"其它"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
());
}
}
...
...
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