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
efbfaf40
Commit
efbfaf40
authored
Mar 16, 2022
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加日志
parent
d162153b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
310 additions
and
292 deletions
+310
-292
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+304
-286
center-channel/app/base/utils/baiduClient.js
+6
-6
No files found.
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
View file @
efbfaf40
...
...
@@ -3,48 +3,48 @@ var settings = require("../../../../config/settings");
const
AppServiceBase
=
require
(
"../../app.base"
);
//区分渠道的uappid
const
uappId
=
{
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
,
//(百度icp、edi)
'zc360'
:
"50"
,
//360icp、edi
"ename"
:
"52"
//易名
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
,
//(百度icp、edi)
'zc360'
:
"50"
,
//360icp、edi
"ename"
:
"52"
//易名
}
//tui song baidu zhuanyong pinyin 2020-11-6
const
cityLetter
=
{
"北京"
:
"BEIJING"
,
"上海"
:
"SHANGHAI"
,
"福建"
:
"FUJIAN"
,
"广西"
:
"GUANGXI"
,
"广东"
:
"GUANGDONG"
,
"安徽"
:
"ANHUI"
,
"河南"
:
"HENAN"
,
"湖北"
:
"HUBEI"
,
"浙江"
:
"ZHEJIANG"
,
"江苏"
:
"JIANGSU"
,
"山东"
:
"SHANDONG"
,
"陕西"
:
"SHANXI_SHAN"
,
"宁夏"
:
"NINGXIA"
,
"甘肃"
:
"GANSU"
,
"新疆"
:
"XINJIANG"
,
"青海"
:
"QINGHAI"
,
"天津"
:
"TIANJIN"
,
"重庆"
:
"CHONGQING"
,
"河北"
:
"HEBEI"
,
"山西"
:
"SHANXI_JIN"
,
"辽宁"
:
"LIAONING"
,
"吉林"
:
"JILIN"
,
"黑龙江"
:
"HEILONGJIANG"
,
"江西"
:
"JIANGXI"
,
"湖南"
:
"HUNAN"
,
"四川"
:
"SUCHUAN"
,
"贵州"
:
"GUIZHOU"
,
"云南"
:
"YUANNAN"
,
"内蒙古"
:
"NEIMENGGU"
,
"西藏"
:
"XIZANG"
,
"外资"
:
"WAIZI"
,
"海南"
:
"HAINAN"
,
"广州"
:
"GUANGZHOU"
,
"深圳"
:
"SHENZHEN"
,
"全国"
:
"QUANGUO"
"北京"
:
"BEIJING"
,
"上海"
:
"SHANGHAI"
,
"福建"
:
"FUJIAN"
,
"广西"
:
"GUANGXI"
,
"广东"
:
"GUANGDONG"
,
"安徽"
:
"ANHUI"
,
"河南"
:
"HENAN"
,
"湖北"
:
"HUBEI"
,
"浙江"
:
"ZHEJIANG"
,
"江苏"
:
"JIANGSU"
,
"山东"
:
"SHANDONG"
,
"陕西"
:
"SHANXI_SHAN"
,
"宁夏"
:
"NINGXIA"
,
"甘肃"
:
"GANSU"
,
"新疆"
:
"XINJIANG"
,
"青海"
:
"QINGHAI"
,
"天津"
:
"TIANJIN"
,
"重庆"
:
"CHONGQING"
,
"河北"
:
"HEBEI"
,
"山西"
:
"SHANXI_JIN"
,
"辽宁"
:
"LIAONING"
,
"吉林"
:
"JILIN"
,
"黑龙江"
:
"HEILONGJIANG"
,
"江西"
:
"JIANGXI"
,
"湖南"
:
"HUNAN"
,
"四川"
:
"SUCHUAN"
,
"贵州"
:
"GUIZHOU"
,
"云南"
:
"YUANNAN"
,
"内蒙古"
:
"NEIMENGGU"
,
"西藏"
:
"XIZANG"
,
"外资"
:
"WAIZI"
,
"海南"
:
"HAINAN"
,
"广州"
:
"GUANGZHOU"
,
"深圳"
:
"SHENZHEN"
,
"全国"
:
"QUANGUO"
}
//baidu pinyinzhuanyong 2020-11-6
...
...
@@ -56,6 +56,7 @@ const baiduIcpStatus = {
511
:
"APPROVED"
,
512
:
"NOT_APPROVED"
};
/**
* 资质信息提报相关接口(ICP\EDI)
*/
...
...
@@ -74,6 +75,7 @@ class BaseCenterOrderService extends AppServiceBase {
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
)
};
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
...
...
@@ -87,7 +89,7 @@ class BaseCenterOrderService extends AppServiceBase {
//提交Icp注册方案
async
submitIcpProgramme
(
pobj
)
{
console
.
log
(
'提交Icp注册方案---'
,
pobj
)
console
.
log
(
'提交Icp注册方案---'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
...
...
@@ -100,27 +102,27 @@ class BaseCenterOrderService extends AppServiceBase {
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
)
{
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
)
{
var
reqPushParams
=
{
actionBody
:
{
uapp_id
:
needinfo
.
uapp_id
,
channelNeedNo
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
uapp_id
:
needinfo
.
uapp_id
,
channelNeedNo
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
channelSolutionNo
:
needsolution
.
channelSolutionNo
,
solutionNo
:
needsolution
.
solutionNo
,
ActionType
:
solution
.
ActionType
,
channelSolutionNo
:
needsolution
.
channelSolutionNo
,
solutionNo
:
needsolution
.
solutionNo
,
},
appInfo
:
pobj
.
appInfo
};
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"pushIcpSolution2Channel"
);
}
else
{
}
else
{
var
self
=
this
;
//2020-10-26 laolan 区分百度与阿里
if
(
needinfo
.
uapp_id
==
uappId
.
ali
)
{
if
(
needinfo
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
// var bizType = needinfo.channelTypeCode;//业务类型里
var
pushObj
=
{
...
...
@@ -130,8 +132,8 @@ class BaseCenterOrderService extends AppServiceBase {
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
...
...
@@ -139,41 +141,41 @@ class BaseCenterOrderService extends AppServiceBase {
var
pushIcpSolutionRes
=
await
this
.
pushIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
)
{
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里
solution
.
Area
=
cityLetter
[
solution
.
Area
]
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
var
pushObj
=
{
requirementId
:
needinfo
.
channelNeedNo
,
companyName
:
solution
.
CompanyName
,
companyAddress
:
solution
.
CompanyAddress
,
area
:
solution
.
Area
,
type
:
solution
.
IcpType
type
:
solution
.
IcpType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
)
console
.
log
(
'pushObj++'
,
pushObj
)
var
pushIcpSolutionRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
if
(
needinfo
.
uapp_id
==
uappId
.
ename
)
{
if
(
needinfo
.
uapp_id
==
uappId
.
ename
)
{
//推送数据至易名
// var bizType = needinfo.channelTypeCode;//业务类型里
// solution.Area = cityLetter[solution.Area]
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
console
.
log
(
'solution++'
,
solution
)
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
console
.
log
(
'solution++'
,
solution
)
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
IcpType
:
solution
.
IcpType
IcpType
:
solution
.
IcpType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
);
console
.
log
(
'pushObj++'
,
pushObj
);
var
pushIcpSolutionRes
=
await
this
.
pushEnameIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
this
.
logCtl
.
info
({
...
...
@@ -200,16 +202,16 @@ class BaseCenterOrderService extends AppServiceBase {
}
//推送ICP方案至渠道方
async
pushIcpSolution2Channel
(
pobj
)
{
async
pushIcpSolution2Channel
(
pobj
)
{
var
actionBody
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
pushRes
=
{
status
:
-
1
,
msg
:
"推送失败"
status
:
-
1
,
msg
:
"推送失败"
};
var
self
=
this
;
if
(
actionBody
)
{
if
(
actionBody
)
{
//2020-10-26 laolan 区分百度与阿里
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
pushObj
=
{
IntentionBizId
:
actionBody
.
channelNeedNo
,
...
...
@@ -218,15 +220,15 @@ class BaseCenterOrderService extends AppServiceBase {
CompanyAddress
:
actionBody
.
CompanyAddress
,
Area
:
actionBody
.
Area
,
Note
:
actionBody
.
Note
,
ActionType
:
actionBody
.
ActionType
,
Source
:
"官网"
ActionType
:
actionBody
.
ActionType
,
Source
:
"官网"
};
if
(
actionBody
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
actionBody
.
channelSolutionNo
;
}
pushRes
=
await
this
.
pushIcpSolution
(
pushObj
,
actionBody
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至baidu
actionBody
.
Area
=
cityLetter
[
actionBody
.
Area
];
var
pushObj
=
{
...
...
@@ -234,7 +236,7 @@ class BaseCenterOrderService extends AppServiceBase {
companyName
:
actionBody
.
CompanyName
,
companyAddress
:
actionBody
.
CompanyAddress
,
area
:
actionBody
.
Area
,
type
:
actionBody
.
IcpType
type
:
actionBody
.
IcpType
};
if
(
actionBody
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
actionBody
.
channelSolutionNo
;
...
...
@@ -251,7 +253,7 @@ class BaseCenterOrderService extends AppServiceBase {
optitle
:
"pushIcpSolution2Channel推送ICP方案至渠道方->pushIcpSolution2Channel"
,
});
}
if
(
pushRes
.
status
==
0
||
pushRes
.
status
==
1
)
{
if
(
pushRes
.
status
==
0
||
pushRes
.
status
==
1
)
{
return
system
.
getResultRedisQueueSuccess
();
}
return
pushRes
;
...
...
@@ -260,7 +262,11 @@ class BaseCenterOrderService extends AppServiceBase {
//推送ICP方案ali
async
pushIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
//推送方案信息
var
pushRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SubmitIcpSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
var
pushRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SubmitIcpSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
BizId
)
{
...
...
@@ -275,7 +281,11 @@ class BaseCenterOrderService extends AppServiceBase {
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
if
(
a
&&
a
.
status
==
0
)
{
//推送方案确认信息
var
confirmRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"ConfirmIntention"
,
reqbody
:
{
BizId
:
pushObj
.
IntentionBizId
},
apiVersion
:
"2019-05-08"
});
var
confirmRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"ConfirmIntention"
,
reqbody
:
{
BizId
:
pushObj
.
IntentionBizId
},
apiVersion
:
"2019-05-08"
});
if
(
confirmRes
&&
confirmRes
.
status
==
0
&&
confirmRes
.
data
)
{
var
confirmResData
=
confirmRes
.
data
;
if
(
confirmResData
.
ConfirmUrl
)
{
...
...
@@ -299,19 +309,19 @@ class BaseCenterOrderService extends AppServiceBase {
//推送ICP方案易名 2021-02-25 庄冰
async
pushEnameIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
console
.
log
(
'pushObj++Ename+++'
,
pushObj
);
console
.
log
(
'pushObj++Ename+++'
,
pushObj
);
//推送方案信息
var
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
)
console
.
log
(
"rtn+++++"
,
rtn
)
var
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
)
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
// var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj });
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
ErrorCode
==
"200"
&&
pushRes
.
Success
==
true
&&
pushRes
.
BizId
)
{
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
ErrorCode
==
"200"
&&
pushRes
.
Success
==
true
&&
pushRes
.
BizId
)
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
...
...
@@ -321,7 +331,7 @@ class BaseCenterOrderService extends AppServiceBase {
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
pushRes
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
...
...
@@ -332,17 +342,18 @@ class BaseCenterOrderService extends AppServiceBase {
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
return
pushRes
;
}
//推送ICP方案baidu 2020-10-26 laolan
async
pushBaiduIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
console
.
log
(
'pushObj++baidu+++'
,
pushObj
)
console
.
log
(
'pushObj++baidu+++'
,
pushObj
)
//推送方案信息
var
pushRes
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/plan"
,
reqbody
:
pushObj
});
console
.
log
(
"pushRes++++"
,
pushRes
)
var
pushRes
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/plan"
,
reqbody
:
pushObj
});
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
if
(
resData
.
planId
)
{
...
...
@@ -355,7 +366,7 @@ class BaseCenterOrderService extends AppServiceBase {
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
resData
.
path
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
...
...
@@ -366,7 +377,7 @@ class BaseCenterOrderService extends AppServiceBase {
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
}
...
...
@@ -375,14 +386,14 @@ class BaseCenterOrderService extends AppServiceBase {
//队列推送材料
async
serviceProviderSubmit2Material
(
pobj
)
{
console
.
log
(
"serviceProviderSubmit2Material+++++pobj+++"
,
pobj
)
console
.
log
(
"serviceProviderSubmit2Material+++++pobj+++"
,
pobj
)
var
actionBody
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
pushRes
=
{
status
:
-
1
,
msg
:
"推送失败"
status
:
-
1
,
msg
:
"推送失败"
};
if
(
actionBody
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
if
(
actionBody
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
pushObj
=
{
"BizId"
:
actionBody
.
BizId
,
...
...
@@ -402,28 +413,32 @@ class BaseCenterOrderService extends AppServiceBase {
};
var
self
=
this
;
//推送方案材料
var
ali
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'ali ----- +++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
){
var
ali
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'ali ----- +++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
)
{
var
aliFlag
=
200
}
else
{
}
else
{
var
aliFlag
=
-
200
}
}
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至百度
var
pushObj
=
{
"businessLicense"
:
{
"address"
:
actionBody
.
businessLicense
.
address
||
""
,
"businessTerm"
:
actionBody
.
businessLicense
.
businessTerm
||
""
,
"createdAt"
:
actionBody
.
businessLicense
.
createdAt
||
""
,
"enterpriseCode"
:
actionBody
.
businessLicense
.
enterpriseCode
||
""
,
"legalRepresentative"
:
actionBody
.
businessLicense
.
legalRepresentative
||
""
,
"name"
:
actionBody
.
businessLicense
.
name
||
""
,
"registeredCapital"
:
actionBody
.
businessLicense
.
registeredCapital
||
""
,
"scopeBusiness"
:
actionBody
.
businessLicense
.
scopeBusiness
||
""
,
"type"
:
actionBody
.
businessLicense
.
type
||
""
"businessLicense"
:
{
"address"
:
actionBody
.
businessLicense
.
address
||
""
,
"businessTerm"
:
actionBody
.
businessLicense
.
businessTerm
||
""
,
"createdAt"
:
actionBody
.
businessLicense
.
createdAt
||
""
,
"enterpriseCode"
:
actionBody
.
businessLicense
.
enterpriseCode
||
""
,
"legalRepresentative"
:
actionBody
.
businessLicense
.
legalRepresentative
||
""
,
"name"
:
actionBody
.
businessLicense
.
name
||
""
,
"registeredCapital"
:
actionBody
.
businessLicense
.
registeredCapital
||
""
,
"scopeBusiness"
:
actionBody
.
businessLicense
.
scopeBusiness
||
""
,
"type"
:
actionBody
.
businessLicense
.
type
||
""
},
"domain"
:
actionBody
.
domain
,
"corporateName"
:
actionBody
.
corporateName
,
...
...
@@ -442,14 +457,17 @@ class BaseCenterOrderService extends AppServiceBase {
};
var
self
=
this
;
//推送方案材料
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu -----+++++'
,
baidu
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu -----+++++'
,
baidu
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
)
{
var
baiduFlag
=
200
}
else
{
}
else
{
var
baiduFlag
=
-
200
}
console
.
log
(
'hhhhh+++baiduFlag+++'
,
baiduFlag
)
console
.
log
(
'hhhhh+++baiduFlag+++'
,
baiduFlag
)
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
...
...
@@ -461,7 +479,7 @@ class BaseCenterOrderService extends AppServiceBase {
optitle
:
"serviceProviderSubmit2Material推送ICP材料至渠道方->serviceProviderSubmit2Material"
,
});
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
// pushRes.status = 1
return
system
.
getResultRedisQueueSuccess
();
}
...
...
@@ -470,25 +488,26 @@ class BaseCenterOrderService extends AppServiceBase {
//交付材料提交
async
serviceProviderSubmitMaterial
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
console
.
log
(
'zzzzlllll+++++'
,
res
)
console
.
log
(
'zzzzlllll++pobj+++'
,
pobj
)
let
self
=
this
;
let
resFlag
=
-
200
;
try
{
let
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-reqCenterOrderApi:"
,
pobj
,
"center-channel-serviceProviderSubmitMaterial"
,
res
,
null
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
let
needsolution
=
res
.
data
;
//方案信息
let
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
var
material
=
ab
.
material
;
var
reqPushParams
=
{};
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
let
material
=
ab
.
material
;
let
reqPushParams
=
{};
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
let
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
reqPushParams
=
{
actionBody
:
{
"uapp_id"
:
res
.
data
.
uapp_id
,
"uapp_id"
:
res
.
data
.
uapp_id
,
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
...
...
@@ -507,24 +526,22 @@ class BaseCenterOrderService extends AppServiceBase {
appInfo
:
pobj
.
appInfo
};
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
let
BizId
=
needsolution
.
orderChannelNo
;
reqPushParams
=
{
actionBody
:
{
"uapp_id"
:
res
.
data
.
uapp_id
,
"businessLicense"
:
{
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
"uapp_id"
:
res
.
data
.
uapp_id
,
"businessLicense"
:
{
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
},
"corporateName"
:
material
.
CorporateName
,
"domain"
:
material
.
Domain
,
...
...
@@ -545,14 +562,12 @@ class BaseCenterOrderService extends AppServiceBase {
}
}
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProviderSubmit2Material"
);
// console.log('result+++-cailiao--++++----',result)
// console.log('result+++-reqPushParams--++++----',reqPushParams)
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
let
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
let
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
...
...
@@ -568,32 +583,34 @@ class BaseCenterOrderService extends AppServiceBase {
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
var
ali
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'ali tui ziliao ++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
){
var
aliFlag
=
200
}
else
{
var
aliFlag
=
-
200
let
aliParams
=
{
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
}
let
ali
=
await
self
.
aliclient
.
reqbyget
(
aliParams
);
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-aliclient:"
,
aliParams
,
"center-channel-serviceProviderSubmitMaterial"
,
ali
,
null
);
if
(
ali
&&
ali
.
status
==
200
)
{
resFlag
=
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
"businessLicense"
:
{
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
let
BizId
=
needsolution
.
orderChannelNo
;
let
pushObj
=
{
"businessLicense"
:
{
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
},
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"orderNo"
:
BizId
,
...
...
@@ -610,24 +627,20 @@ class BaseCenterOrderService extends AppServiceBase {
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu tui ziliao +++++'
,
baidu
)
console
.
log
(
'baidu pushObj ziliao +++++'
,
pushObj
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
var
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
let
baiduParams
=
{
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
}
let
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
(
baiduParams
);
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-baiduReqbyget:"
,
baiduParams
,
"center-channel-serviceProviderSubmitMaterial"
,
baidu
,
null
);
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
)
{
resFlag
=
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
){
var
aliFlag
=
-
200
;
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
)
{
//推送数据至易名
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
let
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
let
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
// "BizId": BizId,
"OrderNo"
:
BizId
,
"Domain"
:
material
.
Domain
,
...
...
@@ -643,56 +656,52 @@ class BaseCenterOrderService extends AppServiceBase {
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[],
"BusinessLicense"
:
{
"CreatedAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"EnterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"LegalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"Address"
:
material
.
BusinessLicense
.
Address
||
""
,
"RegisteredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"Name"
:
material
.
BusinessLicense
.
Name
||
""
,
"BusinessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"Type"
:
material
.
BusinessLicense
.
Type
||
""
,
"ScopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
"BusinessLicense"
:
{
"CreatedAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"EnterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"LegalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"Address"
:
material
.
BusinessLicense
.
Address
||
""
,
"RegisteredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"Name"
:
material
.
BusinessLicense
.
Name
||
""
,
"BusinessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"Type"
:
material
.
BusinessLicense
.
Type
||
""
,
"ScopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
},
};
var
self
=
this
;
//推送方案材料
var
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"SavePartnerSubmitMaterial"
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"SavePartnerSubmitMaterial"
)
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
aliFlag
=
-
200
;
}
else
{
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
){
aliFlag
==
200
;
}
else
{
aliFlag
==
-
200
;
let
eNameUrl
=
settings
.
enameClientUrl
()
+
"SavePartnerSubmitMaterial"
;
let
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
eNameUrl
);
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-execEnamePost:eNameUrl:"
+
eNameUrl
,
pushObj
,
"center-channel-serviceProviderSubmitMaterial"
,
rtn
,
null
);
if
(
rtn
&&
rtn
.
stdout
)
{
let
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
resFlag
=
200
;
}
}
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
if
(
resFlag
==
200
)
{
return
system
.
getResultSuccess
();
}
}
console
.
log
(
'rsrsr++++------------++++'
,
res
)
return
res
}
return
res
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-reqError:"
,
pobj
,
"center-channel-serviceProviderSubmitMaterial"
,
null
,
stackStr
);
}
}
//队列通知交付状态变更
async
serviceProvider2Notification
(
pobj
)
{
console
.
log
(
"serviceProvider2Notification+++++pobj+++"
,
pobj
)
async
serviceProvider2Notification
(
pobj
)
{
console
.
log
(
"serviceProvider2Notification+++++pobj+++"
,
pobj
)
var
actionBody
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
pushRes
=
{
status
:
-
1
,
msg
:
"推送失败"
status
:
-
1
,
msg
:
"推送失败"
};
if
(
actionBody
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
if
(
actionBody
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
pushObj
=
{
BizId
:
actionBody
.
BizId
,
...
...
@@ -700,28 +709,35 @@ class BaseCenterOrderService extends AppServiceBase {
ApplicationStatus
:
actionBody
.
ApplicationStatus
};
//推送状态变更
var
ali
=
await
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'状态变更 ali ----- +++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
){
var
ali
=
await
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'状态变更 ali ----- +++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
)
{
var
aliFlag
=
200
}
else
{
}
else
{
var
aliFlag
=
-
200
}
}
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
// actionBody.ApplicationStatus = baiduIcpStatus[actionBody.ApplicationStatus];
//推送数据至百度
var
pushObj
=
{
orderNo
:
actionBody
.
orderNo
,
status
:
actionBody
.
status
};
console
.
log
(
'pushObj 推送状态变更 +++++'
,
pushObj
)
console
.
log
(
'pushObj 推送状态变更 +++++'
,
pushObj
)
//推送状态变更
var
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu 推送状态变更 +++++'
,
baidu
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
var
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu 推送状态变更 +++++'
,
baidu
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
)
{
var
baiduFlag
=
200
}
else
{
}
else
{
var
baiduFlag
=
-
200
}
}
...
...
@@ -735,7 +751,7 @@ class BaseCenterOrderService extends AppServiceBase {
optitle
:
"serviceProvider2Notification推送ICP材料至渠道方->serviceProvider2Notification"
,
});
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
pushRes
.
status
=
1
return
system
.
getResultRedisQueueSuccess
();
}
...
...
@@ -744,125 +760,125 @@ class BaseCenterOrderService extends AppServiceBase {
//通知交付状态变更-所有渠道状态更改
async
serviceProviderNotification
(
pobj
)
{
console
.
log
(
'zhuangtai ++++'
,
pobj
)
let
self
=
this
;
let
resFlag
=
-
200
;
try
{
let
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-reqCenterOrderApi:"
,
pobj
,
"center-channel-serviceProviderNotification"
,
res
,
null
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
pobj
.
actionBody
.
isTest
&&
pobj
.
actionBody
.
isTest
==
1
)
{
if
(
pobj
.
actionBody
.
isTest
&&
pobj
.
actionBody
.
isTest
==
1
)
{
var
reqPushParams
=
{};
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
reqPushParams
=
{
actionBody
:
{
uapp_id
:
res
.
data
.
uapp_id
,
uapp_id
:
res
.
data
.
uapp_id
,
BizId
:
res
.
data
.
BizId
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
},
appInfo
:
pobj
.
appInfo
appInfo
:
pobj
.
appInfo
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
//推送数据至百度
reqPushParams
=
{
actionBody
:
{
uapp_id
:
res
.
data
.
uapp_id
,
actionBody
:
{
uapp_id
:
res
.
data
.
uapp_id
,
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
},
appInfo
:
pobj
.
appInfo
appInfo
:
pobj
.
appInfo
}
}
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProvider2Notification"
);
// console.log('reqPushParams+++-状态变更--++++----',reqPushParams)
// console.log('result+++-状态变更--++++----',result)
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
pushObj
=
{
let
pushObj
=
{
BizId
:
res
.
data
.
BizId
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
,
//2021-3-18 addNew
CertificateNumber
:
res
.
data
.
CertificateNumber
||
""
,
//证书编号
CertificateStartTime
:
res
.
data
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
CertificateEndTime
:
res
.
data
.
CertificateEndTime
||
""
//证书有效期 结束时间
CertificateNumber
:
res
.
data
.
CertificateNumber
||
""
,
//证书编号
CertificateStartTime
:
res
.
data
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
CertificateEndTime
:
res
.
data
.
CertificateEndTime
||
""
//证书有效期 结束时间
};
//推送状态变更
var
ali
=
await
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
ali
&&
ali
.
status
==
200
){
var
aliFlag
=
200
}
else
{
var
aliFlag
=
-
200
let
aliParams
=
{
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
}
let
ali
=
await
this
.
aliclient
.
reqbyget
(
aliParams
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-aliclient:"
,
aliParams
,
"center-channel-serviceProviderNotification"
,
ali
,
null
);
if
(
ali
&&
ali
.
status
==
200
)
{
resFlag
=
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
){
var
enameFlag
=-
200
;
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
)
{
//推送数据至易名
var
pushObj
=
{
let
pushObj
=
{
OrderNo
:
res
.
data
.
channelOrderNo
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
};
var
rtn
=
await
this
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"AcceptPartnerNotification"
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"AcceptPartnerNotification"
)
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
enameFlag
=
-
200
;
}
else
{
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
){
enameFlag
==
200
;
}
else
{
enameFlag
==
-
200
;
let
eNameUrl
=
settings
.
enameClientUrl
()
+
"AcceptPartnerNotification"
;
let
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
eNameUrl
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-execEnamePost:eNameUrl:"
+
eNameUrl
,
pushObj
,
"center-channel-serviceProviderNotification"
,
rtn
,
null
);
if
(
rtn
&&
rtn
.
stdout
)
{
let
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
resFlag
=
200
;
}
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
var
pushObj
=
{
let
pushObj
=
{
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
var
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-baiduReqbyget:"
,
pushObj
,
"center-channel-serviceProviderNotification"
,
baidu
,
null
);
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
var
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
let
baiduParams
=
{
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
}
let
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
(
baiduParams
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-baiduReqbyget:"
,
baiduParams
,
"center-channel-serviceProviderNotification"
,
baidu
,
null
);
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
)
{
resFlag
=
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
zc360
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
zc360
)
{
pobj
.
pushObj
=
res
.
data
;
let
zc360
=
await
this
.
utils360Sve
.
pushOrderStatus
(
pobj
);
if
(
zc360
&&
zc360
.
code
==
200
&&
zc360
.
msg
==
'ok'
){
var
zc360Flag
=
200
}
else
{
var
zc360Flag
=
-
200
if
(
zc360
&&
zc360
.
code
==
200
&&
zc360
.
msg
==
'ok'
)
{
resFlag
=
200
}
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
||
zc360Flag
==
200
||
enameFlag
==
200
)
{
if
(
resFlag
==
200
)
{
return
system
.
getResultSuccess
();
}
}
return
res
;
}
return
res
;
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-reqError:"
,
pobj
,
"center-channel-serviceProviderNotification"
,
null
,
stackStr
);
}
}
//易名退款,关闭订单 2021-3-23
async
eNameCloseOrder
(
pobj
)
{
console
.
log
(
"eNameCloseOrder+++"
,
pobj
)
async
eNameCloseOrder
(
pobj
)
{
console
.
log
(
"eNameCloseOrder+++"
,
pobj
)
var
pushObj
=
{}
var
orderNo
var
note
...
...
@@ -873,19 +889,19 @@ class BaseCenterOrderService extends AppServiceBase {
if
(
res
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
console
.
log
(
'delOrder---'
,
res
)
console
.
log
(
'delOrder---'
,
res
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channelOrderNo
)
{
pushObj
=
{
OrderNo
:
res
.
data
.
channelOrderNo
,
Note
:
note
OrderNo
:
res
.
data
.
channelOrderNo
,
Note
:
note
}
console
.
log
(
'eNameCloseOrder+++pushObj----'
,
pushObj
)
var
rtn
=
await
this
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"CloseOrder"
);
console
.
log
(
'eNameCloseOrder+++rtn----'
,
rtn
)
if
(
rtn
&&
rtn
.
stdout
)
{
console
.
log
(
'eNameCloseOrder+++pushObj----'
,
pushObj
)
var
rtn
=
await
this
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"CloseOrder"
);
console
.
log
(
'eNameCloseOrder+++rtn----'
,
rtn
)
if
(
rtn
&&
rtn
.
stdout
)
{
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
console
.
log
(
'ename----'
,
pushRes
)
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
console
.
log
(
'ename----'
,
pushRes
)
return
pushRes
}
}
...
...
@@ -893,4 +909,5 @@ class BaseCenterOrderService extends AppServiceBase {
return
res
}
}
module
.
exports
=
BaseCenterOrderService
;
\ No newline at end of file
center-channel/app/base/utils/baiduClient.js
View file @
efbfaf40
...
...
@@ -14,7 +14,7 @@ class baiduClient extends AppServiceBase {
//2020 1027 laolan 调用百度网关
async
baiduPost
(
path
,
actionBody
)
{
console
.
log
(
'actionBody++'
,
actionBody
)
console
.
log
(
'
baiduPost-
actionBody++'
,
actionBody
)
let
domain
=
this
.
baiduClientParams
.
domain
;
let
url
=
domain
+
path
;
let
version
=
"bce-auth-v1"
;
...
...
@@ -27,8 +27,8 @@ class baiduClient extends AppServiceBase {
let
extime
=
1800
;
let
canonicalHeaders
=
"host:"
+
this
.
baiduClientParams
.
host
;
//中间结果1:规范化请求和前缀字符串
var
canonicalRequest
=
null
var
pathParams
=
path
.
split
(
"?"
);
let
canonicalRequest
=
null
let
pathParams
=
path
.
split
(
"?"
);
if
(
pathParams
&&
pathParams
.
length
>
1
)
{
canonicalRequest
=
"POST"
+
"
\
n"
+
pathParams
[
0
]
+
"
\
n"
+
pathParams
[
1
]
+
"
\
n"
+
canonicalHeaders
;
}
else
{
...
...
@@ -48,17 +48,17 @@ class baiduClient extends AppServiceBase {
.
digest
(
'hex'
);
//最终结果:认证字符串 authorization
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
var
baiduObj
=
{
let
baiduObj
=
{
authorization
:
authorization
,
data
:
actionBody
}
var
rtn
=
await
this
.
execClient
.
execBaiduPost
(
baiduObj
,
url
);
let
rtn
=
await
this
.
execClient
.
execBaiduPost
(
baiduObj
,
url
);
this
.
execClientNew
.
execLogs
(
`baiduClient-baiduPost-result:url=
${
url
}
`
,
baiduObj
,
"center-channel-opBaiduClientPost"
,
rtn
,
null
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
this
.
execClientNew
.
execLogs
(
`baiduClient-opBaiduClientPost-result:url=
${
url
}
`
,
actionBody
,
"center-channel-opBaiduClientPost"
,
null
,
rtn
);
return
system
.
getResult
(
null
,
rtn
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
let
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
...
...
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