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 17:21:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b7fc7357209d0c376bf2c30fdb36ede5d483ebfc
b7fc7357
1 parent
38e50a48
切换线上参数
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
36 deletions
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/util/union/UnionConstants.java
src/main/java/com/cjs/site/util/union/UnionPayUtil.java
src/main/webapp/view/user/pick/payInfo.jsp
src/main/webapp/view/user/pick/zhaoonline.jsp
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
View file @
b7fc735
...
...
@@ -55,9 +55,15 @@ public class PickPayBiz {
pickTotal
+=
apply
.
getCurrentAmount
();
}
}
// BigDecimal totalAmount = new BigDecimal("0.01").multiply(new BigDecimal(DateUtil.getTrustCycle())).
// multiply(new BigDecimal(pickTotal)).add(new BigDecimal("6"));
BigDecimal
totalAmount
=
new
BigDecimal
(
"0.01"
);
//调试接口代码写死
if
(
pickTotal
==
0
){
result
.
put
(
"code"
,
false
);
result
.
put
(
"msg"
,
"库存不足无法提货"
);
return
result
;
}
Integer
trustCycle
=
DateUtil
.
getTrustCycle
();
BigDecimal
totalAmount
=
new
BigDecimal
(
"0.01"
).
multiply
(
new
BigDecimal
(
trustCycle
)).
multiply
(
new
BigDecimal
(
pickTotal
)).
add
(
new
BigDecimal
(
"6"
));
// BigDecimal totalAmount = new BigDecimal("0.01");//调试接口代码写死
result
.
put
(
"totalAmount"
,
totalAmount
);
try
{
CreateQrCode
createQrCode
=
new
CreateQrCode
();
...
...
@@ -77,7 +83,7 @@ public class PickPayBiz {
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
()
);
insertPickPay
(
userId
,
createQrCode
.
getBillNo
(),
createQrCode
.
getSrcReserve
(),
totalAmount
.
toString
(),
trustCycle
);
}
else
{
result
.
put
(
"code"
,
false
);
result
.
put
(
"msg"
,
response
.
getErrMsg
());
...
...
@@ -121,7 +127,7 @@ public class PickPayBiz {
}
catch
(
Exception
e
)
{
transactionManager
.
rollback
(
status
);
}
}
else
{
}
else
{
OutpropApplyPayInfo
update
=
new
OutpropApplyPayInfo
();
update
.
setTradeNo
(
result
.
get
(
"billNo"
));
update
.
setStatus
(
"3"
);
...
...
src/main/java/com/cjs/site/model/union/BaseRequest.java
View file @
b7fc735
...
...
@@ -11,7 +11,7 @@ public class BaseRequest implements Serializable {
private
static
final
long
serialVersionUID
=
6996666421495567155L
;
private
String
msgSrc
=
"WWW.
TEST
.COM"
;
private
String
msgSrc
=
"WWW.
SHYTYSP
.COM"
;
private
String
requestTimestamp
;
private
String
mid
=
UnionConstants
.
MID
;
private
String
tid
=
UnionConstants
.
TID
;
...
...
src/main/java/com/cjs/site/util/union/UnionConstants.java
View file @
b7fc735
...
...
@@ -8,7 +8,7 @@ public class UnionConstants {
/**
* 银联商务支付网关
*/
private
static
final
String
BASE_URL
=
"https://qr
-test2
.chinaums.com"
;
private
static
final
String
BASE_URL
=
"https://qr.chinaums.com"
;
/**
* 银联商务发起订单请求url
*/
...
...
@@ -20,19 +20,19 @@ public class UnionConstants {
/**
* 银联商务分配的来源编号
*/
public
static
final
String
MSG_ID
=
"
3194
"
;
public
static
final
String
MSG_ID
=
"
5455
"
;
/**
* 银联商务分配的商户号
*/
public
static
final
String
MID
=
"8983
40149000005
"
;
public
static
final
String
MID
=
"8983
10173994369
"
;
/**
*
终端号,默认赋值
*
银联商务分配的终端号
*/
public
static
final
String
TID
=
"
88880001
"
;
public
static
final
String
TID
=
"
20078574
"
;
/**
* 银联商务分配的密钥
*/
public
static
final
String
MD5_KEY
=
"
fcAmtnx7MwismjWNhNKdHC44mNXtnEQeJkRrhKJwyrW2ysRR
"
;
public
static
final
String
MD5_KEY
=
"
ze5M3J5JQR3tzeAAeY8tcshEsmnaNtDycEGbbWf4f5M8T8FT
"
;
/**
* 银联商务response返回正确的状态码
*/
...
...
src/main/java/com/cjs/site/util/union/UnionPayUtil.java
View file @
b7fc735
...
...
@@ -136,20 +136,4 @@ public class UnionPayUtil {
}
}
/* public static void main(String[] args) {
Map<String, String> params = new HashMap<String, String>();
params.put("mid", UnionConstants.MID);
params.put("tid", UnionConstants.TID);
params.put("msgType", "bills.refund");
params.put("msgSrc", "WWW.TEST.COM");
params.put("instMid", "QRPAYDEFAULT");
params.put("billNo", "3194201905231441281233453476");
params.put("billDate", "2019-05-23");
params.put("refundAmount", "1");
params.put("requestTimestamp", DateUtil.getNow());
params.put("sign", makeSign(params));
String result = sendPost("https://qr-test2.chinaums.com/netpay-route-server/api/", params);
System.out.println(JsonUtil.toJson(result));
}*/
}
...
...
src/main/webapp/view/user/pick/payInfo.jsp
View file @
b7fc735
...
...
@@ -26,6 +26,7 @@
this
.
render
();
this
.
countdown
=
120
;
this
.
count
=
1
;
this
.
billNo
=
''
;
},
bind
:
function
()
{
$
(
document
).
on
(
'click'
,
'#payBtn'
,
this
.
showPayDialog
);
...
...
@@ -73,8 +74,9 @@
});
qrcode
.
clear
();
qrcode
.
makeCode
(
data
.
qrCode
);
Pay
.
billNo
=
data
.
billNo
;
setTimeout
(
function
()
{
setInterval
(
function
()
{
Pay
.
ajaxstatus
(
data
.
billNo
)},
5000
);
setInterval
(
function
()
{
Pay
.
ajaxstatus
()},
5000
);
},
5000
);
Pay
.
_timer
();
}
else
{
...
...
@@ -83,10 +85,10 @@
}
});
},
ajaxstatus
:
function
(
billNo
)
{
ajaxstatus
:
function
()
{
$
.
ajax
({
type
:
"get"
,
url
:
"/pick/unionPay/query?billNo="
+
billNo
,
url
:
"/pick/unionPay/query?billNo="
+
Pay
.
billNo
,
success
:
function
(
data
)
{
console
.
info
(
data
)
if
(
data
.
status
===
'PAID'
)
{
...
...
@@ -96,8 +98,10 @@
},
3
*
1000
)
}
else
if
(
data
.
status
===
'CLOSED'
)
{
layer
.
msg
(
'二维码已失效,请重新扫码支付'
,
{
icon
:
'1'
});
setTimeout
(
function
()
{},
5
*
1000
)
}
else
if
(
data
.
status
===
'UNKNOWN'
)
{
layer
.
msg
(
'付款失败,请重新扫码支付'
,
{
icon
:
'1'
});
setTimeout
(
function
()
{},
5
*
1000
)
}
},
error
:
function
()
{
...
...
@@ -115,7 +119,7 @@
url
:
"/pick/unionPay/createOrder"
,
success
:
function
(
data
)
{
if
(
data
.
code
)
{
Pay
.
countdown
=
120
;
Pay
.
countdown
=
120
;
zx
var
qrcode
=
new
QRCode
(
document
.
getElementById
(
"qrcode"
),
{
width
:
200
,
height
:
200
,
...
...
@@ -123,9 +127,7 @@
});
qrcode
.
clear
();
qrcode
.
makeCode
(
data
.
qrCode
);
setTimeout
(
function
()
{
setInterval
(
function
()
{
Pay
.
ajaxstatus
(
data
.
billNo
)},
5000
);
},
5000
);
Pay
.
billNo
=
data
.
billNo
;
Pay
.
count
++
;
}
else
{
layer
.
msg
(
data
.
msg
,
{
icon
:
'2'
});
...
...
src/main/webapp/view/user/pick/zhaoonline.jsp
View file @
b7fc735
...
...
@@ -36,7 +36,7 @@
<h4>
填写账号信息
</h4>
<div
class=
"content-msg"
>
<div
class=
"input-box "
>
<form
id=
"pickForm"
method=
"post"
action=
"${ctx }/user/pick/
zhaoonline
"
>
<form
id=
"pickForm"
method=
"post"
action=
"${ctx }/user/pick/
payInfo?pickType=3
"
>
<p>
<span>
赵涌在线账号:
</span>
<input
type=
"text"
id=
"zhaoonlineId"
name=
"zhaoonlineId"
maxlength=
"11"
/>
<i>
( 7位会员号或11位手机号 )
</i>
...
...
Please
register
or
login
to post a comment