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-23 15:21:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f62341c71469c5ddbd164426d7e944d6c79f688d
f62341c7
1 parent
f848facf
仓管费
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
28 deletions
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
src/main/java/com/cjs/site/model/user/pick/OutpropApplyPayInfo.java
src/main/java/com/cjs/site/util/union/UnionConstants.java
src/main/resources/mybatis/user/pick/out-prop-apply-pay-mapper.xml
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
View file @
f62341c
...
...
@@ -76,7 +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
()));
insertPickPay
(
userId
,
createQrCode
.
getBillNo
(),
createQrCode
.
getSrcReserve
());
insertPickPay
(
userId
,
createQrCode
.
getBillNo
(),
createQrCode
.
getSrcReserve
()
,
totalAmount
.
toString
(),
DateUtil
.
getTrustCycle
()
);
}
else
{
result
.
put
(
"code"
,
false
);
result
.
put
(
"msg"
,
response
.
getErrMsg
());
...
...
@@ -90,44 +90,48 @@ public class PickPayBiz {
public
Boolean
isValidNotify
(
Map
<
String
,
String
>
result
)
{
if
(
UnionPayUtil
.
checkSign
(
result
))
{
DefaultTransactionDefinition
def
=
new
DefaultTransactionDefinition
();
def
.
setPropagationBehavior
(
TransactionDefinition
.
PROPAGATION_REQUIRED
);
TransactionStatus
status
=
transactionManager
.
getTransaction
(
def
);
try
{
String
tradeNo
=
result
.
get
(
"billNo"
);
OutpropApplyPayInfo
info
=
outpropApplyPayDao
.
selectByTradeNo
(
tradeNo
);
if
(!
info
.
getStatus
().
equals
(
"2"
))
{
OutpropApplyPayInfo
update
=
new
OutpropApplyPayInfo
();
update
.
setTradeNo
(
tradeNo
);
update
.
setStatus
(
"2"
);
outpropApplyPayDao
.
update
(
update
);
if
(
result
.
get
(
"status"
).
equals
(
UnionConstants
.
NOTIFY_PAY_STATUS
))
{
DefaultTransactionDefinition
def
=
new
DefaultTransactionDefinition
();
def
.
setPropagationBehavior
(
TransactionDefinition
.
PROPAGATION_REQUIRED
);
TransactionStatus
status
=
transactionManager
.
getTransaction
(
def
);
try
{
String
tradeNo
=
result
.
get
(
"billNo"
);
OutpropApplyPayInfo
info
=
outpropApplyPayDao
.
selectByTradeNo
(
tradeNo
);
if
(!
info
.
getStatus
().
equals
(
"2"
))
{
OutpropApplyPayInfo
update
=
new
OutpropApplyPayInfo
();
update
.
setTradeNo
(
tradeNo
);
update
.
setStatus
(
"2"
);
outpropApplyPayDao
.
update
(
update
);
OutpropApplyPickInfo
pickInfo
=
JsonUtil
.
fromJson
(
result
.
get
(
"srcReserve"
),
OutpropApplyPickInfo
.
class
);
pickInfo
.
setClientId
(
info
.
getClientId
());
if
(
"0"
.
equals
(
pickInfo
.
getPickType
())
||
"1"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
selfPickNew
(
pickInfo
);
}
else
if
(
"2"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
expressPickNew
(
pickInfo
);
}
else
if
(
"3"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
zhaoonlinePickNew
(
pickInfo
);
OutpropApplyPickInfo
pickInfo
=
JsonUtil
.
fromJson
(
result
.
get
(
"srcReserve"
),
OutpropApplyPickInfo
.
class
);
pickInfo
.
setClientId
(
info
.
getClientId
());
if
(
"0"
.
equals
(
pickInfo
.
getPickType
())
||
"1"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
selfPickNew
(
pickInfo
);
}
else
if
(
"2"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
expressPickNew
(
pickInfo
);
}
else
if
(
"3"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
zhaoonlinePickNew
(
pickInfo
);
}
}
transactionManager
.
commit
(
status
);
return
true
;
}
catch
(
Exception
e
)
{
transactionManager
.
rollback
(
status
);
}
transactionManager
.
commit
(
status
);
return
true
;
}
catch
(
Exception
e
)
{
transactionManager
.
rollback
(
status
);
}
}
return
false
;
}
private
void
insertPickPay
(
String
clientId
,
String
tradeNo
,
String
extInfo
)
{
private
void
insertPickPay
(
String
clientId
,
String
tradeNo
,
String
extInfo
,
String
amount
,
Integer
cycle
)
{
OutpropApplyPayInfo
insert
=
new
OutpropApplyPayInfo
();
insert
.
setCreatedAt
(
DateUtil
.
getNow
());
insert
.
setClientId
(
clientId
);
insert
.
setStatus
(
"1"
);
insert
.
setTradeNo
(
tradeNo
);
insert
.
setExtInfo
(
extInfo
);
insert
.
setAmount
(
amount
);
insert
.
setTrusteeshipCycle
(
cycle
);
outpropApplyPayDao
.
insert
(
insert
);
}
...
...
src/main/java/com/cjs/site/model/user/pick/OutpropApplyPayInfo.java
View file @
f62341c
...
...
@@ -17,6 +17,8 @@ public class OutpropApplyPayInfo extends BaseInfo {
private
String
createdAt
;
private
String
updatedAt
;
private
String
extInfo
;
private
String
amount
;
private
Integer
trusteeshipCycle
;
public
String
getTradeNo
()
{
return
tradeNo
;
...
...
@@ -81,4 +83,20 @@ public class OutpropApplyPayInfo extends BaseInfo {
public
void
setExtInfo
(
String
extInfo
)
{
this
.
extInfo
=
extInfo
;
}
public
String
getAmount
()
{
return
amount
;
}
public
void
setAmount
(
String
amount
)
{
this
.
amount
=
amount
;
}
public
Integer
getTrusteeshipCycle
()
{
return
trusteeshipCycle
;
}
public
void
setTrusteeshipCycle
(
Integer
trusteeshipCycle
)
{
this
.
trusteeshipCycle
=
trusteeshipCycle
;
}
}
...
...
src/main/java/com/cjs/site/util/union/UnionConstants.java
View file @
f62341c
...
...
@@ -37,6 +37,10 @@ public class UnionConstants {
* 银联商务response返回正确的状态码
*/
public
static
final
String
SUCCESS_CODE
=
"SUCCESS"
;
/**
* 银联商务推送支付成功状态的状态码
*/
public
static
final
String
NOTIFY_PAY_STATUS
=
"TRADE_SUCCESS"
;
public
static
final
String
NOTIFY_DOMAIN
=
"http://zyn.yocung.com"
;
...
...
src/main/resources/mybatis/user/pick/out-prop-apply-pay-mapper.xml
View file @
f62341c
...
...
@@ -11,16 +11,19 @@
<result
property=
"payAt"
column=
"PAY_AT"
/>
<result
property=
"status"
column=
"STATUS"
/>
<result
property=
"extInfo"
column=
"EXT_INFO"
/>
<result
property=
"amount"
column=
"AMOUNT"
/>
<result
property=
"trusteeshipCycle"
column=
"TRUSTEESHIP_CYCLE"
/>
</resultMap>
<sql
id=
"base_field"
>
TRADE_NO,CREATED_AT,UPDATED_AT,PAY_AT,STATUS,EXT_INFO,CLIENT_ID
TRADE_NO,CREATED_AT,UPDATED_AT,PAY_AT,STATUS,EXT_INFO,CLIENT_ID
,AMOUNT,TRUSTEESHIP_CYCLE
</sql>
<insert
id=
"insert"
parameterType=
"OutpropApplyPayInfo"
>
INSERT INTO HS_ASSET.OUTPROPAPPLY_PAY (TRADE_NO,CREATED_AT,UPDATED_AT,PAY_AT,STATUS,EXT_INFO,CLIENT_ID)
INSERT INTO HS_ASSET.OUTPROPAPPLY_PAY (TRADE_NO,CREATED_AT,UPDATED_AT,PAY_AT,STATUS,EXT_INFO,CLIENT_ID
,AMOUNT,TRUSTEESHIP_CYCLE
)
VALUES (#{tradeNo, jdbcType=VARCHAR}, #{createdAt, jdbcType=VARCHAR}, #{updatedAt, jdbcType=VARCHAR},
#{payAt, jdbcType=VARCHAR}, #{status, jdbcType=VARCHAR}, #{extInfo, jdbcType=VARCHAR}, #{clientId, jdbcType=VARCHAR})
#{payAt, jdbcType=VARCHAR}, #{status, jdbcType=VARCHAR}, #{extInfo, jdbcType=VARCHAR}, #{clientId, jdbcType=VARCHAR},
#{amount, jdbcType=VARCHAR}, #{trusteeshipCycle})
</insert>
<select
id=
"selectByTradeNo"
parameterType=
"java.lang.String"
resultMap=
"BaseMap"
>
...
...
Please
register
or
login
to post a comment