Commit a6ab7c72 by linboxuan

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

parents 1237f4ca bbfd3a2e
......@@ -5,6 +5,7 @@ class QcAPI extends APIBase {
constructor() {
super();
this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve");
this.baseOrderSve = system.getObject("service.common.baseCenterOrderSve");
}
/**
* 接口跳转-POST请求
......@@ -26,7 +27,7 @@ class QcAPI extends APIBase {
opResult = await this.qcCenterOrderSve.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
break;
case "submitIcpProgramme"://icp方案提交
opResult = await this.qcCenterOrderSve.submitIcpProgramme(pobj);
opResult = await this.baseOrderSve.submitIcpProgramme(pobj);
break;
case "receiveProgrammeNo"://接收渠道方案号(测试)
opResult = await this.qcCenterOrderSve.reqCenterOrderApi(pobj);
......@@ -44,10 +45,10 @@ class QcAPI extends APIBase {
opResult = await this.qcCenterOrderSve.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.qcCenterOrderSve.serviceProviderSubmitMaterial(pobj);
opResult = await this.baseOrderSve.serviceProviderSubmitMaterial(pobj);
break;
case "serviceProviderNotification"://交付商通知状态变更
opResult = await this.qcCenterOrderSve.serviceProviderNotification(pobj);
opResult = await this.baseOrderSve.serviceProviderNotification(pobj);
break;
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj);
......
......@@ -25,13 +25,13 @@ class QcAPI2 extends APIBase {
var opResult = null;
switch (action_type) {
case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.baseOrderSve.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
opResult = await this.centerorderSve.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
break;
case "submitIcpProgramme"://icp方案提交
opResult = await this.baseOrderSve.submitIcpProgramme(pobj);
break;
case "receiveProgrammeNo"://接收渠道方案号(测试)
opResult = await this.baseOrderSve.reqCenterOrderApi(pobj);
opResult = await this.centerorderSve.reqCenterOrderApi(pobj);
break;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.baseOrderSve.submitIcpMaterial(pobj);
......@@ -40,10 +40,10 @@ class QcAPI2 extends APIBase {
// opResult = await this.baseOrderSve.acceptIcpPartnerNotification(pobj);
// break;
case "abolishIcpProgramme"://服务商icp方案关闭
opResult = await this.baseOrderSve.abolishIcpProgramme(pobj);
opResult = await this.centerorderSve.abolishIcpProgramme(pobj);
break;
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.baseOrderSve.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
opResult = await this.centerorderSve.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.baseOrderSve.serviceProviderSubmitMaterial(pobj);
......@@ -52,7 +52,7 @@ class QcAPI2 extends APIBase {
opResult = await this.baseOrderSve.serviceProviderNotification(pobj);
break;
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.baseOrderSve.closeOrderDelivery(pobj);
opResult = await this.centerorderSve.closeOrderDelivery(pobj);
break;
// --------- 文网文 ---------
......
......@@ -6,6 +6,8 @@ class Need extends APIBase {
super();
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
this.centerorderSve = system.getObject("service.common.centerorderSve");
this.utilsNeedSve2 = system.getObject("service.utilsSve.utilsNeedSve2");
}
/**
......@@ -40,7 +42,7 @@ class Need extends APIBase {
opResult = await this.utilsNeedSve.needClose(pobj, pobj.actionBody);
break;
case "needCloseIcp"://关闭需求
opResult = await this.utilsNeedSve.needCloseIcp(pobj, pobj.actionBody);
opResult = await this.utilsNeedSve2.needCloseIcp(pobj, pobj.actionBody);
break;
case "needDetailByChannelNo":
opResult = await this.utilsNeedSve.needDetailByChannelNo(pobj, pobj.actionBody);
......@@ -68,10 +70,10 @@ class Need extends APIBase {
}
break;
case "writeCommunicationLog"://icp接收方案反馈信息
opResult = await this.utilsNeedSve.writeCommunicationLog(pobj);
opResult = await this.utilsNeedSve2.writeCommunicationLog(pobj);
break;
case "queryExpertApplyCommunicationLogs"://icp接收方案反馈信息
opResult = await this.utilsNeedSve.queryExpertApplyCommunicationLogs(pobj);
opResult = await this.utilsNeedSve2.queryExpertApplyCommunicationLogs(pobj);
break;
case "getaliicpProduce"://方案询价
opResult = await this.centerorderSve.getaliicpProduce(pobj);
......
......@@ -41,7 +41,7 @@ class Need2 extends APIBase {
opResult = await this.utilsNeedSve.needClose(pobj, pobj.actionBody);
break;
case "needCloseIcp"://关闭需求
opResult = await this.utilsNeedSve.needCloseIcp(pobj, pobj.actionBody);
opResult = await this.utilsNeedSve2.needCloseIcp(pobj, pobj.actionBody);
break;
case "needDetailByChannelNo":
opResult = await this.utilsNeedSve.needDetailByChannelNo(pobj, pobj.actionBody);
......
......@@ -80,7 +80,7 @@ class BaseCenterOrderService extends AppServiceBase {
};
//调用center-order
async reqCenterOrderApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/baseapi/springBoard";
var url = this.centerOrderUrl + "action/qcapi/springBoard";
if (reqUrl) {
var url = this.centerOrderUrl + reqUrl;
}
......@@ -230,24 +230,37 @@ class BaseCenterOrderService extends AppServiceBase {
console.log("pushRes++++",pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data;
if (resData.result) {
if (resData.planId) {
var reqObj2 = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
solutionBizId: resData.result
solutionBizId: resData.planId
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
return pushRes;
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/baseapi/springBoard");
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
......@@ -305,15 +318,15 @@ class BaseCenterOrderService extends AppServiceBase {
console.log('BizId++',BizId)
var pushObj = {
"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
"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 || ""
},
"partnerForeignInvestment": material.PartnerForeignInvestment || "",
"orderNo": BizId,
......@@ -371,7 +384,7 @@ class BaseCenterOrderService extends AppServiceBase {
}
//交付单关闭
async closeOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
......@@ -390,7 +403,7 @@ class BaseCenterOrderService extends AppServiceBase {
//服务商提交服务操作(文网文)2020-9-26
async serviceSubmitOption(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
......@@ -412,7 +425,7 @@ class BaseCenterOrderService extends AppServiceBase {
//提交方案(文网文)2020-9-27
async submitWangwenSolution(pobj) {
console.log('文网文提交方案',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
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;
......@@ -490,7 +503,7 @@ class BaseCenterOrderService extends AppServiceBase {
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/baseapi/springBoard";
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+++result',result)
if (result.status == 0) {
......@@ -545,7 +558,7 @@ class BaseCenterOrderService extends AppServiceBase {
//提交沟通记录
async recordLog(pobj) {
console.log('提交沟通记录pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100491");
}
......@@ -553,7 +566,7 @@ class BaseCenterOrderService extends AppServiceBase {
return system.getResult(null, "actionBody.note can not be empty,100492");
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/baseapi/springBoard";
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('www+提交沟通记录result',result)
//推送交付系统
......@@ -607,7 +620,7 @@ class BaseCenterOrderService extends AppServiceBase {
//服务商提交服务操作
async foodServiceSubmitOption(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var resStatus = res.data.ApplicationStatus;
......@@ -628,7 +641,7 @@ async foodServiceSubmitOption(pobj) {
//提交方案
async submitFoodSolution(pobj) {
console.log('food+++pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
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);
......@@ -686,7 +699,7 @@ async foodCloseNeed(pobj) {
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.needNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/baseapi/springBoard";
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('food+++result',result)
if (result.status == 0) {
......@@ -731,7 +744,7 @@ async foodCloseNeed(pobj) {
//提交沟通记录
async foodRecordLog(pobj) {
console.log('提交沟通记录pobj',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/baseapi/springBoard");
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (!pobj.actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100491");
}
......@@ -739,7 +752,7 @@ async foodRecordLog(pobj) {
return system.getResult(null, "actionBody.note can not be empty,100492");
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/baseapi/springBoard";
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('提交沟通记录result',result)
//推送交付系统
......
......@@ -106,6 +106,10 @@ class UtilsNeedService extends AppServiceBase {
}
var self = this;
pobj.actionType = "receiveIcpFeedback";
if(pobj.actionBody && pobj.actionBody.intentionStatus){
pobj.intentionStatus = pobj.actionBody.intentionStatus;
}
var rtn = await this.execClient.execPost(pobj, url);
// 2020 0803 lin 修改;
if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq
......@@ -113,7 +117,6 @@ class UtilsNeedService extends AppServiceBase {
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
}
}
var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout);
return data;
}
......
......@@ -222,7 +222,7 @@ class UtilsNeedService2 extends AppServiceBase {
// 2020 1016 lin 新增 需求关闭时判断 方案状态 订单状态,打个比方如果已经生成订单了 那么肯定不能直接关闭需求
var self = this;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/baseapi/springBoard";
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
// 2020 1015 lin 新增 这里为什么只推送蜂擎 没有推送交付?
// 明天找栋源确认 如果需要增加 在这个文件搜索updateChanceStatus
......@@ -259,11 +259,14 @@ class UtilsNeedService2 extends AppServiceBase {
* @param {*} actionBody
*/
async needCloseIcp(pobj, actionBody) {
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");
console.log('guanbi icp xuqiu pobj+++',pobj)
if(actionBody.uapp_id == uappId.ali){
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;
......@@ -279,9 +282,10 @@ class UtilsNeedService2 extends AppServiceBase {
resultInfo: JSON.stringify(result),
optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
console.log('result close',result)
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
if (result.data && result.data.orderNo ) {
pobj.actionBody.orderNo = result.data.orderNo;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
......@@ -308,9 +312,15 @@ class UtilsNeedService2 extends AppServiceBase {
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
console.log(a);
// 推送ali
if(result.data.uapp_id == uappId.ali){
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
}
// 推送baidu
if(result.data.uapp_id == uappId.baidu){
var a = await self.baiduclient.baiduReqbyget({ path : "/api/bla/provider/requirement/update", reqbody : { requirementId : actionBody.channelNeedNo, status: "CLOSED" ,note: actionBody.note }});
}
console.log("closed need a+++",a);
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
return system.getResultSuccess();
} else {
......@@ -496,7 +506,7 @@ class UtilsNeedService2 extends AppServiceBase {
return system.getResult(null, "actionBody.note can not be empty,100492");
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/need2/springBoard";
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
//2020-10-28 laolan start
if(result && result.status == 0 && result.data){
......@@ -541,7 +551,7 @@ class UtilsNeedService2 extends AppServiceBase {
// return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
// }
//2020-10-28 laolan start
var reqUrl = this.centerOrderUrl + "action/need2/springBoard";
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('jilu+++result++++',result)
if(result && result.status == 0 && result.data && result.data.uapp_id){
......@@ -662,7 +672,7 @@ class UtilsNeedService2 extends AppServiceBase {
pobj.actionBody.data = [];
await this.queryByAli(pobj, 1);
pobj.actionType = "getUnCreated";
let reqUrl = this.centerOrderUrl + "action/need2/springBoard";
let reqUrl = this.centerOrderUrl + "action/need/springBoard";
let result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
pobj.actionBody = {
......
......@@ -57,6 +57,7 @@
"sha256": "^0.2.0",
"socket.io": "^2.1.1",
"tenpay": "^2.1.18",
"urlencode": "^1.1.0",
"uuid": "^3.2.1",
"wx-pay": "^1.0.2",
"xml2js": "^0.4.23"
......
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