Commit 8cdbe604 by 兰国旗

laolan

parent 3feac937
......@@ -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,40 +56,64 @@ 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 "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;
case "rtSubmitSolution"://提交方案(文网文)2020-9-26
opResult = await this.qcCenterOrderSve.rtSubmitSolution(pobj);
case "rtGetCommunicationRecord"://查询沟通记录(广电)2020-11-11
opResult = await this.rtSve.rtGetCommunicationRecord(pobj);
break;
case "rtCloseNeed"://关闭需求(文网文)2020-9-28
opResult = await this.qcCenterOrderSve.rtCloseNeed(pobj);
case "rtCloseNeed"://关闭需求(广电)2020-11-11
opResult = await this.rtSve.rtCloseNeed(pobj);
break;
case "rtRecordLog"://提交沟通记录(文网文)2020-9-28
opResult = await this.qcCenterOrderSve.rtRecordLog(pobj);
case "rtClosePlan"://关闭方案(广电)2020-11-11
opResult = await this.rtSve.rtClosePlan(pobj);
break;
case "rtRecordLogList"://查询沟通记录(文网文)2020-9-29
opResult = await this.qcCenterOrderSve.rtRecordLogList(pobj);
case "rtCloseOrderDelivery"://关闭交付单(广电)2020-11-11
opResult = await this.rtSve.rtCloseOrderDelivery(pobj);
break;
default:
......
const system = require("../../../system");
const crypto = require('crypto');
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//(文网文状态2020-9-26)
......@@ -398,407 +397,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
const co = require("co");
var request = require("request");
const crypto = require('crypto');
const sha256 = require('sha256');
var urlencode = require('urlencode');
const system = require("../system");
class baiduClient {
constructor() {
......
......@@ -14,15 +14,16 @@ 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: [
"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"]
}
......
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