Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zyn
/
cjs-site
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
bruce
2019-05-27 14:12:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
de184c1daa0436bef52638368d3e49d8064a6de8
de184c1d
1 parent
123c7f49
仓管费
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
137 additions
and
90 deletions
src/main/java/com/cjs/site/action/user/fund/PickPayAction.java
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
src/main/java/com/cjs/site/model/union/BaseRequest.java
src/main/java/com/cjs/site/model/union/CreateQrCode.java
src/main/java/com/cjs/site/model/union/QueryBill.java
src/main/java/com/cjs/site/model/union/UnionResponse.java
src/main/java/com/cjs/site/util/union/UnionConstants.java
src/main/webapp/view/user/pick/payInfo.jsp
src/main/java/com/cjs/site/action/user/fund/PickPayAction.java
View file @
de184c1
package
com
.
cjs
.
site
.
action
.
user
.
fund
;
import
com.cjs.site.biz.user.pick.PickPayBiz
;
import
com.cjs.site.model.union.QueryBill
;
import
com.cjs.site.model.union.UnionResponse
;
import
com.cjs.site.util.lang.DateEnum
;
import
com.cjs.site.util.lang.DateUtil
;
import
com.cjs.site.util.lang.JsonUtil
;
import
com.cjs.site.util.union.UnionConstants
;
import
com.cjs.site.util.union.UnionPayUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
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
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpSession
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* Created by bruce on 2019-05-14 13:41
*/
@Controller
@RequestMapping
(
"/pick/
p
ay"
)
@RequestMapping
(
"/pick/
unionP
ay"
)
public
class
PickPayAction
{
@Autowired
private
PickPayBiz
pickPayBiz
;
//创建订单
@RequestMapping
(
value
=
"
/
createOrder"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"createOrder"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
createOrder
(
HttpSession
session
)
{
return
pickPayBiz
.
createOrder
(
session
);
...
...
@@ -35,21 +38,29 @@ public class PickPayAction {
@RequestMapping
(
value
=
"notify"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
String
notify
(
HttpServletRequest
request
)
{
Map
<
String
,
String
>
params
=
UnionPayUtil
.
getRequestParams
(
request
);
System
.
out
.
println
(
"银联支付推送回调参数:"
+
JsonUtil
.
toJson
(
params
));
if
(
pickPayBiz
.
isValidNotify
(
params
)){
Map
<
String
,
String
>
params
=
UnionPayUtil
.
getRequestParams
(
request
);
System
.
out
.
println
(
"银联支付推送回调参数:"
+
JsonUtil
.
toJson
(
params
));
if
(
pickPayBiz
.
isValidNotify
(
params
))
{
return
"SUCCESS"
;
}
return
"FAILED"
;
}
@RequestMapping
(
value
=
"
test"
,
method
=
RequestMethod
.
POS
T
)
@RequestMapping
(
value
=
"
query"
,
method
=
RequestMethod
.
GE
T
)
@ResponseBody
public
String
notify
(
@RequestBody
Map
<
String
,
String
>
params
)
{
if
(
pickPayBiz
.
isValidNotify
(
params
)){
return
"SUCCESS"
;
}
return
"FAILED"
;
public
Object
returnPage
(
String
billNo
)
{
QueryBill
queryBill
=
new
QueryBill
();
queryBill
.
setBillDate
(
DateUtil
.
getNow
(
DateEnum
.
DATE
));
queryBill
.
setRequestTimestamp
(
DateUtil
.
getNow
());
queryBill
.
setBillNo
(
billNo
);
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
String
>
params
=
JsonUtil
.
fromJson
(
JsonUtil
.
toJson
(
queryBill
),
Map
.
class
);
String
result
=
UnionPayUtil
.
sendPost
(
UnionConstants
.
CREATE_ORDER
,
params
);
UnionResponse
response
=
JsonUtil
.
fromJson
(
result
,
UnionResponse
.
class
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"status"
,
response
.
getBillStatus
());
map
.
put
(
"code"
,
response
.
getErrCode
());
return
map
;
}
}
...
...
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
View file @
de184c1
...
...
@@ -76,6 +76,7 @@ public class PickPayBiz {
UnionResponse
response
=
JsonUtil
.
fromJson
(
json
,
UnionResponse
.
class
);
if
(
response
!=
null
&&
response
.
getErrCode
().
equals
(
UnionConstants
.
SUCCESS_CODE
))
{
result
.
put
(
"qrCode"
,
UnionPayUtil
.
createQrCode
(
createQrCode
.
getQrCodeId
()));
result
.
put
(
"billNo"
,
createQrCode
.
getBillNo
());
insertPickPay
(
userId
,
createQrCode
.
getBillNo
(),
createQrCode
.
getSrcReserve
(),
totalAmount
.
toString
(),
DateUtil
.
getTrustCycle
());
}
else
{
result
.
put
(
"code"
,
false
);
...
...
src/main/java/com/cjs/site/model/union/BaseRequest.java
0 → 100644
View file @
de184c1
package
com
.
cjs
.
site
.
model
.
union
;
import
com.cjs.site.util.union.UnionConstants
;
import
java.io.Serializable
;
/**
* Created by bruce on 2019-05-27 9:50
*/
public
class
BaseRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6996666421495567155L
;
private
String
msgSrc
=
"WWW.TEST.COM"
;
private
String
requestTimestamp
;
private
String
mid
=
UnionConstants
.
MID
;
private
String
tid
=
UnionConstants
.
TID
;
private
String
instMid
=
"QRPAYDEFAULT"
;
private
String
billNo
;
private
String
billDate
;
public
String
getMsgSrc
()
{
return
msgSrc
;
}
public
void
setMsgSrc
(
String
msgSrc
)
{
this
.
msgSrc
=
msgSrc
;
}
public
String
getRequestTimestamp
()
{
return
requestTimestamp
;
}
public
void
setRequestTimestamp
(
String
requestTimestamp
)
{
this
.
requestTimestamp
=
requestTimestamp
;
}
public
String
getMid
()
{
return
mid
;
}
public
void
setMid
(
String
mid
)
{
this
.
mid
=
mid
;
}
public
String
getTid
()
{
return
tid
;
}
public
void
setTid
(
String
tid
)
{
this
.
tid
=
tid
;
}
public
String
getInstMid
()
{
return
instMid
;
}
public
void
setInstMid
(
String
instMid
)
{
this
.
instMid
=
instMid
;
}
public
String
getBillNo
()
{
return
billNo
;
}
public
void
setBillNo
(
String
billNo
)
{
this
.
billNo
=
billNo
;
}
public
String
getBillDate
()
{
return
billDate
;
}
public
void
setBillDate
(
String
billDate
)
{
this
.
billDate
=
billDate
;
}
}
src/main/java/com/cjs/site/model/union/CreateQrCode.java
View file @
de184c1
...
...
@@ -7,31 +7,15 @@ import java.io.Serializable;
/**
* Created by bruce on 2019-05-14 11:00
*/
public
class
CreateQrCode
implements
Serializable
{
public
class
CreateQrCode
extends
BaseRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4945657951041450816L
;
private
String
msgSrc
=
"WWW.TEST.COM"
;
private
String
msgType
=
"bills.getQRCode"
;
private
String
requestTimestamp
;
private
String
srcReserve
;
private
String
mid
=
UnionConstants
.
MID
;
private
String
tid
=
UnionConstants
.
TID
;
private
String
instMid
=
"QRPAYDEFAULT"
;
private
String
billNo
;
private
String
billDate
;
private
String
totalAmount
;
private
String
qrCodeId
;
private
String
returnUrl
=
UnionConstants
.
NOTIFY_DOMAIN
+
"/user/pick/record"
;
private
String
notifyUrl
=
UnionConstants
.
NOTIFY_DOMAIN
+
"/pick/pay/notify"
;
public
String
getMsgSrc
()
{
return
msgSrc
;
}
public
void
setMsgSrc
(
String
msgSrc
)
{
this
.
msgSrc
=
msgSrc
;
}
private
String
notifyUrl
=
UnionConstants
.
DOMAIN
+
"/pick/unionPay/notify"
;
public
String
getMsgType
()
{
return
msgType
;
...
...
@@ -41,14 +25,6 @@ public class CreateQrCode implements Serializable {
this
.
msgType
=
msgType
;
}
public
String
getRequestTimestamp
()
{
return
requestTimestamp
;
}
public
void
setRequestTimestamp
(
String
requestTimestamp
)
{
this
.
requestTimestamp
=
requestTimestamp
;
}
public
String
getSrcReserve
()
{
return
srcReserve
;
}
...
...
@@ -57,46 +33,6 @@ public class CreateQrCode implements Serializable {
this
.
srcReserve
=
srcReserve
;
}
public
String
getMid
()
{
return
mid
;
}
public
void
setMid
(
String
mid
)
{
this
.
mid
=
mid
;
}
public
String
getTid
()
{
return
tid
;
}
public
void
setTid
(
String
tid
)
{
this
.
tid
=
tid
;
}
public
String
getInstMid
()
{
return
instMid
;
}
public
void
setInstMid
(
String
instMid
)
{
this
.
instMid
=
instMid
;
}
public
String
getBillNo
()
{
return
billNo
;
}
public
void
setBillNo
(
String
billNo
)
{
this
.
billNo
=
billNo
;
}
public
String
getBillDate
()
{
return
billDate
;
}
public
void
setBillDate
(
String
billDate
)
{
this
.
billDate
=
billDate
;
}
public
String
getTotalAmount
()
{
return
totalAmount
;
}
...
...
@@ -113,14 +49,6 @@ public class CreateQrCode implements Serializable {
this
.
qrCodeId
=
qrCodeId
;
}
public
String
getReturnUrl
()
{
return
returnUrl
;
}
public
void
setReturnUrl
(
String
returnUrl
)
{
this
.
returnUrl
=
returnUrl
;
}
public
String
getNotifyUrl
()
{
return
notifyUrl
;
}
...
...
src/main/java/com/cjs/site/model/union/QueryBill.java
0 → 100644
View file @
de184c1
package
com
.
cjs
.
site
.
model
.
union
;
import
java.io.Serializable
;
/**
* Created by bruce on 2019-05-27 9:47
*/
public
class
QueryBill
extends
BaseRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
7327860744879948066L
;
private
String
msgType
=
"bills.query"
;
public
String
getMsgType
()
{
return
msgType
;
}
public
void
setMsgType
(
String
msgType
)
{
this
.
msgType
=
msgType
;
}
}
src/main/java/com/cjs/site/model/union/UnionResponse.java
View file @
de184c1
...
...
@@ -15,6 +15,7 @@ public class UnionResponse implements Serializable {
private
String
responseTimestamp
;
private
String
srcReserve
;
private
String
sign
;
private
String
billStatus
;
public
String
getErrCode
()
{
return
errCode
;
...
...
@@ -63,4 +64,12 @@ public class UnionResponse implements Serializable {
public
void
setSign
(
String
sign
)
{
this
.
sign
=
sign
;
}
public
String
getBillStatus
()
{
return
billStatus
;
}
public
void
setBillStatus
(
String
billStatus
)
{
this
.
billStatus
=
billStatus
;
}
}
...
...
src/main/java/com/cjs/site/util/union/UnionConstants.java
View file @
de184c1
...
...
@@ -42,6 +42,6 @@ public class UnionConstants {
*/
public
static
final
String
NOTIFY_PAY_STATUS
=
"PAID"
;
public
static
final
String
NOTIFY_
DOMAIN
=
"http://zyn.yocung.com"
;
public
static
final
String
DOMAIN
=
"http://zyn.yocung.com"
;
}
...
...
src/main/webapp/view/user/pick/payInfo.jsp
View file @
de184c1
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment