Commit e0ec79b1 by linboxuan

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

parents a8a3f0c8 3f666a2d
......@@ -58,6 +58,12 @@ class QcAPI extends APIBase {
case "submitWangwenSolution"://提交方案(文网文)2020-9-26
opResult = await this.centerorderSve.submitWangwenSolution(pobj);
break;
case "closeNeed"://关闭需求(文网文)2020-9-28
opResult = await this.centerorderSve.closeNeed(pobj);
break;
case "recordLog"://提交沟通记录(文网文)2020-9-28
opResult = await this.centerorderSve.recordLog(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -244,12 +244,9 @@ class QcCenterOrderService extends AppServiceBase {
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var pushObj = {
CompanyName: res.data.CompanyName,
licenseType: res.data.licenseType,
actionType: res.data.actionType,
companyLocation: res.data.Area,
channelTypeCode: res.data.channelTypeCode,
source: res.data.source
intentionBizId: res.data.channelNeedNo,
bizType: res.data.bizType,
solution: res.data.solutionContent
};
//推送状态变更
this.aliclient.reqbyget({ action: "SubmitSolution", reqbody: pushObj, apiVersion: "2019-03-06" });
......@@ -257,5 +254,103 @@ class QcCenterOrderService extends AppServiceBase {
}
return res;
}
//关闭需求
async closeNeed(pobj) {
if (!actionBody.channelNeedNo) {
return system.getResult(null, "actionBody.channelNeedNo can not be empty,100395");
}
if (!actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100395");
}
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsNeedSve.js/closeNeed",
content: JSON.stringify(pobj),
resultInfo: JSON.stringify(result),
optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
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.channelNeedNo,
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/utilsSve/utilsNeedSve.js/closeNeed",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: { BizId: actionBody.channelNeedNo, note: actionBody.note }, apiVersion: "2019-03-06" });
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "close fail 100389 ");
}
}
//提交沟通记录
async recordLog(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId 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/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log("res", res)
//推送交付系统
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
};
//提交沟通记录
this.aliclient.reqbyget({ action: "SubmitIntentionNote", reqbody: pushObj, apiVersion: "2019-03-06" });
return system.getResultSuccess();
}
}
module.exports = QcCenterOrderService;
\ No newline at end of file
......@@ -281,7 +281,9 @@ module.exports = function (app) {
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention",
"tmAccept", "tmStatus",
"needBatchUpload"
"needBatchUpload",
"serviceSubmitOption","submitWangwenSolution","closeNeed","recordLog"
];
if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || "";
......
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