Commit 4c9bf6ab by 王悦

Merge remote-tracking branch 'origin/center-channel' into center-channel

parents 2854206b 8958cc56
......@@ -6,6 +6,8 @@ class QcAPI extends APIBase {
super();
this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve");
this.baseOrderSve = system.getObject("service.common.baseCenterOrderSve");
this.ncSve = system.getObject("service.common.ncSve");
this.rtSve = system.getObject("service.common.rtSve");
}
/**
* 接口跳转-POST请求
......@@ -54,42 +56,70 @@ class QcAPI extends APIBase {
opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj);
break;
// --------- 网文 ---------
// --------- 网文 ---------
case "ncServiceSubmitOption"://服务商提交服务操作(文网文)2020-9-26
opResult = await this.qcCenterOrderSve.ncServiceSubmitOption(pobj);
case "ncGetNeedList"://查询需求列表(网文)2020-11-11
opResult = await this.ncSve.ncGetNeedList(pobj);
break;
case "ncSubmitSolution"://提交方案(文网文)2020-9-26
opResult = await this.qcCenterOrderSve.ncSubmitSolution(pobj);
case "ncSubmitMaterial"://交付材料提交(网文)2020-11-11
opResult = await this.ncSve.ncSubmitMaterial(pobj);
break;
case "ncCloseNeed"://关闭需求(文网文)2020-9-28
opResult = await this.qcCenterOrderSve.ncCloseNeed(pobj);
case "ncNotification"://状态通知(网文)2020-11-11
opResult = await this.ncSve.ncNotification(pobj);
break;
case "ncRecordLog"://提交沟通记录(文网文)2020-9-28
opResult = await this.qcCenterOrderSve.ncRecordLog(pobj);
case "ncSubmitSolution"://提交方案(网文)2020-11-11
opResult = await this.ncSve.ncSubmitSolution(pobj);
break;
case "ncRecordLogList"://查询沟通记录(文网文)2020-9-29
opResult = await this.qcCenterOrderSve.ncRecordLogList(pobj);
case "ncWriteCommunicationRecord"://提交沟通记录(网文)2020-11-11
opResult = await this.ncSve.ncWriteCommunicationRecord(pobj);
break;
case "ncGetCommunicationRecord"://查询沟通记录(网文)2020-11-11
opResult = await this.ncSve.ncGetCommunicationRecord(pobj);
break;
case "ncCloseNeed"://关闭需求(网文)2020-11-11
opResult = await this.ncSve.ncCloseNeed(pobj);
break;
case "ncClosePlan"://关闭方案(网文)2020-11-11
opResult = await this.ncSve.ncClosePlan(pobj);
break;
case "ncCloseOrderDelivery"://关闭交付单(网文)2020-11-11
opResult = await this.ncSve.ncCloseOrderDelivery(pobj);
break;
// --------- 广电 ---------
case "rtServiceSubmitOption"://服务商提交服务操作(文网文)2020-9-26
opResult = await this.qcCenterOrderSve.rtServiceSubmitOption(pobj);
case "rtGetNeedList"://查询需求列表(广电)2020-11-11
opResult = await this.rtSve.rtGetNeedList(pobj);
break;
case "rtSubmitMaterial"://交付材料提交(广电)2020-11-11
opResult = await this.rtSve.rtSubmitMaterial(pobj);
break;
case "rtSubmitSolution"://提交方案(文网文)2020-9-26
opResult = await this.qcCenterOrderSve.rtSubmitSolution(pobj);
case "rtNotification"://状态通知(广电)2020-11-11
opResult = await this.rtSve.rtNotification(pobj);
break;
case "rtCloseNeed"://关闭需求(文网文)2020-9-28
opResult = await this.qcCenterOrderSve.rtCloseNeed(pobj);
case "rtSubmitSolution"://提交方案(广电)2020-11-11
opResult = await this.rtSve.rtSubmitSolution(pobj);
break;
case "rtRecordLog"://提交沟通记录(文网文)2020-9-28
opResult = await this.qcCenterOrderSve.rtRecordLog(pobj);
case "rtWriteCommunicationRecord"://提交沟通记录(广电)2020-11-11
opResult = await this.rtSve.rtWriteCommunicationRecord(pobj);
break;
case "rtRecordLogList"://查询沟通记录(文网文)2020-9-29
opResult = await this.qcCenterOrderSve.rtRecordLogList(pobj);
case "rtGetCommunicationRecord"://查询沟通记录(广电)2020-11-11
opResult = await this.rtSve.rtGetCommunicationRecord(pobj);
break;
case "rtCloseNeed"://关闭需求(广电)2020-11-11
opResult = await this.rtSve.rtCloseNeed(pobj);
break;
case "rtClosePlan"://关闭方案(广电)2020-11-11
opResult = await this.rtSve.rtClosePlan(pobj);
break;
case "rtCloseOrderDelivery"://关闭交付单(广电)2020-11-11
opResult = await this.rtSve.rtCloseOrderDelivery(pobj);
break;
// --------- 推送icp信息至渠道和作方 zhuangbing-20201116--------
case "pushIcpSolution2Channel"://推送ICP方案至渠道(百度)
opResult = await this.baseOrderSve.pushIcpSolution2Channel(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class QueueNotify extends APIBase {
constructor() {
super();
this.baseOrderSve = system.getObject("service.common.baseCenterOrderSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
// --------- 推送icp信息至渠道和作方 zhuangbing-20201116--------
case "pushIcpSolution2Channel"://推送ICP方案至渠道(百度)
opResult = await this.baseOrderSve.pushIcpSolution2Channel(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = QueueNotify;
\ No newline at end of file
const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//(文网文状态2020-9-26)
......@@ -103,11 +102,25 @@ class BaseCenterOrderService extends AppServiceBase {
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 0916 lin 修改 增加获取返回值
//var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
//2020-10-26 laolan 区分百度与阿里
if(needinfo.uapp_id == uappId.ali){
//推送数据至阿里
......@@ -146,21 +159,6 @@ class BaseCenterOrderService extends AppServiceBase {
console.log('pushObj++',pushObj)
var pushIcpSolutionRes = await this.pushBaiduIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
// // 2020 0806 lin 新增推送
// var reqParams = {
// actionType: "produceData",// Y 功能名称
// actionBody: {
// pushUrl: pushUrl,// Y 推送地址
// actionType: "updateChanceStatus",// Y 推送地址接收时的功能名称
// notifyUrl: "",// N 推送成功后通知的Url
// identifyCode: "ali.vat",// Y 操作的业务标识
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
// headData: ""//N 请求头信息,Json格式,如:{token:"XXXXXXX"}
// },
// requestId: pobj.requestId || "" // N 请求id
// }
// this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
......@@ -170,6 +168,8 @@ class BaseCenterOrderService extends AppServiceBase {
resultInfo: JSON.stringify(needinfo),
optitle: "createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
}
var reqParams = {
actionBody: {
intentionBizId: needinfo.channelNeedNo,
......@@ -177,12 +177,71 @@ class BaseCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
await this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//
return system.getResultSuccess(pushIcpSolutionRes);
// return system.getResultSuccess(pushIcpSolutionRes);
}
return res;
}
//推送ICP方案至渠道方
async pushIcpSolution2Channel(pobj){
var actionBody = pobj.actionBody;
var appInfo = pobj.appInfo;
var pushRes = {
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) {
pushObj["BizId"] = actionBody.channelSolutionNo;
}
pushRes = await this.pushIcpSolution(pushObj, actionBody.solutionNo, actionBody.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, actionBody.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",
});
}
if(pushRes.status==0 || pushRes.status==1 ){
return system.getResultRedisQueueSuccess();
}
return pushRes;
}
//推送ICP方案ali
async pushIcpSolution(pushObj, solutionNo, appInfo, self) {
//推送方案信息
......@@ -216,10 +275,11 @@ class BaseCenterOrderService extends AppServiceBase {
var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
}
}
return confirmRes;
// return confirmRes;
}
}
}
return pushRes;
}
//推送ICP方案baidu 2020-10-26 laolan
......@@ -252,10 +312,11 @@ class BaseCenterOrderService extends AppServiceBase {
};
var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
console.log('save confirmUrl ++ ',url)
return pushRes;
// return pushRes;
}
}
}
return pushRes;
}
//服务商icp方案关闭 2020-10-26 laolan
......@@ -398,407 +459,5 @@ class BaseCenterOrderService extends AppServiceBase {
}
return res;
}
// ----------- 文网文 -----------
//服务商提交服务操作(文网文)2020-9-26
async serviceSubmitOption(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
var pushObj = {
BizId: pobj.actionBody.orderNo,
BizType: pobj.actionBody.channelType,
OperateType: wangwenStatusDisct[resStatus],
ExtInfo:pobj.actionBody.extInfo
};
console.log("fuwu++++pushObj",pushObj);
//推送状态变更
var r = await this.aliclient.reqbyget({ action: "OperateProduceForPartner", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ttttssss',r)
return system.getResultSuccess();
}
return res;
}
//提交方案(文网文)2020-9-27
async submitWangwenSolution(pobj) {
console.log('文网文提交方案',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
console.log('www',res.data.needsolution.solutionContent);
var solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution);
solution = solution.solution
solution = JSON.stringify(solution)
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: res.data.needinfo.channelNeedNo,
status: "createSolution"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.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/submitWangwenSolution",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
//推送数据至阿里
var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode,
// solution: res.data.needsolution.solutionContent
solution: solution
};
console.log("wangwen",pushObj);
this.pushSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
return system.getResultSuccess();
}
return res;
}
//推送方案
async pushSubmitSolution(pushObj, solutionNo, appInfo, self) {
//推送状态变更
var pushRes = await this.aliclient.reqbyget({ action: "SubmitSolution", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('wangwen++++pushRespushRes',pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
var reqObj2 = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
solutionBizId: resData.SolutionBizId
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
return a;
}
}
//关闭需求
async closeNeed(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100395");
}
if (!pobj.actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100395");
}
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+++result',result)
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "closeNeed"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.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/closeNeed",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntentionForPartner", reqbody: { IntentionBizId: pobj.actionBody.needNo, BizType: "esp.wangwen" ,Note : pobj.actionBody.note}, apiVersion: "2020-03-06" });
console.log('alalallala',a)
// 2020 1021 lin 新增查看日志
self.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/closeNeed",
content: JSON.stringify(a),
resultInfo: "",
optitle: "推送ali关闭需求->closeNeed",
});
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseWangWenNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "close fail 100389 ");
}
}
//提交沟通记录
async recordLog(pobj) {
console.log('提交沟通记录pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100491");
}
if (!pobj.actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100492");
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+提交沟通记录result',result)
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//推送数据至阿里
var pushObj = {
IntentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
};
//提交沟通记录
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('www+提交沟通记录r',r)
return system.getResultSuccess();
}
//查看沟通记录
async recordLogList(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100493");
}
let res = await this.aliclient.reqbyget({
action: "ListIntentionNote", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
IntentionBizId: pobj.actionBody.needNo,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2020-03-06"
});
console.log('loglist-----',res)
if(res && res.data && res.data.Data){
var len = res.data.Data.length;
for(var i=0; i<len;i++){
res.data.Data[i].CreateTime = res.data.Data[i].CreateTime / 1000
}
}
return system.getResultSuccess(res);
}
// ----------- 食品 -----------
//服务商提交服务操作
async foodServiceSubmitOption(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
var pushObj = {
BizId: pobj.actionBody.orderNo,
BizType: pobj.actionBody.channelTpye,
OperateType: wangwenStatusDisct[resStatus],
ExtInfo:pobj.actionBody.extInfo
};
//推送状态变更
var r = await this.aliclient.reqbyget({ action: "OperateProduceForPartner", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ttttssss',r)
return system.getResultSuccess();
}
return res;
}
//提交方案
async submitFoodSolution(pobj) {
console.log('food+++pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('food+++res',res)
if (res && res.status == 0 && res.data) {
console.log('food',res.data.needsolution.solutionContent);
var solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution);
solution = solution.solution
solution = JSON.stringify(solution)
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "createSolution"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.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/submitFoodSolution",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
//推送数据至阿里
var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode,
// solution: res.data.needsolution.solutionContent
solution: solution
};
console.log("food",pushObj);
this.pushSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
return system.getResultSuccess();
}
return res;
}
//关闭需求
async foodCloseNeed(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100395");
}
if (!pobj.actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100395");
}
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('food+++result',result)
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "closeNeed"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.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/foodCloseNeed",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntentionForPartner", reqbody: { IntentionBizId: pobj.actionBody.needNo, BizType: "esp.wangwen" ,Note : pobj.actionBody.note}, apiVersion: "2020-03-06" });
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseFoodNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "close fail 100389 ");
}
}
//提交沟通记录
async foodRecordLog(pobj) {
console.log('提交沟通记录pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100491");
}
if (!pobj.actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100492");
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('提交沟通记录result',result)
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//推送数据至阿里
var pushObj = {
IntentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
};
//提交沟通记录
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('提交沟通记录r',r)
return system.getResultSuccess();
}
//查看沟通记录
async foodRecordLogList(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100493");
}
let res = await this.aliclient.reqbyget({
action: "ListIntentionNote", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
IntentionBizId: pobj.actionBody.needNo,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2020-03-06"
});
if(res && res.data && res.data.Data){
var len = res.data.Data.length;
for(var i=0; i<len;i++){
res.data.Data[i].CreateTime = res.data.Data[i].CreateTime / 1000
}
}
return system.getResultSuccess(res);
}
}
module.exports = BaseCenterOrderService;
\ No newline at end of file
const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//(文网文状态2020-9-26)
const wangwenStatusDisct = {
601: "PARTNER_SUBMIT_MATERIAL",
602: "CERT_ACCOUNT_REGISTERED",
603: "CERT_MATERIAL_SUBMITTED",
604: "CERT_GXB_ACCEPT",
605: "CERT_GXB_REFUSE",
606: "CERT_GXB_SUCCESS",
607: "CERT_GXB_FAIL"
};
const { getResultSuccess } = require("../../../system");
//区分渠道的uappid
const uappId = {
'ali':"18", //(阿里icp、edi)
......@@ -53,7 +44,7 @@ const cityLetter = {
"海南":"HAINAN"
}
//百度拼音转义 2020-11-6
//百度拼音转义 2020-11-11 laolan
const baiduIcpStatus = {
507: "REGISTRATION",
508: "SUBMITTED",
......@@ -70,7 +61,6 @@ class NcService extends AppServiceBase {
super();
this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient");
this.aliclient = system.getObject("util.aliyunClient");
this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
......@@ -89,197 +79,33 @@ class NcService extends AppServiceBase {
return data;
}
//提交Icp注册方案
async submitIcpProgramme(pobj) {
//查询需求列表 2020-11-11 laolan
async ncGetNeedList(pobj){
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) {
var needinfo = res.data.needinfo;//需求信息
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;
var self = this;
//推送方案
// 2020 0916 lin 修改 增加获取返回值
//var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
//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)
if (res && res.status == 0 && res.data) {
if(res.data.uapp_id == uappId.baidu){
var pushObj = {
requirementId: needinfo.channelNeedNo,
companyName: solution.CompanyName,
companyAddress: solution.CompanyAddress,
area: solution.Area,
type:solution.ActionType
};
if (needsolution.channelSolutionNo) {
pushObj["bizId"] = needsolution.channelSolutionNo;
}
console.log('pushObj++',pushObj)
var pushIcpSolutionRes = await this.pushBaiduIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
// // 2020 0806 lin 新增推送
// var reqParams = {
// actionType: "produceData",// Y 功能名称
// actionBody: {
// pushUrl: pushUrl,// Y 推送地址
// actionType: "updateChanceStatus",// Y 推送地址接收时的功能名称
// notifyUrl: "",// N 推送成功后通知的Url
// identifyCode: "ali.vat",// Y 操作的业务标识
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
// headData: ""//N 请求头信息,Json格式,如:{token:"XXXXXXX"}
// },
// requestId: pobj.requestId || "" // N 请求id
// }
// this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
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
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//
return system.getResultSuccess(pushIcpSolutionRes);
}
return res;
}
//推送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;
}
}
}
}
//推送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;
}
type:res.data.type,
begin:res.data.begin || "",
end:res.data.end || "",
intentionBizId:res.data.intentionBizId,
status:res.data.status,
area:res.data.area,
pagreSize:res.data.pagreSize || 10,
pageNum:res.data.pageNum || 1
}
//查询需求列表
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
console.log('nc rrrr+++++',r)
}
return getResultSuccess();
}
return res
}
//服务商icp方案关闭 2020-10-26 laolan
async abolishIcpProgramme(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
//推送数据至阿里
var pushObj = {
BizId: ab.BizId, Note: ab.Note
};
//关闭方案
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
}
//交付材料提交
async serviceProviderSubmitMaterial(pobj) {
//交付材料提交 2020-11-11 laolan
async ncSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
......@@ -288,162 +114,69 @@ class NcService extends AppServiceBase {
ab.material = JSON.parse(ab.material);
}
var material = ab.material;
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里
var BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = {
"BizId": BizId,
"Domain": material.Domain,
"CorporateName": material.CorporateName,
"IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerIdCardList": material.PartnerIdCardList,
"PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerPlan": material.PartnerPlan || "",
"PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerLaw": material.PartnerLaw || "",
"PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
};
var self = this;
//推送方案材料
self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" });
}
if(res.data.uapp_id == uappId.baidu){
//推送数据至百度
var BizId = needsolution.orderChannelNo;
console.log('BizId++',BizId)
var bizId = needsolution.orderChannelNo;
console.log('bizId++',bizId)
var pushObj = {
"orderNo": bizId,
"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 || ""
"name" :material.businessLicense.name || "",
"type" : material.businessLicense.type || "",
"address" :material.businessLicense.address || "",
"createdAt" : material.businessLicense.createdAt || "",
"businessTerm" :material.businessLicense.businessTerm || "",
"scopeBusiness" :material.businessLicense.scopeBusiness || "",
"enterpriseCode" :material.businessLicense.enterpriseCode || "",
"registeredCapital" : material.businessLicense.registeredCapital || "",
"legalRepresentative" :material.businessLicense.legalRepresentative || "",
},
"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 || []
"partnerBusinessLicense": material.partnerBusinessLicense || "",
"legalPersonIdentityCard":material.legalPersonIdentityCard || "",
"businessDevelopmentDescription":material.businessDevelopmentDescription || "",
"companyPolicy":material.companyPolicy || "",
"mainManagement":material.mainManagement || "",
"creditCertificateDocument":material.creditCertificateDocument || "",
"registeredAddressCertificateDocument":material.registeredAddressCertificateDocument || "",
"partnerOtherList":material.partnerOtherList || ""
};
var self = this;
//推送方案材料
var r = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('rrrr+++++',r)
var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('nc rrrr+++++',r)
}
return system.getResultSuccess();
}
return res;
}
//通知交付状态变更
async serviceProviderNotification(pobj) {
//通知交付状态变更 2020-11-11 laolan
async ncNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里
var pushObj = {
BizId: res.data.BizId,
OfficialFileURL: res.data.OfficialFileURL,
ApplicationStatus: res.data.ApplicationStatus
};
//推送状态变更
this.aliclient.reqbyget({ action: "AcceptPartnerNotification", reqbody: pushObj, apiVersion: "2019-05-08" });
}
if(res.data.uapp_id == uappId.baidu){
res.data.ApplicationStatus = baiduIcpStatus[res.data.ApplicationStatus];
console.log('res.data.channelOrderNo',res.data.channelOrderNo)
res.data.applicationStatus = baiduIcpStatus[res.data.applicationStatus];
console.log('nc res.data.channelOrderNo',res.data.channelOrderNo)
//推送数据至百度
var pushObj = {
orderNo: res.data.channelOrderNo,
status: res.data.ApplicationStatus
status: res.data.applicationStatus,
};
//推送状态变更
this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
}
return system.getResultSuccess();
}
return res;
var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
console("nc tongzhi+++",r)
}
//交付单关闭
async closeOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
//推送数据至阿里
var pushObj = {
BizId: needsolution.channelSolutionNo, Note: ab.note
};
//关闭方案
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
}
// ----------- 文网文 -----------
//服务商提交服务操作(文网文)2020-9-26
async ncServiceSubmitOption(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
if(res.data.uapp_id = uappId.ali){
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
var pushObj = {
BizId: pobj.actionBody.orderNo,
BizType: pobj.actionBody.channelType,
OperateType: wangwenStatusDisct[resStatus],
ExtInfo:pobj.actionBody.extInfo
};
console.log("ali fuwu++++pushObj",pushObj);
//推送状态变更
var r = await this.aliclient.reqbyget({ action: "OperateProduceForPartner", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ali +++ r+++',r)
}
if(res.data.uapp_id = uappId.baidu){
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
var pushObj = {
bizId: pobj.actionBody.orderNo,
bizType: pobj.actionBody.channelType,
operateType: wangwenStatusDisct[resStatus],
extInfo:pobj.actionBody.extInfo
};
console.log(" baidu fuwu++++pushObj",pushObj);
//推送状态变更
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
console.log('baidu +++ r+++',r)
}
return system.getResultSuccess();
}
return res;
}
//提交方案(文网文)2020-9-27
//提交方案 2020-11-11 laolan
async ncSubmitSolution(pobj) {
console.log('文网文提交方案',pobj)
console.log('nc+++pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('nc+++res',res)
if (res && res.status == 0 && res.data) {
console.log('www',res.data.needsolution.solutionContent);
console.log('nc solutionContent+++',res.data.needsolution.solutionContent);
var solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution);
......@@ -453,7 +186,7 @@ class NcService extends AppServiceBase {
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: res.data.needinfo.channelNeedNo,
intentionBizId: pobj.actionBody.needNo,
status: "createSolution"
},
opType: "updateChanceStatus",
......@@ -466,51 +199,36 @@ class NcService extends AppServiceBase {
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/submitWangwenSolution",
op: "service/impl/common/ncSve.js/ncSubmitSolution",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里
var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode,
// solution: res.data.needsolution.solutionContent
solution: solution
};
console.log("wangwen",pushObj);
this.pushAliNcSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
if(res.data.uapp_id == uappId.baidu){
if(res.data.needinfo.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode,
// solution: res.data.needsolution.solutionContent
bizType: res.data.needinfo.bizType,
solution: solution
};
console.log("wangwen",pushObj);
this.pushBaiduNcSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
console.log("nc pushObj+++",pushObj);
var r = await this.pushBaiduNcSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
console.log('nc rr+++',r)
return system.getResultSuccess();
}
}
return res;
}
//推送方案ali
async pushAliNcSubmitSolution(pushObj, solutionNo, appInfo, self) {
//推送方案baidu 2020-11-11 laolan
async pushBaiduNcSubmitSolution(pushObj, solutionNo, appInfo, self) {
//推送状态变更
var pushRes = await this.aliclient.reqbyget({ action: "SubmitSolution", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ali wangwen++++pushRespushRes',pushRes)
var pushRes = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('baidu nc++++pushRes',pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
var reqObj2 = {
actionType: "receiveProgrammeNo",
actionType: "ncReceiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
......@@ -523,45 +241,77 @@ class NcService extends AppServiceBase {
}
//推送方案baidu
async pushBaiduNcSubmitSolution(pushObj, solutionNo, appInfo, self) {
//推送状态变更
var pushRes = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('baidu wangwen++++pushRespushRes',pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
var reqObj2 = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
//提交沟通记录 2020-11-11 laolan
async ncWriteCommunicationRecord(pobj) {
console.log('nc 提交沟通记录pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('nc 提交沟通记录res',res)
if(res && res.data && res.status == 0){
//推送交付系统
var reqParams = {
actionBody: {
solutionNo: solutionNo,
solutionBizId: resData.SolutionBizId
intentionBizId: pobj.actionBody.needNo,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var push = await self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
if( push && res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
intentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
return a;
//提交沟通记录
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
}
console.log('nc 提交沟通记录r++',r)
return system.getResultSuccess();
}
}
//关闭需求
async ncCloseNeed(pobj) {
//查看沟通记录 2020-11-11 laolan
async ncGetCommunicationRecord(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('nc 查看沟通记录res-----',res)
if(res && res.data && res.status == 0){
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
beginTime: pobj.actionBody.beginTime ? pobj.actionBody.beginTime : "",
endTime: pobj.actionBody.endTime ? pobj.actionBody.endTime : "",
intentionBizId: pobj.actionBody.needNo,
pageNum: pobj.actionBody.pageNum || 1,
pageSize: pobj.actionBody.pageSize || 10,
};
//查看沟通记录
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
if(r && r.data && r.data.data){
var len = r.data.data.length;
for(var i=0; i<len;i++){
r.data.data[i].createTime = r.data.data[i].createTime / 1000
}
}
console.log('nc 查看沟通记录++',r)
}
return system.getResultSuccess(r);
}
}
// if (!pobj.actionBody.needNo) {
// return system.getResult(null, "actionBody.needNo can not be empty,100395");
// }
// if (!pobj.actionBody.note) {
// return system.getResult(null, "actionBody.note can not be empty,100395");
// }
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
//关闭需求 2020-11-11 laolan
async ncCloseNeed(pobj) {
pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo;
pobj.actionType = "ncClosePlan"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+++result',result)
console.log('nc 关闭需求result-----',result)
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data.orderNo;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
pobj.actionBody.orderNo = result.data;
var orderrtn = await this.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
......@@ -576,112 +326,78 @@ class NcService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
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/closeNeed",
op: "service/impl/common/ncSve.js/ncCloseNeed",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if(result.data.uapp_id == uappId.ali){
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntentionForPartner", reqbody: { IntentionBizId: pobj.actionBody.needNo, BizType: "esp.wangwen" ,Note : pobj.actionBody.note}, apiVersion: "2020-03-06" });
console.log('alalallala++',a)
}
if(result.data.uapp_id == uappId.baidu){
if(res.data.uapp_id == uappId.baidu){
// 推送baidu
var a = await self.baiduclient.baiduReqbyget({ path: "///", reqbody: { intentionBizId: pobj.actionBody.needNo, bizType: "网络文化许可证" ,note : pobj.actionBody.note} });
console.log('baidubaidu++',a)
var pushObj = {
intentionBizId: pobj.actionBody.needNo,
bizType: pobj.actionBody.bizType,
note : pobj.actionBody.note
}
// 2020 1021 lin 新增查看日志
self.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/closeNeed",
content: JSON.stringify(a),
resultInfo: "",
optitle: "推送ali关闭需求->closeNeed",
});
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseWangWenNeed");
var r = await this.baiduclient.baiduReqbyget({ path: "////", pushObj });
console.log('nc closeNeed+++',r)
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNcNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "close fail 100389 ");
}
}
//提交沟通记录
async ncWriteCommunicationRecord(pobj) {
console.log('提交沟通记录pobj',pobj)
//服务商方案关闭 2020-11-11 laolan
async ncClosePlan(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data){
var self = this;
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+提交沟通记录result',result)
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var result = await self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
if(result && result.status ==0){
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里
var pushObj = {
IntentionBizId: pobj.actionBody.needNo,
Note: pobj.actionBody.note
};
//提交沟通记录
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ali www+提交沟通记录r',r)
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
intentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
bizId: ab.bizId,
note: ab.note
};
//提交沟通记录
var r = await this.aliclient.reqbyget({ path: "///", reqbody: pushObj });
console.log('baidu www+提交沟通记录r',r)
}
//关闭方案
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
console.log('nc cloesePlan r+++',r)
}
return system.getResultSuccess();
}
return res;
}
//查看沟通记录
async ncGetCommunicationRecord(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100493");
}
let res = await this.aliclient.reqbyget({
action: "ListIntentionNote", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
IntentionBizId: pobj.actionBody.needNo,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2020-03-06"
});
console.log('loglist-----',res)
if(res && res.data && res.data.Data){
var len = res.data.Data.length;
for(var i=0; i<len;i++){
res.data.Data[i].CreateTime = res.data.Data[i].CreateTime / 1000
//交付单关闭 2020-11-11 laolan
async ncCloseOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
bizId: needsolution.channelSolutionNo,
note: ab.note
};
//关闭方案
var r = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('nc交付单关闭+++',r)
}
return system.getResultSuccess();
}
return system.getResultSuccess(res);
return res;
}
}
module.exports = NcService;
\ No newline at end of file
const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//(文网文状态2020-9-26)
const wangwenStatusDisct = {
601: "PARTNER_SUBMIT_MATERIAL",
602: "CERT_ACCOUNT_REGISTERED",
603: "CERT_MATERIAL_SUBMITTED",
604: "CERT_GXB_ACCEPT",
605: "CERT_GXB_REFUSE",
606: "CERT_GXB_SUCCESS",
607: "CERT_GXB_FAIL"
};
//区分渠道的uappid
const uappId = {
'ali':"18", //(阿里icp、edi)
......@@ -53,8 +43,7 @@ const cityLetter = {
"海南":"HAINAN"
}
//百度拼音转义
2020-11-6
//百度拼音转义 2020-11-11 laolan
const baiduIcpStatus = {
507: "REGISTRATION",
508: "SUBMITTED",
......@@ -71,7 +60,6 @@ class RtService extends AppServiceBase {
super();
this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient");
this.aliclient = system.getObject("util.aliyunClient");
this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
......@@ -90,197 +78,33 @@ class RtService extends AppServiceBase {
return data;
}
//提交Icp注册方案
async submitIcpProgramme(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) {
var needinfo = res.data.needinfo;//需求信息
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;
var self = this;
//推送方案
// 2020 0916 lin 修改 增加获取返回值
//var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
//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.ActionType
};
if (needsolution.channelSolutionNo) {
pushObj["bizId"] = needsolution.channelSolutionNo;
}
console.log('pushObj++',pushObj)
var pushIcpSolutionRes = await this.pushBaiduIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
// // 2020 0806 lin 新增推送
// var reqParams = {
// actionType: "produceData",// Y 功能名称
// actionBody: {
// pushUrl: pushUrl,// Y 推送地址
// actionType: "updateChanceStatus",// Y 推送地址接收时的功能名称
// notifyUrl: "",// N 推送成功后通知的Url
// identifyCode: "ali.vat",// Y 操作的业务标识
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
// headData: ""//N 请求头信息,Json格式,如:{token:"XXXXXXX"}
// },
// requestId: pobj.requestId || "" // N 请求id
// }
// this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
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
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//
return system.getResultSuccess(pushIcpSolutionRes);
}
return res;
}
//推送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;
}
}
}
}
//推送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;
}
}
}
}
//服务商icp方案关闭 2020-10-26 laolan
async abolishIcpProgramme(pobj) {
//查询需求列表 2020-11-11 laolan
async rtGetNeedList(pobj){
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
//推送数据至阿里
if(res.data.uapp_id == uappId.baidu){
var pushObj = {
BizId: ab.BizId, Note: ab.Note
};
//关闭方案
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
type:res.data.type,
begin:res.data.begin || "",
end:res.data.end || "",
intentionBizId:res.data.intentionBizId,
status:res.data.status,
area:res.data.area,
pagreSize:res.data.pagreSize || 10,
pageNum:res.data.pageNum || 1
}
return res;
//查询需求列表
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
console.log('rt rrrr+++++',r)
}
return getResultSuccess();
}
return res
}
//交付材料提交
async serviceProviderSubmitMaterial(pobj) {
//交付材料提交 2020-11-11 laolan
async rtSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
......@@ -289,148 +113,69 @@ class RtService extends AppServiceBase {
ab.material = JSON.parse(ab.material);
}
var material = ab.material;
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里
var BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = {
"BizId": BizId,
"Domain": material.Domain,
"CorporateName": material.CorporateName,
"IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerIdCardList": material.PartnerIdCardList,
"PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerPlan": material.PartnerPlan || "",
"PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerLaw": material.PartnerLaw || "",
"PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
};
var self = this;
//推送方案材料
self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" });
}
if(res.data.uapp_id == uappId.baidu){
//推送数据至百度
var BizId = needsolution.orderChannelNo;
console.log('BizId++',BizId)
var bizId = needsolution.orderChannelNo;
console.log('rt bizId++',bizId)
var pushObj = {
"orderNo": bizId,
"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 || ""
"name" :material.businessLicense.name || "",
"type" : material.businessLicense.type || "",
"address" :material.businessLicense.address || "",
"createdAt" : material.businessLicense.createdAt || "",
"businessTerm" :material.businessLicense.businessTerm || "",
"scopeBusiness" :material.businessLicense.scopeBusiness || "",
"enterpriseCode" :material.businessLicense.enterpriseCode || "",
"registeredCapital" : material.businessLicense.registeredCapital || "",
"legalRepresentative" :material.businessLicense.legalRepresentative || "",
},
"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 || []
"partnerBusinessLicense": material.partnerBusinessLicense || "",
"legalPersonIdentityCard":material.legalPersonIdentityCard || "",
"administrativeLicenseAuthorization":material.administrativeLicenseAuthorization || "",
"companyPolicy":material.companyPolicy || "",
"mainManagement":material.mainManagement || "",
"radioAndTelevisionQualifications":material.radioAndTelevisionQualifications || "",
"registeredAddressCertificateDocument":material.registeredAddressCertificateDocument || "",
"partnerOtherList":material.partnerOtherList || ""
};
var self = this;
//推送方案材料
var r = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('rrrr+++++',r)
var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('rt rrrr+++++',r)
}
return system.getResultSuccess();
}
return res;
}
//通知交付状态变更
async serviceProviderNotification(pobj) {
//通知交付状态变更 2020-11-11 laolan
async rtNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
if(res.data.uapp_id == uappId.ali){
//推送数据至阿里
var pushObj = {
BizId: res.data.BizId,
OfficialFileURL: res.data.OfficialFileURL,
ApplicationStatus: res.data.ApplicationStatus
};
//推送状态变更
this.aliclient.reqbyget({ action: "AcceptPartnerNotification", reqbody: pushObj, apiVersion: "2019-05-08" });
}
if(res.data.uapp_id == uappId.baidu){
res.data.ApplicationStatus = baiduIcpStatus[res.data.ApplicationStatus];
console.log('res.data.channelOrderNo',res.data.channelOrderNo)
res.data.applicationStatus = baiduIcpStatus[res.data.applicationStatus];
console.log('rt res.data.channelOrderNo+++',res.data.channelOrderNo)
//推送数据至百度
var pushObj = {
orderNo: res.data.channelOrderNo,
status: res.data.ApplicationStatus
status: res.data.applicationStatus,
};
//推送状态变更
this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
}
return system.getResultSuccess();
}
return res;
var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
console("rt tongzhi+++",r)
}
//交付单关闭
async closeOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
//推送数据至阿里
var pushObj = {
BizId: needsolution.channelSolutionNo, Note: ab.note
};
//关闭方案
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
}
// ----------- 广电 -----------
//服务商提交服务操作
async foodServiceSubmitOption(pobj) {
//提交方案 2020-11-11 laolan
async rtSubmitSolution(pobj) {
console.log('rt+++pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('rt+++res',res)
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
var pushObj = {
BizId: pobj.actionBody.orderNo,
BizType: pobj.actionBody.channelTpye,
OperateType: wangwenStatusDisct[resStatus],
ExtInfo:pobj.actionBody.extInfo
};
//推送状态变更
var r = await this.aliclient.reqbyget({ action: "OperateProduceForPartner", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ttttssss',r)
return system.getResultSuccess();
}
return res;
}
//提交方案
async submitFoodSolution(pobj) {
console.log('food+++pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('food+++res',res)
if (res && res.status == 0 && res.data) {
console.log('food',res.data.needsolution.solutionContent);
console.log('rt solutionContent+++',res.data.needsolution.solutionContent);
var solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution);
......@@ -453,41 +198,115 @@ async submitFoodSolution(pobj) {
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/submitFoodSolution",
op: "service/impl/common/rtSve.js/rtSubmitSolution",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
//推送数据至阿里
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode,
// solution: res.data.needsolution.solutionContent
solution: solution
};
console.log("food",pushObj);
this.pushSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
console.log("rt pushObj+++",pushObj);
var r = await this.pushBaiduRtSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
console.log('rt rr+++',r)
return system.getResultSuccess();
}
}
return res;
}
}
//推送方案baidu 2020-11-11 laolan
async pushBaiduRtSubmitSolution(pushObj, solutionNo, appInfo, self) {
//推送状态变更
var pushRes = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log(' rt++++pushRes',pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
var reqObj2 = {
actionType: "rtReceiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
solutionBizId: resData.SolutionBizId
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
return a;
}
}
//关闭需求
async foodCloseNeed(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100395");
//提交沟通记录 2020-11-11 laolan
async rtWriteCommunicationRecord(pobj) {
console.log('rt 提交沟通记录pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('rt 提交沟通记录res',res)
if(res && res.data && res.status == 0){
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var push = await self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
if( push && res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
intentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
};
//提交沟通记录
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
}
if (!pobj.actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100395");
console.log('rt 提交沟通记录r++',r)
return system.getResultSuccess();
}
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
}
//查看沟通记录 2020-11-11 laolan
async rtGetCommunicationRecord(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('rt 查看沟通记录res-----',res)
if(res && res.data && res.status == 0){
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
beginTime: pobj.actionBody.beginTime ? pobj.actionBody.beginTime : "",
endTime: pobj.actionBody.endTime ? pobj.actionBody.endTime : "",
intentionBizId: pobj.actionBody.needNo,
pageNum: pobj.actionBody.pageNum || 1,
pageSize: pobj.actionBody.pageSize || 10,
};
//查看沟通记录
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
if(r && r.data && r.data.data){
var len = r.data.data.length;
for(var i=0; i<len;i++){
r.data.data[i].createTime = r.data.data[i].createTime / 1000
}
}
console.log('rt 查看沟通记录++',r)
}
return system.getResultSuccess(r);
}
}
//关闭需求 2020-11-11 laolan
async rtCloseNeed(pobj) {
pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo;
pobj.actionType = "rtClosePlan"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('food+++result',result)
console.log('rt 关闭需求result-----',result)
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
......@@ -506,85 +325,78 @@ async foodCloseNeed(pobj) {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
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/foodCloseNeed",
op: "service/impl/common/rtSve.js/rtCloseNeed",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntentionForPartner", reqbody: { IntentionBizId: pobj.actionBody.needNo, BizType: "esp.wangwen" ,Note : pobj.actionBody.note}, apiVersion: "2020-03-06" });
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseFoodNeed");
if(res.data.uapp_id == uappId.baidu){
// 推送baidu
var pushObj = {
intentionBizId: pobj.actionBody.needNo,
bizType: pobj.actionBody.bizType,
note : pobj.actionBody.note
}
var a = await this.baiduclient.baiduReqbyget({ path: "////", pushObj });
console.log('rt closeNeed+++',a)
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseRtNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "close fail 100389 ");
}
}
}
//提交沟通记录
async foodRecordLog(pobj) {
console.log('提交沟通记录pobj',pobj)
//服务商方案关闭 2020-11-11 laolan
async rtClosePlan(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100491");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
if (!pobj.actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100492");
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
bizId: ab.bizId,
note: ab.note
};
//关闭方案
var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
console.log('rt closePlan +++',r)
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('提交沟通记录result',result)
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.needNo,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
return system.getResultSuccess();
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//推送数据至阿里
return res;
}
//交付单关闭 2020-11-11 laolan
async rtCloseOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = {
IntentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
bizId: needsolution.channelSolutionNo,
note: ab.note
};
//提交沟通记录
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('提交沟通记录r',r)
//关闭方案
var r = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('rt 交付单关闭+++',r)
}
return system.getResultSuccess();
}
//查看沟通记录
async foodRecordLogList(pobj) {
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100493");
}
let res = await this.aliclient.reqbyget({
action: "ListIntentionNote", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
IntentionBizId: pobj.actionBody.needNo,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2020-03-06"
});
if(res && res.data && res.data.Data){
var len = res.data.Data.length;
for(var i=0; i<len;i++){
res.data.Data[i].CreateTime = res.data.Data[i].CreateTime / 1000
}
return res;
}
return system.getResultSuccess(res);
}
}
module.exports = RtService;
\ No newline at end of file
var system = require("../../../system");
const AppServiceBase = require("../../app.base");
var settings = require("../../../../config/settings");
//此类用来db中配置来进行调用-主要功能是推送渠道合作方
class UtilsChannelPartnerService extends AppServiceBase {
constructor() {
super();
this.opPushQueueUrl = settings.opPushQueueUrl();
this.signSve = system.getObject("service.common.signSve");
}
/**
* 推送业务信息到渠道合作方
* 业务操作的信息不变外加增加组装的一些参数(推送方案、订单交付信息)
* @param {*} pobj
*/
async pushBusiness2Channel(pobj) {//推送业务信息到渠道合作方
console.log(pobj,"pushBusiness2Channel-zhuangbing------------------------------");
var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2Channel->verifyResult", this.pushlogFailType.FQ);
}
var actionbody = pobj.actionBody;
var interface_params_info = verifyResult.data;
if(interface_params_info.headData){
interface_params_info.headData.appcode = pobj.appInfo.app_code;
interface_params_info.headData.sign = verifyResult.sign;
interface_params_info.headData.appkey = pobj.appInfo.uapp_key;
}
var reqParams = {
actionType: "produceData",// Y 功能名称
actionBody: {
pushUrl: interface_params_info.pushUrl,// Y 推送地址
actionType: interface_params_info.actionType,// Y 推送地址接收时的功能名称
notifyUrl: interface_params_info.notifyUrl || "",// N 推送成功后通知的Url
identifyCode: interface_params_info.identifyCode,// Y 操作的业务标识
messageBody: actionbody, // Y 推送的业务消息,必须有一项对象属性值
headData: interface_params_info.headData //N 请求头信息,Json格式,如:{token:"XXXXXXX"}
},
requestId: pobj.requestId || "" // N 请求id
}
var opQueuePushClientPostRes = await this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
console.log(opQueuePushClientPostRes,"pushBusiness2Channel-zhuangbing----2--------------------------");
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) {
try {
var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
if (rtn.status != 1) {
return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn));
}
return system.getResultSuccess(null, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "utilsSve/utilsChannelPartnerSve/opQueuePushClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常deliver->opQueuePushClientPost",
});
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.pushUrl || !interface_params_info.headData) {
verify = system.getResult(null, "interface_params(pushUrl、headData) can not be empty,100430");
}
if(!pobj || !pobj.appInfo || !pobj.appInfo.app_code){
verify = system.getResult(null, "appInfo can not be empty,100450");
}
var signRes = await this.signSve.createSign({actionBody:pobj.actionBody,actionType: interface_params_info.actionType},pobj.appInfo.uapp_secret);
if(signRes && signRes.status==0){
verify.sign=signRes.data;
}else{
verify = system.getResult(null, "creatSign fail!,100470");
}
verify.data = interface_params_info;
console.log(verify,"app/base/service/impl/utilsSve/utilsChannelPartnerSve.js____verifyParam___________________");
return verify;
}
//--------------------------------------------------内部辅助方法-------------------end-----------------
}
module.exports = UtilsChannelPartnerService;
......@@ -14,6 +14,7 @@ class UtilsDeliverSystemService extends AppServiceBase {
* @param {*} pobj
*/
async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统
console.log(pobj,"pushBusiness2DeliverSystem-zhuangbing------------------------------");
var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2DeliverSystem->verifyResult", this.pushlogFailType.FQ);
......@@ -36,7 +37,8 @@ class UtilsDeliverSystemService extends AppServiceBase {
},
requestId: pobj.requestId || "" // N 请求id
}
await this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
var opQueuePushClientPostRes = await this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
console.log(opQueuePushClientPostRes,"pushBusiness2DeliverSystem-zhuangbing----2--------------------------");
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
......
......@@ -1456,6 +1456,7 @@ class UtilsNeedService extends AppServiceBase {
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url);
if (rtn.status == 0 && rtn.data) {
var channelOrderNo = pobj.actionBody.orderNo;
pobj.actionBody.orderNo = rtn.data.orderNo;
pobj.actionType="delOrder";
var orderrtn = await self.utilsOrderSve.delOrder(pobj, actionBody);
......@@ -1471,8 +1472,16 @@ class UtilsNeedService extends AppServiceBase {
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.baiduBusiness2Fq(tmpObj, "pushOrderICPClose");
// tmpObj.actionBody.orderNo = channelOrderNo;
var tmpObj2 = {
actionBody: {
orderNo: channelOrderNo,
channelNeedNo: rtn.data.channelNeedNo,
needsolution: rtn.data.solutionContent
},
appInfo: pobj.appInfo
};
self.utilsPushSve.baiduBusiness2Fq(tmpObj2, "pushOrderICPClose");
}//通知更新状态
return rtn;
}
......
......@@ -29,6 +29,30 @@ class UtilsPushService extends AppServiceBase {
return system.getResult(null, "push Fail,interface_info data is empty");
}
async business2Channel(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
console.log("business2Channel++++++++start++++++++++");
console.log(pobj,"business2Channel++++++++++++++++++");
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/business2Channel",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送获取的接口信息->business2Channel",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async aliBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
......@@ -53,12 +77,13 @@ class UtilsPushService extends AppServiceBase {
}
async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务总入口,不在db中做配置进行调用
console.log(JSON.stringify(pobj), ".......pushBusInfo.........................");
console.log(JSON.stringify(pobj), ".......pushBusInfo........................."+opType);
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
}
var interface_list_temp = interface_list.filter(f => f.op_type == opType)
var interface_list_temp = interface_list.filter(f => f.op_type == opType);
console.log(interface_list_temp,"interface_list_temp+++++++++++++++");
if (!interface_list_temp || interface_list_temp.length == 0) {
return system.getResult(null, "暂无【" + opType + "】的推送配置");
}
......@@ -94,6 +119,8 @@ class UtilsPushService extends AppServiceBase {
}
async reflexAction(interface_info, opType, pobj, isDelProductInfo) {
console.log(interface_info,"reflexAction+++++++++++++++"+opType);
console.log(pobj,"reflexAction++++++2+++++++++"+opType);
var refResult = null;
pobj.interface_info = interface_info;
pobj.opType = opType;
......@@ -165,6 +192,8 @@ class UtilsPushService extends AppServiceBase {
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
console.log(pobj,"baiduBusiness2Delivery-zhuangbing------------------------------"+opType);
console.log(productItemInterfaceResult);
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......
const co = require("co");
var request = require("request");
const crypto = require('crypto');
const sha256 = require('sha256');
var urlencode = require('urlencode');
const system = require("../system");
var settings = require("../../config/settings");
class baiduClient {
constructor() {
this.pushlogSve = system.getObject("service.common.pushlogSve");
this.execClient = system.getObject("util.execClient");
this.baiduClientParams = settings.baiduClientParams();
}
//2020 1027 laolan 调用百度网关
async baiduPost( path, actionBody) {
console.log('actionBody++',actionBody)
// let domain = "https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com";//开发
let domain = "https://gwgp-nbzljnwusrw.i.bdcloudapi.com";//线上
let domain = this.baiduClientParams.domain;
let url = domain+path;
let version ="bce-auth-v1";
// let accessKey = "ed0f5c4c7c2d4e87aa335d9b07bf9bd4";
// let secretKey = "f600c4e91f6d43998d637401e6e34ef9";
let accessKey = "0e5abf33ef07457f8dbd779287747c0c";
let secretKey = "9d86f04a85db4cdfa95ba8ad28009188";
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:gwgp-nbzljnwusrw.i.bdcloudapi.com"
let canonicalHeaders = "host:"+this.baiduClientParams.host;
//中间结果1:规范化请求和前缀字符串
let canonicalRequest = "POST" + "\n" + path + "\n" + "\n" + canonicalHeaders;
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
......@@ -67,7 +63,7 @@ class baiduClient {
formatParams: true, // default true, format the parameter name to first letter upper case
method: 'POST', // set the http method, default is GET
headers: {
host:"gwgp-nbzljnwusrw.i.bdcloudapi.com"
host:this.baiduClientParams.host
}, // set the http request headers
});
console.log('baidu++++res+++',res)
......@@ -97,3 +93,5 @@ class baiduClient {
}
}
module.exports = baiduClient;
// var task = new baiduClient();
// console.log(task.baiduClientParams,"11111111111111111");
\ No newline at end of file
......@@ -14,17 +14,18 @@ module.exports = {
"orderTotalSum", "collect", "reg", "orderCheck", "getReOrderList", "getOfficalList", "addReviewList", "opSubmitNeed", "opNeedClose", "opNeedList",
"getItemByNeedNo", "opNeedDetailByChannelNo", "getNeedListUser", "manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention", "tmAccept", "tmStatus", "needBatchUpload",
"ncServiceSubmitOption", "ncSubmitSolution", "ncCloseNeed", "ncWriteCommunicationRecord", "ncGetCommunicationRecord", "rtServiceSubmitOption", "rtSubmitSolution",
"rtCloseNeed", "rtWriteCommunicationRecord", "rtGetCommunicationRecord", "getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode",
"ncSubmitMaterial","ncNotification","ncSubmitSolution","ncWriteCommunicationRecord","ncGetCommunicationRecord","ncCloseNeed","ncClosePlan","ncCloseOrderDelivery",
"rtSubmitMaterial","rtNotification","rtSubmitSolution","rtWriteCommunicationRecord","rtGetCommunicationRecord","rtCloseNeed","rtClosePlan","rtCloseOrderDelivery",
"getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode",
"putUserPwdByMobile", "icpNotifyNew"
],
apiMustUserpinList: [
"icpOrderClose",
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme",
"submitService","serviceProviderNotification",
"ncServiceSubmitOption", "ncSubmitSolution", "ncCloseNeed", "ncWriteCommunicationRecord", "ncGetCommunicationRecord", "rtServiceSubmitOption", "rtSubmitSolution",
"rtCloseNeed", "rtWriteCommunicationRecord", "rtGetCommunicationRecord",
"ncGetNeedList","ncSubmitMaterial","ncNotification","ncSubmitSolution","ncWriteCommunicationRecord","ncGetCommunicationRecord","ncCloseNeed","ncClosePlan","ncCloseOrderDelivery",
"rtGetNeedList","rtSubmitMaterial","rtNotification","rtSubmitSolution","rtWriteCommunicationRecord","rtGetCommunicationRecord","rtCloseNeed","rtClosePlan","rtCloseOrderDelivery",
],
apiSecretPathList: ["/api/icp/consultation/submit","/api/icp/feedback/submit","/api/icp/order/notify","/api/opreceive/service/create","/api/icp/order/close","/api/opreceive/service/notify"]
apiSecretPathList: ["/api/icp/consultation/submit","/api/icp/feedback/submit","/api/icp/order/notify","/api/opreceive/service/create","/api/icp/order/close","/api/opreceive/service/notify","/api/icp/queueNotify/springBoard",]
}
}
......@@ -30,6 +30,22 @@ var settings = {
}
return "http://43.247.184.94:7200/center_channel_req_log/_doc?pretty";
},
baiduClientParams: function () {
if (this.env == 'dev') {
return {
domain:"https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com",//开发
accessKey:"ed0f5c4c7c2d4e87aa335d9b07bf9bd4",
secretKey:"f600c4e91f6d43998d637401e6e34ef9",
host:"gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
};
}
return {
domain:"https://gwgp-nbzljnwusrw.i.bdcloudapi.com",//线上
accessKey:"0e5abf33ef07457f8dbd779287747c0c",
secretKey:"9d86f04a85db4cdfa95ba8ad28009188",
host:"gwgp-nbzljnwusrw.i.bdcloudapi.com"
};
},
fbQueryUrl: function () {
if (this.env == 'dev' || this.env == 'test') {
return 'http://43.247.184.92:15505'
......
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