Commit fd6ec8b3 by 宋毅

tj

parent 6341c45c
......@@ -27,7 +27,7 @@ class QcCenterOrderService extends AppServiceBase {
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");//测试用
this.opPushQueueUrl = settings.opPushQueueUrl();
};
//调用center-order
async reqCenterOrderApi(pobj, reqUrl) {
......@@ -60,8 +60,8 @@ class QcCenterOrderService extends AppServiceBase {
IntentionBizId: needinfo.channelNeedNo,
CompanyName: solution.CompanyName, IcpType: solution.IcpType, CompanyAddress: solution.CompanyAddress,
Area: solution.Area, Note: solution.Note,
ActionType:solution.actionType,
Source:"官网"
ActionType: solution.actionType,
Source: "官网"
};
if (needsolution.channelSolutionNo) {
pushObj["BizId"] = needsolution.channelSolutionNo;
......@@ -196,7 +196,7 @@ class QcCenterOrderService extends AppServiceBase {
};
var self = this;
//推送方案材料
if(pobj.appInfo.uapp_id ==18){
if (pobj.appInfo.uapp_id == 18) {
self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" });
}
return system.getResultSuccess();
......@@ -210,20 +210,20 @@ class QcCenterOrderService extends AppServiceBase {
pobj.actionType = "getOrderByOrderNo";
let orderUrl = settings.centerOrderUrl() + "action/order/springBoard";
let orderResult = await this.restPostUrl(pobj, orderUrl);
if(orderResult.status !=0){
return system.getResultFail(-1,'查询订单失败')
if (orderResult.status != 0) {
return system.getResultFail(-1, '查询订单失败')
}
let uapp_id = orderResult.data.uapp_id;
pobj.appInfo = {uapp_id : uapp_id};
pobj.appInfo = { uapp_id: uapp_id };
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
if(productItemInterfaceResult.status != 0){
system.getResultFail(-1,'获取接口参数失败')
if (productItemInterfaceResult.status != 0) {
system.getResultFail(-1, '获取接口参数失败')
}
pobj.interface_info = productItemInterfaceResult.data;
pobj.pushObj = res.data;
this.utilsPushSve.pushBusInfo(pobj,'pushStatus',1);
this.utilsPushSve.pushBusInfo(pobj, 'pushStatus', 1);
//推送数据至阿里
// var pushObj = {
// BizId: res.data.BizId,
......@@ -253,7 +253,7 @@ class QcCenterOrderService extends AppServiceBase {
return res;
}
// ----------- 文网文 -----------
// ----------- 文网文 -----------
//服务商提交服务操作(文网文)2020-9-26
async serviceSubmitOption(pobj) {
......@@ -265,12 +265,12 @@ class QcCenterOrderService extends AppServiceBase {
BizId: pobj.actionBody.orderNo,
BizType: pobj.actionBody.channelType,
OperateType: wangwenStatusDisct[resStatus],
ExtInfo:pobj.actionBody.extInfo
ExtInfo: pobj.actionBody.extInfo
};
console.log("fuwu++++pushObj",pushObj);
console.log("fuwu++++pushObj", pushObj);
//推送状态变更
var r = await this.aliclient.reqbyget({ action: "OperateProduceForPartner", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('ttttssss',r)
console.log('ttttssss', r)
return system.getResultSuccess();
}
return res;
......@@ -278,10 +278,10 @@ class QcCenterOrderService extends AppServiceBase {
//提交方案(文网文)2020-9-27
async submitWangwenSolution(pobj) {
console.log('文网文提交方案',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);
console.log('www', res.data.needsolution.solutionContent);
var solution = res.data.needsolution.solutionContent;
var needsolution = res.data.needsolution;//方案信息
solution = JSON.parse(solution);
......@@ -316,8 +316,8 @@ class QcCenterOrderService extends AppServiceBase {
// solution: res.data.needsolution.solutionContent
solution: solution
};
console.log("wangwen",pushObj);
console.log("wangwen", pushObj);
this.pushSubmitSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
return system.getResultSuccess();
}
......@@ -329,7 +329,7 @@ class QcCenterOrderService extends AppServiceBase {
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)
console.log('wangwen++++pushRespushRes', pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
var reqObj2 = {
......@@ -359,7 +359,7 @@ class QcCenterOrderService extends AppServiceBase {
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+++result',result)
console.log('www+++result', result)
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
......@@ -390,8 +390,8 @@ class QcCenterOrderService extends AppServiceBase {
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)
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 || "" : "",
......@@ -411,7 +411,7 @@ class QcCenterOrderService extends AppServiceBase {
//提交沟通记录
async recordLog(pobj) {
console.log('提交沟通记录pobj',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");
......@@ -422,7 +422,7 @@ class QcCenterOrderService extends AppServiceBase {
var self = this;
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+提交沟通记录result',result)
console.log('www+提交沟通记录result', result)
//推送交付系统
var reqParams = {
actionBody: {
......@@ -441,7 +441,7 @@ class QcCenterOrderService extends AppServiceBase {
//提交沟通记录
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" });
console.log('www+提交沟通记录r',r)
console.log('www+提交沟通记录r', r)
return system.getResultSuccess();
}
......@@ -459,10 +459,10 @@ class QcCenterOrderService extends AppServiceBase {
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2020-03-06"
});
console.log('loglist-----',res)
if(res && res.data && res.data.Data){
console.log('loglist-----', res)
if (res && res.data && res.data.Data) {
var len = res.data.Data.length;
for(var i=0; i<len;i++){
for (var i = 0; i < len; i++) {
res.data.Data[i].CreateTime = res.data.Data[i].CreateTime / 1000
}
}
......@@ -470,40 +470,40 @@ class QcCenterOrderService extends AppServiceBase {
}
// ----------- 食品 -----------
// ----------- 食品 -----------
//服务商提交服务操作
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();
//服务商提交服务操作
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;
}
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)
//提交方案
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 = {
......@@ -526,142 +526,142 @@ async submitFoodSolution(pobj) {
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();
//推送数据至阿里
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;
}
return res;
}
//关闭需求
async foodCloseNeed(pobj) {
//关闭需求
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, "订单关闭失败");
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: "closeNeed"
status: "followingUp"
},
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 ");
}
}
//推送数据至阿里
var pushObj = {
IntentionBizId: pobj.actionBody.needNo,
note: pobj.actionBody.note
};
//提交沟通记录
var r = await this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2020-03-06" });
//提交沟通记录
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
console.log('提交沟通记录r', r)
return system.getResultSuccess();
}
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
//查看沟通记录
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);
}
return system.getResultSuccess(res);
}
//推送订单状态
async pushOrderStatus(pobj){
async pushOrderStatus(pobj) {
if (!pobj.interface_params) {
return system.getResult(null, "interface_params can not be empty,100400");
}
let interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.action || interface_params_info.apiVersion) {
return system.getResult(null, "interface_params(action、apiVersion) can not be empty,100430");
if (!interface_params_info || !interface_params_info.action || !interface_params_info.apiVersion) {
return system.getResult(null, "interface_params(action、apiVersion) can not be empty,100430");
}
let pushObj = {
BizId: pobj.pushObj.BizId,
......@@ -669,35 +669,35 @@ async foodRecordLogList(pobj) {
ApplicationStatus: pobj.pushObj.ApplicationStatus
};
let obj = {
action:interface_params_info.action,
reqbody:pushObj,
apiVersion:interface_params_info.apiVersion
action: interface_params_info.action,
reqbody: pushObj,
apiVersion: interface_params_info.apiVersion
}
let result = await this.aliclient.reqbyget(obj);
return result;
}
// //推送ICP方案
// async pushIcpSolution1(pushObj, solutionNo, appInfo, self) {
// //推送方案确认信息
// var confirmRes = await this.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
// console.log("confirmRes",confirmRes)
// // 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方案
// async pushIcpSolution1(pushObj, solutionNo, appInfo, self) {
// //推送方案确认信息
// var confirmRes = await this.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
// console.log("confirmRes",confirmRes)
// // 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;
// }
}
module.exports = QcCenterOrderService;
......
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