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
70f328c2
Commit
70f328c2
authored
Sep 15, 2020
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orderNotify/channelPayNotify
parent
537ee14a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
3 deletions
+139
-3
center-channel/app/base/api/impl/action/tmQuery.js
+3
-0
center-channel/app/base/service/impl/trademark/toolSve.js
+7
-0
center-channel/app/base/service/impl/utilsSve/utilsDeliverSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+102
-1
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+3
-0
center-channel/app/config/routes/api.js
+19
-0
center-channel/app/front/entry/public/apidoc/platform/order.md
+4
-1
No files found.
center-channel/app/base/api/impl/action/tmQuery.js
View file @
70f328c2
...
...
@@ -99,6 +99,9 @@ class TmQueryAPI extends WEBBase {
opResult
=
system
.
getResult
(
null
,
rtn
.
msg
);
}
break
;
case
"getNclByCode"
:
opResult
=
await
this
.
toolSve
.
getNclByCode
(
pobj
,
req
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-channel/app/base/service/impl/trademark/toolSve.js
View file @
70f328c2
...
...
@@ -111,6 +111,13 @@ class ToolService extends AppServiceBase {
var
plaintext
=
bytes
.
toString
(
cryptoJS
.
enc
.
Utf8
);
return
system
.
getResultSuccess
(
plaintext
);
}
//智能推荐、犬类保护获取尼斯分类
async
getNclByCode
(
pobj
,
req
){
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"action/tmOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
}
}
module
.
exports
=
ToolService
;
center-channel/app/base/service/impl/utilsSve/utilsDeliverSve.js
View file @
70f328c2
...
...
@@ -110,7 +110,7 @@ class utilsDeliverSve extends AppServiceBase{
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!==
0
){
return
system
.
getResult
(
null
,
'更新失败'
)
return
system
.
getResult
(
null
,
result
.
msg
)
}
//获取订单
let
orderUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
70f328c2
...
...
@@ -697,7 +697,7 @@ class UtilsOrderService extends AppServiceBase {
}
async
wxPayNotify
(
parmas
,
client_ip
)
{
// 微信宝回调
async
wxPayNotify
(
parmas
,
client_ip
)
{
// 微信宝回调
----暂时不用
try
{
//日志记录
this
.
logCtl
.
info
({
...
...
@@ -797,6 +797,107 @@ class UtilsOrderService extends AppServiceBase {
}
}
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
.
orderNo
){
return
system
.
getResult
(
null
,
'orderNo 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
.
payType
){
return
system
.
getResult
(
null
,
'payType 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
){
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
,
'验证签名失败'
)
}
var
appInfo
=
appInfoRt
.
data
;
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
params
.
orderNo
);
console
.
log
(
"拿锁结果"
,
locker
)
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
appInfoRt
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/aliPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
params
),
clientIp
:
params
.
client_ip
||
""
,
optitle
:
"阿里回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
pay_type
=
params
.
payType
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
var
orderUrl
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByChannel"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
params
,
orderUrl
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
,
uapp_key
:
appInfo
.
uapp_key
,
app_code
:
appInfo
.
app_code
,
app_name
:
appInfo
.
app_name
};
opOrderResult
.
data
.
userInfo
=
{
channel_userid
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_username
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_nickname
:
opOrderResult
.
data
.
order_info
.
channelUserId
};
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_time
=
params
.
payTime
;
//付款时间
opOrderResult
.
data
.
order_info
.
pay_payer_bank_no
=
params
.
buyer_email
||
""
;
//付款账号
opOrderResult
.
data
.
order_contact
=
opOrderResult
.
data
.
delivery_content
.
orderContact
;
var
pobj
=
{
appInfo
:
opOrderResult
.
data
.
appInfo
,
actionBody
:
opOrderResult
.
data
}
// 推送
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
params
.
orderNo
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/opBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
params
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
async
tmAccept
(
pobj
)
{
// 2020 0828 lin 新增 ali商标交易 创建订单接口
try
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
70f328c2
...
...
@@ -19,6 +19,9 @@ class UtilsProductService extends AppServiceBase {
if
(
!
actionBody
.
pathCode
)
{
return
system
.
getResult
(
null
,
"actionBody.pathCode can not be empty,100330"
);
}
if
(
actionBody
.
name
){
pobj
.
actionBody
.
productName
=
actionBody
.
name
;
}
pobj
.
actionBody
.
pathCode
=
"/"
+
actionBody
.
pathCode
+
"/"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
center-channel/app/config/routes/api.js
View file @
70f328c2
...
...
@@ -199,6 +199,25 @@ module.exports = function (app) {
}
});
app
.
use
(
'/orderNotify/channelPayNotify'
,
async
function
(
req
,
res
)
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsOrderSve
.
channelPayNotify
(
req
.
body
,
client_ip
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"渠道支付订单通知 api层"
,
op
:
"center-channel/orderNotify/channelPayNotify"
,
content
:
"支付回调处理结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"FAIL"
);
}
return
res
.
end
(
"success"
);
}
catch
(
e
)
{
}
});
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
...
...
center-channel/app/front/entry/public/apidoc/platform/order.md
View file @
70f328c2
...
...
@@ -380,7 +380,10 @@
"appkey":"202001170336",// Y appkey
"orderNo":"TM26202002271337mkgN",// Y 订单号
"payTotalSum":300.00,// Y 订单金额
"signature":"DC18F27EFC1A251AFC5F2FCF36ABE6FA"
"signature":"DC18F27EFC1A251AFC5F2FCF36ABE6FA",
"payType":"", //支付方式 wx alipay
"payTime":"",// 支付时间
"payOrderNo":""// 支付订单流水号
}
```
...
...
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