Commit 8cdbe604 by 兰国旗

laolan

parent 3feac937
...@@ -6,6 +6,8 @@ class QcAPI extends APIBase { ...@@ -6,6 +6,8 @@ class QcAPI extends APIBase {
super(); super();
this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve"); this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve");
this.baseOrderSve = system.getObject("service.common.baseCenterOrderSve"); this.baseOrderSve = system.getObject("service.common.baseCenterOrderSve");
this.ncSve = system.getObject("service.common.ncSve");
this.rtSve = system.getObject("service.common.rtSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -54,40 +56,64 @@ class QcAPI extends APIBase { ...@@ -54,40 +56,64 @@ class QcAPI extends APIBase {
opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj); opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj);
break; break;
// --------- 网文 --------- // --------- 网文 ---------
case "ncServiceSubmitOption"://服务商提交服务操作(文网文)2020-9-26 case "ncGetNeedList"://查询需求列表(网文)2020-11-11
opResult = await this.qcCenterOrderSve.ncServiceSubmitOption(pobj); opResult = await this.ncSve.ncGetNeedList(pobj);
break; break;
case "ncSubmitSolution"://提交方案(文网文)2020-9-26 case "ncSubmitMaterial"://交付材料提交(网文)2020-11-11
opResult = await this.qcCenterOrderSve.ncSubmitSolution(pobj); opResult = await this.ncSve.ncSubmitMaterial(pobj);
break; break;
case "ncCloseNeed"://关闭需求(文网文)2020-9-28 case "ncNotification"://状态通知(网文)2020-11-11
opResult = await this.qcCenterOrderSve.ncCloseNeed(pobj); opResult = await this.ncSve.ncNotification(pobj);
break; break;
case "ncRecordLog"://提交沟通记录(文网文)2020-9-28 case "ncSubmitSolution"://提交方案(网文)2020-11-11
opResult = await this.qcCenterOrderSve.ncRecordLog(pobj); opResult = await this.ncSve.ncSubmitSolution(pobj);
break; break;
case "ncRecordLogList"://查询沟通记录(文网文)2020-9-29 case "ncWriteCommunicationRecord"://提交沟通记录(网文)2020-11-11
opResult = await this.qcCenterOrderSve.ncRecordLogList(pobj); 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; break;
// --------- 广电 --------- // --------- 广电 ---------
case "rtServiceSubmitOption"://服务商提交服务操作(文网文)2020-9-26 case "rtGetNeedList"://查询需求列表(广电)2020-11-11
opResult = await this.qcCenterOrderSve.rtServiceSubmitOption(pobj); opResult = await this.rtSve.rtGetNeedList(pobj);
break;
case "rtSubmitMaterial"://交付材料提交(广电)2020-11-11
opResult = await this.rtSve.rtSubmitMaterial(pobj);
break;
case "rtNotification"://状态通知(广电)2020-11-11
opResult = await this.rtSve.rtNotification(pobj);
break;
case "rtSubmitSolution"://提交方案(广电)2020-11-11
opResult = await this.rtSve.rtSubmitSolution(pobj);
break;
case "rtWriteCommunicationRecord"://提交沟通记录(广电)2020-11-11
opResult = await this.rtSve.rtWriteCommunicationRecord(pobj);
break; break;
case "rtSubmitSolution"://提交方案(文网文)2020-9-26 case "rtGetCommunicationRecord"://查询沟通记录(广电)2020-11-11
opResult = await this.qcCenterOrderSve.rtSubmitSolution(pobj); opResult = await this.rtSve.rtGetCommunicationRecord(pobj);
break; break;
case "rtCloseNeed"://关闭需求(文网文)2020-9-28 case "rtCloseNeed"://关闭需求(广电)2020-11-11
opResult = await this.qcCenterOrderSve.rtCloseNeed(pobj); opResult = await this.rtSve.rtCloseNeed(pobj);
break; break;
case "rtRecordLog"://提交沟通记录(文网文)2020-9-28 case "rtClosePlan"://关闭方案(广电)2020-11-11
opResult = await this.qcCenterOrderSve.rtRecordLog(pobj); opResult = await this.rtSve.rtClosePlan(pobj);
break; break;
case "rtRecordLogList"://查询沟通记录(文网文)2020-9-29 case "rtCloseOrderDelivery"://关闭交付单(广电)2020-11-11
opResult = await this.qcCenterOrderSve.rtRecordLogList(pobj); opResult = await this.rtSve.rtCloseOrderDelivery(pobj);
break; break;
default: default:
......
const system = require("../../../system"); const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base"); const AppServiceBase = require("../../app.base");
//(文网文状态2020-9-26) //(文网文状态2020-9-26)
...@@ -398,407 +397,5 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -398,407 +397,5 @@ class BaseCenterOrderService extends AppServiceBase {
} }
return res; 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; module.exports = BaseCenterOrderService;
\ No newline at end of file
const system = require("../../../system"); const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base"); const AppServiceBase = require("../../app.base");
//(文网文状态2020-9-26) const { getResultSuccess } = require("../../../system");
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 //区分渠道的uappid
const uappId = { const uappId = {
'ali':"18", //(阿里icp、edi) 'ali':"18", //(阿里icp、edi)
...@@ -53,7 +44,7 @@ const cityLetter = { ...@@ -53,7 +44,7 @@ const cityLetter = {
"海南":"HAINAN" "海南":"HAINAN"
} }
//百度拼音转义 2020-11-6 //百度拼音转义 2020-11-11 laolan
const baiduIcpStatus = { const baiduIcpStatus = {
507: "REGISTRATION", 507: "REGISTRATION",
508: "SUBMITTED", 508: "SUBMITTED",
...@@ -70,7 +61,6 @@ class NcService extends AppServiceBase { ...@@ -70,7 +61,6 @@ class NcService extends AppServiceBase {
super(); super();
this.centerOrderUrl = settings.centerOrderUrl(); this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.aliclient = system.getObject("util.aliyunClient");
this.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve"); this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve"); this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
...@@ -89,197 +79,33 @@ class NcService extends AppServiceBase { ...@@ -89,197 +79,33 @@ class NcService extends AppServiceBase {
return data; return data;
} }
//提交Icp注册方案 //查询需求列表 2020-11-11 laolan
async submitIcpProgramme(pobj) { async ncGetNeedList(pobj){
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) { if (res && res.status == 0 && res.data) {
var needinfo = res.data.needinfo;//需求信息 if(res.data.uapp_id == uappId.baidu){
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 = { var pushObj = {
requirementId: needinfo.channelNeedNo, type:res.data.type,
companyName: solution.CompanyName, begin:res.data.begin || "",
companyAddress: solution.CompanyAddress, end:res.data.end || "",
area: solution.Area, intentionBizId:res.data.intentionBizId,
type:solution.ActionType status:res.data.status,
}; area:res.data.area,
if (needsolution.channelSolutionNo) { pagreSize:res.data.pagreSize || 10,
pushObj["bizId"] = needsolution.channelSolutionNo; pageNum:res.data.pageNum || 1
} }
console.log('pushObj++',pushObj) //查询需求列表
var pushIcpSolutionRes = await this.pushBaiduIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self); var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
} console.log('nc rrrr+++++',r)
// // 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;
}
} }
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;
}
//交付材料提交 //交付材料提交 2020-11-11 laolan
async serviceProviderSubmitMaterial(pobj) { async ncSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) { if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息 var needsolution = res.data;//方案信息
...@@ -288,162 +114,69 @@ class NcService extends AppServiceBase { ...@@ -288,162 +114,69 @@ class NcService extends AppServiceBase {
ab.material = JSON.parse(ab.material); ab.material = JSON.parse(ab.material);
} }
var material = 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){ if(res.data.uapp_id == uappId.baidu){
//推送数据至百度 //推送数据至百度
var BizId = needsolution.orderChannelNo; var bizId = needsolution.orderChannelNo;
console.log('BizId++',BizId) console.log('bizId++',bizId)
var pushObj = { var pushObj = {
"orderNo": bizId,
"businessLicense" : { "businessLicense" : {
"createdAt" : material.BusinessLicense.CreatedAt || "", "name" :material.businessLicense.name || "",
"enterpriseCode" :material.BusinessLicense.EnterpriseCode || "", "type" : material.businessLicense.type || "",
"legalRepresentative" :material.BusinessLicense.LegalRepresentative || "", "address" :material.businessLicense.address || "",
"address" :material.BusinessLicense.Address || "", "createdAt" : material.businessLicense.createdAt || "",
"registeredCapital" : material.BusinessLicense.RegisteredCapital || "", "businessTerm" :material.businessLicense.businessTerm || "",
"name" :material.BusinessLicense.Name || "", "scopeBusiness" :material.businessLicense.scopeBusiness || "",
"businessTerm" :material.BusinessLicense.BusinessTerm || "", "enterpriseCode" :material.businessLicense.enterpriseCode || "",
"type" : material.BusinessLicense.Type || "", "registeredCapital" : material.businessLicense.registeredCapital || "",
"scopeBusiness" :material.BusinessLicense.ScopeBusiness || "" "legalRepresentative" :material.businessLicense.legalRepresentative || "",
}, },
"partnerForeignInvestment": material.PartnerForeignInvestment || "", "partnerBusinessLicense": material.partnerBusinessLicense || "",
"orderNo": BizId, "legalPersonIdentityCard":material.legalPersonIdentityCard || "",
"domain": material.Domain, "businessDevelopmentDescription":material.businessDevelopmentDescription || "",
"corporateName": material.CorporateName, "companyPolicy":material.companyPolicy || "",
"includeForeignInvestment": material.IncludeForeignInvestment, "mainManagement":material.mainManagement || "",
"partnerBusinessLicense": material.PartnerBusinessLicense, "creditCertificateDocument":material.creditCertificateDocument || "",
"partnerIdCardList": material.PartnerIdCardList, "registeredAddressCertificateDocument":material.registeredAddressCertificateDocument || "",
"partnerDomainCertificate": material.PartnerDomainCertificate, "partnerOtherList":material.partnerOtherList || ""
"partnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"partnerPlan": material.PartnerPlan || "",
"partnerLaw": material.PartnerLaw || "",
"partnerStampOtherList": material.PartnerStampOtherList || [],
"partnerSignOtherList": material.PartnerSignOtherList || [],
"partnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
}; };
var self = this;
//推送方案材料 //推送方案材料
var r = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj }); var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('rrrr+++++',r) console.log('nc rrrr+++++',r)
} }
return system.getResultSuccess(); return system.getResultSuccess();
} }
return res; return res;
} }
//通知交付状态变更 //通知交付状态变更 2020-11-11 laolan
async serviceProviderNotification(pobj) { async ncNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) { 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){ 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) console.log('nc res.data.channelOrderNo',res.data.channelOrderNo)
//推送数据至百度 //推送数据至百度
var pushObj = { var pushObj = {
orderNo: res.data.channelOrderNo, orderNo: res.data.channelOrderNo,
status: res.data.ApplicationStatus status: res.data.applicationStatus,
}; };
//推送状态变更 //推送状态变更
this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj }); var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
} console("nc tongzhi+++",r)
return system.getResultSuccess();
}
return res;
} }
//交付单关闭
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 system.getResultSuccess();
} }
return res; 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) { async ncSubmitSolution(pobj) {
console.log('文网文提交方案',pobj) console.log('nc+++pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('nc+++res',res)
if (res && res.status == 0 && res.data) { 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 solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息 var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution); solution = JSON.parse(solution);
...@@ -453,7 +186,7 @@ class NcService extends AppServiceBase { ...@@ -453,7 +186,7 @@ class NcService extends AppServiceBase {
//推送交付系统 //推送交付系统
var reqParams = { var reqParams = {
actionBody: { actionBody: {
intentionBizId: res.data.needinfo.channelNeedNo, intentionBizId: pobj.actionBody.needNo,
status: "createSolution" status: "createSolution"
}, },
opType: "updateChanceStatus", opType: "updateChanceStatus",
...@@ -466,51 +199,36 @@ class NcService extends AppServiceBase { ...@@ -466,51 +199,36 @@ class NcService extends AppServiceBase {
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/submitWangwenSolution", op: "service/impl/common/ncSve.js/ncSubmitSolution",
content: JSON.stringify(reqParams), content: JSON.stringify(reqParams),
resultInfo: "", resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
if(res.data.uapp_id == uappId.ali){ if(res.data.needinfo.uapp_id == uappId.baidu){
//推送数据至阿里
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){
//推送数据至baidu //推送数据至baidu
var pushObj = { var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo, intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode, bizType: res.data.needinfo.bizType,
// solution: res.data.needsolution.solutionContent
solution: solution solution: solution
}; };
console.log("wangwen",pushObj); console.log("nc pushObj+++",pushObj);
var r = await this.pushBaiduNcSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
this.pushBaiduNcSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self); console.log('nc rr+++',r)
}
return system.getResultSuccess(); return system.getResultSuccess();
} }
}
return res; return res;
} }
//推送方案baidu 2020-11-11 laolan
//推送方案ali async pushBaiduNcSubmitSolution(pushObj, solutionNo, appInfo, self) {
async pushAliNcSubmitSolution(pushObj, solutionNo, appInfo, self) {
//推送状态变更 //推送状态变更
var pushRes = await this.aliclient.reqbyget({ action: "SubmitSolution", reqbody: pushObj, apiVersion: "2020-03-06" }); var pushRes = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('ali wangwen++++pushRespushRes',pushRes) console.log('baidu nc++++pushRes',pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) { if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data; var resData = pushRes.data;
var reqObj2 = { var reqObj2 = {
actionType: "receiveProgrammeNo", actionType: "ncReceiveProgrammeNo",
appInfo: appInfo, appInfo: appInfo,
actionBody: { actionBody: {
solutionNo: solutionNo, solutionNo: solutionNo,
...@@ -523,45 +241,77 @@ class NcService extends AppServiceBase { ...@@ -523,45 +241,77 @@ class NcService extends AppServiceBase {
} }
//推送方案baidu //提交沟通记录 2020-11-11 laolan
async pushBaiduNcSubmitSolution(pushObj, solutionNo, appInfo, self) { async ncWriteCommunicationRecord(pobj) {
//推送状态变更 console.log('nc 提交沟通记录pobj',pobj)
var pushRes = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj }); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('baidu wangwen++++pushRespushRes',pushRes) console.log('nc 提交沟通记录res',res)
if (pushRes && pushRes.status == 0 && pushRes.data) { if(res && res.data && res.status == 0){
var resData = pushRes.data; //推送交付系统
var reqObj2 = { var reqParams = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
actionBody: { actionBody: {
solutionNo: solutionNo, intentionBizId: pobj.actionBody.needNo,
solutionBizId: resData.SolutionBizId 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();
} }
} }
//关闭需求 //查看沟通记录 2020-11-11 laolan
async ncCloseNeed(pobj) { 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");
// } //关闭需求 2020-11-11 laolan
// if (!pobj.actionBody.note) { async ncCloseNeed(pobj) {
// return system.getResult(null, "actionBody.note can not be empty,100395"); pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo;
// } pobj.actionType = "ncClosePlan"
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard"; var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+++result',result) console.log('nc 关闭需求result-----',result)
if (result.status == 0) { if (result.status == 0) {
if (result.data) { if (result.data) {
pobj.actionBody.orderNo = result.data.orderNo; pobj.actionBody.orderNo = result.data;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody); var orderrtn = await this.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) { if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败"); return system.getResultFail(-5022, "订单关闭失败");
} }
...@@ -576,112 +326,78 @@ class NcService extends AppServiceBase { ...@@ -576,112 +326,78 @@ class NcService extends AppServiceBase {
opType: "updateChanceStatus", opType: "updateChanceStatus",
appInfo: pobj.appInfo 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 || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/closeNeed", op: "service/impl/common/ncSve.js/ncCloseNeed",
content: JSON.stringify(reqParams), content: JSON.stringify(reqParams),
resultInfo: "", resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
if(result.data.uapp_id == uappId.ali){ if(res.data.uapp_id == uappId.baidu){
// 推送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){
// 推送baidu // 推送baidu
var a = await self.baiduclient.baiduReqbyget({ path: "///", reqbody: { intentionBizId: pobj.actionBody.needNo, bizType: "网络文化许可证" ,note : pobj.actionBody.note} }); var pushObj = {
console.log('baidubaidu++',a) intentionBizId: pobj.actionBody.needNo,
bizType: pobj.actionBody.bizType,
note : pobj.actionBody.note
} }
// 2020 1021 lin 新增查看日志 var r = await this.baiduclient.baiduReqbyget({ path: "////", pushObj });
self.logCtl.info({ console.log('nc closeNeed+++',r)
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", }
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNcNeed");
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(); return system.getResultSuccess();
} else { } else {
return system.getResult(null, "close fail 100389 "); return system.getResult(null, "close fail 100389 ");
} }
} }
//提交沟通记录
async ncWriteCommunicationRecord(pobj) { //服务商方案关闭 2020-11-11 laolan
console.log('提交沟通记录pobj',pobj) async ncClosePlan(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data){ if (res && res.status == 0 && res.data) {
var self = this; var needsolution = res.data;//方案信息
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard"; var ab = pobj.actionBody;
var result = await this.restPostUrl(pobj, reqUrl); if (typeof (ab.material) == "string") {
console.log('www+提交沟通记录result',result) ab.material = JSON.parse(ab.material);
//推送交付系统
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.data.uapp_id == uappId.baidu){ if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu //推送数据至baidu
var pushObj = { var pushObj = {
intentionBizId: pobj.actionBody.needNo, bizId: ab.bizId,
note: pobj.actionBody.note note: ab.note
}; };
//提交沟通记录 //关闭方案
var r = await this.aliclient.reqbyget({ path: "///", reqbody: pushObj }); var r = await this.baiduclient.baiduReqbyget({ path: "////", reqbody: pushObj });
console.log('baidu www+提交沟通记录r',r) console.log('nc cloesePlan r+++',r)
}
} }
return system.getResultSuccess(); return system.getResultSuccess();
} }
return res;
} }
//查看沟通记录 //交付单关闭 2020-11-11 laolan
async ncGetCommunicationRecord(pobj) { async ncCloseOrderDelivery(pobj) {
if (!pobj.actionBody.needNo) { var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
return system.getResult(null, "actionBody.needNo can not be empty,100493"); if (res && res.status == 0 && res.data) {
} var needsolution = res.data;//方案信息
let res = await this.aliclient.reqbyget({ var ab = pobj.actionBody;
action: "ListIntentionNote", reqbody: { if(res.data.uapp_id == uappId.baidu){
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", //推送数据至baidu
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "", var pushObj = {
IntentionBizId: pobj.actionBody.needNo, bizId: needsolution.channelSolutionNo,
PageNum: pobj.actionBody.pageNum || 1, note: ab.note
PageSize: pobj.actionBody.pageSize || 10, };
}, apiVersion: "2020-03-06" //关闭方案
}); var r = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('loglist-----',res) console.log('nc交付单关闭+++',r)
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();
} }
return system.getResultSuccess(res); return res;
} }
} }
module.exports = NcService; module.exports = NcService;
\ No newline at end of file
const system = require("../../../system"); const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base"); 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 //区分渠道的uappid
const uappId = { const uappId = {
'ali':"18", //(阿里icp、edi) 'ali':"18", //(阿里icp、edi)
...@@ -53,8 +43,7 @@ const cityLetter = { ...@@ -53,8 +43,7 @@ const cityLetter = {
"海南":"HAINAN" "海南":"HAINAN"
} }
//百度拼音转义 //百度拼音转义 2020-11-11 laolan
2020-11-6
const baiduIcpStatus = { const baiduIcpStatus = {
507: "REGISTRATION", 507: "REGISTRATION",
508: "SUBMITTED", 508: "SUBMITTED",
...@@ -71,7 +60,6 @@ class RtService extends AppServiceBase { ...@@ -71,7 +60,6 @@ class RtService extends AppServiceBase {
super(); super();
this.centerOrderUrl = settings.centerOrderUrl(); this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.aliclient = system.getObject("util.aliyunClient");
this.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve"); this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve"); this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
...@@ -90,197 +78,33 @@ class RtService extends AppServiceBase { ...@@ -90,197 +78,33 @@ class RtService extends AppServiceBase {
return data; 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 //查询需求列表 2020-11-11 laolan
async pushBaiduIcpSolution(pushObj, solutionNo, appInfo, self) { async rtGetNeedList(pobj){
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) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) { if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息 if(res.data.uapp_id == uappId.baidu){
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
//推送数据至阿里
var pushObj = { var pushObj = {
BizId: ab.BizId, Note: ab.Note type:res.data.type,
}; begin:res.data.begin || "",
//关闭方案 end:res.data.end || "",
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" }); intentionBizId:res.data.intentionBizId,
return system.getResultSuccess(); 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
} }
//交付材料提交 //交付材料提交 2020-11-11 laolan
async serviceProviderSubmitMaterial(pobj) { async rtSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) { if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息 var needsolution = res.data;//方案信息
...@@ -289,148 +113,69 @@ class RtService extends AppServiceBase { ...@@ -289,148 +113,69 @@ class RtService extends AppServiceBase {
ab.material = JSON.parse(ab.material); ab.material = JSON.parse(ab.material);
} }
var material = 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){ if(res.data.uapp_id == uappId.baidu){
//推送数据至百度 //推送数据至百度
var BizId = needsolution.orderChannelNo; var bizId = needsolution.orderChannelNo;
console.log('BizId++',BizId) console.log('rt bizId++',bizId)
var pushObj = { var pushObj = {
"orderNo": bizId,
"businessLicense" : { "businessLicense" : {
"createdAt" : material.BusinessLicense.CreatedAt || "", "name" :material.businessLicense.name || "",
"enterpriseCode" :material.BusinessLicense.EnterpriseCode || "", "type" : material.businessLicense.type || "",
"legalRepresentative" :material.BusinessLicense.LegalRepresentative || "", "address" :material.businessLicense.address || "",
"address" :material.BusinessLicense.Address || "", "createdAt" : material.businessLicense.createdAt || "",
"registeredCapital" : material.BusinessLicense.RegisteredCapital || "", "businessTerm" :material.businessLicense.businessTerm || "",
"name" :material.BusinessLicense.Name || "", "scopeBusiness" :material.businessLicense.scopeBusiness || "",
"businessTerm" :material.BusinessLicense.BusinessTerm || "", "enterpriseCode" :material.businessLicense.enterpriseCode || "",
"type" : material.BusinessLicense.Type || "", "registeredCapital" : material.businessLicense.registeredCapital || "",
"scopeBusiness" :material.BusinessLicense.ScopeBusiness || "" "legalRepresentative" :material.businessLicense.legalRepresentative || "",
}, },
"partnerForeignInvestment": material.PartnerForeignInvestment || "", "partnerBusinessLicense": material.partnerBusinessLicense || "",
"orderNo": BizId, "legalPersonIdentityCard":material.legalPersonIdentityCard || "",
"domain": material.Domain, "administrativeLicenseAuthorization":material.administrativeLicenseAuthorization || "",
"corporateName": material.CorporateName, "companyPolicy":material.companyPolicy || "",
"includeForeignInvestment": material.IncludeForeignInvestment, "mainManagement":material.mainManagement || "",
"partnerBusinessLicense": material.PartnerBusinessLicense, "radioAndTelevisionQualifications":material.radioAndTelevisionQualifications || "",
"partnerIdCardList": material.PartnerIdCardList, "registeredAddressCertificateDocument":material.registeredAddressCertificateDocument || "",
"partnerDomainCertificate": material.PartnerDomainCertificate, "partnerOtherList":material.partnerOtherList || ""
"partnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"partnerPlan": material.PartnerPlan || "",
"partnerLaw": material.PartnerLaw || "",
"partnerStampOtherList": material.PartnerStampOtherList || [],
"partnerSignOtherList": material.PartnerSignOtherList || [],
"partnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
}; };
var self = this;
//推送方案材料 //推送方案材料
var r = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj }); var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/material", reqbody: pushObj });
console.log('rrrr+++++',r) console.log('rt rrrr+++++',r)
} }
return system.getResultSuccess(); return system.getResultSuccess();
} }
return res; return res;
} }
//通知交付状态变更 //通知交付状态变更 2020-11-11 laolan
async serviceProviderNotification(pobj) { async rtNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) { 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){ 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) console.log('rt res.data.channelOrderNo+++',res.data.channelOrderNo)
//推送数据至百度 //推送数据至百度
var pushObj = { var pushObj = {
orderNo: res.data.channelOrderNo, orderNo: res.data.channelOrderNo,
status: res.data.ApplicationStatus status: res.data.applicationStatus,
}; };
//推送状态变更 //推送状态变更
this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj }); var r = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/license/update", reqbody: pushObj });
} console("rt tongzhi+++",r)
return system.getResultSuccess();
}
return res;
} }
//交付单关闭
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 system.getResultSuccess();
} }
return res; return res;
} }
//提交方案 2020-11-11 laolan
// ----------- 广电 ----------- async rtSubmitSolution(pobj) {
console.log('rt+++pobj',pobj)
//服务商提交服务操作
async foodServiceSubmitOption(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
console.log('rt+++res',res)
if (res && res.status == 0 && res.data) { if (res && res.status == 0 && res.data) {
//推送数据至阿里 console.log('rt solutionContent+++',res.data.needsolution.solutionContent);
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 solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息 var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution); solution = JSON.parse(solution);
...@@ -453,41 +198,115 @@ async submitFoodSolution(pobj) { ...@@ -453,41 +198,115 @@ async submitFoodSolution(pobj) {
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/submitFoodSolution", op: "service/impl/common/rtSve.js/rtSubmitSolution",
content: JSON.stringify(reqParams), content: JSON.stringify(reqParams),
resultInfo: "", resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
//推送数据至阿里 if(res.data.uapp_id == uappId.baidu){
//推送数据至baidu
var pushObj = { var pushObj = {
intentionBizId: res.data.needinfo.channelNeedNo, intentionBizId: res.data.needinfo.channelNeedNo,
bizType: res.data.needinfo.channelTypeCode, bizType: res.data.needinfo.channelTypeCode,
// solution: res.data.needsolution.solutionContent // solution: res.data.needsolution.solutionContent
solution: solution solution: solution
}; };
console.log("food",pushObj); console.log("rt pushObj+++",pushObj);
this.pushSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self); var r = await this.pushBaiduRtSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
console.log('rt rr+++',r)
return system.getResultSuccess(); return system.getResultSuccess();
} }
}
return res; 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) { //提交沟通记录 2020-11-11 laolan
return system.getResult(null, "actionBody.needNo can not be empty,100395"); 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) { console.log('rt 提交沟通记录r++',r)
return system.getResult(null, "actionBody.note can not be empty,100395"); 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 reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
console.log('food+++result',result) console.log('rt 关闭需求result-----',result)
if (result.status == 0) { if (result.status == 0) {
if (result.data) { if (result.data) {
pobj.actionBody.orderNo = result.data; pobj.actionBody.orderNo = result.data;
...@@ -506,85 +325,78 @@ async foodCloseNeed(pobj) { ...@@ -506,85 +325,78 @@ async foodCloseNeed(pobj) {
opType: "updateChanceStatus", opType: "updateChanceStatus",
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
var self = this; this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录 //日志记录
self.logCtl.info({ this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/foodCloseNeed", op: "service/impl/common/rtSve.js/rtCloseNeed",
content: JSON.stringify(reqParams), content: JSON.stringify(reqParams),
resultInfo: "", resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
// 推送ali if(res.data.uapp_id == uappId.baidu){
var a = await self.aliclient.reqbyget({ action: "CloseIntentionForPartner", reqbody: { IntentionBizId: pobj.actionBody.needNo, BizType: "esp.wangwen" ,Note : pobj.actionBody.note}, apiVersion: "2020-03-06" }); // 推送baidu
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseFoodNeed"); 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(); return system.getResultSuccess();
} else { } else {
return system.getResult(null, "close fail 100389 "); return system.getResult(null, "close fail 100389 ");
} }
} }
//提交沟通记录
async foodRecordLog(pobj) { //服务商方案关闭 2020-11-11 laolan
console.log('提交沟通记录pobj',pobj) async rtClosePlan(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.needNo) { if (res && res.status == 0 && res.data) {
return system.getResult(null, "actionBody.needNo can not be empty,100491"); var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
} }
if (!pobj.actionBody.note) { if(res.data.uapp_id == uappId.baidu){
return system.getResult(null, "actionBody.note can not be empty,100492"); //推送数据至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; return system.getResultSuccess();
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"); 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 = { var pushObj = {
IntentionBizId: pobj.actionBody.needNo, bizId: needsolution.channelSolutionNo,
note: pobj.actionBody.note note: ab.note
}; };
//提交沟通记录 //关闭方案
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" }); var r = await this.baiduclient.baiduReqbyget({ path: "///", reqbody: pushObj });
console.log('rt 交付单关闭+++',r)
console.log('提交沟通记录r',r) }
return system.getResultSuccess(); 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; module.exports = RtService;
\ No newline at end of file
const co = require("co");
var request = require("request");
const crypto = require('crypto'); const crypto = require('crypto');
const sha256 = require('sha256'); const sha256 = require('sha256');
var urlencode = require('urlencode');
const system = require("../system"); const system = require("../system");
class baiduClient { class baiduClient {
constructor() { constructor() {
......
...@@ -14,15 +14,16 @@ module.exports = { ...@@ -14,15 +14,16 @@ module.exports = {
"orderTotalSum", "collect", "reg", "orderCheck", "getReOrderList", "getOfficalList", "addReviewList", "opSubmitNeed", "opNeedClose", "opNeedList", "orderTotalSum", "collect", "reg", "orderCheck", "getReOrderList", "getOfficalList", "addReviewList", "opSubmitNeed", "opNeedClose", "opNeedList",
"getItemByNeedNo", "opNeedDetailByChannelNo", "getNeedListUser", "manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail", "getItemByNeedNo", "opNeedDetailByChannelNo", "getNeedListUser", "manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention", "tmAccept", "tmStatus", "needBatchUpload", "submitIcpIntention", "queryIntentionList", "confirmIcpIntention", "tmAccept", "tmStatus", "needBatchUpload",
"ncServiceSubmitOption", "ncSubmitSolution", "ncCloseNeed", "ncWriteCommunicationRecord", "ncGetCommunicationRecord", "rtServiceSubmitOption", "rtSubmitSolution", "ncSubmitMaterial","ncNotification","ncSubmitSolution","ncWriteCommunicationRecord","ncGetCommunicationRecord","ncCloseNeed","ncClosePlan","ncCloseOrderDelivery",
"rtCloseNeed", "rtWriteCommunicationRecord", "rtGetCommunicationRecord", "getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode", "rtSubmitMaterial","rtNotification","rtSubmitSolution","rtWriteCommunicationRecord","rtGetCommunicationRecord","rtCloseNeed","rtClosePlan","rtCloseOrderDelivery",
"getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode",
"putUserPwdByMobile", "icpNotifyNew" "putUserPwdByMobile", "icpNotifyNew"
], ],
apiMustUserpinList: [ apiMustUserpinList: [
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme", "submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme",
"submitService","serviceProviderNotification", "submitService","serviceProviderNotification",
"ncServiceSubmitOption", "ncSubmitSolution", "ncCloseNeed", "ncWriteCommunicationRecord", "ncGetCommunicationRecord", "rtServiceSubmitOption", "rtSubmitSolution", "ncGetNeedList","ncSubmitMaterial","ncNotification","ncSubmitSolution","ncWriteCommunicationRecord","ncGetCommunicationRecord","ncCloseNeed","ncClosePlan","ncCloseOrderDelivery",
"rtCloseNeed", "rtWriteCommunicationRecord", "rtGetCommunicationRecord", "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"]
} }
......
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