Commit 832d845d by 宋毅

tj

parent 91f02175
...@@ -61,11 +61,9 @@ class Need extends APIBase { ...@@ -61,11 +61,9 @@ class Need extends APIBase {
opResult = await this.utilsNeedSve.reqCenterOrderQcApi(pobj); opResult = await this.utilsNeedSve.reqCenterOrderQcApi(pobj);
break; break;
case "icpNotify"://icp方案更新 case "icpNotify"://icp方案更新
var rtn = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody);
if (pobj.actionBody.status == 2 && rtn.status == 0) { if (opResult.status == 0 && pobj.actionBody.status == 2) {
opResult = await self.centerorderSve.icppaysuccess(pobj, pobj.actionBody); opResult = await self.centerorderSve.icppaysuccess(pobj, pobj.actionBody);
} else {
opResult = rtn;
} }
break; break;
case "writeCommunicationLog"://icp接收方案反馈信息 case "writeCommunicationLog"://icp接收方案反馈信息
......
...@@ -259,7 +259,6 @@ class CenterorderService extends AppServiceBase { ...@@ -259,7 +259,6 @@ class CenterorderService extends AppServiceBase {
pobj.actionType = "receiveSolutionPayInfo"; pobj.actionType = "receiveSolutionPayInfo";
var url = settings.centerOrderUrl() + "action/icapi/springBoard"; var url = settings.centerOrderUrl() + "action/icapi/springBoard";
var solutionrtn = await this.execClient.execPost(pobj, url); var solutionrtn = await this.execClient.execPost(pobj, url);
console.log(solutionrtn);
if (!solutionrtn || !solutionrtn.stdout) { if (!solutionrtn || !solutionrtn.stdout) {
return system.getResultFail(-5011, "方案查询失败"); return system.getResultFail(-5011, "方案查询失败");
} }
...@@ -267,6 +266,9 @@ class CenterorderService extends AppServiceBase { ...@@ -267,6 +266,9 @@ class CenterorderService extends AppServiceBase {
if (solutiondata.status != 0) { if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败"); return system.getResultFail(-5011, "方案查询失败");
} }
if (!solutiondata.data) {
return system.getResultFail(-5012, "方案查询数据为空");
}
if (solutiondata.data && solutiondata.data.channelNeedNo) { if (solutiondata.data && solutiondata.data.channelNeedNo) {
pobj.actionBody.needId = solutiondata.data.channelNeedNo; pobj.actionBody.needId = solutiondata.data.channelNeedNo;
} }
...@@ -276,20 +278,26 @@ class CenterorderService extends AppServiceBase { ...@@ -276,20 +278,26 @@ class CenterorderService extends AppServiceBase {
pobj.actionBody.regType = "ali.edi"; pobj.actionBody.regType = "ali.edi";
} }
var fqobj = { var fqobj = {
"actionType": "getAppInterface", actionBody: {
"actionBody": { area: pobj.actionBody.province,
"area": pobj.actionBody.province, city: pobj.actionBody.province,
"city": pobj.actionBody.province, regType: pobj.actionBody.regType,
"regType": pobj.actionBody.regType, orderNo: pobj.actionBody.channelOrder.channelOrderNo,
"orderNo": pobj.actionBody.channelOrder.channelOrderNo, orderPrice: pobj.actionBody.orderPrice,
"orderPrice": pobj.actionBody.orderPrice, phone: pobj.actionBody.publishMobile,
"phone": pobj.actionBody.publishMobile, needId: solutiondata.data.channelNeedNo
"needId": solutiondata.data.channelNeedNo
}, },
"appInfo": pobj.appInfo appInfo: pobj.appInfo
}
var deliveryObj = {
actionBody: {
orderNo: pobj.actionBody.channelOrder.channelOrderNo,
needsolution: solutiondata.data.solutionContent
},
appInfo: pobj.appInfo
} }
this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness"); this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness");
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
return system.getResultSuccess(); return system.getResultSuccess();
} }
//--------------------------阿里IC---end-------------------------------------------------------- //--------------------------阿里IC---end--------------------------------------------------------
......
...@@ -39,7 +39,7 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -39,7 +39,7 @@ class UtilsDeliverSystemService extends AppServiceBase {
async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) { async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) {
try { try {
var rtn = await this.restPostUrl(pushQueueUrl, reqParams); var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
if (rtn.status != 1) { if (rtn.status != 1) {
return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn)); return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn));
} }
......
...@@ -41,16 +41,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -41,16 +41,16 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) { if (result.status == 0) {
if(pobj.actionBody.channel_type_code=="esp.companyreg"){ if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
}else{ } else {
if(pobj.actionBody.channel_type_code==5){ if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type="ali.icp"; pobj.actionBody.type = "ali.icp";
}else{ } else {
pobj.actionBody.type="ali.edi"; pobj.actionBody.type = "ali.edi";
} }
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
} }
} }
return result; return result;
} }
...@@ -104,7 +104,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -104,7 +104,7 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) { if (result.status == 0) {
if(pobj.actionBody.channel_type_code=="esp.companyreg"){ if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
} }
// else{ // else{
...@@ -162,14 +162,14 @@ class UtilsNeedService extends AppServiceBase { ...@@ -162,14 +162,14 @@ class UtilsNeedService extends AppServiceBase {
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody bizId 渠道方案号 * @param {*} actionBody bizId 渠道方案号
*/ */
async getItemByChannelSolutionNo(pobj, actionBody) { async getItemByChannelSolutionNo(pobj, actionBody) {
if (!actionBody.bizId) { if (!actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100390"); return system.getResult(null, "actionBody.bizId can not be empty,100390");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
} }
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/** /**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
...@@ -268,13 +268,27 @@ class UtilsNeedService extends AppServiceBase { ...@@ -268,13 +268,27 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionType = "receiveIcpStatusNotify"; pobj.actionType = "receiveIcpStatusNotify";
var url = settings.centerOrderUrl() + "action/qcapi/springBoard"; var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url); var rtn = await this.restPostUrl(pobj, url);
if (rtn.status == 0 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
actionBody: {
orderNo: rtn.data.orderNo,
needsolution: rtn.data.solutionContent
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
if (actionBody.status == 11) {
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn; return rtn;
} }
/** /**
* 推送交付信息至企业宝(交付系统) * 推送交付信息至企业宝(交付系统)
*/ */
async pushOrderDelivery2Qfb(pobj,needsolution){ async pushOrderDelivery2Qfb(pobj, needsolution) {
} }
async opDownFileInfo(docUrl, result) { //从oss下载到本地并上传到自己oss,之后删除本地文件 async opDownFileInfo(docUrl, result) { //从oss下载到本地并上传到自己oss,之后删除本地文件
...@@ -330,8 +344,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -330,8 +344,8 @@ class UtilsNeedService extends AppServiceBase {
} }
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(sobj, reqUrl); var itemResult = await this.restPostUrl(sobj, reqUrl);
if(itemResult.status==0){ if (itemResult.status == 0) {
itemResult.data.channelSolutionNo=pobj.actionBody.channelSolutionNo; itemResult.data.channelSolutionNo = pobj.actionBody.channelSolutionNo;
} }
return itemResult; return itemResult;
} }
...@@ -346,10 +360,10 @@ class UtilsNeedService extends AppServiceBase { ...@@ -346,10 +360,10 @@ class UtilsNeedService extends AppServiceBase {
var self = this; var self = this;
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
let res = await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.BizId ,Note:pobj.actionBody.Note}, apiVersion: "2019-05-08" }); let res = await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.BizId, Note: pobj.actionBody.Note }, apiVersion: "2019-05-08" });
return result; return result;
} }
async queryExpertApplyCommunicationLogs(pobj) { async queryExpertApplyCommunicationLogs(pobj) {
if (!pobj.actionBody.BizId) { if (!pobj.actionBody.BizId) {
return system.getResult(null, "actionBody.BizId can not be empty,100493"); return system.getResult(null, "actionBody.BizId can not be empty,100493");
...@@ -357,13 +371,15 @@ class UtilsNeedService extends AppServiceBase { ...@@ -357,13 +371,15 @@ class UtilsNeedService extends AppServiceBase {
if (!pobj.actionBody.UserFeedBack) { if (!pobj.actionBody.UserFeedBack) {
return system.getResult(null, "actionBody.UserFeedBack can not be empty,100494"); return system.getResult(null, "actionBody.UserFeedBack can not be empty,100494");
} }
let res = await self.aliclient.reqbyget({ action: "queryExpertApplyCommunicationLogs", reqbody: { let res = await self.aliclient.reqbyget({
action: "queryExpertApplyCommunicationLogs", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime:pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "", EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId:pobj.actionBody.BizId, BizId: pobj.actionBody.BizId,
UserFeedBack:pobj.actionBody.UserFeedBack, UserFeedBack: pobj.actionBody.UserFeedBack,
apiVersion: "2019-05-08" apiVersion: "2019-05-08"
}}); }
});
return res; return res;
} }
......
...@@ -7,12 +7,34 @@ class UtilsPushService extends AppServiceBase { ...@@ -7,12 +7,34 @@ class UtilsPushService extends AppServiceBase {
super(); super();
}; };
async aliBusiness2Delivery(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/aliBusiness2Delivery",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async aliBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用 async aliBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface"; pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard"; var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl); var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data; pobj.interface_info = productItemInterfaceResult.data;
debugger;
//日志记录 //日志记录
this.logCtl.info({ this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
...@@ -30,7 +52,7 @@ class UtilsPushService extends AppServiceBase { ...@@ -30,7 +52,7 @@ class UtilsPushService extends AppServiceBase {
return system.getResult(null, "push Fail,interface_info data is empty"); return system.getResult(null, "push Fail,interface_info data is empty");
} }
async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务总入口 async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务总入口,不在db中做配置进行调用
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info; var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) { if (!interface_list) {
return system.getResult(null, "暂无推送配置"); return system.getResult(null, "暂无推送配置");
......
...@@ -25,7 +25,7 @@ var settings = { ...@@ -25,7 +25,7 @@ var settings = {
port: process.env.NODE_PORT || 4012, port: process.env.NODE_PORT || 4012,
opPushQueueUrl: function () { opPushQueueUrl: function () {
if (this.env == "dev" || this.env == "test") { if (this.env == "dev" || this.env == "test") {
return "http://192.168.210.205:4018/api/queueAction/producer/springBoard"; return "http://192.168.18.101:4018/api/queueAction/producer/springBoard";
} else { } else {
return "http://sytxpublic-msgq-service/api/queueAction/producer/springBoard"; return "http://sytxpublic-msgq-service/api/queueAction/producer/springBoard";
} }
......
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