Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
7d0c8a1a
Commit
7d0c8a1a
authored
Sep 20, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
cab499a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
41 deletions
+40
-41
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+40
-41
No files found.
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
7d0c8a1a
...
...
@@ -46,8 +46,8 @@ class UtilsOrderService extends AppServiceBase {
if
(
buyPayTotalSum
==
0
)
{
actionBody
.
payTotalSum
=
totalSum
;
}
console
.
log
(
"buyTotalSum"
,
buyTotalSum
)
console
.
log
(
"totalSum"
,
totalSum
)
console
.
log
(
"buyTotalSum"
,
buyTotalSum
)
console
.
log
(
"totalSum"
,
totalSum
)
if
(
buyTotalSum
<
totalSum
)
{
return
system
.
getResult
(
null
,
"订单金额有误,100060"
);
}
...
...
@@ -247,7 +247,7 @@ class UtilsOrderService extends AppServiceBase {
isPut
=
1
;
}
}
pobj
.
actionBody
.
isPut
=
isPut
;
pobj
.
actionBody
.
isPut
=
isPut
;
pobj
.
actionBody
.
setField
=
setField
;
pobj
.
actionBody
.
receiptVoucherId
=
receiptVoucher
.
id
;
pobj
.
actionBody
.
trxid
=
result
.
data
.
trxid
;
...
...
@@ -291,19 +291,18 @@ class UtilsOrderService extends AppServiceBase {
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"0000"
)
{
//TODO:处理支付成功的业务逻辑
// this.opPayStatusSuccess
payStatus
.
data
.
out_trade_no
=
receiptVoucher
.
sourceOrderNo
;
this
.
opPayStatusSuccess
(
payStatus
.
data
,
pobj
.
appInfo
,
null
);
// return system.getResultFail(-100130,'订单已支付,请勿重复付款,100130')
return
system
.
getResultSuccess
(
payStatus
.
data
,
'订单已支付,请勿重复付款,100130'
);
return
system
.
getResultSuccess
(
payStatus
.
data
,
'订单已支付,请勿重复付款,100130'
);
}
else
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"3045"
)
{
return
system
.
getResultFail
(
-
100170
,
"超时未支付,请刷新页面,100170"
);
}
return
system
.
getResultFail
(
-
100180
,
"请及时支付,100180"
);
}
async
opPayStatusSuccess
(
parmas
,
client_ip
)
{
//操作回调业务逻辑---查询支付状态为已支付时进行调用
async
opPayStatusSuccess
(
parmas
,
appInfo
,
client_ip
)
{
//操作回调业务逻辑---查询支付状态为已支付时进行调用
try
{
//日志记录
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单参数:,method=opPayStatusSuccess"
,
...
...
@@ -312,8 +311,8 @@ class UtilsOrderService extends AppServiceBase {
clientIp
:
client_ip
||
""
});
//获取充值业务锁
// await this.cacheManager["TlPayLocker"].init(receiptVoucher.sourceOrderN
o);//---测试时放开
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
receiptVoucher
.
sourceOrderN
o
);
await
this
.
cacheManager
[
"TlPayLocker"
].
init
(
parmas
.
out_trade_n
o
);
//---测试时放开
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
parmas
.
out_trade_n
o
);
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
appInfo
.
uapp_id
,
...
...
@@ -361,7 +360,7 @@ class UtilsOrderService extends AppServiceBase {
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/op
BackNotify
"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/op
PayStatusSuccess
"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
...
...
@@ -628,7 +627,7 @@ class UtilsOrderService extends AppServiceBase {
try
{
console
.
log
(
"支付宝回调参数信息--------------------start"
)
console
.
log
(
JSON
.
stringify
(
parmas
))
console
.
log
(
typeof
(
parmas
))
console
.
log
(
typeof
(
parmas
))
console
.
log
(
parmas
.
toString
())
console
.
log
(
"支付宝回调参数信息--------------------end"
)
//日志记录
...
...
@@ -651,7 +650,7 @@ class UtilsOrderService extends AppServiceBase {
let
params
=
{
"app"
:
"ukgc"
,
//应用名称 固定
"key"
:
"a1519e2eab53dfb909e4c32a86b2ea2b"
,
//应用 key 固定
"tData"
:
parmas
"tData"
:
parmas
}
var
sign
=
JSON
.
stringify
(
params
);
// sign += "ab53dfb909e4c32a"
...
...
@@ -674,7 +673,7 @@ class UtilsOrderService extends AppServiceBase {
// }
// 模拟验签结果
var
outTradeInfo
=
parmas
.
out_trade_no
.
split
(
'-'
);
console
.
log
(
"模拟验签结果--------------"
,
outTradeInfo
)
console
.
log
(
"模拟验签结果--------------"
,
outTradeInfo
)
//
var
opResult
=
{}
opResult
.
data
=
{
...
...
@@ -692,7 +691,7 @@ class UtilsOrderService extends AppServiceBase {
var
appInfo
=
appInfoResult
.
data
;
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
opResult
.
data
.
orderNo
);
console
.
log
(
"拿锁结果"
,
locker
)
console
.
log
(
"拿锁结果"
,
locker
)
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
opResult
.
data
.
uappId
,
...
...
@@ -853,47 +852,47 @@ class UtilsOrderService extends AppServiceBase {
}
}
async
channelPayNotify
(
params
,
client_ip
){
//渠道订单支付通知
try
{
async
channelPayNotify
(
params
,
client_ip
)
{
//渠道订单支付通知
try
{
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"渠道订单支付回调参数信息"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/channelPayNotify"
,
content
:
JSON
.
stringify
(
params
),
clientIp
:
client_ip
||
""
});
if
(
!
params
.
appkey
)
{
return
system
.
getResult
(
null
,
'appKey can be not null'
)
if
(
!
params
.
appkey
)
{
return
system
.
getResult
(
null
,
'appKey can be not null'
)
}
if
(
!
params
.
orderNo
)
{
return
system
.
getResult
(
null
,
'orderNo can be not null'
)
if
(
!
params
.
orderNo
)
{
return
system
.
getResult
(
null
,
'orderNo can be not null'
)
}
if
(
!
params
.
payTotalSum
)
{
return
system
.
getResult
(
null
,
'payTotalSum can be not null'
)
if
(
!
params
.
payTotalSum
)
{
return
system
.
getResult
(
null
,
'payTotalSum can be not null'
)
}
if
(
!
params
.
signature
)
{
return
system
.
getResult
(
null
,
'signature can be not null'
)
if
(
!
params
.
signature
)
{
return
system
.
getResult
(
null
,
'signature can be not null'
)
}
if
(
!
params
.
payType
)
{
return
system
.
getResult
(
null
,
'payType can be not null'
)
if
(
!
params
.
payType
)
{
return
system
.
getResult
(
null
,
'payType can be not null'
)
}
if
(
!
params
.
payOrderNo
)
{
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
if
(
!
params
.
payOrderNo
)
{
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
}
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
if
(
appInfoRt
.
status
!=
0
)
{
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
if
(
appInfoRt
.
status
!=
0
)
{
appInfoRt
.
msg
=
appInfoRt
.
msg
+
",100270"
;
return
appInfoRt
;
}
let
singStr
=
params
.
appkey
+
params
.
orderNo
+
params
.
payTotalSum
+
appInfoRt
.
data
.
uapp_secret
let
sign
=
md5
(
singStr
).
toUpperCase
();
if
(
sign
!=
params
.
signature
)
{
return
system
.
getResultFail
(
-
1
,
'验证签名失败'
)
if
(
sign
!=
params
.
signature
)
{
return
system
.
getResultFail
(
-
1
,
'验证签名失败'
)
}
var
appInfo
=
appInfoRt
.
data
;
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
params
.
orderNo
);
console
.
log
(
"拿锁结果"
,
locker
)
console
.
log
(
"拿锁结果"
,
locker
)
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
appInfoRt
.
data
.
uappId
,
...
...
@@ -928,7 +927,7 @@ class UtilsOrderService extends AppServiceBase {
};
opOrderResult
.
data
.
orderNo
=
params
.
orderNo
;
opOrderResult
.
data
.
order_info
.
pay_flow_no
=
params
.
trade_no
||
""
;
// 2020 0704 lin 新增 推送fq必填字段
opOrderResult
.
data
.
order_info
.
pay_channel
=
params
.
payType
==
'wx'
?
'微信'
:
'支付宝'
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_channel
=
params
.
payType
==
'wx'
?
'微信'
:
'支付宝'
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_time
=
params
.
payTime
;
//付款时间
opOrderResult
.
data
.
order_info
.
pay_payer_bank_no
=
params
.
buyer_email
||
""
;
//付款账号
opOrderResult
.
data
.
order_contact
=
opOrderResult
.
data
.
delivery_content
.
orderContact
;
...
...
@@ -942,7 +941,7 @@ class UtilsOrderService extends AppServiceBase {
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
params
.
orderNo
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
...
...
@@ -963,7 +962,7 @@ class UtilsOrderService extends AppServiceBase {
pobj
.
actionBody
.
code
=
pobj
.
actionBody
.
registerNumber
;
var
url
=
settings
.
centerTmtransactionUrl
()
+
"tmtransaction/action/trademarktransaction/springBoard"
;
var
tmStatusCheckResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
!
tmStatusCheckResult
.
data
)
{
if
(
!
tmStatusCheckResult
.
data
)
{
var
result
=
{
"errorCode"
:
"error"
,
"errorMsg"
:
"标源状态不符合"
,
...
...
@@ -973,7 +972,7 @@ class UtilsOrderService extends AppServiceBase {
}
return
result
;
}
if
(
tmStatusCheckResult
.
data
.
publish_status
!=
"uppershelf"
)
{
if
(
tmStatusCheckResult
.
data
.
publish_status
!=
"uppershelf"
)
{
var
result
=
{
"errorCode"
:
"error"
,
"errorMsg"
:
"标源状态不符合"
,
...
...
@@ -1014,7 +1013,7 @@ class UtilsOrderService extends AppServiceBase {
pobj
.
actionBody
.
status
=
"lowershelf"
var
url
=
settings
.
centerTmtransactionUrl
()
+
"tmtransaction/action/trademarktransaction/springBoard"
;
var
tmStatusUpdateResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
)
{
if
(
result
)
{
var
tmResult
=
{
"errorCode"
:
"OK"
,
"errorMsg"
:
"操作成功"
,
...
...
@@ -1022,7 +1021,7 @@ class UtilsOrderService extends AppServiceBase {
"requestId"
:
pobj
.
requestId
,
"success"
:
true
}
console
.
log
(
"utils"
,
tmResult
)
console
.
log
(
"utils"
,
tmResult
)
return
tmResult
;
}
}
catch
(
e
)
{
...
...
@@ -1042,7 +1041,7 @@ class UtilsOrderService extends AppServiceBase {
var
reqUrl
=
this
.
centerOrderUrl
+
"action/tmOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
// 如果返回值正常
if
(
result
.
status
==
0
)
{
if
(
result
.
status
==
0
)
{
var
tmResult
=
{
"errorCode"
:
"OK"
,
"errorMsg"
:
"操作成功"
,
...
...
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