Commit bd2b7795 by 蒋勇

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents c97e2e81 3de5a10d
var APIBase = require("../../api.base"); var APIBase = require("../../api.base");
var system = require("../../../system"); var system = require("../../../system");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
class QcAPI extends APIBase { class QcAPI extends APIBase {
constructor() { constructor() {
super(); super();
...@@ -9,12 +10,13 @@ class QcAPI extends APIBase { ...@@ -9,12 +10,13 @@ class QcAPI extends APIBase {
this.ncSve = system.getObject("service.common.ncSve"); this.ncSve = system.getObject("service.common.ncSve");
this.rtSve = system.getObject("service.common.rtSve"); this.rtSve = system.getObject("service.common.rtSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
* action_process 执行的流程 * action_process 执行的流程
* action_type 执行的类型 * action_type 执行的类型
* action_body 执行的参数 * action_body 执行的参数
*/ */
async springBoard(pobj, qobj, req) { async springBoard(pobj, qobj, req) {
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空"); return system.getResult(null, "actionType参数不能为空");
...@@ -22,6 +24,7 @@ class QcAPI extends APIBase { ...@@ -22,6 +24,7 @@ class QcAPI extends APIBase {
var result = await this.opActionProcess(pobj, pobj.actionType, req); var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result; return result;
} }
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
...@@ -55,7 +58,7 @@ class QcAPI extends APIBase { ...@@ -55,7 +58,7 @@ class QcAPI extends APIBase {
case "closeOrderDelivery"://交付商关闭交付单 case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj); opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj);
break; break;
// 2021-3-23 laolan 易名退款 // 2021-3-23 laolan 易名退款
case "eNameCloseOrder": case "eNameCloseOrder":
opResult = await this.baseOrderSve.eNameCloseOrder(pobj); opResult = await this.baseOrderSve.eNameCloseOrder(pobj);
...@@ -71,7 +74,7 @@ class QcAPI extends APIBase { ...@@ -71,7 +74,7 @@ class QcAPI extends APIBase {
case "ncSubmitSolution"://提交方案(网文)2020-11-11 case "ncSubmitSolution"://提交方案(网文)2020-11-11
opResult = await this.ncSve.ncSubmitSolution(pobj); opResult = await this.ncSve.ncSubmitSolution(pobj);
break; break;
// --------- 广电 --------- // --------- 广电 ---------
...@@ -85,7 +88,7 @@ class QcAPI extends APIBase { ...@@ -85,7 +88,7 @@ class QcAPI extends APIBase {
opResult = await this.rtSve.rtSubmitSolution(pobj); opResult = await this.rtSve.rtSubmitSolution(pobj);
break; break;
// --------- 推送icp信息至渠道和作方 zhuangbing-20201116-------- // --------- 推送icp信息至渠道和作方 zhuangbing-20201116--------
case "pushIcpSolution2Channel"://推送ICP方案至渠道(百度) case "pushIcpSolution2Channel"://推送ICP方案至渠道(百度)
opResult = await this.baseOrderSve.pushIcpSolution2Channel(pobj); opResult = await this.baseOrderSve.pushIcpSolution2Channel(pobj);
break; break;
...@@ -97,4 +100,5 @@ class QcAPI extends APIBase { ...@@ -97,4 +100,5 @@ class QcAPI extends APIBase {
} }
} }
module.exports = QcAPI; module.exports = QcAPI;
\ No newline at end of file
...@@ -21,44 +21,21 @@ class Order extends APIBase { ...@@ -21,44 +21,21 @@ class Order extends APIBase {
if (!pobj.orderNo) { if (!pobj.orderNo) {
return regCfg.getResultFail("orderNo不能为空"); return regCfg.getResultFail("orderNo不能为空");
} }
// var i = 0;
// var orderLength = pobj.subOrderList.lenght;
// for (i = 0; i <= orderLength; i++) {
// if (!pobj.subOrderList[i].orderNo) {
// return regCfg.getResultFail("orderNo不能为空");
// }
// if (pobj.isDirectBuy == 0 && !pobj.subOrderList[i].bizId) {
// return regCfg.getResultFail("非直接下单bizId不能为空");
// }
// if (pobj.isDirectBuy == 1 && !pobj.subOrderList[i].phone) {
// return regCfg.getResultFail("直接下单phone不能为空");
// }
// if (pobj.isDirectBuy == 1 && !pobj.subOrderList[i].consultType) {
// return regCfg.getResultFail("直接下单consultType不能为空");
// }
// // if (pobj.subOrderList[i].area) {
// // pobj.subOrderList[i].area = regCfg.baiduArea[pobj.subOrderList[i].area]
// // }
// if (!pobj.subOrderList[i].area) {
// return regCfg.getResultFail("area参数错误");
// }
// }
if (!pobj.orderNo) { if (!pobj.orderNo) {
return regCfg.getResultFail("orderNo不能为空"); return regCfg.getResultFail("orderNo不能为空");
} }
if (pobj.isDirectBuy==0 && !pobj.bizId) { if (pobj.isDirectBuy == 0 && !pobj.bizId) {
return regCfg.getResultFail("非直接下单bizId不能为空"); return regCfg.getResultFail("非直接下单bizId不能为空");
} }
if (pobj.isDirectBuy==1 && !pobj.phone) { if (pobj.isDirectBuy == 1 && !pobj.phone) {
return regCfg.getResultFail("直接下单phone不能为空"); return regCfg.getResultFail("直接下单phone不能为空");
} }
if (pobj.isDirectBuy==1 && !pobj.consultType) { if (pobj.isDirectBuy == 1 && !pobj.consultType) {
return regCfg.getResultFail("直接下单consultType不能为空"); return regCfg.getResultFail("直接下单consultType不能为空");
} }
if (pobj.area) { if (pobj.area) {
pobj.area = regCfg.baiduArea[pobj.area] pobj.area = regCfg.baiduArea[pobj.area]
} }
pobj.status = 1; pobj.status = 1;
pobj.action_type = "regOrderStatus"; pobj.action_type = "regOrderStatus";
...@@ -98,4 +75,5 @@ class Order extends APIBase { ...@@ -98,4 +75,5 @@ class Order extends APIBase {
} }
} }
module.exports = Order; module.exports = Order;
\ No newline at end of file
//百度配置 //百度配置
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
var regCfg = { var regCfg = {
//工商注册城市对照表 //工商注册城市对照表
baiduArea : { baiduArea: {
"310100":"上海", "310100": "上海",
"441900":"东莞", "441900": "东莞",
"440600":"佛山", "440600": "佛山",
"110100":"北京", "110100": "北京",
"320100":"南京", "320100": "南京",
"360100":"南昌", "360100": "南昌",
"320600":"南通", "320600": "南通",
"331000":"台州", "331000": "台州",
"340100":"合肥", "340100": "合肥",
"330400":"嘉兴", "330400": "嘉兴",
"210200":"大连", "210200": "大连",
"120100":"天津", "120100": "天津",
"140100":"太原", "140100": "太原",
"330200":"宁波", "330200": "宁波",
"320400":"常州", "320400": "常州",
"440100":"广州", "440100": "广州",
"320300":"徐州", "320300": "徐州",
"510100":"成都", "510100": "成都",
"321000":"扬州", "321000": "扬州",
"320200":"无锡", "320200": "无锡",
"530100":"昆明", "530100": "昆明",
"330100":"杭州", "330100": "杭州",
"420100":"武汉", "420100": "武汉",
"210100":"沈阳", "210100": "沈阳",
"370100":"济南", "370100": "济南",
"440300":"深圳", "440300": "深圳",
"330300":"温州", "330300": "温州",
"370600":"烟台", "370600": "烟台",
"350100":"福州", "350100": "福州",
"330600":"绍兴", "330600": "绍兴",
"320500":"苏州", "320500": "苏州",
"610100":"西安", "610100": "西安",
"520100":"贵阳", "520100": "贵阳",
"410100":"郑州", "410100": "郑州",
"500100":"重庆", "500100": "重庆",
"330700":"金华", "330700": "金华",
"220100":"长春", "220100": "长春",
"430100":"长沙", "430100": "长沙",
"370200":"青岛", "370200": "青岛",
"410200":"开封", "410200": "开封",
"230100":"哈尔滨", "230100": "哈尔滨",
"130100":"石家庄", "130100": "石家庄",
"350200":"厦门", "350200": "厦门",
"360400":"九江", "360400": "九江",
"410300":"洛阳", "410300": "洛阳",
"411000":"许昌", "411000": "许昌",
"411600":"周口", "411600": "周口",
"411300":"南阳", "411300": "南阳",
"420500":"宜昌", "420500": "宜昌",
"420600":"襄阳", "420600": "襄阳",
"430600":"岳阳", "430600": "岳阳",
"430700":"常德", "430700": "常德",
"440700":"江门", "440700": "江门",
"440400":"珠海", "440400": "珠海",
"440900":"茂名", "440900": "茂名",
"441300":"惠州", "441300": "惠州",
"442000":"中山", "442000": "中山",
"450100":"南宁", "450100": "南宁",
"460100":"海口", "460100": "海口",
"460200":"三亚", "460200": "三亚",
"510700":"绵阳", "510700": "绵阳",
"540100":"拉萨", "540100": "拉萨",
"130600":"保定", "130600": "保定",
"130200":"唐山", "130200": "唐山",
"140200":"大同", "140200": "大同",
"1501":"呼和浩特", "1501": "呼和浩特",
"341200":"阜阳" "341200": "阜阳",
"CPF009": "北京朝阳区",
"CPF010": "北京海淀区",
"CPF011": "北京丰台区",
"CPF012": "北京东城区",
"CPF013": "北京西城区",
"CPF014": "北京昌平区",
"CPF015": "北京通州区",
"CPF016": "北京怀柔区",
"CPF017": "北京石景山区",
"CPF018": "北京平谷区",
"CPF019": "北京顺义区",
"CPF020": "北京房山区",
"CPF021": "北京门头沟区",
"CPF022": "北京密云区",
"CPF023": "北京大兴区",
"CP0024": "北京顺义园区",
"CP0025": "北京房山园区"
}, },
baiduAreaCode : { baiduAreaCode: {
"上海": "310100", "上海": "310100",
"东莞": "441900", "东莞": "441900",
"佛山": "440600", "佛山": "440600",
"北京": "110100", "北京": "110100",
"南京": "320100", "南京": "320100",
"南昌": "360100", "南昌": "360100",
"南通": "320600", "南通": "320600",
"台州": "331000", "台州": "331000",
"合肥": "340100", "合肥": "340100",
"嘉兴": "330400", "嘉兴": "330400",
"大连": "210200", "大连": "210200",
"天津": "120100", "天津": "120100",
"太原": "140100", "太原": "140100",
"宁波": "330200", "宁波": "330200",
"常州": "320400", "常州": "320400",
"广州": "440100", "广州": "440100",
"徐州": "320300", "徐州": "320300",
"成都": "510100", "成都": "510100",
"扬州": "321000", "扬州": "321000",
"无锡": "320200", "无锡": "320200",
"昆明": "530100", "昆明": "530100",
"杭州": "330100", "杭州": "330100",
"武汉": "420100", "武汉": "420100",
"沈阳": "210100", "沈阳": "210100",
"济南": "370100", "济南": "370100",
"深圳": "440300", "深圳": "440300",
"温州": "330300", "温州": "330300",
"烟台": "370600", "烟台": "370600",
"福州": "350100", "福州": "350100",
"绍兴": "330600", "绍兴": "330600",
"苏州": "320500", "苏州": "320500",
"西安": "610100", "西安": "610100",
"贵阳": "520100", "贵阳": "520100",
"郑州": "410100", "郑州": "410100",
"重庆": "500100", "重庆": "500100",
"金华": "330700", "金华": "330700",
"长春": "220100", "长春": "220100",
"长沙": "430100", "长沙": "430100",
"青岛": "370200", "青岛": "370200",
"开封": "410200", "开封": "410200",
"哈尔滨":"230100", "哈尔滨": "230100",
"石家庄":"130100", "石家庄": "130100",
"厦门":"350200", "厦门": "350200",
"九江":"360400", "九江": "360400",
"洛阳":"410300", "洛阳": "410300",
"许昌":"411000", "许昌": "411000",
"周口":"411600", "周口": "411600",
"南阳":"411300", "南阳": "411300",
"宜昌":"420500", "宜昌": "420500",
"襄阳":"420600", "襄阳": "420600",
"岳阳":"430600", "岳阳": "430600",
"常德":"430700", "常德": "430700",
"江门":"440700", "江门": "440700",
"珠海":"440400", "珠海": "440400",
"茂名":"440900", "茂名": "440900",
"惠州":"441300", "惠州": "441300",
"中山":"442000", "中山": "442000",
"南宁":"450100", "南宁": "450100",
"海口":"460100", "海口": "460100",
"三亚":"460200", "三亚": "460200",
"绵阳":"510700", "绵阳": "510700",
"拉萨":"540100", "拉萨": "540100",
"保定":"130600", "保定": "130600",
"唐山":"130200", "唐山": "130200",
"大同":"140200", "大同": "140200",
"呼和浩特":"150100", "呼和浩特": "150100",
"阜阳":"341200" "阜阳": "341200",
}, "北京朝阳区": "CPF009",
channelTypeCode : { "北京海淀区": "CPF010",
"GSREG" : "baidu.gsreg", "北京丰台区": "CPF011",
"KZFW" : "baidu.kzfw", "北京东城区": "CPF012",
"GSCHANGS" : "baidu.gsbg", "北京西城区": "CPF013",
"GSNB" : "baidu.gsnb", "北京昌平区": "CPF014",
"SKSQ" : "baidu.sksq", "北京通州区": "CPF015",
"SWBD" : "baidu.swbd" "北京怀柔区": "CPF016",
}, "北京石景山区": "CPF017",
"北京平谷区": "CPF018",
"北京顺义区": "CPF019",
"北京房山区": "CPF020",
"北京门头沟区": "CPF021",
"北京密云区": "CPF022",
"北京大兴区": "CPF023",
"北京顺义园区": "CP0024",
"北京房山园区": "CP0025"
},
channelTypeCode: {
"GSREG": "baidu.gsreg",
"KZFW": "baidu.kzfw",
"GSCHANGS": "baidu.gsbg",
"GSNB": "baidu.gsnb",
"SKSQ": "baidu.sksq",
"SWBD": "baidu.swbd",
"QYJYTC3":"baidu_qyjytc3",
"QYJYTC4":"baidu_qyjytc4",
"QYJYTC5":"baidu_qyjytc5"
},
//区分渠道的uappid //区分渠道的uappid
uappId : { uappId: {
'baidu':44, 'baidu': 44,
'zhogxiaowei': 38 'zhogxiaowei': 38
}, },
//交付状态 //交付状态
deliverRegStatus:{ deliverRegStatus: {
'RECEIVED': 'RECEIVED',//已接单 'RECEIVED': 'RECEIVED',//已接单
'COLLECTING': 'COLLECTING',//材料收集环节 'COLLECTING': 'COLLECTING',//材料收集环节
'AUDITING': 'AUDITING',//工商审核环节 'AUDITING': 'AUDITING',//工商审核环节
...@@ -163,8 +200,8 @@ var regCfg = { ...@@ -163,8 +200,8 @@ var regCfg = {
'SUCCESS': 'SUCCESS', //已完成 'SUCCESS': 'SUCCESS', //已完成
'ACTIVE': 'ACTIVE' //服务中 'ACTIVE': 'ACTIVE' //服务中
}, },
//交付状态 //交付状态
deliverStatus:{ deliverStatus: {
'RECEIVED': '已接单',// 'RECEIVED': '已接单',//
'COLLECTING': '材料收集环节',// 'COLLECTING': '材料收集环节',//
'AUDITING': '工商审核环节',// 'AUDITING': '工商审核环节',//
...@@ -180,19 +217,19 @@ var regCfg = { ...@@ -180,19 +217,19 @@ var regCfg = {
}, },
getResultSuccess(requestId) { getResultSuccess(requestId) {
return { return {
"status": 0, "status": 0,
"msg": "success", "msg": "success",
"data":null, "data": null,
"requestId": requestId "requestId": requestId
}; };
}, },
getResultFail(errmsg) { getResultFail(errmsg) {
return { return {
"status":-1, "status": -1,
"msg": errmsg, "msg": errmsg,
"requestId": this.getUUID(), "requestId": this.getUUID(),
"data":null, "data": null,
"bizmsg":"empty" "bizmsg": "empty"
}; };
} }
} }
......
...@@ -3,892 +3,949 @@ var settings = require("../../../../config/settings"); ...@@ -3,892 +3,949 @@ 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.centerOrderUrl = settings.centerOrderUrl(); this.execClientNew = system.getObject("util.execClientNew");
this.execClient = system.getObject("util.execClient"); this.centerOrderUrl = settings.centerOrderUrl();
this.aliclient = system.getObject("util.aliyunClient"); this.execClient = system.getObject("util.execClient");
this.cacheManager = system.getObject("db.common.cacheManager"); this.aliclient = system.getObject("util.aliyunClient");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve"); this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve"); this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");//测试用 this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.opPushQueueUrl = settings.opPushQueueUrl(); this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");//测试用
this.baiduclient = system.getObject("util.baiduClient"); this.opPushQueueUrl = settings.opPushQueueUrl();
this.utils360Sve = system.getObject("service.utilsSve.utils360Sve") this.baiduclient = system.getObject("util.baiduClient");
}; this.utils360Sve = system.getObject("service.utilsSve.utils360Sve")
//调用center-order };
async reqCenterOrderApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/qcapi/springBoard";
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);
}
if(needinfo.uapp_id == uappId.baidu){
//推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里
solution.Area = cityLetter[solution.Area]
console.log('solution.Area++',solution.Area)
var pushObj = {
requirementId: needinfo.channelNeedNo,
companyName: solution.CompanyName,
companyAddress: solution.CompanyAddress,
area: solution.Area,
type:solution.IcpType
};
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 rtn = await this.execClient.execPost(pobj, url);
//推送数据至易名 var data = JSON.parse(rtn.stdout);
// var bizType = needinfo.channelTypeCode;//业务类型里 return data;
// solution.Area = cityLetter[solution.Area] }
console.log('solution.Area++',solution.Area)
console.log('solution++',solution) //提交Icp注册方案
var pushObj = { async submitIcpProgramme(pobj) {
IntentionBizId: needinfo.channelNeedNo, console.log('提交Icp注册方案---', pobj)
CompanyName: solution.CompanyName, var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
CompanyAddress: solution.CompanyAddress, if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) {
Area: solution.Area, var needinfo = res.data.needinfo;//需求信息
IcpType:solution.IcpType var needsolution = res.data.needsolution;//方案信息
}; var ab = pobj.actionBody;
if (needsolution.channelSolutionNo) { if (typeof (ab.solutionContent) == "string") {
pushObj["BizId"] = needsolution.channelSolutionNo; ab.solutionContent = JSON.parse(ab.solutionContent);
} }
console.log('pushObj++',pushObj); if (typeof (needsolution.solutionContent) == "string") {
var pushIcpSolutionRes = await this.pushEnameIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self); 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);
}
if (needinfo.uapp_id == uappId.baidu) {
//推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里
solution.Area = cityLetter[solution.Area]
console.log('solution.Area++', solution.Area)
var pushObj = {
requirementId: needinfo.channelNeedNo,
companyName: solution.CompanyName,
companyAddress: solution.CompanyAddress,
area: solution.Area,
type: solution.IcpType
};
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;
}
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");
} }
this.logCtl.info({ return res;
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;
}
//推送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(); //推送ICP方案ali
async pushIcpSolution(pushObj, solutionNo, appInfo, self) {
//推送方案信息
var pushRes = await self.aliclient.reqbyget({
action: "SubmitIcpSolution",
reqbody: pushObj,
apiVersion: "2019-05-08"
});
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
if (resData.BizId) {
var reqObj2 = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
solutionBizId: resData.BizId
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
if (a && a.status == 0) {
//推送方案确认信息
var confirmRes = await self.aliclient.reqbyget({
action: "ConfirmIntention",
reqbody: {BizId: pushObj.IntentionBizId},
apiVersion: "2019-05-08"
});
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;
}
}
}
return pushRes;
} }
return pushRes;
}
//推送ICP方案ali //推送ICP方案易名 2021-02-25 庄冰
async pushIcpSolution(pushObj, solutionNo, appInfo, self) { async pushEnameIcpSolution(pushObj, solutionNo, appInfo, self) {
//推送方案信息 console.log('pushObj++Ename+++', pushObj);
var pushRes = await self.aliclient.reqbyget({ action: "SubmitIcpSolution", reqbody: pushObj, apiVersion: "2019-05-08" }); //推送方案信息
if (pushRes && pushRes.status == 0 && pushRes.data) { var rtn = await self.execClient.execEnamePost(pushObj, settings.enameClientUrl() + "SubmitIcpSolution");
var resData = pushRes.data; console.log("url+++++", settings.enameClientUrl() + "SubmitIcpSolution")
if (resData.BizId) { console.log("rtn+++++", rtn)
var reqObj2 = { if (!rtn || !rtn.stdout) {
actionType: "receiveProgrammeNo", return system.getResult(null, "execPost data is empty");
appInfo: appInfo, }
actionBody: { var pushRes = JSON.parse(rtn.stdout);
solutionNo: solutionNo,
solutionBizId: resData.BizId // var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj });
} console.log("pushRes++++", pushRes)
}; if (pushRes && pushRes.ErrorCode == "200" && pushRes.Success == true && pushRes.BizId) {
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id var reqObj2 = {
if (a && a.status == 0) { actionType: "receiveProgrammeNo",
//推送方案确认信息
var confirmRes = await self.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
if (confirmRes && confirmRes.status == 0 && confirmRes.data) {
var confirmResData = confirmRes.data;
if (confirmResData.ConfirmUrl) {
var reqObj3 = {
actionType: "receiveIcpConfirmUrl",
appInfo: appInfo, appInfo: appInfo,
actionBody: { actionBody: {
solutionNo: solutionNo, solutionNo: solutionNo,
confirmUrl: confirmResData.ConfirmUrl solutionBizId: pushRes.BizId
} }
}; };
var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url 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 confirmRes;
} }
} return pushRes;
} }
return pushRes;
}
//推送ICP方案易名 2021-02-25 庄冰 //推送ICP方案baidu 2020-10-26 laolan
async pushEnameIcpSolution(pushObj, solutionNo, appInfo, self) { async pushBaiduIcpSolution(pushObj, solutionNo, appInfo, self) {
console.log('pushObj++Ename+++',pushObj); console.log('pushObj++baidu+++', pushObj)
//推送方案信息 //推送方案信息
var rtn = await self.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"SubmitIcpSolution"); var pushRes = await self.baiduclient.baiduReqbyget({path: "/api/bla/provider/plan", reqbody: pushObj});
console.log("url+++++",settings.enameClientUrl()+"SubmitIcpSolution") console.log("pushRes++++", pushRes)
console.log("rtn+++++",rtn) if (pushRes && pushRes.status == 0 && pushRes.data) {
if (!rtn || !rtn.stdout) { var resData = pushRes.data;
return system.getResult(null, "execPost data is empty"); if (resData.planId) {
} var reqObj2 = {
var pushRes = JSON.parse(rtn.stdout); actionType: "receiveProgrammeNo",
appInfo: appInfo,
// var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj }); actionBody: {
console.log("pushRes++++",pushRes) solutionNo: solutionNo,
if (pushRes && pushRes.ErrorCode == "200" && pushRes.Success==true && pushRes.BizId) { solutionBizId: resData.planId
var reqObj2 = { }
actionType: "receiveProgrammeNo", };
appInfo: appInfo, var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
actionBody: { console.log("保存渠道方案id aaaa++ ", a)
solutionNo: solutionNo, if (a && a.status == 0 && resData.path) {
solutionBizId: pushRes.BizId var reqObj3 = {
} actionType: "receiveIcpConfirmUrl",
}; appInfo: appInfo,
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id actionBody: {
console.log("保存渠道方案id aaaa++ ",a) solutionNo: solutionNo,
if (a && a.status == 0 && pushRes.ConfirmUrl) { confirmUrl: resData.path
var reqObj3 = { }
actionType: "receiveIcpConfirmUrl", };
appInfo: appInfo, var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
actionBody: { console.log('save confirmUrl ++ ', url)
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
async pushBaiduIcpSolution(pushObj, solutionNo, appInfo, self) {
console.log('pushObj++baidu+++',pushObj)
//推送方案信息
var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj });
console.log("pushRes++++",pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
if (resData.planId) {
var reqObj2 = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
solutionBizId: resData.planId
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
console.log("保存渠道方案id aaaa++ ",a)
if (a && a.status == 0 && resData.path) {
var reqObj3 = {
actionType: "receiveIcpConfirmUrl",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
confirmUrl: resData.path
} }
};
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) { 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 {
if (res && res.status == 0 && res.data) { let res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
var needsolution = res.data;//方案信息 this.execClientNew.execLogs("serviceProviderSubmitMaterial-reqCenterOrderApi:", pobj, "center-channel-serviceProviderSubmitMaterial", res, null);
var ab = pobj.actionBody; if (res && res.status == 0 && res.data) {
if (typeof (ab.material) == "string") { let needsolution = res.data;//方案信息
ab.material = JSON.parse(ab.material); let ab = pobj.actionBody;
} if (typeof (ab.material) == "string") {
var material = ab.material; ab.material = JSON.parse(ab.material);
var reqPushParams = {}; }
if(ab.isTest && ab.isTest==1){ let material = ab.material;
if(res.data.uapp_id == uappId.ali){ let reqPushParams = {};
//推送数据至阿里 if (ab.isTest && ab.isTest == 1) {
var BizId = needsolution.channelSolutionNo;//⽅案业务ID if (res.data.uapp_id == uappId.ali) {
//推送数据至阿里
reqPushParams = { let BizId = needsolution.channelSolutionNo;//⽅案业务ID
actionBody: { reqPushParams = {
"uapp_id":res.data.uapp_id, actionBody: {
"BizId": BizId, "uapp_id": res.data.uapp_id,
"Domain": material.Domain, "BizId": BizId,
"CorporateName": material.CorporateName, "Domain": material.Domain,
"IncludeForeignInvestment": material.IncludeForeignInvestment, "CorporateName": material.CorporateName,
"PartnerBusinessLicense": material.PartnerBusinessLicense, "IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerIdCardList": material.PartnerIdCardList, "PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerDomainCertificate": material.PartnerDomainCertificate, "PartnerIdCardList": material.PartnerIdCardList,
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [], "PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPlan": material.PartnerPlan || "", "PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerForeignInvestment": material.PartnerForeignInvestment || "", "PartnerPlan": material.PartnerPlan || "",
"PartnerLaw": material.PartnerLaw || "", "PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerStampOtherList": material.PartnerStampOtherList || [], "PartnerLaw": material.PartnerLaw || "",
"PartnerSignOtherList": material.PartnerSignOtherList || [], "PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || [] "PartnerSignOtherList": material.PartnerSignOtherList || [],
}, "PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
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, "includeForeignInvestment": material.IncludeForeignInvestment,
"includeForeignInvestment": material.IncludeForeignInvestment, "orderNo": BizId,
"orderNo": BizId, "partnerForeignInvestment": material.PartnerForeignInvestment || "",
"partnerForeignInvestment": material.PartnerForeignInvestment || "", "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 || [] },
}, appInfo: pobj.appInfo
appInfo: pobj.appInfo }
} }
} await this.utilsPushSve.business2Channel(reqPushParams, "serviceProviderSubmit2Material");
await this.utilsPushSve.business2Channel(reqPushParams, "serviceProviderSubmit2Material"); } else {
// console.log('result+++-cailiao--++++----',result) if (res.data.uapp_id == uappId.ali) {
// console.log('result+++-reqPushParams--++++----',reqPushParams) //推送数据至阿里
}else{ let BizId = needsolution.channelSolutionNo;//⽅案业务ID
if(res.data.uapp_id == uappId.ali){ let pushObj = {
//推送数据至阿里 "CompanyName": material.CompanyName,
var BizId = needsolution.channelSolutionNo;//⽅案业务ID "BizId": BizId,
var pushObj = { "Domain": material.Domain,
"CompanyName":material.CompanyName, "CorporateName": material.CorporateName,
"BizId": BizId, "IncludeForeignInvestment": material.IncludeForeignInvestment,
"Domain": material.Domain, "PartnerBusinessLicense": material.PartnerBusinessLicense,
"CorporateName": material.CorporateName, "PartnerIdCardList": material.PartnerIdCardList,
"IncludeForeignInvestment": material.IncludeForeignInvestment, "PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerBusinessLicense": material.PartnerBusinessLicense, "PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerIdCardList": material.PartnerIdCardList, "PartnerPlan": material.PartnerPlan || "",
"PartnerDomainCertificate": material.PartnerDomainCertificate, "PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [], "PartnerLaw": material.PartnerLaw || "",
"PartnerPlan": material.PartnerPlan || "", "PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerForeignInvestment": material.PartnerForeignInvestment || "", "PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerLaw": material.PartnerLaw || "", "PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
"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){ //推送方案材料
//推送数据至百度 let aliParams = {
var BizId = needsolution.orderChannelNo; action: "SavePartnerSubmitMaterial",
console.log('BizId++',BizId) reqbody: pushObj,
var pushObj = { apiVersion: "2019-05-08"
"businessLicense" : { }
"createdAt" : material.BusinessLicense.CreatedAt || "", let ali = await self.aliclient.reqbyget(aliParams);
"enterpriseCode" :material.BusinessLicense.EnterpriseCode || "", this.execClientNew.execLogs("serviceProviderSubmitMaterial-aliclient:", aliParams, "center-channel-serviceProviderSubmitMaterial", ali, null);
"legalRepresentative" :material.BusinessLicense.LegalRepresentative || "", if (ali && ali.status == 200) {
"address" :material.BusinessLicense.Address || "", resFlag = 200
"registeredCapital" : material.BusinessLicense.RegisteredCapital || "", }
"name" :material.BusinessLicense.Name || "", }
"businessTerm" :material.BusinessLicense.BusinessTerm || "",
"type" : material.BusinessLicense.Type || "",
"scopeBusiness" :material.BusinessLicense.ScopeBusiness || ""
},
"partnerForeignInvestment": material.PartnerForeignInvestment || "",
"orderNo": BizId,
"domain": material.Domain,
"corporateName": material.CorporateName,
"includeForeignInvestment": material.IncludeForeignInvestment,
"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 || []
};
var self = this;
//推送方案材料
var baidu = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('baidu tui ziliao +++++',baidu)
console.log('baidu pushObj ziliao +++++',pushObj)
if(baidu && baidu.data && baidu.data.result){
var baiduFlag = 200
}else{
var baiduFlag = -200
}
}
if(res.data.uapp_id == uappId.ename){ if (res.data.uapp_id == uappId.baidu) {
var aliFlag = -200; //推送数据至百度
//推送数据至易名 let BizId = needsolution.orderChannelNo;
var BizId = needsolution.channelSolutionNo;//⽅案业务ID let pushObj = {
var pushObj = { "businessLicense": {
"CompanyName":material.CompanyName, "createdAt": material.BusinessLicense.CreatedAt || "",
// "BizId": BizId, "enterpriseCode": material.BusinessLicense.EnterpriseCode || "",
"OrderNo": BizId, "legalRepresentative": material.BusinessLicense.LegalRepresentative || "",
"Domain": material.Domain, "address": material.BusinessLicense.Address || "",
"CorporateName": material.CorporateName, "registeredCapital": material.BusinessLicense.RegisteredCapital || "",
"IncludeForeignInvestment": material.IncludeForeignInvestment, "name": material.BusinessLicense.Name || "",
"PartnerBusinessLicense": material.PartnerBusinessLicense, "businessTerm": material.BusinessLicense.BusinessTerm || "",
"PartnerIdCardList": material.PartnerIdCardList, "type": material.BusinessLicense.Type || "",
"PartnerDomainCertificate": material.PartnerDomainCertificate, "scopeBusiness": material.BusinessLicense.ScopeBusiness || ""
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [], },
"PartnerPlan": material.PartnerPlan || "", "partnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerForeignInvestment": material.PartnerForeignInvestment || "", "orderNo": BizId,
"PartnerLaw": material.PartnerLaw || "", "domain": material.Domain,
"PartnerStampOtherList": material.PartnerStampOtherList || [], "corporateName": material.CorporateName,
"PartnerSignOtherList": material.PartnerSignOtherList || [], "includeForeignInvestment": material.IncludeForeignInvestment,
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || [], "partnerBusinessLicense": material.PartnerBusinessLicense,
"BusinessLicense" : { "partnerIdCardList": material.PartnerIdCardList,
"CreatedAt" : material.BusinessLicense.CreatedAt || "", "partnerDomainCertificate": material.PartnerDomainCertificate,
"EnterpriseCode" :material.BusinessLicense.EnterpriseCode || "", "partnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"LegalRepresentative" :material.BusinessLicense.LegalRepresentative || "", "partnerPlan": material.PartnerPlan || "",
"Address" :material.BusinessLicense.Address || "", "partnerLaw": material.PartnerLaw || "",
"RegisteredCapital" : material.BusinessLicense.RegisteredCapital || "", "partnerStampOtherList": material.PartnerStampOtherList || [],
"Name" :material.BusinessLicense.Name || "", "partnerSignOtherList": material.PartnerSignOtherList || [],
"BusinessTerm" :material.BusinessLicense.BusinessTerm || "", "partnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
"Type" : material.BusinessLicense.Type || "", };
"ScopeBusiness" :material.BusinessLicense.ScopeBusiness || "" //推送方案材料
}, let baiduParams = {path: "/api/bla/provider/license/material", reqbody: pushObj}
}; let baidu = await self.baiduclient.baiduReqbyget(baiduParams);
var self = this; this.execClientNew.execLogs("serviceProviderSubmitMaterial-baiduReqbyget:", baiduParams, "center-channel-serviceProviderSubmitMaterial", baidu, null);
//推送方案材料 if (baidu && baidu.data && baidu.data.result) {
var rtn = await self.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"SavePartnerSubmitMaterial"); resFlag = 200
console.log("url+++++",settings.enameClientUrl()+"SavePartnerSubmitMaterial") }
console.log("rtn+++++",rtn) }
if (!rtn || !rtn.stdout) {
aliFlag = -200; if (res.data.uapp_id == uappId.ename) {
}else{ //推送数据至易名
var pushRes = JSON.parse(rtn.stdout); let BizId = needsolution.channelSolutionNo;//⽅案业务ID
if(pushRes && pushRes.Success && pushRes.Success==true){ let pushObj = {
aliFlag == 200; "CompanyName": material.CompanyName,
}else{ // "BizId": BizId,
aliFlag == -200; "OrderNo": 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 || [],
"BusinessLicense": {
"CreatedAt": material.BusinessLicense.CreatedAt || "",
"EnterpriseCode": material.BusinessLicense.EnterpriseCode || "",
"LegalRepresentative": material.BusinessLicense.LegalRepresentative || "",
"Address": material.BusinessLicense.Address || "",
"RegisteredCapital": material.BusinessLicense.RegisteredCapital || "",
"Name": material.BusinessLicense.Name || "",
"BusinessTerm": material.BusinessLicense.BusinessTerm || "",
"Type": material.BusinessLicense.Type || "",
"ScopeBusiness": material.BusinessLicense.ScopeBusiness || ""
},
};
//推送方案材料
let eNameUrl = settings.enameClientUrl() + "SavePartnerSubmitMaterial";
let rtn = await self.execClient.execEnamePost(pushObj, eNameUrl);
this.execClientNew.execLogs("serviceProviderSubmitMaterial-execEnamePost:eNameUrl:" + eNameUrl, pushObj, "center-channel-serviceProviderSubmitMaterial", rtn, null);
if (rtn && rtn.stdout) {
let pushRes = JSON.parse(rtn.stdout);
if (pushRes && pushRes.Success && pushRes.Success == true) {
resFlag = 200;
}
}
}
if (resFlag == 200) {
return system.getResultSuccess();
}
}
} }
} 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){ //队列通知交付状态变更
console.log("serviceProvider2Notification+++++pobj+++",pobj) async serviceProvider2Notification(pobj) {
var actionBody = pobj.actionBody; console.log("serviceProvider2Notification+++++pobj+++", pobj)
var appInfo = pobj.appInfo; var actionBody = pobj.actionBody;
var pushRes = { var appInfo = pobj.appInfo;
status:-1,msg:"推送失败" var pushRes = {
}; 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;
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); let resFlag = -200;
if (res && res.status == 0 && res.data) { try {
if(pobj.actionBody.isTest && pobj.actionBody.isTest==1){ let res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
var reqPushParams = {}; this.execClientNew.execLogs("serviceProviderNotification-reqCenterOrderApi:", pobj, "center-channel-serviceProviderNotification", res, null);
if(res.data.uapp_id == uappId.ali){ if (res && res.status == 0 && res.data) {
//推送数据至阿里 if (pobj.actionBody.isTest && pobj.actionBody.isTest == 1) {
reqPushParams = { var reqPushParams = {};
actionBody: { if (res.data.uapp_id == uappId.ali) {
uapp_id:res.data.uapp_id, //推送数据至阿里
BizId: res.data.BizId, reqPushParams = {
OfficialFileURL: res.data.OfficialFileURL, actionBody: {
ApplicationStatus: res.data.ApplicationStatus uapp_id: res.data.uapp_id,
}, BizId: res.data.BizId,
appInfo:pobj.appInfo OfficialFileURL: res.data.OfficialFileURL,
} ApplicationStatus: res.data.ApplicationStatus
} },
if(res.data.uapp_id == uappId.baidu){ appInfo: pobj.appInfo
res.data.ApplicationStatus = baiduIcpStatus[res.data.ApplicationStatus]; }
//推送数据至百度 }
reqPushParams = { if (res.data.uapp_id == uappId.baidu) {
actionBody:{ res.data.ApplicationStatus = baiduIcpStatus[res.data.ApplicationStatus];
uapp_id:res.data.uapp_id, //推送数据至百度
orderNo: res.data.channelOrderNo, reqPushParams = {
status: res.data.ApplicationStatus actionBody: {
}, uapp_id: res.data.uapp_id,
appInfo:pobj.appInfo orderNo: res.data.channelOrderNo,
} status: res.data.ApplicationStatus
} },
await this.utilsPushSve.business2Channel(reqPushParams, "serviceProvider2Notification"); appInfo: pobj.appInfo
// console.log('reqPushParams+++-状态变更--++++----',reqPushParams) }
// console.log('result+++-状态变更--++++----',result) }
}else{ await this.utilsPushSve.business2Channel(reqPushParams, "serviceProvider2Notification");
if(res.data.uapp_id == uappId.ali){ } else {
//推送数据至阿里 if (res.data.uapp_id == uappId.ali) {
var pushObj = { //推送数据至阿里
BizId: res.data.BizId, let pushObj = {
OfficialFileURL: res.data.OfficialFileURL, BizId: res.data.BizId,
ApplicationStatus: res.data.ApplicationStatus, OfficialFileURL: res.data.OfficialFileURL,
//2021-3-18 addNew ApplicationStatus: res.data.ApplicationStatus,
CertificateNumber:res.data.CertificateNumber || "",//证书编号 //2021-3-18 addNew
CertificateStartTime:res.data.CertificateStartTime || "",//证书有效期 开始时间 CertificateNumber: res.data.CertificateNumber || "",//证书编号
CertificateEndTime:res.data.CertificateEndTime || ""//证书有效期 结束时间 CertificateStartTime: res.data.CertificateStartTime || "",//证书有效期 开始时间
}; CertificateEndTime: res.data.CertificateEndTime || ""//证书有效期 结束时间
//推送状态变更 };
var ali = await this.aliclient.reqbyget({ action: "AcceptPartnerNotification", reqbody: pushObj, apiVersion: "2019-05-08" }); //推送状态变更
if(ali && ali.status == 200){ let aliParams = {
var aliFlag = 200 action: "AcceptPartnerNotification",
}else{ reqbody: pushObj,
var aliFlag = -200 apiVersion: "2019-05-08"
} }
} let ali = await this.aliclient.reqbyget(aliParams);
this.execClientNew.execLogs("serviceProviderNotification-aliclient:", aliParams, "center-channel-serviceProviderNotification", ali, null);
if (ali && ali.status == 200) {
resFlag = 200
}
}
if(res.data.uapp_id == uappId.ename){ 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",
console.log('res.data baidu +++++',baidu) reqbody: pushObj
if(baidu && baidu.data && baidu.data.result){ }
var baiduFlag = 200 let baidu = await this.baiduclient.baiduReqbyget(baiduParams);
}else{ this.execClientNew.execLogs("serviceProviderNotification-updateStatus-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){ //推送材料数据至百度用于更新订单状态完成
pobj.pushObj = res.data; let material = res.data.material;
let zc360 = await this.utils360Sve.pushOrderStatus(pobj); if (material) {
if(zc360 && zc360.code == 200 && zc360.msg == 'ok' ){ let pushMaterialObj = {
var zc360Flag = 200 "businessLicense": {
}else{ "createdAt": material.BusinessLicense.CreatedAt || "",
var zc360Flag = -200 "enterpriseCode": material.BusinessLicense.EnterpriseCode || "",
} "legalRepresentative": material.BusinessLicense.LegalRepresentative || "",
} "address": material.BusinessLicense.Address || "",
"registeredCapital": material.BusinessLicense.RegisteredCapital || "",
"name": material.BusinessLicense.Name || "",
"businessTerm": material.BusinessLicense.BusinessTerm || "",
"type": material.BusinessLicense.Type || "",
"scopeBusiness": material.BusinessLicense.ScopeBusiness || ""
},
"partnerForeignInvestment": material.PartnerForeignInvestment || "",
"orderNo": res.data.channelOrderNo,
"domain": material.Domain,
"corporateName": material.CorporateName,
"includeForeignInvestment": material.IncludeForeignInvestment,
"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 || []
};
//推送方案材料
let baiduMaterialParams = {
path: "/api/bla/provider/license/material",
reqbody: pushMaterialObj
}
let baiduMaterial = await self.baiduclient.baiduReqbyget(baiduMaterialParams);
this.execClientNew.execLogs("serviceProviderNotification-updateMaterial-baiduReqbyget:", pushMaterialObj, "center-channel-serviceProviderNotification", baiduMaterial, null);
}
}
if(aliFlag == 200 || baiduFlag == 200 || zc360Flag == 200 || enameFlag == 200){ if (res.data.uapp_id == uappId.zc360) {
return system.getResultSuccess(); pobj.pushObj = res.data;
} let zc360 = await this.utils360Sve.pushOrderStatus(pobj);
} if (zc360 && zc360.code == 200 && zc360.msg == 'ok') {
resFlag = 200
}
}
return res; if (resFlag == 200) {
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;
}
//易名退款,关闭订单 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
...@@ -7,6 +7,7 @@ const regCfg = require("../../../api/impl/ic/regCfg"); ...@@ -7,6 +7,7 @@ const regCfg = require("../../../api/impl/ic/regCfg");
class RegCenterOrderService extends AppServiceBase { class RegCenterOrderService extends AppServiceBase {
constructor() { constructor() {
super(); super();
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.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
...@@ -22,7 +23,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -22,7 +23,7 @@ class RegCenterOrderService extends AppServiceBase {
704: 'ENGRAVING', //刻章环节 704: 'ENGRAVING', //刻章环节
705: 'SUCCESS', //已完成 705: 'SUCCESS', //已完成
706: 'ACTIVE' //服务中 706: 'ACTIVE' //服务中
} }
}; };
//调用center-order //调用center-order
...@@ -48,7 +49,6 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -48,7 +49,6 @@ class RegCenterOrderService extends AppServiceBase {
} }
async regPaySuccess(pobj) { async regPaySuccess(pobj) {
console.log('regPaySuccess++++pobj----', pobj)
var sobj = { var sobj = {
actionType: "getRegProducePrice", actionType: "getRegProducePrice",
actionBody: { actionBody: {
...@@ -60,7 +60,6 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -60,7 +60,6 @@ class RegCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo, appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess actionProcess: pobj.actionProcess
} }
console.log('regPaySuccess++++sobj----', sobj)
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url); var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
...@@ -70,9 +69,6 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -70,9 +69,6 @@ class RegCenterOrderService extends AppServiceBase {
if (data.status != 0) { if (data.status != 0) {
return system.getResultFail(-5010, "产品查询失败"); return system.getResultFail(-5010, "产品查询失败");
} }
console.log('data----data----', data)
// pobj.actionBody = data.data;
// pobj.actionBody.orderNo = pobj.actionBody.bizId;
pobj.actionBody.totalSum = data.data.price; pobj.actionBody.totalSum = data.data.price;
pobj.actionBody.orderPrice = data.data.price; pobj.actionBody.orderPrice = data.data.price;
pobj.actionBody.payTotalSum = data.data.price; pobj.actionBody.payTotalSum = data.data.price;
...@@ -86,10 +82,8 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -86,10 +82,8 @@ class RegCenterOrderService extends AppServiceBase {
channelOrderNo: pobj.actionBody.orderNo, channelOrderNo: pobj.actionBody.orderNo,
orderStatus: 2 orderStatus: 2
} }
console.log('pobj.actionBody------', pobj.actionBody)
var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody); var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
console.log('orderrtn----', orderrtn) this.execClientNew.execLogs(`regOrderStatusRegPaySuccess`, pobj, "center-channel-regCenterOrderSve-regPaySuccess", orderrtn, null);
if (orderrtn.status != 0 && orderrtn.status != -1) { if (orderrtn.status != 0 && orderrtn.status != -1) {
return system.getResultFail(-5012, "订单创建失败"); return system.getResultFail(-5012, "订单创建失败");
} }
...@@ -105,7 +99,6 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -105,7 +99,6 @@ class RegCenterOrderService extends AppServiceBase {
return system.getResultFail(-5011, "方案查询失败"); return system.getResultFail(-5011, "方案查询失败");
} }
var solutiondata = JSON.parse(solutionrtn.stdout); var solutiondata = JSON.parse(solutionrtn.stdout);
console.log('solutiondata----', solutiondata)
if (solutiondata.status != 0) { if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败"); return system.getResultFail(-5011, "方案查询失败");
} }
...@@ -135,8 +128,9 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -135,8 +128,9 @@ class RegCenterOrderService extends AppServiceBase {
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
console.log('fqobj----', fqobj) //往云服推送订单
var baiduPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew"); let yunfuRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = { var deliveryObj = {
actionBody: { actionBody: {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo, orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
...@@ -151,10 +145,11 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -151,10 +145,11 @@ class RegCenterOrderService extends AppServiceBase {
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
}; };
//往资质宝推送订单
if (pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy == 1) {//直接下单需执行添加订单业务员操作 if (pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy == 1) {//直接下单需执行添加订单业务员操作
if (baiduPushRes && baiduPushRes.status == 0) { if (yunfuRes && yunfuRes.status == 0) {
if (baiduPushRes.data && baiduPushRes.data.data) { if (yunfuRes.data && yunfuRes.data.data) {
var resData = baiduPushRes.data.data; var resData = yunfuRes.data.data;
var salesmanInfo = { var salesmanInfo = {
salesmanName: resData.orderList && resData.orderList.length > 0 ? resData.orderList[0].operatorName : "", salesmanName: resData.orderList && resData.orderList.length > 0 ? resData.orderList[0].operatorName : "",
salesmanChannelId: resData.orderList && resData.orderList.length > 0 ? resData.orderList[0].operator : "", salesmanChannelId: resData.orderList && resData.orderList.length > 0 ? resData.orderList[0].operator : "",
...@@ -162,7 +157,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -162,7 +157,7 @@ class RegCenterOrderService extends AppServiceBase {
var salesmanObj = { var salesmanObj = {
appInfo: pobj.appInfo, appInfo: pobj.appInfo,
actionType: "addRegSalesmanInfo",//添加业务员信息 actionType: "addRegSalesmanInfo",//添加业务员信息
actionBody: { salesmanInfo: salesmanInfo, orderNo: orderrtn.data.orderNo } actionBody: {salesmanInfo: salesmanInfo, orderNo: orderrtn.data.orderNo}
}; };
var url = settings.centerOrderUrl() + "action/regapi/springBoard"; var url = settings.centerOrderUrl() + "action/regapi/springBoard";
var addRes = await this.execClient.execPost(salesmanObj, url); var addRes = await this.execClient.execPost(salesmanObj, url);
...@@ -261,6 +256,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -261,6 +256,7 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionType = "submitRegNeed"; pobj.actionType = "submitRegNeed";
var reqUrl = this.centerOrderUrl + "action/regapi/springBoard"; var reqUrl = this.centerOrderUrl + "action/regapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
//往云服推送需求
if (result.status == 0) { if (result.status == 0) {
pobj.actionBody.description = pobj.actionBody.description + " 成交概率:" + pobj.actionBody.level pobj.actionBody.description = pobj.actionBody.description + " 成交概率:" + pobj.actionBody.level
if (pobj.actionBody.probability) { if (pobj.actionBody.probability) {
...@@ -297,24 +293,34 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -297,24 +293,34 @@ class RegCenterOrderService extends AppServiceBase {
return data; return data;
} }
//状态更新 /***
* 状态更新
* @param pobj
* @returns {Promise<{msg: *, data: *, status: *}|{msg: *, data, bizmsg: *|string, status: number}|any>}
* status:
1:用户已支付
2:用户已上传(客户上传材料)
3:为资料未确认(暂时不用做处理)
4:用户已确认
11:方案已关闭
*/
async regOrderStatus(pobj) { async regOrderStatus(pobj) {
var actionBody = pobj.actionBody; var actionBody = pobj.actionBody;
var self = this; var self = this;
if (actionBody.isDirectBuy && actionBody.isDirectBuy == 1) { if (actionBody.isDirectBuy && actionBody.isDirectBuy == 1) {
actionBody.bizId = actionBody.orderNo actionBody.bizId = actionBody.orderNo
} }//直购
if (!actionBody.bizId) { if (!actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100495"); return system.getResult(null, "actionBody.bizId can not be empty,100495");
} }
actionBody.BizId = actionBody.bizId; actionBody.BizId = actionBody.bizId;
if (!actionBody.status) { if (!actionBody.status) {
return system.getResult(null, "actionBody.status can not be empty,100495"); return system.getResult(null, "actionBody.status can not be empty,100496");
} }
pobj.actionType = "regOrderStatus"; pobj.actionType = "regOrderStatus";
var url = settings.centerOrderUrl() + "action/regapi/springBoard"; var url = settings.centerOrderUrl() + "action/regapi/springBoard";
var rtn = await this.restPostUrl(pobj, url); var rtn = await this.restPostUrl(pobj, url);
console.log('公司宝--rtn---', rtn) this.execClientNew.execLogs(`regOrderStatusUpdate`, pobj, "center-channel-regCenterOrderSve-reqCenterOrder-regOrderStatus", rtn, null);
if (actionBody.status == 2) { if (actionBody.status == 2) {
var deliveryObj = { var deliveryObj = {
actionBody: { actionBody: {
...@@ -330,7 +336,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -330,7 +336,7 @@ class RegCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder"); this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
} }//往资质宝推送
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) { if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = { var tmpObj = {
actionBody: { actionBody: {
...@@ -350,7 +356,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -350,7 +356,7 @@ class RegCenterOrderService extends AppServiceBase {
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo; tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose"); self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
} }
}//通知更新状态 }//往资质宝推送更新状态
return rtn; return rtn;
} }
...@@ -548,7 +554,10 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -548,7 +554,10 @@ class RegCenterOrderService extends AppServiceBase {
note: pobj.actionBody.note note: pobj.actionBody.note
} }
// 推送baidu // 推送baidu
var tmpResult = await this.baiduRegClient.baiduReqbyget({ path: "/v1/provider/demand?close=", reqbody: pushObj }); var tmpResult = await this.baiduRegClient.baiduReqbyget({
path: "/v1/provider/demand?close=",
reqbody: pushObj
});
//查看日志 //查看日志
this.logCtl.info({ this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
...@@ -574,11 +583,11 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -574,11 +583,11 @@ class RegCenterOrderService extends AppServiceBase {
//提交交付信息/修改订单状态 //提交交付信息/修改订单状态
async regUpdateOrderStatus(pobj) { async regUpdateOrderStatus(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard"); let self = this;
console.log('推送交付信息/修改订单状态res+++++', res) let res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
console.log('推送交付信息/修改订单状态++pobj+++', pobj) this.execClientNew.execLogs("regUpdateOrderStatus-reqCenterOrderApi:", pobj, "center-channel-regUpdateOrderStatus", res, null);
var deliverContent = {} let deliverContent = {}
var pushObj = {} let pushObj = {}
if (res && res.status == 0 && res.data) { if (res && res.status == 0 && res.data) {
if (pobj.actionBody.deliverContent) { if (pobj.actionBody.deliverContent) {
if (pobj.actionBody.deliverContent.companyInfo && pobj.actionBody.deliverContent.companyInfo.serviceArea) { if (pobj.actionBody.deliverContent.companyInfo && pobj.actionBody.deliverContent.companyInfo.serviceArea) {
...@@ -624,7 +633,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -624,7 +633,7 @@ class RegCenterOrderService extends AppServiceBase {
consultType: pobj.actionBody.consultType, //需求类型: GSREG:正常原始公司注册; QYJYTC1:企业经营套餐1; QYJYTC2:企业经营套餐2; consultType: pobj.actionBody.consultType, //需求类型: GSREG:正常原始公司注册; QYJYTC1:企业经营套餐1; QYJYTC2:企业经营套餐2;
productType: pobj.actionBody.productType, //套餐包含业的务类型: 不传为原始公司注册 productType: pobj.actionBody.productType, //套餐包含业的务类型: 不传为原始公司注册
startTime: pobj.actionBody.startTime || null, //开始时间 startTime: pobj.actionBody.startTime || null, //开始时间
endTime: pobj.actionBody.endTime || null //结束时间 endTime: pobj.actionBody.endTime || null //结束时间
}; };
} else { } else {
pushObj = { pushObj = {
...@@ -636,18 +645,16 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -636,18 +645,16 @@ class RegCenterOrderService extends AppServiceBase {
}; };
} }
} }
var self = this; let baiduParams = {path: "/v1/provider/comreg", reqbody: pushObj}
//推送交付信息/修改订单状态 //推送交付信息/修改订单状态
var baidu = await self.baiduRegClient.baiduReqbyget({ path: "/v1/provider/comreg", reqbody: pushObj }); let baidu = await self.baiduRegClient.baiduReqbyget(baiduParams);
console.log('推送交付信息/修改订单状态baidu+++', baidu) this.execClientNew.execLogs("regUpdateOrderStatus-baiduReqbyget:", baiduParams, "center-channel-regUpdateOrderStatus", baidu, null);
console.log('推送交付信息/修改订单状态pushObj+++', pushObj)
//todo 推送云服订单所有交付单状态为完成时订单状态为完成的判断 //todo 推送云服订单所有交付单状态为完成时订单状态为完成的判断
// if(res.data.deliveryFlag && res.data.deliveryFlag2 && 200 == res.data.deliveryFlag == res.data.deliveryFlag2){ // if(res.data.deliveryFlag && res.data.deliveryFlag2 && 200 == res.data.deliveryFlag == res.data.deliveryFlag2){
// await this.utilsPushSve.business2Channel("蜂擎参数", "更新订单完成状态的方法"); // await this.utilsPushSve.business2Channel("蜂擎参数", "更新订单完成状态的方法");
// } // }
return baidu.data return baidu.data
} }
console.log('rsrsr++++------------++++', res)
} }
return res return res
} }
...@@ -672,7 +679,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -672,7 +679,7 @@ class RegCenterOrderService extends AppServiceBase {
reqbody: pushObj reqbody: pushObj
}); });
if (ress.data.status != 0) { if (ress.data.status != 0) {
return system.getResultFail(ress.data.msg) return system.getResultFail(-1, ress.data.msg)
} }
console.log("regWriteCommunicationLog---------", ress) console.log("regWriteCommunicationLog---------", ress)
} }
......
...@@ -4,92 +4,74 @@ var settings = require("../../../../config/settings"); ...@@ -4,92 +4,74 @@ var settings = require("../../../../config/settings");
//此类用来db中配置来进行调用-主要功能是推送交付系统 //此类用来db中配置来进行调用-主要功能是推送交付系统
class UtilsDeliverSystemService extends AppServiceBase { class UtilsDeliverSystemService extends AppServiceBase {
constructor() { constructor() {
super(); super();
this.opPushQueueUrl = settings.opPushQueueUrl(); this.opPushQueueUrl = settings.opPushQueueUrl();
}
/**
* 推送业务信息到交付系统
* 业务操作的信息不变外加增加组装的一些参数(推送需求商机、关闭需求、订单商机、关闭订单)
* @param {*} pobj
*/
async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统
var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2DeliverSystem->verifyResult", this.pushlogFailType.FQ);
} }
var interface_params_info = verifyResult.data;
// var reqParams = { /**
// actionType: "produceData",// Y 功能名称 * 推送业务信息到交付系统
// actionBody: { * 业务操作的信息不变外加增加组装的一些参数(推送需求商机、关闭需求、订单商机、关闭订单)
// pushUrl: interface_params_info.pushUrl,// Y 推送地址 * @param {*} pobj
// actionType: interface_params_info.actionType,// Y 推送地址接收时的功能名称 */
// notifyUrl: interface_params_info.notifyUrl || "",// N 推送成功后通知的Url async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统
// identifyCode: interface_params_info.identifyCode,// Y 操作的业务标识 this.execClientNew.execLogs(`推送资质宝结果->pushBusiness2DeliverSystem`, pobj, "center-channel-utilsDeliverSystemSve-pushBusiness2DeliverSystem", null, null);
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值 var verifyResult = await this.verifyParam(pobj);
// headData: interface_params_info.headData //N 请求头信息,Json格式,如:{token:"XXXXXXX"} if (verifyResult.status != 0) {
// }, return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2DeliverSystem->verifyResult", this.pushlogFailType.FQ);
// requestId: pobj.requestId || "" // N 请求id }
// } var interface_params_info = verifyResult.data;
let params = null
let params=null let headInfo = {}
let headInfo={} if (pobj.appInfo) {
if(req.appInfo){ headInfo["appcode"] = pobj.appInfo.app_code
headInfo["appcode"]=req.appInfo.app_code params = {
parms = { actionType: interface_params_info.actionType,
actionType:interface_params_info.actionType, actionBody: pobj.actionBody,
actionBody: pobj.actionBody, headData: headInfo
headData:headInfo }
} } else {
}else{ params = {
parms = { actionType: interface_params_info.actionType,
actionType:interface_params_info.actionType, actionBody: pobj.actionBody
actionBody: pobj.actionBody }
} }
let url = interface_params_info.opUrl;
var opQueuePushClientPostRes = await this.opQueuePushClientPost(pobj, url, params);
return await this.disposePushResult(pobj, opQueuePushClientPostRes, "delivery->pushBusiness2DeliverSystem->result", this.pushlogFailType.FQ);
} }
let url = interface_params_info.opUrl;
var opQueuePushClientPostRes = await this.opQueuePushClientPost(pobj, url, parms);
return await this.disposePushResult(pobj, opQueuePushClientPostRes, "delivery->pushBusiness2DeliverSystem->result", this.pushlogFailType.FQ);
}
//--------------------------------------------------内部辅助方法-------------------start----------------- //--------------------------------------------------内部辅助方法-------------------start-----------------
async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) { async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) {
try { try {
var rtn = await this.restPostUrl(reqParams, pushQueueUrl); var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
if (rtn.status != 1) { this.execClientNew.execLogs(`推送资质宝结果->opQueuePushClientPost->url:` + pushQueueUrl, reqParams, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", rtn, null);
this.execClientNew.execLogs(`推送资质宝失败->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", rtn, JSON.stringify(rtn)); if (rtn.status != 1) {
return system.getResult(null, "推送资质宝失败,失败原因:" + JSON.stringify(rtn)); return system.getResult(null, "推送资质宝失败,失败原因:" + JSON.stringify(rtn));
} }
return system.getResultSuccess(null, "推送成功"); return system.getResultSuccess(null, "推送成功");
} catch (e) { } catch (e) {
//日志记录 const stackStr = e.stack ? e.stack : JSON.stringify(e);
// this.logCtl.error({ this.execClientNew.execLogs(`推送操作异常deliver->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", null, stackStr);
// appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", return system.getResult(null, "推送操作异常deliver->opQueuePushClientPost->error:" + stackStr);
// appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", }
// requestId: pobj.requestId || "",
// op: "utilsSve/utilsDeliverSystemSve/opQueuePushClientPost",
// content: "error:" + e.stack,
// // clientIp: pobj.clientIp,
// optitle: pobj.opType + "推送操作异常deliver->opQueuePushClientPost",
// });
this.execClientNew.execLogs(`推送资质宝失败->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", null, JSON.stringify(e.stack));
return system.getResult(null, "推送操作异常deliver->opQueuePushClientPost->error:" + e.stack);
}
}
async verifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
verify = system.getResult(null, "interface_params can not be empty,100400");
} }
var interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.opUrl || !interface_params_info.headData) { async verifyParam(pobj) {//参数信息验证
verify = system.getResult(null, "interface_params(opUrl、headData) can not be empty,100430"); var verify = system.getResultSuccess();
if (!pobj.interface_params) {
verify = system.getResult(null, "interface_params can not be empty,100400");
}
var interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.opUrl || !interface_params_info.headData) {
verify = system.getResult(null, "interface_params(opUrl、headData) can not be empty,100430");
}
verify.data = interface_params_info;
return verify;
} }
verify.data = interface_params_info;
return verify;
}
//--------------------------------------------------内部辅助方法-------------------end----------------- //--------------------------------------------------内部辅助方法-------------------end-----------------
} }
module.exports = UtilsDeliverSystemService; module.exports = UtilsDeliverSystemService;
...@@ -164,7 +164,6 @@ class UtilsOrderService extends AppServiceBase { ...@@ -164,7 +164,6 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionType = "addOrder"; pobj.actionType = "addOrder";
var reqUrl = this.centerOrderUrl + "action/order/springBoard"; var reqUrl = this.centerOrderUrl + "action/order/springBoard";
// console.log(pobj);
var result = await this.execPostByTimeOut(null, pobj, reqUrl); var result = await this.execPostByTimeOut(null, pobj, reqUrl);
if (result.status != 0) { if (result.status != 0) {
return result; return result;
......
...@@ -3,108 +3,87 @@ const sha256 = require('sha256'); ...@@ -3,108 +3,87 @@ const sha256 = require('sha256');
const system = require("../system"); const system = require("../system");
var settings = require("../../config/settings"); var settings = require("../../config/settings");
const AppServiceBase = require("../service/app.base"); const AppServiceBase = require("../service/app.base");
class baiduClient extends AppServiceBase{
constructor() { class baiduClient extends AppServiceBase {
super(); constructor() {
this.pushlogSve = system.getObject("service.common.pushlogSve"); super();
this.execClient = system.getObject("util.execClient"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.baiduClientParams = settings.baiduClientParams(); this.execClient = system.getObject("util.execClient");
} this.baiduClientParams = settings.baiduClientParams();
//2020 1027 laolan 调用百度网关
async baiduPost( path, actionBody) {
console.log('actionBody++',actionBody)
let domain = this.baiduClientParams.domain;
let url = domain+path;
let version ="bce-auth-v1";
let accessKey = this.baiduClientParams.accessKey;
let secretKey = this.baiduClientParams.secretKey;
let timestamp = new Date().toISOString()
let site = timestamp.lastIndexOf(".");
timestamp = timestamp.substring(0,site)+"Z"
let signedHeaders = "host";
let extime = 1800;
let canonicalHeaders = "host:"+this.baiduClientParams.host;
//中间结果1:规范化请求和前缀字符串
var canonicalRequest = null
var pathParams = path.split("?");
if(pathParams && pathParams.length > 1){
canonicalRequest = "POST" + "\n" + pathParams[0] + "\n" + pathParams[1] + "\n" + canonicalHeaders;
}else{
canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
}
// let canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
console.log('canonicalRequest+++++++',canonicalRequest)
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
let authStringPrefix = version+"/"+accessKey+"/"+timestamp+"/"+extime;
//中间结果2:派生签名密钥 signingKey
let signingKey = crypto.createHmac('sha256', secretKey)
.update(authStringPrefix)
.digest('hex');
//中间结果3:签名摘要 signature
let signature = crypto.createHmac('sha256', signingKey)
.update(canonicalRequest)
.digest('hex');
//最终结果:认证字符串 authorization
let authorization = authStringPrefix+"/"+signedHeaders+"/"+signature;
var baiduObj={
authorization:authorization,
data:actionBody
} }
var rtn = await this.execClient.execBaiduPost(baiduObj, url);
if (!rtn || !rtn.stdout) { //2020 1027 laolan 调用百度网关
this.execClientNew.execLogs(`baiduClient-opBaiduClientPost-result:url=${url}`, actionBody, "center-channel-opBaiduClientPost", null, rtn); async baiduPost(path, actionBody) {
return system.getResult(null, rtn); console.log('baiduPost-actionBody++', actionBody)
let domain = this.baiduClientParams.domain;
let url = domain + path;
let version = "bce-auth-v1";
let accessKey = this.baiduClientParams.accessKey;
let secretKey = this.baiduClientParams.secretKey;
let timestamp = new Date().toISOString()
let site = timestamp.lastIndexOf(".");
timestamp = timestamp.substring(0, site) + "Z"
let signedHeaders = "host";
let extime = 1800;
let canonicalHeaders = "host:" + this.baiduClientParams.host;
//中间结果1:规范化请求和前缀字符串
let canonicalRequest = null
let pathParams = path.split("?");
if (pathParams && pathParams.length > 1) {
canonicalRequest = "POST" + "\n" + pathParams[0] + "\n" + pathParams[1] + "\n" + canonicalHeaders;
} else {
canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
}
// let canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
console.log('canonicalRequest+++++++', canonicalRequest)
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
let authStringPrefix = version + "/" + accessKey + "/" + timestamp + "/" + extime;
//中间结果2:派生签名密钥 signingKey
let signingKey = crypto.createHmac('sha256', secretKey)
.update(authStringPrefix)
.digest('hex');
//中间结果3:签名摘要 signature
let signature = crypto.createHmac('sha256', signingKey)
.update(canonicalRequest)
.digest('hex');
//最终结果:认证字符串 authorization
let authorization = authStringPrefix + "/" + signedHeaders + "/" + signature;
let baiduObj = {
authorization: authorization,
data: actionBody
}
let rtn = await this.execClient.execBaiduPost(baiduObj, url);
this.execClientNew.execLogs(`baiduClient-baiduPost-result:url=${url}`, baiduObj, "center-channel-opBaiduClientPost", rtn, null);
if (!rtn || !rtn.stdout) {
this.execClientNew.execLogs(`baiduClient-opBaiduClientPost-result:url=${url}`, actionBody, "center-channel-opBaiduClientPost", null, rtn);
return system.getResult(null, rtn);
}
let result = JSON.parse(rtn.stdout);
return result;
} }
var result = JSON.parse(rtn.stdout);
return result;
}
//百度接口 2020-10-27 laolan //百度接口 2020-10-27 laolan
async baiduReqbyget(obj, cbk) { async baiduReqbyget(obj, cbk) {
var path = obj.path; var path = obj.path;
var reqbody = obj.reqbody; var reqbody = obj.reqbody;
try { try {
var res = await this.baiduPost( path, reqbody, { var res = await this.baiduPost(path, reqbody, {
timeout: 10000, // default 3000 ms 修改3000为10000,原因ConfirmIcpIntention BizIds 超过5条会超时 timeout: 10000, // default 3000 ms 修改3000为10000,原因ConfirmIcpIntention BizIds 超过5条会超时
formatAction: true, // default true, format the action to Action formatAction: true, // default true, format the action to Action
formatParams: true, // default true, format the parameter name to first letter upper case formatParams: true, // default true, format the parameter name to first letter upper case
method: 'POST', // set the http method, default is GET method: 'POST', // set the http method, default is GET
headers: { headers: {
host:this.baiduClientParams.host host: this.baiduClientParams.host
}, // set the http request headers }, // set the http request headers
}); });
if(res.status == 0){ return system.getResultSuccess(res);
await this.disposePushResult(obj, res, "baidu->pushBusiness2Baidu->result", ""); } catch (e) {
}else{ await this.disposePushResultFail(obj, e, "badiu->baiduReqbyget->catchError", this.pushlogFailType.FAILLOG);
await this.disposePushResultFail(obj, res, "badiu->pushBusiness2Baidu->catchError", this.pushlogFailType.FAILLOG); return system.getResultFail(-200, "出现异常,error:" + e.stack);
} }
// this.pushlogSve.createDb({
// op: "new-baiduReqbyget",
// content: JSON.stringify(obj),//推送的参数信息
// resultInfo: JSON.stringify(res),
// returnType: '1',
// logLevel: '1',
// opTitle: "new-baiduReqbyget推送百度信息返回成功"
// });
return system.getResultSuccess(res);
} catch (e) {
await this.disposePushResultFail(obj, e, "badiu->pushBusiness2Baidu->catchError", this.pushlogFailType.FAILLOG);
// this.pushlogSve.createFailLogDb({
// appid: obj.appInfo ? obj.appInfo.uapp_id || "" : "",
// appkey: obj.appInfo ? obj.appInfo.uapp_key || "" : "",
// requestId: obj.requestId || "",
// content: JSON.stringify(obj),//推送的参数信息
// resultInfo: "error:" + JSON.stringify(e),
// clientIp: obj.clientIp || "",
// failType: 1,
// opTitle: "new-baiduReqbyget推送百度信息返回异常",
// pushNumber: obj.pushNumber || 1
// });
return system.getResultFail(-200, "出现异常,error:" + e.stack);
} }
}
} }
module.exports = baiduClient; module.exports = baiduClient;
// var task = new baiduClient(); // var task = new baiduClient();
// console.log(task.baiduClientParams,"11111111111111111"); // console.log(task.baiduClientParams,"11111111111111111");
\ No newline at end of file
...@@ -6,12 +6,13 @@ class baiduRegClient { ...@@ -6,12 +6,13 @@ class baiduRegClient {
constructor() { constructor() {
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.execClientNew = system.getObject("util.execClientNew");
this.baiduRegClientParams = settings.baiduRegClientParams(); this.baiduRegClientParams = settings.baiduRegClientParams();
} }
//2020 1027 laolan 调用百度网关 //2020 1027 laolan 调用百度网关
async baiduPost( path, actionBody) { async baiduPost( path, actionBody) {
console.log('actionBody++',actionBody) // console.log('actionBody++',actionBody)
let domain = this.baiduRegClientParams.domain; let domain = this.baiduRegClientParams.domain;
let url = domain+path; let url = domain+path;
let version ="bce-auth-v1"; let version ="bce-auth-v1";
...@@ -32,7 +33,7 @@ class baiduRegClient { ...@@ -32,7 +33,7 @@ class baiduRegClient {
canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders; canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
} }
// let canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders; // let canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
console.log('canonicalRequest+++++++',canonicalRequest) // console.log('canonicalRequest+++++++',canonicalRequest)
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成) //authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
let authStringPrefix = version+"/"+accessKey+"/"+timestamp+"/"+extime; let authStringPrefix = version+"/"+accessKey+"/"+timestamp+"/"+extime;
//中间结果2:派生签名密钥 signingKey //中间结果2:派生签名密钥 signingKey
...@@ -50,9 +51,10 @@ class baiduRegClient { ...@@ -50,9 +51,10 @@ class baiduRegClient {
data:actionBody data:actionBody
} }
var rtn = await this.execClient.execBaiduPost(baiduObj, url); var rtn = await this.execClient.execBaiduPost(baiduObj, url);
console.log("baiduObj+++++",baiduObj) this.execClientNew.execLogs("api-center-channel-baiduPost:"+url, baiduObj, "center-channel-baiduPost", rtn, null);
console.log("url+++++",url) // console.log("baiduObj+++++",baiduObj)
console.log("rtn+++++",rtn) // console.log("url+++++",url)
// 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");
} }
......
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