Commit efbfaf40 by 宋毅

增加日志

parent d162153b
...@@ -3,48 +3,48 @@ var settings = require("../../../../config/settings"); ...@@ -3,48 +3,48 @@ 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
...@@ -56,6 +56,7 @@ const baiduIcpStatus = { ...@@ -56,6 +56,7 @@ const baiduIcpStatus = {
511: "APPROVED", 511: "APPROVED",
512: "NOT_APPROVED" 512: "NOT_APPROVED"
}; };
/** /**
* 资质信息提报相关接口(ICP\EDI) * 资质信息提报相关接口(ICP\EDI)
*/ */
...@@ -74,6 +75,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -74,6 +75,7 @@ class BaseCenterOrderService extends AppServiceBase {
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 //调用center-order
async reqCenterOrderApi(pobj, reqUrl) { async reqCenterOrderApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/qcapi/springBoard"; var url = this.centerOrderUrl + "action/qcapi/springBoard";
...@@ -87,7 +89,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -87,7 +89,7 @@ class BaseCenterOrderService extends AppServiceBase {
//提交Icp注册方案 //提交Icp注册方案
async submitIcpProgramme(pobj) { async submitIcpProgramme(pobj) {
console.log('提交Icp注册方案---',pobj) console.log('提交Icp注册方案---', pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) { if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) {
var needinfo = res.data.needinfo;//需求信息 var needinfo = res.data.needinfo;//需求信息
...@@ -100,27 +102,27 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -100,27 +102,27 @@ class BaseCenterOrderService extends AppServiceBase {
needsolution.solutionContent = JSON.parse(needsolution.solutionContent); needsolution.solutionContent = JSON.parse(needsolution.solutionContent);
} }
var solution = needsolution.solutionContent.solution; var solution = needsolution.solutionContent.solution;
if(ab.isTest && ab.isTest==1){ if (ab.isTest && ab.isTest == 1) {
var reqPushParams = { var reqPushParams = {
actionBody: { actionBody: {
uapp_id:needinfo.uapp_id, uapp_id: needinfo.uapp_id,
channelNeedNo:needinfo.channelNeedNo, channelNeedNo: needinfo.channelNeedNo,
CompanyName:solution.CompanyName, CompanyName: solution.CompanyName,
IcpType:solution.IcpType, IcpType: solution.IcpType,
CompanyAddress:solution.CompanyAddress, CompanyAddress: solution.CompanyAddress,
Area:solution.Area, Area: solution.Area,
Note: solution.Note, Note: solution.Note,
ActionType:solution.ActionType, ActionType: solution.ActionType,
channelSolutionNo:needsolution.channelSolutionNo, channelSolutionNo: needsolution.channelSolutionNo,
solutionNo:needsolution.solutionNo, solutionNo: needsolution.solutionNo,
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
}; };
await this.utilsPushSve.business2Channel(reqPushParams, "pushIcpSolution2Channel"); await this.utilsPushSve.business2Channel(reqPushParams, "pushIcpSolution2Channel");
}else{ } else {
var self = this; var self = this;
//2020-10-26 laolan 区分百度与阿里 //2020-10-26 laolan 区分百度与阿里
if(needinfo.uapp_id == uappId.ali){ if (needinfo.uapp_id == uappId.ali) {
//推送数据至阿里 //推送数据至阿里
// var bizType = needinfo.channelTypeCode;//业务类型里 // var bizType = needinfo.channelTypeCode;//业务类型里
var pushObj = { var pushObj = {
...@@ -130,8 +132,8 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -130,8 +132,8 @@ class BaseCenterOrderService extends AppServiceBase {
CompanyAddress: solution.CompanyAddress, CompanyAddress: solution.CompanyAddress,
Area: solution.Area, Area: solution.Area,
Note: solution.Note, Note: solution.Note,
ActionType:solution.ActionType, ActionType: solution.ActionType,
Source:"官网" Source: "官网"
}; };
if (needsolution.channelSolutionNo) { if (needsolution.channelSolutionNo) {
pushObj["BizId"] = needsolution.channelSolutionNo; pushObj["BizId"] = needsolution.channelSolutionNo;
...@@ -139,41 +141,41 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -139,41 +141,41 @@ class BaseCenterOrderService extends AppServiceBase {
var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self); var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
} }
if(needinfo.uapp_id == uappId.baidu){ if (needinfo.uapp_id == uappId.baidu) {
//推送数据至baidu //推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里 // var bizType = needinfo.channelTypeCode;//业务类型里
solution.Area = cityLetter[solution.Area] solution.Area = cityLetter[solution.Area]
console.log('solution.Area++',solution.Area) console.log('solution.Area++', solution.Area)
var pushObj = { var pushObj = {
requirementId: needinfo.channelNeedNo, requirementId: needinfo.channelNeedNo,
companyName: solution.CompanyName, companyName: solution.CompanyName,
companyAddress: solution.CompanyAddress, companyAddress: solution.CompanyAddress,
area: solution.Area, area: solution.Area,
type:solution.IcpType type: solution.IcpType
}; };
if (needsolution.channelSolutionNo) { if (needsolution.channelSolutionNo) {
pushObj["bizId"] = 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); 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;//业务类型里 // var bizType = needinfo.channelTypeCode;//业务类型里
// solution.Area = cityLetter[solution.Area] // solution.Area = cityLetter[solution.Area]
console.log('solution.Area++',solution.Area) console.log('solution.Area++', solution.Area)
console.log('solution++',solution) console.log('solution++', solution)
var pushObj = { var pushObj = {
IntentionBizId: needinfo.channelNeedNo, IntentionBizId: needinfo.channelNeedNo,
CompanyName: solution.CompanyName, CompanyName: solution.CompanyName,
CompanyAddress: solution.CompanyAddress, CompanyAddress: solution.CompanyAddress,
Area: solution.Area, Area: solution.Area,
IcpType:solution.IcpType IcpType: solution.IcpType
}; };
if (needsolution.channelSolutionNo) { if (needsolution.channelSolutionNo) {
pushObj["BizId"] = 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); var pushIcpSolutionRes = await this.pushEnameIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
} }
this.logCtl.info({ this.logCtl.info({
...@@ -200,16 +202,16 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -200,16 +202,16 @@ class BaseCenterOrderService extends AppServiceBase {
} }
//推送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; var self = this;
if(actionBody){ if (actionBody) {
//2020-10-26 laolan 区分百度与阿里 //2020-10-26 laolan 区分百度与阿里
if(actionBody.uapp_id == uappId.ali){ if (actionBody.uapp_id == uappId.ali) {
//推送数据至阿里 //推送数据至阿里
var pushObj = { var pushObj = {
IntentionBizId: actionBody.channelNeedNo, IntentionBizId: actionBody.channelNeedNo,
...@@ -218,15 +220,15 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -218,15 +220,15 @@ class BaseCenterOrderService extends AppServiceBase {
CompanyAddress: actionBody.CompanyAddress, CompanyAddress: actionBody.CompanyAddress,
Area: actionBody.Area, Area: actionBody.Area,
Note: actionBody.Note, Note: actionBody.Note,
ActionType:actionBody.ActionType, ActionType: actionBody.ActionType,
Source:"官网" Source: "官网"
}; };
if (actionBody.channelSolutionNo) { if (actionBody.channelSolutionNo) {
pushObj["BizId"] = actionBody.channelSolutionNo; pushObj["BizId"] = actionBody.channelSolutionNo;
} }
pushRes = await this.pushIcpSolution(pushObj, actionBody.solutionNo, pobj.appInfo, self); pushRes = await this.pushIcpSolution(pushObj, actionBody.solutionNo, pobj.appInfo, self);
} }
if(actionBody.uapp_id == uappId.baidu){ if (actionBody.uapp_id == uappId.baidu) {
//推送数据至baidu //推送数据至baidu
actionBody.Area = cityLetter[actionBody.Area]; actionBody.Area = cityLetter[actionBody.Area];
var pushObj = { var pushObj = {
...@@ -234,7 +236,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -234,7 +236,7 @@ class BaseCenterOrderService extends AppServiceBase {
companyName: actionBody.CompanyName, companyName: actionBody.CompanyName,
companyAddress: actionBody.CompanyAddress, companyAddress: actionBody.CompanyAddress,
area: actionBody.Area, area: actionBody.Area,
type:actionBody.IcpType type: actionBody.IcpType
}; };
if (actionBody.channelSolutionNo) { if (actionBody.channelSolutionNo) {
pushObj["bizId"] = actionBody.channelSolutionNo; pushObj["bizId"] = actionBody.channelSolutionNo;
...@@ -251,7 +253,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -251,7 +253,7 @@ class BaseCenterOrderService extends AppServiceBase {
optitle: "pushIcpSolution2Channel推送ICP方案至渠道方->pushIcpSolution2Channel", optitle: "pushIcpSolution2Channel推送ICP方案至渠道方->pushIcpSolution2Channel",
}); });
} }
if(pushRes.status==0 || pushRes.status==1 ){ if (pushRes.status == 0 || pushRes.status == 1) {
return system.getResultRedisQueueSuccess(); return system.getResultRedisQueueSuccess();
} }
return pushRes; return pushRes;
...@@ -260,7 +262,11 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -260,7 +262,11 @@ class BaseCenterOrderService extends AppServiceBase {
//推送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({
action: "SubmitIcpSolution",
reqbody: pushObj,
apiVersion: "2019-05-08"
});
if (pushRes && pushRes.status == 0 && pushRes.data) { if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data; var resData = pushRes.data;
if (resData.BizId) { if (resData.BizId) {
...@@ -275,7 +281,11 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -275,7 +281,11 @@ class BaseCenterOrderService extends AppServiceBase {
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
if (a && a.status == 0) { 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) { if (confirmRes && confirmRes.status == 0 && confirmRes.data) {
var confirmResData = confirmRes.data; var confirmResData = confirmRes.data;
if (confirmResData.ConfirmUrl) { if (confirmResData.ConfirmUrl) {
...@@ -299,19 +309,19 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -299,19 +309,19 @@ class BaseCenterOrderService extends AppServiceBase {
//推送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,
...@@ -321,7 +331,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -321,7 +331,7 @@ class BaseCenterOrderService extends AppServiceBase {
} }
}; };
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 && pushRes.ConfirmUrl) { if (a && a.status == 0 && pushRes.ConfirmUrl) {
var reqObj3 = { var reqObj3 = {
actionType: "receiveIcpConfirmUrl", actionType: "receiveIcpConfirmUrl",
...@@ -332,17 +342,18 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -332,17 +342,18 @@ class BaseCenterOrderService extends AppServiceBase {
} }
}; };
var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
console.log('save confirmUrl ++ ',url) console.log('save confirmUrl ++ ', url)
} }
} }
return pushRes; 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) {
...@@ -355,7 +366,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -355,7 +366,7 @@ class BaseCenterOrderService extends AppServiceBase {
} }
}; };
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",
...@@ -366,7 +377,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -366,7 +377,7 @@ class BaseCenterOrderService extends AppServiceBase {
} }
}; };
var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url 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 { ...@@ -375,14 +386,14 @@ class BaseCenterOrderService extends AppServiceBase {
//队列推送材料 //队列推送材料
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) {
if(actionBody.uapp_id == uappId.ali){ if (actionBody.uapp_id == uappId.ali) {
//推送数据至阿里 //推送数据至阿里
var pushObj = { var pushObj = {
"BizId": actionBody.BizId, "BizId": actionBody.BizId,
...@@ -402,28 +413,32 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -402,28 +413,32 @@ class BaseCenterOrderService extends AppServiceBase {
}; };
var self = this; var self = this;
//推送方案材料 //推送方案材料
var ali =await self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" }); var ali = await self.aliclient.reqbyget({
console.log('ali ----- +++',ali) action: "SavePartnerSubmitMaterial",
if(ali && ali.status == 200){ reqbody: pushObj,
apiVersion: "2019-05-08"
});
console.log('ali ----- +++', ali)
if (ali && ali.status == 200) {
var aliFlag = 200 var aliFlag = 200
}else{ } else {
var aliFlag = -200 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,
...@@ -442,14 +457,17 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -442,14 +457,17 @@ class BaseCenterOrderService extends AppServiceBase {
}; };
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
});
console.log('baidu -----+++++', baidu)
if (baidu && baidu.data && baidu.data.result) {
var baiduFlag = 200 var baiduFlag = 200
}else{ } else {
var baiduFlag = -200 var baiduFlag = -200
} }
console.log('hhhhh+++baiduFlag+++',baiduFlag) console.log('hhhhh+++baiduFlag+++', baiduFlag)
} }
this.logCtl.info({ this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
...@@ -461,7 +479,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -461,7 +479,7 @@ class BaseCenterOrderService extends AppServiceBase {
optitle: "serviceProviderSubmit2Material推送ICP材料至渠道方->serviceProviderSubmit2Material", optitle: "serviceProviderSubmit2Material推送ICP材料至渠道方->serviceProviderSubmit2Material",
}); });
} }
if(aliFlag == 200 || baiduFlag == 200){ if (aliFlag == 200 || baiduFlag == 200) {
// pushRes.status = 1 // pushRes.status = 1
return system.getResultRedisQueueSuccess(); return system.getResultRedisQueueSuccess();
} }
...@@ -470,25 +488,26 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -470,25 +488,26 @@ class BaseCenterOrderService extends AppServiceBase {
//交付材料提交 //交付材料提交
async serviceProviderSubmitMaterial(pobj) { async serviceProviderSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); let self = this;
console.log('zzzzlllll+++++',res) let resFlag = -200;
console.log('zzzzlllll++pobj+++',pobj) 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) { if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息 let needsolution = res.data;//方案信息
var ab = pobj.actionBody; let ab = pobj.actionBody;
if (typeof (ab.material) == "string") { if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material); ab.material = JSON.parse(ab.material);
} }
var material = ab.material; let material = ab.material;
var reqPushParams = {}; let reqPushParams = {};
if(ab.isTest && ab.isTest==1){ if (ab.isTest && ab.isTest == 1) {
if(res.data.uapp_id == uappId.ali){ if (res.data.uapp_id == uappId.ali) {
//推送数据至阿里 //推送数据至阿里
var BizId = needsolution.channelSolutionNo;//⽅案业务ID let BizId = needsolution.channelSolutionNo;//⽅案业务ID
reqPushParams = { reqPushParams = {
actionBody: { actionBody: {
"uapp_id":res.data.uapp_id, "uapp_id": res.data.uapp_id,
"BizId": BizId, "BizId": BizId,
"Domain": material.Domain, "Domain": material.Domain,
"CorporateName": material.CorporateName, "CorporateName": material.CorporateName,
...@@ -507,24 +526,22 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -507,24 +526,22 @@ class BaseCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo appInfo: pobj.appInfo
}; };
} }
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)
reqPushParams = { reqPushParams = {
actionBody: { actionBody: {
"uapp_id":res.data.uapp_id, "uapp_id": res.data.uapp_id,
"businessLicense" : { "businessLicense": {
"address" :material.BusinessLicense.Address || "", "address": material.BusinessLicense.Address || "",
"businessTerm" :material.BusinessLicense.BusinessTerm || "", "businessTerm": material.BusinessLicense.BusinessTerm || "",
"createdAt" : material.BusinessLicense.CreatedAt || "", "createdAt": material.BusinessLicense.CreatedAt || "",
"enterpriseCode" :material.BusinessLicense.EnterpriseCode || "", "enterpriseCode": material.BusinessLicense.EnterpriseCode || "",
"legalRepresentative" :material.BusinessLicense.LegalRepresentative || "", "legalRepresentative": material.BusinessLicense.LegalRepresentative || "",
"name" :material.BusinessLicense.Name || "", "name": material.BusinessLicense.Name || "",
"registeredCapital" : material.BusinessLicense.RegisteredCapital || "", "registeredCapital": material.BusinessLicense.RegisteredCapital || "",
"scopeBusiness" :material.BusinessLicense.ScopeBusiness || "", "scopeBusiness": material.BusinessLicense.ScopeBusiness || "",
"type" : material.BusinessLicense.Type || "" "type": material.BusinessLicense.Type || ""
}, },
"corporateName": material.CorporateName, "corporateName": material.CorporateName,
"domain": material.Domain, "domain": material.Domain,
...@@ -545,14 +562,12 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -545,14 +562,12 @@ class BaseCenterOrderService extends AppServiceBase {
} }
} }
await this.utilsPushSve.business2Channel(reqPushParams, "serviceProviderSubmit2Material"); await this.utilsPushSve.business2Channel(reqPushParams, "serviceProviderSubmit2Material");
// console.log('result+++-cailiao--++++----',result) } else {
// console.log('result+++-reqPushParams--++++----',reqPushParams) if (res.data.uapp_id == uappId.ali) {
}else{
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里 //推送数据至阿里
var BizId = needsolution.channelSolutionNo;//⽅案业务ID let BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = { let pushObj = {
"CompanyName":material.CompanyName, "CompanyName": material.CompanyName,
"BizId": BizId, "BizId": BizId,
"Domain": material.Domain, "Domain": material.Domain,
"CorporateName": material.CorporateName, "CorporateName": material.CorporateName,
...@@ -568,32 +583,34 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -568,32 +583,34 @@ class BaseCenterOrderService extends AppServiceBase {
"PartnerSignOtherList": material.PartnerSignOtherList || [], "PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || [] "PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
}; };
var self = this;
//推送方案材料 //推送方案材料
var ali =await self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" }); let aliParams = {
console.log('ali tui ziliao ++',ali) action: "SavePartnerSubmitMaterial",
if(ali && ali.status == 200){ reqbody: pushObj,
var aliFlag = 200 apiVersion: "2019-05-08"
}else{ }
var aliFlag = -200 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; 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,
...@@ -610,24 +627,20 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -610,24 +627,20 @@ class BaseCenterOrderService extends AppServiceBase {
"partnerSignOtherList": material.PartnerSignOtherList || [], "partnerSignOtherList": material.PartnerSignOtherList || [],
"partnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || [] "partnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
}; };
var self = this;
//推送方案材料 //推送方案材料
var baidu = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj }); let baiduParams = {path: "/api/bla/provider/license/material", reqbody: pushObj}
console.log('baidu tui ziliao +++++',baidu) let baidu = await self.baiduclient.baiduReqbyget(baiduParams);
console.log('baidu pushObj ziliao +++++',pushObj) this.execClientNew.execLogs("serviceProviderSubmitMaterial-baiduReqbyget:", baiduParams, "center-channel-serviceProviderSubmitMaterial", baidu, null);
if(baidu && baidu.data && baidu.data.result){ if (baidu && baidu.data && baidu.data.result) {
var baiduFlag = 200 resFlag = 200
}else{
var baiduFlag = -200
} }
} }
if(res.data.uapp_id == uappId.ename){ if (res.data.uapp_id == uappId.ename) {
var aliFlag = -200;
//推送数据至易名 //推送数据至易名
var BizId = needsolution.channelSolutionNo;//⽅案业务ID let BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = { let pushObj = {
"CompanyName":material.CompanyName, "CompanyName": material.CompanyName,
// "BizId": BizId, // "BizId": BizId,
"OrderNo": BizId, "OrderNo": BizId,
"Domain": material.Domain, "Domain": material.Domain,
...@@ -643,56 +656,52 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -643,56 +656,52 @@ class BaseCenterOrderService extends AppServiceBase {
"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;
//推送方案材料 //推送方案材料
var rtn = await self.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"SavePartnerSubmitMaterial"); let eNameUrl = settings.enameClientUrl() + "SavePartnerSubmitMaterial";
console.log("url+++++",settings.enameClientUrl()+"SavePartnerSubmitMaterial") let rtn = await self.execClient.execEnamePost(pushObj, eNameUrl);
console.log("rtn+++++",rtn) this.execClientNew.execLogs("serviceProviderSubmitMaterial-execEnamePost:eNameUrl:" + eNameUrl, pushObj, "center-channel-serviceProviderSubmitMaterial", rtn, null);
if (!rtn || !rtn.stdout) { if (rtn && rtn.stdout) {
aliFlag = -200; let pushRes = JSON.parse(rtn.stdout);
}else{ if (pushRes && pushRes.Success && pushRes.Success == true) {
var pushRes = JSON.parse(rtn.stdout); resFlag = 200;
if(pushRes && pushRes.Success && pushRes.Success==true){
aliFlag == 200;
}else{
aliFlag == -200;
} }
} }
} }
if(aliFlag == 200 || baiduFlag == 200){ if (resFlag == 200) {
return system.getResultSuccess(); return system.getResultSuccess();
} }
} }
console.log('rsrsr++++------------++++',res)
return 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){ 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) {
if(actionBody.uapp_id == uappId.ali){ if (actionBody.uapp_id == uappId.ali) {
//推送数据至阿里 //推送数据至阿里
var pushObj = { var pushObj = {
BizId: actionBody.BizId, BizId: actionBody.BizId,
...@@ -700,28 +709,35 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -700,28 +709,35 @@ class BaseCenterOrderService extends AppServiceBase {
ApplicationStatus: actionBody.ApplicationStatus ApplicationStatus: actionBody.ApplicationStatus
}; };
//推送状态变更 //推送状态变更
var ali = await this.aliclient.reqbyget({ action: "AcceptPartnerNotification", reqbody: pushObj, apiVersion: "2019-05-08" }); var ali = await this.aliclient.reqbyget({
console.log('状态变更 ali ----- +++',ali) action: "AcceptPartnerNotification",
if(ali && ali.status == 200){ reqbody: pushObj,
apiVersion: "2019-05-08"
});
console.log('状态变更 ali ----- +++', ali)
if (ali && ali.status == 200) {
var aliFlag = 200 var aliFlag = 200
}else{ } else {
var aliFlag = -200 var aliFlag = -200
} }
} }
if(actionBody.uapp_id == uappId.baidu){ if (actionBody.uapp_id == uappId.baidu) {
// actionBody.ApplicationStatus = baiduIcpStatus[actionBody.ApplicationStatus]; // actionBody.ApplicationStatus = baiduIcpStatus[actionBody.ApplicationStatus];
//推送数据至百度 //推送数据至百度
var pushObj = { var pushObj = {
orderNo: actionBody.orderNo, orderNo: actionBody.orderNo,
status: actionBody.status 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 }); var baidu = await this.baiduclient.baiduReqbyget({
console.log('baidu 推送状态变更 +++++',baidu) path: "/api/bla/provider/license/update",
if(baidu && baidu.data && baidu.data.result){ reqbody: pushObj
});
console.log('baidu 推送状态变更 +++++', baidu)
if (baidu && baidu.data && baidu.data.result) {
var baiduFlag = 200 var baiduFlag = 200
}else{ } else {
var baiduFlag = -200 var baiduFlag = -200
} }
} }
...@@ -735,7 +751,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -735,7 +751,7 @@ class BaseCenterOrderService extends AppServiceBase {
optitle: "serviceProvider2Notification推送ICP材料至渠道方->serviceProvider2Notification", optitle: "serviceProvider2Notification推送ICP材料至渠道方->serviceProvider2Notification",
}); });
} }
if(aliFlag == 200 || baiduFlag == 200){ if (aliFlag == 200 || baiduFlag == 200) {
pushRes.status = 1 pushRes.status = 1
return system.getResultRedisQueueSuccess(); return system.getResultRedisQueueSuccess();
} }
...@@ -744,125 +760,125 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -744,125 +760,125 @@ class BaseCenterOrderService extends AppServiceBase {
//通知交付状态变更-所有渠道状态更改 //通知交付状态变更-所有渠道状态更改
async serviceProviderNotification(pobj) { async serviceProviderNotification(pobj) {
console.log('zhuangtai ++++',pobj) let self = this;
let resFlag = -200;
try {
let res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); let res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
this.execClientNew.execLogs("serviceProviderNotification-reqCenterOrderApi:", pobj, "center-channel-serviceProviderNotification", res, null); this.execClientNew.execLogs("serviceProviderNotification-reqCenterOrderApi:", pobj, "center-channel-serviceProviderNotification", res, null);
if (res && res.status == 0 && res.data) { 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 = {}; var reqPushParams = {};
if(res.data.uapp_id == uappId.ali){ if (res.data.uapp_id == uappId.ali) {
//推送数据至阿里 //推送数据至阿里
reqPushParams = { reqPushParams = {
actionBody: { actionBody: {
uapp_id:res.data.uapp_id, uapp_id: res.data.uapp_id,
BizId: res.data.BizId, BizId: res.data.BizId,
OfficialFileURL: res.data.OfficialFileURL, OfficialFileURL: res.data.OfficialFileURL,
ApplicationStatus: res.data.ApplicationStatus 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]; res.data.ApplicationStatus = baiduIcpStatus[res.data.ApplicationStatus];
//推送数据至百度 //推送数据至百度
reqPushParams = { reqPushParams = {
actionBody:{ actionBody: {
uapp_id:res.data.uapp_id, uapp_id: res.data.uapp_id,
orderNo: res.data.channelOrderNo, orderNo: res.data.channelOrderNo,
status: res.data.ApplicationStatus status: res.data.ApplicationStatus
}, },
appInfo:pobj.appInfo appInfo: pobj.appInfo
} }
} }
await this.utilsPushSve.business2Channel(reqPushParams, "serviceProvider2Notification"); await this.utilsPushSve.business2Channel(reqPushParams, "serviceProvider2Notification");
// console.log('reqPushParams+++-状态变更--++++----',reqPushParams) } else {
// console.log('result+++-状态变更--++++----',result) if (res.data.uapp_id == uappId.ali) {
}else{
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;
//推送数据至易名 //推送数据至易名
var pushObj = { let 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
}; };
var rtn = await this.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"AcceptPartnerNotification"); let eNameUrl = settings.enameClientUrl() + "AcceptPartnerNotification";
console.log("url+++++",settings.enameClientUrl()+"AcceptPartnerNotification") let rtn = await self.execClient.execEnamePost(pushObj, eNameUrl);
console.log("rtn+++++",rtn) this.execClientNew.execLogs("serviceProviderNotification-execEnamePost:eNameUrl:" + eNameUrl, pushObj, "center-channel-serviceProviderNotification", rtn, null);
if (!rtn || !rtn.stdout) { if (rtn && rtn.stdout) {
enameFlag = -200; let pushRes = JSON.parse(rtn.stdout);
}else{ if (pushRes && pushRes.Success && pushRes.Success == true) {
var pushRes = JSON.parse(rtn.stdout); resFlag = 200;
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)
//推送数据至百度 //推送数据至百度
var pushObj = { let pushObj = {
orderNo: res.data.channelOrderNo, orderNo: res.data.channelOrderNo,
status: res.data.ApplicationStatus status: res.data.ApplicationStatus
}; };
//推送状态变更 //推送状态变更
var baidu = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj }); let baiduParams = {
this.execClientNew.execLogs("serviceProviderNotification-baiduReqbyget:", pushObj, "center-channel-serviceProviderNotification", baidu, null); path: "/api/bla/provider/license/update",
if(baidu && baidu.data && baidu.data.result){ reqbody: pushObj
var baiduFlag = 200 }
}else{ let baidu = await this.baiduclient.baiduReqbyget(baiduParams);
var baiduFlag = -200 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; 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;
} }
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 //易名退款,关闭订单 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
...@@ -873,19 +889,19 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -873,19 +889,19 @@ class BaseCenterOrderService extends AppServiceBase {
if (res.status < 0) { if (res.status < 0) {
return system.getResultFail(-5022, "订单关闭失败"); return system.getResultFail(-5022, "订单关闭失败");
} }
console.log('delOrder---',res) console.log('delOrder---', res)
if (res && res.status == 0 && res.data && res.data.channelOrderNo) { if (res && res.status == 0 && res.data && res.data.channelOrderNo) {
pushObj = { pushObj = {
OrderNo:res.data.channelOrderNo, OrderNo: res.data.channelOrderNo,
Note:note Note: note
} }
console.log('eNameCloseOrder+++pushObj----',pushObj) console.log('eNameCloseOrder+++pushObj----', pushObj)
var rtn = await this.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"CloseOrder"); var rtn = await this.execClient.execEnamePost(pushObj, settings.enameClientUrl() + "CloseOrder");
console.log('eNameCloseOrder+++rtn----',rtn) console.log('eNameCloseOrder+++rtn----', rtn)
if(rtn && rtn.stdout){ if (rtn && rtn.stdout) {
var pushRes = JSON.parse(rtn.stdout); var pushRes = JSON.parse(rtn.stdout);
if(pushRes && pushRes.Success && pushRes.Success==true){ if (pushRes && pushRes.Success && pushRes.Success == true) {
console.log('ename----',pushRes) console.log('ename----', pushRes)
return pushRes return pushRes
} }
} }
...@@ -893,4 +909,5 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -893,4 +909,5 @@ class BaseCenterOrderService extends AppServiceBase {
return res return res
} }
} }
module.exports = BaseCenterOrderService; module.exports = BaseCenterOrderService;
\ No newline at end of file
...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment