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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
850 additions
and
832 deletions
+850
-832
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+844
-826
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,894 +3,911 @@ var settings = require("../../../../config/settings");
...
@@ -3,894 +3,911 @@ var settings = require("../../../../config/settings");
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//区分渠道的uappid
//区分渠道的uappid
const
uappId
=
{
const
uappId
=
{
'ali'
:
"18"
,
//(阿里icp、edi)
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
,
//(百度icp、edi)
'baidu'
:
"44"
,
//(百度icp、edi)
'zc360'
:
"50"
,
//360icp、edi
'zc360'
:
"50"
,
//360icp、edi
"ename"
:
"52"
//易名
"ename"
:
"52"
//易名
}
}
//tui song baidu zhuanyong pinyin 2020-11-6
//tui song baidu zhuanyong pinyin 2020-11-6
const
cityLetter
=
{
const
cityLetter
=
{
"北京"
:
"BEIJING"
,
"北京"
:
"BEIJING"
,
"上海"
:
"SHANGHAI"
,
"上海"
:
"SHANGHAI"
,
"福建"
:
"FUJIAN"
,
"福建"
:
"FUJIAN"
,
"广西"
:
"GUANGXI"
,
"广西"
:
"GUANGXI"
,
"广东"
:
"GUANGDONG"
,
"广东"
:
"GUANGDONG"
,
"安徽"
:
"ANHUI"
,
"安徽"
:
"ANHUI"
,
"河南"
:
"HENAN"
,
"河南"
:
"HENAN"
,
"湖北"
:
"HUBEI"
,
"湖北"
:
"HUBEI"
,
"浙江"
:
"ZHEJIANG"
,
"浙江"
:
"ZHEJIANG"
,
"江苏"
:
"JIANGSU"
,
"江苏"
:
"JIANGSU"
,
"山东"
:
"SHANDONG"
,
"山东"
:
"SHANDONG"
,
"陕西"
:
"SHANXI_SHAN"
,
"陕西"
:
"SHANXI_SHAN"
,
"宁夏"
:
"NINGXIA"
,
"宁夏"
:
"NINGXIA"
,
"甘肃"
:
"GANSU"
,
"甘肃"
:
"GANSU"
,
"新疆"
:
"XINJIANG"
,
"新疆"
:
"XINJIANG"
,
"青海"
:
"QINGHAI"
,
"青海"
:
"QINGHAI"
,
"天津"
:
"TIANJIN"
,
"天津"
:
"TIANJIN"
,
"重庆"
:
"CHONGQING"
,
"重庆"
:
"CHONGQING"
,
"河北"
:
"HEBEI"
,
"河北"
:
"HEBEI"
,
"山西"
:
"SHANXI_JIN"
,
"山西"
:
"SHANXI_JIN"
,
"辽宁"
:
"LIAONING"
,
"辽宁"
:
"LIAONING"
,
"吉林"
:
"JILIN"
,
"吉林"
:
"JILIN"
,
"黑龙江"
:
"HEILONGJIANG"
,
"黑龙江"
:
"HEILONGJIANG"
,
"江西"
:
"JIANGXI"
,
"江西"
:
"JIANGXI"
,
"湖南"
:
"HUNAN"
,
"湖南"
:
"HUNAN"
,
"四川"
:
"SUCHUAN"
,
"四川"
:
"SUCHUAN"
,
"贵州"
:
"GUIZHOU"
,
"贵州"
:
"GUIZHOU"
,
"云南"
:
"YUANNAN"
,
"云南"
:
"YUANNAN"
,
"内蒙古"
:
"NEIMENGGU"
,
"内蒙古"
:
"NEIMENGGU"
,
"西藏"
:
"XIZANG"
,
"西藏"
:
"XIZANG"
,
"外资"
:
"WAIZI"
,
"外资"
:
"WAIZI"
,
"海南"
:
"HAINAN"
,
"海南"
:
"HAINAN"
,
"广州"
:
"GUANGZHOU"
,
"广州"
:
"GUANGZHOU"
,
"深圳"
:
"SHENZHEN"
,
"深圳"
:
"SHENZHEN"
,
"全国"
:
"QUANGUO"
"全国"
:
"QUANGUO"
}
}
//baidu pinyinzhuanyong 2020-11-6
//baidu pinyinzhuanyong 2020-11-6
const
baiduIcpStatus
=
{
const
baiduIcpStatus
=
{
507
:
"REGISTRATION"
,
507
:
"REGISTRATION"
,
508
:
"SUBMITTED"
,
508
:
"SUBMITTED"
,
509
:
"ACCEPTED"
,
509
:
"ACCEPTED"
,
510
:
"NOT_ACCEPTED"
,
510
:
"NOT_ACCEPTED"
,
511
:
"APPROVED"
,
511
:
"APPROVED"
,
512
:
"NOT_APPROVED"
512
:
"NOT_APPROVED"
};
};
/**
/**
* 资质信息提报相关接口(ICP\EDI)
* 资质信息提报相关接口(ICP\EDI)
*/
*/
class
BaseCenterOrderService
extends
AppServiceBase
{
class
BaseCenterOrderService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
execClientNew
=
system
.
getObject
(
"util.execClientNew"
);
this
.
execClientNew
=
system
.
getObject
(
"util.execClientNew"
);
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
)
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
)
};
};
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
}
//提交Icp注册方案
//调用center-order
async
submitIcpProgramme
(
pobj
)
{
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
console
.
log
(
'提交Icp注册方案---'
,
pobj
)
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
reqUrl
)
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
solutionContent
)
==
"string"
)
{
ab
.
solutionContent
=
JSON
.
parse
(
ab
.
solutionContent
);
}
if
(
typeof
(
needsolution
.
solutionContent
)
==
"string"
)
{
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
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
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
channelSolutionNo
:
needsolution
.
channelSolutionNo
,
solutionNo
:
needsolution
.
solutionNo
,
},
appInfo
:
pobj
.
appInfo
};
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"pushIcpSolution2Channel"
);
}
else
{
var
self
=
this
;
//2020-10-26 laolan 区分百度与阿里
if
(
needinfo
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
// var bizType = needinfo.channelTypeCode;//业务类型里
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
var
pushIcpSolutionRes
=
await
this
.
pushIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
}
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
){
//提交Icp注册方案
//推送数据至baidu
async
submitIcpProgramme
(
pobj
)
{
// var bizType = needinfo.channelTypeCode;//业务类型里
console
.
log
(
'提交Icp注册方案---'
,
pobj
)
solution
.
Area
=
cityLetter
[
solution
.
Area
]
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
var
pushObj
=
{
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
requirementId
:
needinfo
.
channelNeedNo
,
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
companyName
:
solution
.
CompanyName
,
var
ab
=
pobj
.
actionBody
;
companyAddress
:
solution
.
CompanyAddress
,
if
(
typeof
(
ab
.
solutionContent
)
==
"string"
)
{
area
:
solution
.
Area
,
ab
.
solutionContent
=
JSON
.
parse
(
ab
.
solutionContent
);
type
:
solution
.
IcpType
}
};
if
(
typeof
(
needsolution
.
solutionContent
)
==
"string"
)
{
if
(
needsolution
.
channelSolutionNo
)
{
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
}
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
console
.
log
(
'pushObj++'
,
pushObj
)
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
)
{
var
pushIcpSolutionRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
var
reqPushParams
=
{
}
actionBody
:
{
if
(
needinfo
.
uapp_id
==
uappId
.
ename
){
uapp_id
:
needinfo
.
uapp_id
,
//推送数据至易名
channelNeedNo
:
needinfo
.
channelNeedNo
,
// var bizType = needinfo.channelTypeCode;//业务类型里
CompanyName
:
solution
.
CompanyName
,
// solution.Area = cityLetter[solution.Area]
IcpType
:
solution
.
IcpType
,
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
CompanyAddress
:
solution
.
CompanyAddress
,
console
.
log
(
'solution++'
,
solution
)
Area
:
solution
.
Area
,
var
pushObj
=
{
Note
:
solution
.
Note
,
IntentionBizId
:
needinfo
.
channelNeedNo
,
ActionType
:
solution
.
ActionType
,
CompanyName
:
solution
.
CompanyName
,
channelSolutionNo
:
needsolution
.
channelSolutionNo
,
CompanyAddress
:
solution
.
CompanyAddress
,
solutionNo
:
needsolution
.
solutionNo
,
Area
:
solution
.
Area
,
},
IcpType
:
solution
.
IcpType
appInfo
:
pobj
.
appInfo
};
};
if
(
needsolution
.
channelSolutionNo
)
{
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"pushIcpSolution2Channel"
);
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
else
{
}
var
self
=
this
;
console
.
log
(
'pushObj++'
,
pushObj
);
//2020-10-26 laolan 区分百度与阿里
var
pushIcpSolutionRes
=
await
this
.
pushEnameIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
if
(
needinfo
.
uapp_id
==
uappId
.
ali
)
{
}
//推送数据至阿里
this
.
logCtl
.
info
({
// var bizType = needinfo.channelTypeCode;//业务类型里
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
var
pushObj
=
{
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
IntentionBizId
:
needinfo
.
channelNeedNo
,
requestId
:
pobj
.
requestId
||
""
,
CompanyName
:
solution
.
CompanyName
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitIcpProgramme"
,
IcpType
:
solution
.
IcpType
,
content
:
JSON
.
stringify
(
pobj
),
CompanyAddress
:
solution
.
CompanyAddress
,
resultInfo
:
JSON
.
stringify
(
needinfo
),
Area
:
solution
.
Area
,
optitle
:
"createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
Note
:
solution
.
Note
,
});
ActionType
:
solution
.
ActionType
,
}
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
var
pushIcpSolutionRes
=
await
this
.
pushIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
var
reqParams
=
{
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
)
{
actionBody
:
{
//推送数据至baidu
intentionBizId
:
needinfo
.
channelNeedNo
,
// var bizType = needinfo.channelTypeCode;//业务类型里
status
:
"createSolution"
solution
.
Area
=
cityLetter
[
solution
.
Area
]
},
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
appInfo
:
pobj
.
appInfo
var
pushObj
=
{
}
requirementId
:
needinfo
.
channelNeedNo
,
await
this
.
utilsPushSve
.
business2Channel
(
reqParams
,
"updateChanceStatus"
);
companyName
:
solution
.
CompanyName
,
companyAddress
:
solution
.
CompanyAddress
,
area
:
solution
.
Area
,
type
:
solution
.
IcpType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
)
var
pushIcpSolutionRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
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
)
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
IcpType
:
solution
.
IcpType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
);
var
pushIcpSolutionRes
=
await
this
.
pushEnameIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitIcpProgramme"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
needinfo
),
optitle
:
"createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
}
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
needinfo
.
channelNeedNo
,
status
:
"createSolution"
},
appInfo
:
pobj
.
appInfo
}
await
this
.
utilsPushSve
.
business2Channel
(
reqParams
,
"updateChanceStatus"
);
}
return
res
;
}
}
return
res
;
}
//推送ICP方案至渠道方
//推送ICP方案至渠道方
async
pushIcpSolution2Channel
(
pobj
){
async
pushIcpSolution2Channel
(
pobj
)
{
var
actionBody
=
pobj
.
actionBody
;
var
actionBody
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
appInfo
=
pobj
.
appInfo
;
var
pushRes
=
{
var
pushRes
=
{
status
:
-
1
,
msg
:
"推送失败"
status
:
-
1
,
msg
:
"推送失败"
};
var
self
=
this
;
if
(
actionBody
){
//2020-10-26 laolan 区分百度与阿里
if
(
actionBody
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
IntentionBizId
:
actionBody
.
channelNeedNo
,
CompanyName
:
actionBody
.
CompanyName
,
IcpType
:
actionBody
.
IcpType
,
CompanyAddress
:
actionBody
.
CompanyAddress
,
Area
:
actionBody
.
Area
,
Note
:
actionBody
.
Note
,
ActionType
:
actionBody
.
ActionType
,
Source
:
"官网"
};
};
if
(
actionBody
.
channelSolutionNo
)
{
var
self
=
this
;
pushObj
[
"BizId"
]
=
actionBody
.
channelSolutionNo
;
if
(
actionBody
)
{
//2020-10-26 laolan 区分百度与阿里
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
var
pushObj
=
{
IntentionBizId
:
actionBody
.
channelNeedNo
,
CompanyName
:
actionBody
.
CompanyName
,
IcpType
:
actionBody
.
IcpType
,
CompanyAddress
:
actionBody
.
CompanyAddress
,
Area
:
actionBody
.
Area
,
Note
:
actionBody
.
Note
,
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
)
{
//推送数据至baidu
actionBody
.
Area
=
cityLetter
[
actionBody
.
Area
];
var
pushObj
=
{
requirementId
:
actionBody
.
channelNeedNo
,
companyName
:
actionBody
.
CompanyName
,
companyAddress
:
actionBody
.
CompanyAddress
,
area
:
actionBody
.
Area
,
type
:
actionBody
.
IcpType
};
if
(
actionBody
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
actionBody
.
channelSolutionNo
;
}
pushRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
actionBody
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"app/base/service/impl/common/baseCenterOrderSve.js/pushIcpSolution2Channel"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
pushRes
),
optitle
:
"pushIcpSolution2Channel推送ICP方案至渠道方->pushIcpSolution2Channel"
,
});
}
}
pushRes
=
await
this
.
pushIcpSolution
(
pushObj
,
actionBody
.
solutionNo
,
pobj
.
appInfo
,
self
);
if
(
pushRes
.
status
==
0
||
pushRes
.
status
==
1
)
{
}
return
system
.
getResultRedisQueueSuccess
();
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
){
//推送数据至baidu
actionBody
.
Area
=
cityLetter
[
actionBody
.
Area
];
var
pushObj
=
{
requirementId
:
actionBody
.
channelNeedNo
,
companyName
:
actionBody
.
CompanyName
,
companyAddress
:
actionBody
.
CompanyAddress
,
area
:
actionBody
.
Area
,
type
:
actionBody
.
IcpType
};
if
(
actionBody
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
actionBody
.
channelSolutionNo
;
}
}
pushRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
actionBody
.
solutionNo
,
pobj
.
appInfo
,
self
);
return
pushRes
;
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"app/base/service/impl/common/baseCenterOrderSve.js/pushIcpSolution2Channel"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
pushRes
),
optitle
:
"pushIcpSolution2Channel推送ICP方案至渠道方->pushIcpSolution2Channel"
,
});
}
if
(
pushRes
.
status
==
0
||
pushRes
.
status
==
1
){
return
system
.
getResultRedisQueueSuccess
();
}
}
return
pushRes
;
}
//推送ICP方案ali
//推送ICP方案ali
async
pushIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
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
({
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
action
:
"SubmitIcpSolution"
,
var
resData
=
pushRes
.
data
;
reqbody
:
pushObj
,
if
(
resData
.
BizId
)
{
apiVersion
:
"2019-05-08"
var
reqObj2
=
{
});
actionType
:
"receiveProgrammeNo"
,
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
appInfo
:
appInfo
,
var
resData
=
pushRes
.
data
;
actionBody
:
{
if
(
resData
.
BizId
)
{
solutionNo
:
solutionNo
,
var
reqObj2
=
{
solutionBizId
:
resData
.
BizId
actionType
:
"receiveProgrammeNo"
,
}
appInfo
:
appInfo
,
};
actionBody
:
{
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
solutionNo
:
solutionNo
,
if
(
a
&&
a
.
status
==
0
)
{
solutionBizId
:
resData
.
BizId
//推送方案确认信息
}
var
confirmRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"ConfirmIntention"
,
reqbody
:
{
BizId
:
pushObj
.
IntentionBizId
},
apiVersion
:
"2019-05-08"
});
};
if
(
confirmRes
&&
confirmRes
.
status
==
0
&&
confirmRes
.
data
)
{
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
var
confirmResData
=
confirmRes
.
data
;
if
(
a
&&
a
.
status
==
0
)
{
if
(
confirmResData
.
ConfirmUrl
)
{
//推送方案确认信息
var
reqObj3
=
{
var
confirmRes
=
await
self
.
aliclient
.
reqbyget
({
actionType
:
"receiveIcpConfirmUrl"
,
action
:
"ConfirmIntention"
,
appInfo
:
appInfo
,
reqbody
:
{
BizId
:
pushObj
.
IntentionBizId
},
actionBody
:
{
apiVersion
:
"2019-05-08"
solutionNo
:
solutionNo
,
});
confirmUrl
:
confirmResData
.
ConfirmUrl
if
(
confirmRes
&&
confirmRes
.
status
==
0
&&
confirmRes
.
data
)
{
var
confirmResData
=
confirmRes
.
data
;
if
(
confirmResData
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
confirmResData
.
ConfirmUrl
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
}
}
// return confirmRes;
}
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
}
}
}
// return confirmRes;
}
}
}
return
pushRes
;
}
}
return
pushRes
;
}
//推送ICP方案易名 2021-02-25 庄冰
//推送ICP方案易名 2021-02-25 庄冰
async
pushEnameIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
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"
);
var
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
)
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"SubmitIcpSolution"
)
console
.
log
(
"rtn+++++"
,
rtn
)
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
}
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
// var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj });
// var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj });
console
.
log
(
"pushRes++++"
,
pushRes
)
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
ErrorCode
==
"200"
&&
pushRes
.
Success
==
true
&&
pushRes
.
BizId
)
{
if
(
pushRes
&&
pushRes
.
ErrorCode
==
"200"
&&
pushRes
.
Success
==
true
&&
pushRes
.
BizId
)
{
var
reqObj2
=
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
appInfo
:
appInfo
,
actionBody
:
{
actionBody
:
{
solutionNo
:
solutionNo
,
solutionNo
:
solutionNo
,
solutionBizId
:
pushRes
.
BizId
solutionBizId
:
pushRes
.
BizId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
pushRes
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
pushRes
.
ConfirmUrl
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
}
};
return
pushRes
;
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
pushRes
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
pushRes
.
ConfirmUrl
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
}
return
pushRes
;
}
//推送ICP方案baidu 2020-10-26 laolan
//推送ICP方案baidu 2020-10-26 laolan
async
pushBaiduIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
)
{
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
});
var
pushRes
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/plan"
,
reqbody
:
pushObj
});
console
.
log
(
"pushRes++++"
,
pushRes
)
console
.
log
(
"pushRes++++"
,
pushRes
)
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
)
{
var
resData
=
pushRes
.
data
;
var
resData
=
pushRes
.
data
;
if
(
resData
.
planId
)
{
if
(
resData
.
planId
)
{
var
reqObj2
=
{
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
appInfo
:
appInfo
,
actionBody
:
{
actionBody
:
{
solutionNo
:
solutionNo
,
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
planId
solutionBizId
:
resData
.
planId
}
}
};
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
if
(
a
&&
a
.
status
==
0
&&
resData
.
path
)
{
if
(
a
&&
a
.
status
==
0
&&
resData
.
path
)
{
var
reqObj3
=
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
appInfo
:
appInfo
,
actionBody
:
{
actionBody
:
{
solutionNo
:
solutionNo
,
solutionNo
:
solutionNo
,
confirmUrl
:
resData
.
path
confirmUrl
:
resData
.
path
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
}
return
pushRes
;
}
}
return
pushRes
;
}
//队列推送材料
//队列推送材料
async
serviceProviderSubmit2Material
(
pobj
)
{
async
serviceProviderSubmit2Material
(
pobj
)
{
console
.
log
(
"serviceProviderSubmit2Material+++++pobj+++"
,
pobj
)
console
.
log
(
"serviceProviderSubmit2Material+++++pobj+++"
,
pobj
)
var
actionBody
=
pobj
.
actionBody
;
var
actionBody
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
appInfo
=
pobj
.
appInfo
;
var
pushRes
=
{
var
pushRes
=
{
status
:
-
1
,
msg
:
"推送失败"
status
:
-
1
,
msg
:
"推送失败"
};
if
(
actionBody
){
if
(
actionBody
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
"BizId"
:
actionBody
.
BizId
,
"Domain"
:
actionBody
.
Domain
,
"CorporateName"
:
actionBody
.
CorporateName
,
"IncludeForeignInvestment"
:
actionBody
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
actionBody
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
actionBody
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
actionBody
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
actionBody
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
actionBody
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
actionBody
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
actionBody
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
actionBody
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
actionBody
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
actionBody
.
PartnerSignAndStampOtherList
||
[]
};
};
var
self
=
this
;
if
(
actionBody
)
{
//推送方案材料
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
var
ali
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
//推送数据至阿里
console
.
log
(
'ali ----- +++'
,
ali
)
var
pushObj
=
{
if
(
ali
&&
ali
.
status
==
200
){
"BizId"
:
actionBody
.
BizId
,
var
aliFlag
=
200
"Domain"
:
actionBody
.
Domain
,
}
else
{
"CorporateName"
:
actionBody
.
CorporateName
,
var
aliFlag
=
-
200
"IncludeForeignInvestment"
:
actionBody
.
IncludeForeignInvestment
,
}
"PartnerBusinessLicense"
:
actionBody
.
PartnerBusinessLicense
,
}
"PartnerIdCardList"
:
actionBody
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
actionBody
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
actionBody
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
actionBody
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
actionBody
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
actionBody
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
actionBody
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
actionBody
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
actionBody
.
PartnerSignAndStampOtherList
||
[]
};
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
aliFlag
=
200
}
else
{
var
aliFlag
=
-
200
}
}
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
){
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至百度
//推送数据至百度
var
pushObj
=
{
var
pushObj
=
{
"businessLicense"
:
{
"businessLicense"
:
{
"address"
:
actionBody
.
businessLicense
.
address
||
""
,
"address"
:
actionBody
.
businessLicense
.
address
||
""
,
"businessTerm"
:
actionBody
.
businessLicense
.
businessTerm
||
""
,
"businessTerm"
:
actionBody
.
businessLicense
.
businessTerm
||
""
,
"createdAt"
:
actionBody
.
businessLicense
.
createdAt
||
""
,
"createdAt"
:
actionBody
.
businessLicense
.
createdAt
||
""
,
"enterpriseCode"
:
actionBody
.
businessLicense
.
enterpriseCode
||
""
,
"enterpriseCode"
:
actionBody
.
businessLicense
.
enterpriseCode
||
""
,
"legalRepresentative"
:
actionBody
.
businessLicense
.
legalRepresentative
||
""
,
"legalRepresentative"
:
actionBody
.
businessLicense
.
legalRepresentative
||
""
,
"name"
:
actionBody
.
businessLicense
.
name
||
""
,
"name"
:
actionBody
.
businessLicense
.
name
||
""
,
"registeredCapital"
:
actionBody
.
businessLicense
.
registeredCapital
||
""
,
"registeredCapital"
:
actionBody
.
businessLicense
.
registeredCapital
||
""
,
"scopeBusiness"
:
actionBody
.
businessLicense
.
scopeBusiness
||
""
,
"scopeBusiness"
:
actionBody
.
businessLicense
.
scopeBusiness
||
""
,
"type"
:
actionBody
.
businessLicense
.
type
||
""
"type"
:
actionBody
.
businessLicense
.
type
||
""
},
},
"domain"
:
actionBody
.
domain
,
"domain"
:
actionBody
.
domain
,
"corporateName"
:
actionBody
.
corporateName
,
"corporateName"
:
actionBody
.
corporateName
,
"includeForeignInvestment"
:
actionBody
.
includeForeignInvestment
,
"includeForeignInvestment"
:
actionBody
.
includeForeignInvestment
,
"orderNo"
:
actionBody
.
orderNo
,
"orderNo"
:
actionBody
.
orderNo
,
"partnerForeignInvestment"
:
actionBody
.
partnerForeignInvestment
||
""
,
"partnerForeignInvestment"
:
actionBody
.
partnerForeignInvestment
||
""
,
"partnerBusinessLicense"
:
actionBody
.
partnerBusinessLicense
,
"partnerBusinessLicense"
:
actionBody
.
partnerBusinessLicense
,
"partnerIdCardList"
:
actionBody
.
partnerIdCardList
,
"partnerIdCardList"
:
actionBody
.
partnerIdCardList
,
"partnerDomainCertificate"
:
actionBody
.
partnerDomainCertificate
,
"partnerDomainCertificate"
:
actionBody
.
partnerDomainCertificate
,
"partnerPreviewOtherList"
:
actionBody
.
partnerPreviewOtherList
||
[],
"partnerPreviewOtherList"
:
actionBody
.
partnerPreviewOtherList
||
[],
"partnerPlan"
:
actionBody
.
partnerPlan
||
""
,
"partnerPlan"
:
actionBody
.
partnerPlan
||
""
,
"partnerLaw"
:
actionBody
.
partnerLaw
||
""
,
"partnerLaw"
:
actionBody
.
partnerLaw
||
""
,
"partnerStampOtherList"
:
actionBody
.
partnerStampOtherList
||
[],
"partnerStampOtherList"
:
actionBody
.
partnerStampOtherList
||
[],
"partnerSignOtherList"
:
actionBody
.
partnerSignOtherList
||
[],
"partnerSignOtherList"
:
actionBody
.
partnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
actionBody
.
partnerSignAndStampOtherList
||
[]
"partnerSignAndStampOtherList"
:
actionBody
.
partnerSignAndStampOtherList
||
[]
};
};
var
self
=
this
;
var
self
=
this
;
//推送方案材料
//推送方案材料
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
console
.
log
(
'baidu -----+++++'
,
baidu
)
path
:
"/api/bla/provider/license/material"
,
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
reqbody
:
pushObj
var
baiduFlag
=
200
});
}
else
{
console
.
log
(
'baidu -----+++++'
,
baidu
)
var
baiduFlag
=
-
200
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
)
{
var
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
}
console
.
log
(
'hhhhh+++baiduFlag+++'
,
baiduFlag
)
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"app/base/service/impl/common/baseCenterOrderSve.js/serviceProviderSubmit2Material"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
pushRes
),
optitle
:
"serviceProviderSubmit2Material推送ICP材料至渠道方->serviceProviderSubmit2Material"
,
});
}
}
console
.
log
(
'hhhhh+++baiduFlag+++'
,
baiduFlag
)
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
}
// pushRes.status = 1
this
.
logCtl
.
info
({
return
system
.
getResultRedisQueueSuccess
();
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
}
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
return
pushRes
;
requestId
:
pobj
.
requestId
||
""
,
op
:
"app/base/service/impl/common/baseCenterOrderSve.js/serviceProviderSubmit2Material"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
pushRes
),
optitle
:
"serviceProviderSubmit2Material推送ICP材料至渠道方->serviceProviderSubmit2Material"
,
});
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
){
// pushRes.status = 1
return
system
.
getResultRedisQueueSuccess
();
}
}
return
pushRes
;
}
//交付材料提交
async
serviceProviderSubmitMaterial
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
console
.
log
(
'zzzzlllll+++++'
,
res
)
console
.
log
(
'zzzzlllll++pobj+++'
,
pobj
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
var
needsolution
=
res
.
data
;
//方案信息
var
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
){
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
reqPushParams
=
{
//交付材料提交
actionBody
:
{
async
serviceProviderSubmitMaterial
(
pobj
)
{
"uapp_id"
:
res
.
data
.
uapp_id
,
let
self
=
this
;
"BizId"
:
BizId
,
let
resFlag
=
-
200
;
"Domain"
:
material
.
Domain
,
try
{
"CorporateName"
:
material
.
CorporateName
,
let
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-reqCenterOrderApi:"
,
pobj
,
"center-channel-serviceProviderSubmitMaterial"
,
res
,
null
);
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
let
needsolution
=
res
.
data
;
//方案信息
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
let
ab
=
pobj
.
actionBody
;
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
if
(
typeof
(
ab
.
material
)
==
"string"
)
{
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
}
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
let
material
=
ab
.
material
;
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
let
reqPushParams
=
{};
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
)
{
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
},
//推送数据至阿里
appInfo
:
pobj
.
appInfo
let
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
};
reqPushParams
=
{
}
actionBody
:
{
"uapp_id"
:
res
.
data
.
uapp_id
,
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
},
appInfo
:
pobj
.
appInfo
};
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至百度
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
||
""
},
"corporateName"
:
material
.
CorporateName
,
"domain"
:
material
.
Domain
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"orderNo"
:
BizId
,
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
},
appInfo
:
pobj
.
appInfo
}
}
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProviderSubmit2Material"
);
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
let
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
let
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送方案材料
//推送数据至百度
let
aliParams
=
{
var
BizId
=
needsolution
.
orderChannelNo
;
action
:
"SavePartnerSubmitMaterial"
,
console
.
log
(
'BizId++'
,
BizId
)
reqbody
:
pushObj
,
reqPushParams
=
{
apiVersion
:
"2019-05-08"
actionBody
:
{
}
"uapp_id"
:
res
.
data
.
uapp_id
,
let
ali
=
await
self
.
aliclient
.
reqbyget
(
aliParams
);
"businessLicense"
:
{
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-aliclient:"
,
aliParams
,
"center-channel-serviceProviderSubmitMaterial"
,
ali
,
null
);
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
if
(
ali
&&
ali
.
status
==
200
)
{
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
resFlag
=
200
"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
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"orderNo"
:
BizId
,
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
},
appInfo
:
pobj
.
appInfo
}
}
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProviderSubmit2Material"
);
// console.log('result+++-cailiao--++++----',result)
// console.log('result+++-reqPushParams--++++----',reqPushParams)
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"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
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
//推送数据至百度
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
let
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
let
pushObj
=
{
var
pushObj
=
{
"businessLicense"
:
{
"businessLicense"
:
{
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
},
},
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"orderNo"
:
BizId
,
"orderNo"
:
BizId
,
"domain"
:
material
.
Domain
,
"domain"
:
material
.
Domain
,
"corporateName"
:
material
.
CorporateName
,
"corporateName"
:
material
.
CorporateName
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
};
//推送方案材料
var
self
=
this
;
let
baiduParams
=
{
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
}
//推送方案材料
let
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
(
baiduParams
);
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-baiduReqbyget:"
,
baiduParams
,
"center-channel-serviceProviderSubmitMaterial"
,
baidu
,
null
);
console
.
log
(
'baidu tui ziliao +++++'
,
baidu
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
)
{
console
.
log
(
'baidu pushObj ziliao +++++'
,
pushObj
)
resFlag
=
200
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
}
var
baiduFlag
=
200
}
}
else
{
var
baiduFlag
=
-
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
){
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
)
{
var
aliFlag
=
-
200
;
//推送数据至易名
//推送数据至易名
let
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
let
pushObj
=
{
var
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
"CompanyName"
:
material
.
CompanyName
,
// "BizId": BizId,
// "BizId": BizId,
"OrderNo"
:
BizId
,
"OrderNo"
:
BizId
,
"Domain"
:
material
.
Domain
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[],
"BusinessLicense"
:
{
"BusinessLicense"
:
{
"CreatedAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"CreatedAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"EnterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"EnterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"LegalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"LegalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"Address"
:
material
.
BusinessLicense
.
Address
||
""
,
"Address"
:
material
.
BusinessLicense
.
Address
||
""
,
"RegisteredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"RegisteredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"Name"
:
material
.
BusinessLicense
.
Name
||
""
,
"Name"
:
material
.
BusinessLicense
.
Name
||
""
,
"BusinessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"BusinessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"Type"
:
material
.
BusinessLicense
.
Type
||
""
,
"Type"
:
material
.
BusinessLicense
.
Type
||
""
,
"ScopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
"ScopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
},
},
};
};
//推送方案材料
var
self
=
this
;
let
eNameUrl
=
settings
.
enameClientUrl
()
+
"SavePartnerSubmitMaterial"
;
//推送方案材料
let
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
eNameUrl
);
var
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"SavePartnerSubmitMaterial"
);
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-execEnamePost:eNameUrl:"
+
eNameUrl
,
pushObj
,
"center-channel-serviceProviderSubmitMaterial"
,
rtn
,
null
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"SavePartnerSubmitMaterial"
)
if
(
rtn
&&
rtn
.
stdout
)
{
console
.
log
(
"rtn+++++"
,
rtn
)
let
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
aliFlag
=
-
200
;
resFlag
=
200
;
}
else
{
}
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
}
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
){
}
aliFlag
==
200
;
if
(
resFlag
==
200
)
{
}
else
{
return
system
.
getResultSuccess
();
aliFlag
==
-
200
;
}
}
}
}
}
return
res
}
catch
(
e
)
{
}
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
if
(
aliFlag
==
200
||
baiduFlag
==
200
){
this
.
execClientNew
.
execLogs
(
"serviceProviderSubmitMaterial-reqError:"
,
pobj
,
"center-channel-serviceProviderSubmitMaterial"
,
null
,
stackStr
);
return
system
.
getResultSuccess
();
}
}
}
console
.
log
(
'rsrsr++++------------++++'
,
res
)
return
res
}
}
return
res
}
//队列通知交付状态变更
//队列通知交付状态变更
async
serviceProvider2Notification
(
pobj
){
async
serviceProvider2Notification
(
pobj
)
{
console
.
log
(
"serviceProvider2Notification+++++pobj+++"
,
pobj
)
console
.
log
(
"serviceProvider2Notification+++++pobj+++"
,
pobj
)
var
actionBody
=
pobj
.
actionBody
;
var
actionBody
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
appInfo
=
pobj
.
appInfo
;
var
pushRes
=
{
var
pushRes
=
{
status
:
-
1
,
msg
:
"推送失败"
status
:
-
1
,
msg
:
"推送失败"
};
if
(
actionBody
){
if
(
actionBody
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
BizId
:
actionBody
.
BizId
,
OfficialFileURL
:
actionBody
.
OfficialFileURL
,
ApplicationStatus
:
actionBody
.
ApplicationStatus
};
};
//推送状态变更
if
(
actionBody
)
{
var
ali
=
await
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
actionBody
.
uapp_id
==
uappId
.
ali
)
{
console
.
log
(
'状态变更 ali ----- +++'
,
ali
)
//推送数据至阿里
if
(
ali
&&
ali
.
status
==
200
){
var
pushObj
=
{
var
aliFlag
=
200
BizId
:
actionBody
.
BizId
,
}
else
{
OfficialFileURL
:
actionBody
.
OfficialFileURL
,
var
aliFlag
=
-
200
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
aliFlag
=
200
}
else
{
var
aliFlag
=
-
200
}
}
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
)
{
// actionBody.ApplicationStatus = baiduIcpStatus[actionBody.ApplicationStatus];
//推送数据至百度
var
pushObj
=
{
orderNo
:
actionBody
.
orderNo
,
status
:
actionBody
.
status
};
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
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
}
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"app/base/service/impl/common/baseCenterOrderSve.js/serviceProvider2Notification"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
pushRes
),
optitle
:
"serviceProvider2Notification推送ICP材料至渠道方->serviceProvider2Notification"
,
});
}
}
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
)
{
if
(
actionBody
.
uapp_id
==
uappId
.
baidu
){
pushRes
.
status
=
1
// actionBody.ApplicationStatus = baiduIcpStatus[actionBody.ApplicationStatus];
return
system
.
getResultRedisQueueSuccess
();
//推送数据至百度
var
pushObj
=
{
orderNo
:
actionBody
.
orderNo
,
status
:
actionBody
.
status
};
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
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
}
}
}
return
pushRes
;
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"app/base/service/impl/common/baseCenterOrderSve.js/serviceProvider2Notification"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
pushRes
),
optitle
:
"serviceProvider2Notification推送ICP材料至渠道方->serviceProvider2Notification"
,
});
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
){
pushRes
.
status
=
1
return
system
.
getResultRedisQueueSuccess
();
}
}
return
pushRes
;
}
//通知交付状态变更-所有渠道状态更改
//通知交付状态变更-所有渠道状态更改
async
serviceProviderNotification
(
pobj
)
{
async
serviceProviderNotification
(
pobj
)
{
console
.
log
(
'zhuangtai ++++'
,
pobj
)
let
self
=
this
;
let
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
let
resFlag
=
-
200
;
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-reqCenterOrderApi:"
,
pobj
,
"center-channel-serviceProviderNotification"
,
res
,
null
);
try
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
let
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
pobj
.
actionBody
.
isTest
&&
pobj
.
actionBody
.
isTest
==
1
){
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-reqCenterOrderApi:"
,
pobj
,
"center-channel-serviceProviderNotification"
,
res
,
null
);
var
reqPushParams
=
{};
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
if
(
pobj
.
actionBody
.
isTest
&&
pobj
.
actionBody
.
isTest
==
1
)
{
//推送数据至阿里
var
reqPushParams
=
{};
reqPushParams
=
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
actionBody
:
{
//推送数据至阿里
uapp_id
:
res
.
data
.
uapp_id
,
reqPushParams
=
{
BizId
:
res
.
data
.
BizId
,
actionBody
:
{
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
uapp_id
:
res
.
data
.
uapp_id
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
BizId
:
res
.
data
.
BizId
,
},
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
appInfo
:
pobj
.
appInfo
ApplicationStatus
:
res
.
data
.
ApplicationStatus
}
},
}
appInfo
:
pobj
.
appInfo
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
}
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
}
//推送数据至百度
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
reqPushParams
=
{
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
actionBody
:{
//推送数据至百度
uapp_id
:
res
.
data
.
uapp_id
,
reqPushParams
=
{
orderNo
:
res
.
data
.
channelOrderNo
,
actionBody
:
{
status
:
res
.
data
.
ApplicationStatus
uapp_id
:
res
.
data
.
uapp_id
,
},
orderNo
:
res
.
data
.
channelOrderNo
,
appInfo
:
pobj
.
appInfo
status
:
res
.
data
.
ApplicationStatus
}
},
}
appInfo
:
pobj
.
appInfo
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProvider2Notification"
);
}
// console.log('reqPushParams+++-状态变更--++++----',reqPushParams)
}
// console.log('result+++-状态变更--++++----',result)
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProvider2Notification"
);
}
else
{
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
)
{
//推送数据至阿里
//推送数据至阿里
var
pushObj
=
{
let
pushObj
=
{
BizId
:
res
.
data
.
BizId
,
BizId
:
res
.
data
.
BizId
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
,
//2021-3-18 addNew
//2021-3-18 addNew
CertificateNumber
:
res
.
data
.
CertificateNumber
||
""
,
//证书编号
CertificateNumber
:
res
.
data
.
CertificateNumber
||
""
,
//证书编号
CertificateStartTime
:
res
.
data
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
CertificateStartTime
:
res
.
data
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
CertificateEndTime
:
res
.
data
.
CertificateEndTime
||
""
//证书有效期 结束时间
CertificateEndTime
:
res
.
data
.
CertificateEndTime
||
""
//证书有效期 结束时间
};
};
//推送状态变更
//推送状态变更
var
ali
=
await
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
let
aliParams
=
{
if
(
ali
&&
ali
.
status
==
200
){
action
:
"AcceptPartnerNotification"
,
var
aliFlag
=
200
reqbody
:
pushObj
,
}
else
{
apiVersion
:
"2019-05-08"
var
aliFlag
=
-
200
}
}
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
){
if
(
res
.
data
.
uapp_id
==
uappId
.
ename
)
{
var
enameFlag
=-
200
;
//推送数据至易名
//推送数据至易名
let
pushObj
=
{
var
pushObj
=
{
OrderNo
:
res
.
data
.
channelOrderNo
,
OrderNo
:
res
.
data
.
channelOrderNo
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
ApplicationStatus
:
res
.
data
.
ApplicationStatus
};
};
let
eNameUrl
=
settings
.
enameClientUrl
()
+
"AcceptPartnerNotification"
;
var
rtn
=
await
this
.
execClient
.
execEnamePost
(
pushObj
,
settings
.
enameClientUrl
()
+
"AcceptPartnerNotification"
);
let
rtn
=
await
self
.
execClient
.
execEnamePost
(
pushObj
,
eNameUrl
);
console
.
log
(
"url+++++"
,
settings
.
enameClientUrl
()
+
"AcceptPartnerNotification"
)
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-execEnamePost:eNameUrl:"
+
eNameUrl
,
pushObj
,
"center-channel-serviceProviderNotification"
,
rtn
,
null
);
console
.
log
(
"rtn+++++"
,
rtn
)
if
(
rtn
&&
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
let
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
enameFlag
=
-
200
;
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
}
else
{
resFlag
=
200
;
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
}
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
){
}
enameFlag
==
200
;
}
}
else
{
enameFlag
==
-
200
;
}
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
)
{
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
//推送数据至百度
let
pushObj
=
{
var
pushObj
=
{
orderNo
:
res
.
data
.
channelOrderNo
,
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
status
:
res
.
data
.
ApplicationStatus
};
};
//推送状态变更
//推送状态变更
let
baiduParams
=
{
var
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
path
:
"/api/bla/provider/license/update"
,
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-baiduReqbyget:"
,
pushObj
,
"center-channel-serviceProviderNotification"
,
baidu
,
null
);
reqbody
:
pushObj
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
}
var
baiduFlag
=
200
let
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
(
baiduParams
);
}
else
{
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-baiduReqbyget:"
,
baiduParams
,
"center-channel-serviceProviderNotification"
,
baidu
,
null
);
var
baiduFlag
=
-
200
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
;
pobj
.
pushObj
=
res
.
data
;
let
zc360
=
await
this
.
utils360Sve
.
pushOrderStatus
(
pobj
);
let
zc360
=
await
this
.
utils360Sve
.
pushOrderStatus
(
pobj
);
if
(
zc360
&&
zc360
.
code
==
200
&&
zc360
.
msg
==
'ok'
){
if
(
zc360
&&
zc360
.
code
==
200
&&
zc360
.
msg
==
'ok'
)
{
var
zc360Flag
=
200
resFlag
=
200
}
else
{
}
var
zc360Flag
=
-
200
}
}
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
||
zc360Flag
==
200
||
enameFlag
==
200
){
if
(
resFlag
==
200
)
{
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
}
return
res
;
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-reqError:"
,
pobj
,
"center-channel-serviceProviderNotification"
,
null
,
stackStr
);
}
}
}
}
return
res
;
}
return
res
;
}
//易名退款,关闭订单 2021-3-23
//易名退款,关闭订单 2021-3-23
async
eNameCloseOrder
(
pobj
){
async
eNameCloseOrder
(
pobj
)
{
console
.
log
(
"eNameCloseOrder+++"
,
pobj
)
console
.
log
(
"eNameCloseOrder+++"
,
pobj
)
var
pushObj
=
{}
var
pushObj
=
{}
var
orderNo
var
orderNo
var
note
var
note
orderNo
=
pobj
.
actionBody
.
orderNo
orderNo
=
pobj
.
actionBody
.
orderNo
note
=
pobj
.
actionBody
.
note
note
=
pobj
.
actionBody
.
note
pobj
.
actionType
=
"delENameOrder"
pobj
.
actionType
=
"delENameOrder"
var
res
=
await
this
.
utilsOrderSve
.
delENameOrder
(
pobj
,
pobj
.
actionBody
);
var
res
=
await
this
.
utilsOrderSve
.
delENameOrder
(
pobj
,
pobj
.
actionBody
);
if
(
res
.
status
<
0
)
{
if
(
res
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
console
.
log
(
'delOrder---'
,
res
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channelOrderNo
)
{
pushObj
=
{
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
){
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
){
console
.
log
(
'ename----'
,
pushRes
)
return
pushRes
}
}
}
console
.
log
(
'delOrder---'
,
res
)
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channelOrderNo
)
{
pushObj
=
{
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
)
{
var
pushRes
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
pushRes
&&
pushRes
.
Success
&&
pushRes
.
Success
==
true
)
{
console
.
log
(
'ename----'
,
pushRes
)
return
pushRes
}
}
}
return
res
}
}
return
res
}
}
}
module
.
exports
=
BaseCenterOrderService
;
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 {
...
@@ -14,7 +14,7 @@ class baiduClient extends AppServiceBase {
//2020 1027 laolan 调用百度网关
//2020 1027 laolan 调用百度网关
async
baiduPost
(
path
,
actionBody
)
{
async
baiduPost
(
path
,
actionBody
)
{
console
.
log
(
'actionBody++'
,
actionBody
)
console
.
log
(
'
baiduPost-
actionBody++'
,
actionBody
)
let
domain
=
this
.
baiduClientParams
.
domain
;
let
domain
=
this
.
baiduClientParams
.
domain
;
let
url
=
domain
+
path
;
let
url
=
domain
+
path
;
let
version
=
"bce-auth-v1"
;
let
version
=
"bce-auth-v1"
;
...
@@ -27,8 +27,8 @@ class baiduClient extends AppServiceBase {
...
@@ -27,8 +27,8 @@ class baiduClient extends AppServiceBase {
let
extime
=
1800
;
let
extime
=
1800
;
let
canonicalHeaders
=
"host:"
+
this
.
baiduClientParams
.
host
;
let
canonicalHeaders
=
"host:"
+
this
.
baiduClientParams
.
host
;
//中间结果1:规范化请求和前缀字符串
//中间结果1:规范化请求和前缀字符串
var
canonicalRequest
=
null
let
canonicalRequest
=
null
var
pathParams
=
path
.
split
(
"?"
);
let
pathParams
=
path
.
split
(
"?"
);
if
(
pathParams
&&
pathParams
.
length
>
1
)
{
if
(
pathParams
&&
pathParams
.
length
>
1
)
{
canonicalRequest
=
"POST"
+
"
\
n"
+
pathParams
[
0
]
+
"
\
n"
+
pathParams
[
1
]
+
"
\
n"
+
canonicalHeaders
;
canonicalRequest
=
"POST"
+
"
\
n"
+
pathParams
[
0
]
+
"
\
n"
+
pathParams
[
1
]
+
"
\
n"
+
canonicalHeaders
;
}
else
{
}
else
{
...
@@ -48,17 +48,17 @@ class baiduClient extends AppServiceBase {
...
@@ -48,17 +48,17 @@ class baiduClient extends AppServiceBase {
.
digest
(
'hex'
);
.
digest
(
'hex'
);
//最终结果:认证字符串 authorization
//最终结果:认证字符串 authorization
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
let
authorization
=
authStringPrefix
+
"/"
+
signedHeaders
+
"/"
+
signature
;
var
baiduObj
=
{
let
baiduObj
=
{
authorization
:
authorization
,
authorization
:
authorization
,
data
:
actionBody
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
);
this
.
execClientNew
.
execLogs
(
`baiduClient-baiduPost-result:url=
${
url
}
`
,
baiduObj
,
"center-channel-opBaiduClientPost"
,
rtn
,
null
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
this
.
execClientNew
.
execLogs
(
`baiduClient-opBaiduClientPost-result:url=
${
url
}
`
,
actionBody
,
"center-channel-opBaiduClientPost"
,
null
,
rtn
);
this
.
execClientNew
.
execLogs
(
`baiduClient-opBaiduClientPost-result:url=
${
url
}
`
,
actionBody
,
"center-channel-opBaiduClientPost"
,
null
,
rtn
);
return
system
.
getResult
(
null
,
rtn
);
return
system
.
getResult
(
null
,
rtn
);
}
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
let
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
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