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
bf9f1979
Commit
bf9f1979
authored
Sep 22, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of
http://gitlab.gongsibao.com/jiangyong/zhichan
into center-channel
parents
654250ec
cb038ba0
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
860 additions
and
306 deletions
+860
-306
center-channel/app/base/api/impl/auth/accessAuth.js
+3
-0
center-channel/app/base/api/impl/payment/paymentApi.js
+3
-3
center-channel/app/base/service/impl/common/centerorderSve.js
+2
-1
center-channel/app/base/service/impl/trademark/toolSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+43
-0
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+6
-3
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+314
-258
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
+1
-0
center-channel/app/base/utils/execClient.js
+14
-0
center-channel/app/config/routes/api.js
+12
-5
center-channel/app/front/entry/public/apidoc/paymentDesc/payment.md
+24
-35
center-channel/app/front/entry/public/apidoc/platform/tmOrder.md
+437
-0
No files found.
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
bf9f1979
...
...
@@ -118,6 +118,9 @@ class AccessAuthAPI extends WEBBase {
case
"getLoginInfo"
:
//通过userpin获取用户登录信息
opResult
=
await
this
.
utilsAuthSve
.
getLoginInfo
(
pobj
,
pobj
.
actionBody
);
break
;
case
"channelUserLogin"
:
opResult
=
await
this
.
utilsAuthSve
.
channelUserLogin
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"logout"
:
//用户退出
opResult
=
await
this
.
utilsAuthSve
.
userLogout
(
pobj
,
pobj
.
actionBody
);
break
;
...
...
center-channel/app/base/api/impl/payment/paymentApi.js
View file @
bf9f1979
...
...
@@ -39,9 +39,9 @@ class PaymentAPI extends WEBBase {
case
"queryOrderStatus"
:
//通联支付查询
opResult
=
await
this
.
utilsOrderSve
.
queryOrderStatus
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getQrCode"
:
//获取pc端支付二维码--不跟订单关联
opResult
=
await
this
.
utilsOrderSve
.
getQrCode
(
pobj
,
pobj
.
actionBody
);
break
;
//
case "getQrCode"://获取pc端支付二维码--不跟订单关联
//
opResult = await this.utilsOrderSve.getQrCode(pobj, pobj.actionBody);
//
break;
case
"queryOrder"
:
//通联支付查询
opResult
=
await
this
.
utilsOrderSve
.
queryOrder
(
pobj
,
pobj
.
actionBody
);
break
;
...
...
center-channel/app/base/service/impl/common/centerorderSve.js
View file @
bf9f1979
...
...
@@ -306,7 +306,8 @@ class CenterorderService extends AppServiceBase {
orderNo
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
,
orderPrice
:
Number
(
pobj
.
actionBody
.
orderPrice
/
100
),
phone
:
pobj
.
actionBody
.
publishMobile
,
needId
:
solutiondata
.
data
.
channelNeedNo
needId
:
solutiondata
.
data
.
channelNeedNo
,
companyName
:
solutiondata
.
data
.
solutionContent
.
solution
.
CompanyName
||
''
},
appInfo
:
pobj
.
appInfo
}
...
...
center-channel/app/base/service/impl/trademark/toolSve.js
View file @
bf9f1979
...
...
@@ -84,7 +84,7 @@ class ToolService extends AppServiceBase {
}
async
getOssConfig
(
pobj
,
req
)
{
//获取oss信息
var
reqUrl
=
settings
.
centerAppUrl
()
+
"auth/accessAuth/getOssInfo
"
;
var
reqUrl
=
settings
.
reqZcApi
()
+
"api/tool/toolApi/getOssConfig
"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
bf9f1979
...
...
@@ -159,5 +159,48 @@ class UtilsAuthService extends AppServiceBase {
return
applogout
;
}
/**
* 官网首页跳转自主注册
* @param pobj
* @param actionBody
* @param req
* @returns {Promise<void>}
*/
async
channelUserLogin
(
pobj
,
actionBody
,
req
){
//官网登录地址
let
skipUrl
=
'http://gsbweb.qifu.gongsibao.com'
;
let
opResult
=
system
.
getResult
(
null
,
"req Failure"
);
//----通过Authorization 获取用户信息
let
Authorization
=
req
.
headers
[
"authorization"
]
||
""
;
if
(
!
Authorization
){
opResult
=
system
.
getResultFail
(
-
99
,
'用户未登录'
,{
redirectUrl
:
'skipUrl'
});
return
opResult
;
}
let
icCompanyUrl
=
'https://icompanytest.gongsibao.com/api/tUserInfo/info'
;
let
subData
=
{
Authorization
:
Authorization
}
let
rtn
=
await
this
.
execClient
.
execFqGet
(
subData
,
icCompanyUrl
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
var
userInfo
=
JSON
.
parse
(
rtn
.
stdout
);
//----结束
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
let
channelUserId
=
userInfo
.
mobile
;
actionBody
.
channelUserId
=
channelUserId
;
let
loginRt
=
await
this
.
getLoginByUserName
(
pobj
,
actionBody
);
if
(
loginRt
.
status
!=
0
&&
loginRt
.
status
!=
2060
)
{
return
loginRt
;
}
opResult
.
data
=
{
userpin
:
pobj
.
actionBody
.
userpin
}
if
(
loginRt
.
status
==
2060
)
{
opResult
.
msg
=
loginRt
.
msg
;
opResult
.
data
.
userpin
=
loginRt
.
data
.
userpin
;
}
return
opResult
;
}
}
module
.
exports
=
UtilsAuthService
;
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
bf9f1979
var
system
=
require
(
"../../../system"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
{
json
}
=
require
(
"sequelize"
);
//此类用来db中配置来进行调用-主要功能是推送蜂擎业务
class
UtilsFqAliyunService
extends
AppServiceBase
{
...
...
@@ -9,6 +10,7 @@ class UtilsFqAliyunService extends AppServiceBase {
this
.
ucommuneOperatorPhone
=
settings
.
ucommuneOperatorPhone
()
}
async
pushOrderBusinessByProductCode2Fq
(
pobj
)
{
//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
console
.
log
(
JSON
.
stringify
(
pobj
),
".................pushOrderBusinessByProductCode2Fq...............pobj"
);
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
var
orderInfo
=
pobj
.
actionBody
.
order_info
;
var
orderContact
=
pobj
.
actionBody
.
order_contact
?
pobj
.
actionBody
.
order_contact
:
pobj
.
actionBody
.
delivery_content
.
orderContact
;
...
...
@@ -33,7 +35,8 @@ class UtilsFqAliyunService extends AppServiceBase {
}
var
interface_params_info
=
verifyResult
.
data
;
console
.
log
(
"推送的业务员手机号为:"
,
this
.
ucommuneOperatorPhone
)
var
ucommuneOperatorPhone
=
pobj
.
appInfo
&&
pobj
.
appInfo
.
contact_mobile
?
pobj
.
appInfo
.
contact_mobile
:
this
.
ucommuneOperatorPhone
console
.
log
(
"推送的业务员手机号为:"
,
ucommuneOperatorPhone
)
var
params
=
{
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
...
...
@@ -45,13 +48,13 @@ class UtilsFqAliyunService extends AppServiceBase {
orderPrice
:
orderInfo
.
totalSum
,
// 是 订单金额
productId
:
productInfo
.
price_item
.
service_code
,
// 是 产品 ID
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
operator_phone
:
this
.
ucommuneOperatorPhone
,
// 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
operator_phone
:
ucommuneOperatorPhone
,
// 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
createdat
:
orderInfo
.
created_at
,
// 2020 0722 lin新增 张超推送文档新增必填字段
thirdPartyCustomerId
:
orderInfo
.
channelUserId
,
pay_flow_no
:
orderInfo
.
pay_flow_no
,
// 支付流水号
pay_channel
:
orderInfo
.
pay_channel
,
// 支付渠道(微信、支付宝)(必填)
pay_time
:
orderInfo
.
pay_time
,
//付款时间
pay_payer_bank_no
:
orderInfo
.
pay_payer_bank_no
//付款人账号
pay_payer_bank_no
:
orderInfo
.
pay_payer_bank_no
//付款人账号
};
// var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
bf9f1979
...
...
@@ -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
;
...
...
@@ -290,28 +290,83 @@ class UtilsOrderService extends AppServiceBase {
var
payStatus
=
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"0000"
)
{
//TODO:处理支付成功的业务逻辑
// payStatus.data.client_ip = obj.client_ip || "";
// let attachList = [];
// if (payStatus.data.reqsn.indexOf("_") >= 0) {
// attachList = payStatus.data.reqsn.split("_");
// }
// else {
// attachList.push(payStatus.data.reqsn);
// }
// if (attachList.length != 2) {
// return { -120, msg: "reqsn参数错误,没有_标识" };
// }
// payStatus.data.out_trade_no = attachList[0];
// payStatus.data.company_id = attachList[1];
// return await this.utilstlbankSve.opBackNotify(payStatus.data, "页面回调");
return
system
.
getResultFail
(
-
100130
,
'订单已支付,请勿重复付款,100130'
)
//TODO:处理支付成功的业务逻辑
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'
);
}
else
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"3045"
)
{
return
system
.
getResultFail
(
-
100170
,
"超时未支付,请刷新页面,100170"
);
}
return
system
.
getResultFail
(
-
100180
,
"请及时支付,100180"
);
}
async
opPayStatusSuccess
(
parmas
,
appInfo
,
client_ip
)
{
//操作回调业务逻辑---查询支付状态为已支付时进行调用
try
{
//日志记录
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单参数:,method=opPayStatusSuccess"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/opPayStatusSuccess"
,
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
});
//获取充值业务锁
// await this.cacheManager["TlPayLocker"].init(parmas.out_trade_no);//---测试时放开
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
parmas
.
out_trade_no
);
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
appInfo
.
uapp_id
,
appkey
:
appInfo
.
uapp_key
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/opPayStatusSuccess"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"通联回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"回调操作频繁---太频繁了,太频繁了"
);
}
if
(
parmas
.
trxcode
==
"VSP501"
)
{
parmas
.
pay_type
=
"wx"
;
}
else
{
parmas
.
pay_type
=
"alipay"
;
}
parmas
.
appInfo
=
appInfo
;
parmas
.
orderNo
=
parmas
.
out_trade_no
;
//修改并返回订单支付状态,创建收款单
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotify"
;
var
opResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opResult
.
status
==
0
)
{
opResult
.
data
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
,
uapp_key
:
appInfo
.
uapp_key
,
app_code
:
appInfo
.
app_code
,
contact_mobile
:
appInfo
.
contact_mobile
};
opResult
.
data
.
userInfo
=
{
channel_userid
:
opResult
.
data
.
order_info
.
channelUserId
,
channel_username
:
opResult
.
data
.
order_info
.
channelUserId
,
channel_nickname
:
opResult
.
data
.
order_info
.
channelUserId
};
var
pobj
=
{
appInfo
:
opResult
.
data
.
appInfo
,
actionBody
:
opResult
.
data
}
// this.utilsPushSve.pushBusInfo(opResult.data, "pushOrderBusiness",0);
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
}
opResult
.
data
=
null
;
return
opResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/opPayStatusSuccess"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
/**
* 获取pc端支付二维码--不跟订单关联
* @param {*} pobj
...
...
@@ -440,8 +495,9 @@ class UtilsOrderService extends AppServiceBase {
uapp_id
:
appInfo
.
uapp_id
,
uapp_key
:
appInfo
.
uapp_key
,
app_code
:
appInfo
.
app_code
,
app_name
:
appInfo
.
app_name
};
app_name
:
appInfo
.
app_name
,
contact_mobile
:
appInfo
.
contact_mobile
};
opResult
.
data
.
userInfo
=
{
channel_userid
:
opResult
.
data
.
order_info
.
channelUserId
,
channel_username
:
opResult
.
data
.
order_info
.
channelUserId
,
...
...
@@ -570,274 +626,274 @@ class UtilsOrderService extends AppServiceBase {
async
aliPayNotify
(
parmas
,
client_ip
)
{
// 支付宝回调
try
{
console
.
log
(
"支付宝回调参数信息--------------------start"
)
console
.
log
(
JSON
.
stringify
(
parmas
))
console
.
log
(
typeof
(
parmas
))
console
.
log
(
parmas
.
toString
())
console
.
log
(
"支付宝回调参数信息--------------------end"
)
//日志记录
console
.
log
(
"支付宝回调参数信息--------------------start"
)
console
.
log
(
JSON
.
stringify
(
parmas
))
console
.
log
(
typeof
(
parmas
))
console
.
log
(
parmas
.
toString
())
console
.
log
(
"支付宝回调参数信息--------------------end"
)
//日志记录
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"支付宝回调参数信息"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/aliPayNotify"
,
content
:
JSON
.
stringify
(
parmas
),
// content: parmas.toString(),
clientIp
:
client_ip
||
""
});
if
(
!
parmas
.
trade_status
)
{
return
system
.
getResult
(
null
,
"trade_status参数不能为空,100470"
);
}
if
(
parmas
.
trade_status
!=
"TRADE_FINISHED"
&&
parmas
.
trade_status
!=
"TRADE_SUCCESS"
)
{
return
system
.
getResult
(
null
,
"trade_status状态有误,100473"
);
}
console
.
log
(
"parmas.trade_status 校验通过--------------"
)
// 2020 0621 支付宝验签接口
var
url
=
"https://yf-api.gongsibao.com/pay/v1/checkAliPaySign"
;
let
params
=
{
"app"
:
"ukgc"
,
//应用名称 固定
"key"
:
"a1519e2eab53dfb909e4c32a86b2ea2b"
,
//应用 key 固定
"tData"
:
parmas
}
var
sign
=
JSON
.
stringify
(
params
);
// sign += "ab53dfb909e4c32a"
sign
+=
this
.
paySecret
sign
=
md5
(
sign
).
toUpperCase
()
params
.
sign
=
sign
console
.
log
(
"准备验签名params-------------------start"
)
console
.
log
(
params
)
console
.
log
(
"准备验签名params-------------------end"
)
// let res = await axios.post(url, params)
// this.logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "支付宝回调参数验签结果",
// op: "service/impl/utilsSve/utilsOrderSve.js/aliPayNotify",
// content: JSON.stringify(res),
// clientIp: client_ip || ""
// });
// if (res.status != 0) {
// res.msg = res.msg + ",100480";
// return res;
// }
// 模拟验签结果
var
outTradeInfo
=
parmas
.
out_trade_no
.
split
(
'-'
);
console
.
log
(
"模拟验签结果--------------"
,
outTradeInfo
)
//
var
opResult
=
{}
opResult
.
data
=
{
orderNo
:
outTradeInfo
[
0
],
uappId
:
Number
(
outTradeInfo
[
1
]),
productId
:
outTradeInfo
.
length
==
3
?
Number
(
outTradeInfo
[
2
])
:
0
}
// 2020 07.03 lin 修改 获取app信息 推送蜂擎使用
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
appInfoResult
=
await
this
.
restPostUrl
({
uappId
:
opResult
.
data
.
uappId
},
url
);
if
(
appInfoResult
.
status
!=
0
)
{
appInfoResult
.
msg
=
appInfoResult
.
msg
+
",100270"
;
return
appInfoResult
;
}
var
appInfo
=
appInfoResult
.
data
;
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
opResult
.
data
.
orderNo
);
console
.
log
(
"拿锁结果"
,
locker
)
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"支付宝回调参数信息"
,
appid
:
opResult
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/aliPayNotify"
,
content
:
JSON
.
stringify
(
parmas
),
// content: parmas.toString()
,
clientIp
:
client_ip
||
"
"
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"阿里回调操作频繁---太频繁了,太频繁了
"
});
if
(
!
parmas
.
trade_status
)
{
return
system
.
getResult
(
null
,
"trade_status参数不能为空,100470"
);
}
if
(
parmas
.
trade_status
!=
"TRADE_FINISHED"
&&
parmas
.
trade_status
!=
"TRADE_SUCCESS"
)
{
return
system
.
getResult
(
null
,
"trade_status状态有误,100473"
);
}
console
.
log
(
"parmas.trade_status 校验通过--------------"
)
// 2020 0621 支付宝验签接口
var
url
=
"https://yf-api.gongsibao.com/pay/v1/checkAliPaySign"
;
let
params
=
{
"app"
:
"ukgc"
,
//应用名称 固定
"key"
:
"a1519e2eab53dfb909e4c32a86b2ea2b"
,
//应用 key 固定
"tData"
:
parmas
}
var
sign
=
JSON
.
stringify
(
params
);
// sign += "ab53dfb909e4c32a"
sign
+=
this
.
paySecret
sign
=
md5
(
sign
).
toUpperCase
()
params
.
sign
=
sign
console
.
log
(
"准备验签名params-------------------start"
)
console
.
log
(
params
)
console
.
log
(
"准备验签名params-------------------end"
)
// let res = await axios.post(url, params)
// this.logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "支付宝回调参数验签结果",
// op: "service/impl/utilsSve/utilsOrderSve.js/aliPayNotify",
// content: JSON.stringify(res),
// clientIp: client_ip || ""
// });
// if (res.status != 0) {
// res.msg = res.msg + ",100480";
// return res;
// }
// 模拟验签结果
var
outTradeInfo
=
parmas
.
out_trade_no
.
split
(
'-'
);
console
.
log
(
"模拟验签结果--------------"
,
outTradeInfo
)
//
var
opResult
=
{}
opResult
.
data
=
{
orderNo
:
outTradeInfo
[
0
],
uappId
:
Number
(
outTradeInfo
[
1
]),
productId
:
outTradeInfo
.
length
==
3
?
Number
(
outTradeInfo
[
2
])
:
0
}
// 2020 07.03 lin 修改 获取app信息 推送蜂擎使用
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
appInfoResult
=
await
this
.
restPostUrl
({
uappId
:
opResult
.
data
.
uappId
},
url
);
if
(
appInfoResult
.
status
!=
0
)
{
appInfoResult
.
msg
=
appInfoResult
.
msg
+
",100270"
;
return
appInfoResult
;
}
var
appInfo
=
appInfoResult
.
data
;
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
opResult
.
data
.
orderNo
);
console
.
log
(
"拿锁结果"
,
locker
)
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
opResult
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/aliPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"阿里回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
pay_type
=
"alipay"
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByAliDing"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
opResult
.
data
.
uappId
,
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
=
opResult
.
data
.
orderNo
;
opOrderResult
.
data
.
order_info
.
pay_flow_no
=
parmas
.
trade_no
;
// 2020 0704 lin 新增 推送fq必填字段
opOrderResult
.
data
.
order_info
.
pay_channel
=
"支付宝"
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_time
=
parmas
.
gmt_payment
;
//付款时间
opOrderResult
.
data
.
order_info
.
pay_payer_bank_no
=
parmas
.
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
);
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
pay_type
=
"alipay"
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByAliDing"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/aliPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
opResult
.
data
.
uappId
,
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
=
opResult
.
data
.
orderNo
;
opOrderResult
.
data
.
order_info
.
pay_flow_no
=
parmas
.
trade_no
;
// 2020 0704 lin 新增 推送fq必填字段
opOrderResult
.
data
.
order_info
.
pay_channel
=
"支付宝"
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_time
=
parmas
.
gmt_payment
;
//付款时间
opOrderResult
.
data
.
order_info
.
pay_payer_bank_no
=
parmas
.
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
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/aliPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
async
wxPayNotify
(
parmas
,
client_ip
)
{
// 微信宝回调 ----暂时不用
try
{
//日志记录
//日志记录
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"微信回调参数信息"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/wxPayNotify"
,
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
});
if
(
!
parmas
.
result_code
)
{
return
system
.
getResult
(
null
,
"result_code参数不能为空,100670"
);
}
if
(
parmas
.
result_code
!=
"SUCCESS"
)
{
return
system
.
getResult
(
null
,
"result_code状态有误,100673"
);
}
// 2020 0621 支付宝验签接口
// var url = "https://yf-api.gongsibao.com/pay/v1/checkWXPaySign";
// let params = {
// "app": "ukgc", //应用名称 固定
// "key": "a1519e2eab53dfb909e4c32a86b2ea2b", //应用 key 固定
// "tData" : parmas
// }
// var sign = JSON.stringify(params);
// sign += "ab53dfb909e4c32a"
// sign = md5(sign).toUpperCase()
// params.sign = sign
// let res = await axios.post(url, params)
// this.logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "微信回调参数验签结果",
// op: "service/impl/utilsSve/utilsOrderSve.js/wxPayNotify",
// content: JSON.stringify(res),
// clientIp: client_ip || ""
// });
// if (res.status != 0) {
// res.msg = res.msg + ",100480";
// return res;
// }
// 模拟验签结果
var
outTradeInfo
=
parmas
.
out_trade_no
.
split
(
'-'
);
//
var
opResult
=
{}
opResult
.
data
=
{
orderNo
:
outTradeInfo
[
0
],
uappId
:
Number
(
outTradeInfo
[
1
]),
productId
:
outTradeInfo
.
length
==
3
?
Number
(
outTradeInfo
[
2
])
:
0
}
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
opResult
.
data
.
orderNo
);
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"微信回调参数信息"
,
appid
:
opResult
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/wxPayNotify"
,
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"微信回调操作频繁---太频繁了,太频繁了"
});
if
(
!
parmas
.
result_code
)
{
return
system
.
getResult
(
null
,
"result_code参数不能为空,100670"
);
}
if
(
parmas
.
result_code
!=
"SUCCESS"
)
{
return
system
.
getResult
(
null
,
"result_code状态有误,100673"
);
}
// 2020 0621 支付宝验签接口
// var url = "https://yf-api.gongsibao.com/pay/v1/checkWXPaySign";
// let params = {
// "app": "ukgc", //应用名称 固定
// "key": "a1519e2eab53dfb909e4c32a86b2ea2b", //应用 key 固定
// "tData" : parmas
// }
// var sign = JSON.stringify(params);
// sign += "ab53dfb909e4c32a"
// sign = md5(sign).toUpperCase()
// params.sign = sign
// let res = await axios.post(url, params)
// this.logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "微信回调参数验签结果",
// op: "service/impl/utilsSve/utilsOrderSve.js/wxPayNotify",
// content: JSON.stringify(res),
// clientIp: client_ip || ""
// });
// if (res.status != 0) {
// res.msg = res.msg + ",100480";
// return res;
// }
// 模拟验签结果
var
outTradeInfo
=
parmas
.
out_trade_no
.
split
(
'-'
);
//
var
opResult
=
{}
opResult
.
data
=
{
orderNo
:
outTradeInfo
[
0
],
uappId
:
Number
(
outTradeInfo
[
1
]),
productId
:
outTradeInfo
.
length
==
3
?
Number
(
outTradeInfo
[
2
])
:
0
}
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
opResult
.
data
.
orderNo
);
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
opResult
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/wxPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"微信回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"微信回调操作频繁---太频繁了,太频繁了"
);
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
// 注意 微信支付要写wx 不要wxpay等其他。c_order_receiptvoucher收款单的accountType会对应wx:微信"alipay":"支付宝","other":"其它"等其他方式
parmas
.
pay_type
=
"wx"
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
// var url = this.centerOrderUrl + "opaction/opPayOrder/receivePayCallBackNotifyByAliDing";
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByWX"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
opResult
.
data
.
uappId
};
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
=
opResult
.
data
.
orderNo
;
var
pobj
=
{
appInfo
:
opOrderResult
.
data
.
appInfo
,
actionBody
:
opOrderResult
.
data
}
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"createAliTmApply"
,
1
);
return
system
.
getResultFail
(
-
200
,
"微信回调操作频繁---太频繁了,太频繁了"
);
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
// 注意 微信支付要写wx 不要wxpay等其他。c_order_receiptvoucher收款单的accountType会对应wx:微信"alipay":"支付宝","other":"其它"等其他方式
parmas
.
pay_type
=
"wx"
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
// var url = this.centerOrderUrl + "opaction/opPayOrder/receivePayCallBackNotifyByAliDing";
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByWX"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/opBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
opResult
.
data
.
uappId
};
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
=
opResult
.
data
.
orderNo
;
var
pobj
=
{
appInfo
:
opOrderResult
.
data
.
appInfo
,
actionBody
:
opOrderResult
.
data
}
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"createAliTmApply"
,
1
);
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/opBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
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
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
,
...
...
@@ -872,7 +928,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
;
...
...
@@ -886,7 +942,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异常"
,
...
...
@@ -907,7 +963,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"
:
"标源状态不符合"
,
...
...
@@ -917,7 +973,7 @@ class UtilsOrderService extends AppServiceBase {
}
return
result
;
}
if
(
tmStatusCheckResult
.
data
.
publish_status
!=
"uppershelf"
)
{
if
(
tmStatusCheckResult
.
data
.
publish_status
!=
"uppershelf"
)
{
var
result
=
{
"errorCode"
:
"error"
,
"errorMsg"
:
"标源状态不符合"
,
...
...
@@ -944,7 +1000,7 @@ class UtilsOrderService extends AppServiceBase {
pobj
.
actionBody
.
product_id
=
pobj
.
actionBody
.
product_info
.
id
;
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
pobj
.
actionBody
.
product_info
.
interface_info
=
productItemInterfaceResult
.
data
;
pobj
.
actionType
=
"addOrder"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
pobj
.
actionBody
.
channelOrder
.
orderStatus
=
64
;
// 2020 0908 lin 新增。64作为orderinfo的orderStatus的值。含义为已付部分款
...
...
@@ -958,7 +1014,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"
:
"操作成功"
,
...
...
@@ -966,7 +1022,7 @@ class UtilsOrderService extends AppServiceBase {
"requestId"
:
pobj
.
requestId
,
"success"
:
true
}
console
.
log
(
"utils"
,
tmResult
)
console
.
log
(
"utils"
,
tmResult
)
return
tmResult
;
}
}
catch
(
e
)
{
...
...
@@ -980,13 +1036,13 @@ class UtilsOrderService extends AppServiceBase {
return
result
;
}
}
async
tmRefuse
(
pobj
)
{
// 2020 0828 lin 新增 ali商标交易 关闭订单接口
try
{
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"
:
"操作成功"
,
...
...
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
View file @
bf9f1979
...
...
@@ -53,6 +53,7 @@ class UtilsPushService extends AppServiceBase {
}
async
pushBusInfo
(
pobj
,
opType
,
isDelProductInfo
)
{
//推送业务总入口,不在db中做配置进行调用
console
.
log
(
JSON
.
stringify
(
pobj
),
".......pushBusInfo........................."
);
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
system
.
getResult
(
null
,
"暂无推送配置"
);
...
...
center-channel/app/base/utils/execClient.js
View file @
bf9f1979
...
...
@@ -77,6 +77,12 @@ class ExecClient {
console
.
log
(
cmd
);
return
cmd
;
}
FetchFqGetCmd
(
subData
,
url
)
{
var
cmd
=
this
.
cmdFeishuGetPattern
.
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
Authorization
\}
/g
,
"Bearer "
+
subData
.
Authorization
);
console
.
log
(
cmd
);
return
cmd
;
}
//飞书小程序GET请求
FetchFeishuGetCmd
(
subData
,
url
)
{
var
cmd
=
this
.
cmdFeishuGetPattern
.
replace
(
...
...
@@ -96,6 +102,14 @@ class ExecClient {
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
async
execFqGet
(
subData
,
url
){
let
cmd
=
this
.
FetchFqGetCmd
(
subData
,
url
);
console
.
log
(
cmd
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
async
execGet2
(
subData
,
url
)
{
let
cmd
=
this
.
FetchGetCmd
(
subData
,
url
);
console
.
log
(
cmd
);
...
...
center-channel/app/config/routes/api.js
View file @
bf9f1979
...
...
@@ -200,7 +200,7 @@ module.exports = function (app) {
});
app
.
use
(
'/orderNotify/channelPayNotify'
,
async
function
(
req
,
res
)
{
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsOrderSve
.
channelPayNotify
(
req
.
body
,
client_ip
);
logCtl
.
info
({
...
...
@@ -213,7 +213,7 @@ module.exports = function (app) {
return
res
.
end
(
"FAIL"
);
}
return
res
.
end
(
"success"
);
}
catch
(
e
)
{
}
catch
(
e
)
{
var
client_ip
=
system
.
get_client_ip
(
req
);
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"渠道订单支付通知处理异常"
,
...
...
@@ -237,8 +237,15 @@ module.exports = function (app) {
return
;
}
// 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
,
"getIndustries"
,
"getSecondIndustries"
,
"getQualificationByIndustry"
,
"counselling"
,
"queryTradeProduceList"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
,
"getIndustries"
,
"getSecondIndustries"
,
"getQualificationByIndustry"
,
"counselling"
,
"queryTradeProduceList"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
next
();
return
;
}
if
(
req
.
originalUrl
.
indexOf
(
"/action/tmQuery"
)
>=
0
||
req
.
originalUrl
.
indexOf
(
"/action/tmTools"
)
>=
0
)
{
req
.
body
.
actionProcess
=
"test-code"
;
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
req
.
body
.
appInfo
=
{
id
:
1
}
next
();
return
;
}
...
...
@@ -273,8 +280,8 @@ module.exports = function (app) {
"getNeedListUser"
,
"manualEvaluation"
,
"diagnosisInfo"
,
"check"
,
"enterpriseInfo"
,
"diagnosisDetail"
,
"submitIcpIntention"
,
"queryIntentionList"
,
"confirmIcpIntention"
,
"tmAccept"
,
"tmStatus"
,
"needBatchUpload"
"tmAccept"
,
"tmStatus"
,
"needBatchUpload"
];
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
...
...
center-channel/app/front/entry/public/apidoc/paymentDesc/payment.md
View file @
bf9f1979
<a
name=
"menu"
href=
"/doc"
>
返回主目录
</a>
1.
[
获取pc端支付二维码--不跟订单关联
](
#getQrCode
)
1.
[
pc端订单支付二维码生成
](
#getOrderQrCode
)
1.
[
pc端查询订单是否支付成功
](
#getOrderQrCode
)
1.
[
获取H5支付链接
](
#getH5PayUrl
)
## **<a name="getQrCode"> 获取pc端支付二维码--不跟订单关联</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/payment/paymentApi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getQrCode
```
javascript
{
"uapp_id"
:
"1"
,
//平台渠道ID
"order_num"
:
"1"
,
//支付单号
"total_fee"
:
"1"
,
//支付金额 分
"body_desc"
:
"1"
,
//产品名称
"opType"
:
"1"
,
// 支付方式 alipay阿里 wx微信
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
//0 成功 小于0 失败
"msg"
:
"SUCCESS"
,
"data"
:
{
"payinfo"
:
"https://syb.allinpay.com/apiweb/h5unionpay/native?key=l6lfPuHDErJrTW%2FN7WxSlg4n"
,
//二维码url
"reqsn"
:
"dfghrtjjn_1"
,
////商户订单号_appid
"chnltrxid"
:
"112094120001042656"
,
// 支付渠道交易单号,如支付宝,微信平台的交易单号
"trxid"
:
"112094120001042656"
,
// 交易单号,平台的交易流水号
"trxstatus"
:
"0000"
// 交易状态,0000:交易成功、1001:交易不存在、
},
"requestId"
:
"058244807fff4ab388bbda79afc04b28"
}
```
## **<a name="getOrderQrCode"> pc端订单支付二维码生成</a>**
[
返回到目录
](
#menu
)
##### URL
...
...
@@ -71,6 +37,29 @@
}
```
## **<a name="queryOrderStatus"> pc端查询订单是否支付成功</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/payment/paymentApi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:queryOrderStatus
```
javascript
{
"orderNo"
:
"TM22202008042050Pmex"
,
//订单号
"opType"
:
"wx"
// 支付方式 alipay阿里 wx微信
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"07dedd4ffd4441dcac54c6d8a0f91653"
}
```
## **<a name="getH5PayUrl"> 获取H5支付链接</a>**
[
返回到目录
](
#menu
)
...
...
center-channel/app/front/entry/public/apidoc/platform/tmOrder.md
View file @
bf9f1979
...
...
@@ -15,6 +15,7 @@
1.
[
商标订单修改-修改交官材料
](
#updateOfficial
)
1.
[
商标方案确认
](
#tmConfirm
)
1.
[
推送委托书模板邮件(阿里云)
](
#sendAliWtsEmail
)
1.
[
商标智能推荐及全类保护
](
#getNclByCode
)
## **<a name="getNcl"> 尼斯查询(一)</a>**
[
返回到目录
](
#menu
)
...
...
@@ -704,3 +705,439 @@
}
```
## **<a name="getNclByCode"> 尼斯智能推荐及大类保护</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/tmQuery/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getNclByCode
```
javascript
{
"businessCode"
:
"技术研究"
//二级行业名称 或者 大类全称
}
```
#### 返回结果
```
javascript
"businessCode"
:
"22类-绳网袋蓬"
{
"status"
:
0
,
"msg"
:
"操作成功"
,
"data"
:
{
"code"
:
"22"
,
"name"
:
"绳网袋蓬"
,
"nclThree"
:
[
{
"code"
:
"220015"
,
"name"
:
"麻带"
,
"pcode"
:
"2201"
,
"pname"
:
"缆,绳,线,带"
,
"disabled"
:
false
,
"fullname"
:
"220015 麻带"
},
{
"code"
:
"220020"
,
"name"
:
"非金属绳索"
,
"pcode"
:
"2201"
,
"pname"
:
"缆,绳,线,带"
,
"disabled"
:
false
,
"fullname"
:
"220020 非金属绳索"
},
{
"code"
:
"220021"
,
"name"
:
"绳索"
,
"pcode"
:
"2201"
,
"pname"
:
"缆,绳,线,带"
,
"disabled"
:
false
,
"fullname"
:
"220021 绳索"
},
{
"code"
:
"220049"
,
"name"
:
"网织物"
,
"pcode"
:
"2202"
,
"pname"
:
"网,遮篷,帐篷,防水帆布,帆"
,
"disabled"
:
false
,
"fullname"
:
"220049 网织物"
},
{
"code"
:
"220071"
,
"name"
:
"帐篷"
,
"pcode"
:
"2202"
,
"pname"
:
"网,遮篷,帐篷,防水帆布,帆"
,
"disabled"
:
false
,
"fullname"
:
"220071 帐篷"
},
{
"code"
:
"220075"
,
"name"
:
"运载工具非专用盖罩"
,
"pcode"
:
"2202"
,
"pname"
:
"网,遮篷,帐篷,防水帆布,帆"
,
"disabled"
:
false
,
"fullname"
:
"220075 运载工具非专用盖罩"
},
{
"code"
:
"220094"
,
"name"
:
"网"
,
"pcode"
:
"2202"
,
"pname"
:
"网,遮篷,帐篷,防水帆布,帆"
,
"disabled"
:
false
,
"fullname"
:
"220094 网"
},
{
"code"
:
"220115"
,
"name"
:
"防尘罩布"
,
"pcode"
:
"2202"
,
"pname"
:
"网,遮篷,帐篷,防水帆布,帆"
,
"disabled"
:
false
,
"fullname"
:
"220115 防尘罩布"
},
{
"code"
:
"220068"
,
"name"
:
"运输和贮存散装物用麻袋"
,
"pcode"
:
"2203"
,
"pname"
:
"袋子,装卸、包装用物品"
,
"disabled"
:
false
,
"fullname"
:
"220068 运输和贮存散装物用麻袋"
},
{
"code"
:
"220069"
,
"name"
:
"包装用纺织品袋(信封、小袋)"
,
"pcode"
:
"2203"
,
"pname"
:
"袋子,装卸、包装用物品"
,
"disabled"
:
false
,
"fullname"
:
"220069 包装用纺织品袋(信封、小袋)"
}
]
},
"bizmsg"
:
"empty"
,
"requestId"
:
"78fb84ea948f4f64844994fb80796234"
}
"businessCode"
:
"技术研究"
{
"status"
:
0
,
"msg"
:
"操作成功"
,
"data"
:
[
{
"code"
:
"09"
,
"name"
:
"科学仪器"
,
"nclThree"
:
[
{
"code"
:
"090306"
,
"name"
:
"数据处理设备"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"090306 数据处理设备"
},
{
"code"
:
"090373"
,
"name"
:
"已录制的计算机程序"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"090373 已录制的计算机程序"
},
{
"code"
:
"090590"
,
"name"
:
"计算机外围设备"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"090590 计算机外围设备"
},
{
"code"
:
"090717"
,
"name"
:
"可下载的计算机应用软件"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"090717 可下载的计算机应用软件"
},
{
"code"
:
"090732"
,
"name"
:
"计算机硬件"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"090732 计算机硬件"
},
{
"code"
:
"090791"
,
"name"
:
"已录制的或可下载的计算机软件平台"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"090791 已录制的或可下载的计算机软件平台"
},
{
"code"
:
"C090142"
,
"name"
:
"可下载的手机应用软件"
,
"pcode"
:
"0901"
,
"pname"
:
"电子计算机及其外部设备"
,
"disabled"
:
false
,
"fullname"
:
"C090142 可下载的手机应用软件"
}
]
},
{
"code"
:
"35"
,
"name"
:
"广告销售"
,
"nclThree"
:
[
{
"code"
:
""
,
"name"
:
"计算机网络和网站的在线推广"
,
"pcode"
:
"3501"
,
"pname"
:
"广告"
,
"disabled"
:
false
,
"fullname"
:
"计算机网络和网站的在线推广"
},
{
"code"
:
"350025"
,
"name"
:
"工商管理辅助"
,
"pcode"
:
"3502"
,
"pname"
:
"工商管理辅助业"
,
"disabled"
:
false
,
"fullname"
:
"350025 工商管理辅助"
},
{
"code"
:
""
,
"name"
:
"通过互联网提供商业信息服务"
,
"pcode"
:
"3502"
,
"pname"
:
"工商管理辅助业"
,
"disabled"
:
false
,
"fullname"
:
"通过互联网提供商业信息服务"
},
{
"code"
:
""
,
"name"
:
"通过互联网、有线网络或其他形式的数据传输提供商业信息"
,
"pcode"
:
"3502"
,
"pname"
:
"工商管理辅助业"
,
"disabled"
:
false
,
"fullname"
:
"通过互联网、有线网络或其他形式的数据传输提供商业信息"
},
{
"code"
:
""
,
"name"
:
"商业咨询、顾问和信息服务"
,
"pcode"
:
"3502"
,
"pname"
:
"工商管理辅助业"
,
"disabled"
:
false
,
"fullname"
:
"商业咨询、顾问和信息服务"
},
{
"code"
:
""
,
"name"
:
"专业商业咨询"
,
"pcode"
:
"3502"
,
"pname"
:
"工商管理辅助业"
,
"disabled"
:
false
,
"fullname"
:
"专业商业咨询"
},
{
"code"
:
"350071"
,
"name"
:
"替他人推销"
,
"pcode"
:
"35"
,
"pname"
:
""
,
"disabled"
:
false
,
"fullname"
:
"350071 替他人推销"
},
{
"code"
:
"350081"
,
"name"
:
"计算机数据库信息系统化"
,
"pcode"
:
"3506"
,
"pname"
:
"办公事务"
,
"disabled"
:
false
,
"fullname"
:
"350081 计算机数据库信息系统化"
},
{
"code"
:
"350117"
,
"name"
:
"在计算机数据库中更新和维护数据"
,
"pcode"
:
"3506"
,
"pname"
:
"办公事务"
,
"disabled"
:
false
,
"fullname"
:
"350117 在计算机数据库中更新和维护数据"
},
{
"code"
:
"350102"
,
"name"
:
"寻找赞助"
,
"pcode"
:
"3508"
,
"pname"
:
"单一服务"
,
"disabled"
:
false
,
"fullname"
:
"350102 寻找赞助"
}
]
},
{
"code"
:
"41"
,
"name"
:
"教育娱乐"
,
"nclThree"
:
[
{
"code"
:
"410017"
,
"name"
:
"培训"
,
"pcode"
:
"4101"
,
"pname"
:
"教育"
,
"disabled"
:
false
,
"fullname"
:
"410017 培训"
},
{
"code"
:
"410017"
,
"name"
:
"教学"
,
"pcode"
:
"4101"
,
"pname"
:
"教育"
,
"disabled"
:
false
,
"fullname"
:
"410017 教学"
},
{
"code"
:
"410195"
,
"name"
:
"职业再培训"
,
"pcode"
:
"4101"
,
"pname"
:
"教育"
,
"disabled"
:
false
,
"fullname"
:
"410195 职业再培训"
},
{
"code"
:
"410207"
,
"name"
:
"通过模拟装置进行的培训服务"
,
"pcode"
:
"4101"
,
"pname"
:
"教育"
,
"disabled"
:
false
,
"fullname"
:
"410207 通过模拟装置进行的培训服务"
},
{
"code"
:
""
,
"name"
:
"设计方面的培训"
,
"pcode"
:
"4101"
,
"pname"
:
"教育"
,
"disabled"
:
false
,
"fullname"
:
"设计方面的培训"
},
{
"code"
:
"410070"
,
"name"
:
"安排和组织专家讨论会"
,
"pcode"
:
"4102"
,
"pname"
:
"组织和安排教育、文化、娱乐等活动"
,
"disabled"
:
false
,
"fullname"
:
"410070 安排和组织专家讨论会"
},
{
"code"
:
"410076"
,
"name"
:
"安排和组织培训班"
,
"pcode"
:
"4102"
,
"pname"
:
"组织和安排教育、文化、娱乐等活动"
,
"disabled"
:
false
,
"fullname"
:
"410076 安排和组织培训班"
},
{
"code"
:
"410187"
,
"name"
:
"除广告以外的版面设计"
,
"pcode"
:
"4104"
,
"pname"
:
"出版服务"
,
"disabled"
:
false
,
"fullname"
:
"410187 除广告以外的版面设计"
},
{
"code"
:
""
,
"name"
:
"通过互联网方式提供的电子游戏服务"
,
"pcode"
:
"4105"
,
"pname"
:
"文娱、体育活动的服务"
,
"disabled"
:
false
,
"fullname"
:
"通过互联网方式提供的电子游戏服务"
},
{
"code"
:
""
,
"name"
:
"提供在线计算机游戏"
,
"pcode"
:
"4105"
,
"pname"
:
"文娱、体育活动的服务"
,
"disabled"
:
false
,
"fullname"
:
"提供在线计算机游戏"
}
]
},
{
"code"
:
"42"
,
"name"
:
"网站服务"
,
"nclThree"
:
[
{
"code"
:
"420040"
,
"name"
:
"技术研究"
,
"pcode"
:
"4209"
,
"pname"
:
"提供科学技术研究服务"
,
"disabled"
:
false
,
"fullname"
:
"420040 技术研究"
},
{
"code"
:
"420061"
,
"name"
:
"技术项目研究"
,
"pcode"
:
"4209"
,
"pname"
:
"提供科学技术研究服务"
,
"disabled"
:
false
,
"fullname"
:
"420061 技术项目研究"
},
{
"code"
:
""
,
"name"
:
"替他人开发产品"
,
"pcode"
:
"4209"
,
"pname"
:
"提供科学技术研究服务"
,
"disabled"
:
false
,
"fullname"
:
"替他人开发产品"
},
{
"code"
:
""
,
"name"
:
"技术开发领域的咨询服务"
,
"pcode"
:
"4209"
,
"pname"
:
"提供科学技术研究服务"
,
"disabled"
:
false
,
"fullname"
:
"技术开发领域的咨询服务"
},
{
"code"
:
"产品测试420194"
,
"name"
:
"计算机系统设计"
,
"pcode"
:
"4220"
,
"pname"
:
"计算机编程及相关服务"
,
"disabled"
:
false
,
"fullname"
:
"产品测试420194 计算机系统设计"
},
{
"code"
:
"420220"
,
"name"
:
"软件即服务(SaaS)"
,
"pcode"
:
"4220"
,
"pname"
:
"计算机编程及相关服务"
,
"disabled"
:
false
,
"fullname"
:
"420220 软件即服务(SaaS)"
},
{
"code"
:
"420229"
,
"name"
:
"云计算"
,
"pcode"
:
"4220"
,
"pname"
:
"计算机编程及相关服务"
,
"disabled"
:
false
,
"fullname"
:
"420229 云计算"
},
{
"code"
:
"420230"
,
"name"
:
"外包商提供的信息技术服务"
,
"pcode"
:
"4220"
,
"pname"
:
"计算机编程及相关服务"
,
"disabled"
:
false
,
"fullname"
:
"420230 外包商提供的信息技术服务"
},
{
"code"
:
""
,
"name"
:
"为他人提供计算机软件设计"
,
"pcode"
:
"4220"
,
"pname"
:
"计算机编程及相关服务"
,
"disabled"
:
false
,
"fullname"
:
"为他人提供计算机软件设计"
}
]
}
],
"bizmsg"
:
"empty"
,
"requestId"
:
"25e1f406b03f46ed80cced320a6c52a1"
}
```
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