Commit 832d845d by 宋毅

tj

parent 91f02175
......@@ -61,11 +61,9 @@ class Need extends APIBase {
opResult = await this.utilsNeedSve.reqCenterOrderQcApi(pobj);
break;
case "icpNotify"://icp方案更新
var rtn = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody);
if (pobj.actionBody.status == 2 && rtn.status == 0) {
opResult = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody);
if (opResult.status == 0 && pobj.actionBody.status == 2) {
opResult = await self.centerorderSve.icppaysuccess(pobj, pobj.actionBody);
} else {
opResult = rtn;
}
break;
case "writeCommunicationLog"://icp接收方案反馈信息
......
......@@ -259,7 +259,6 @@ class CenterorderService extends AppServiceBase {
pobj.actionType = "receiveSolutionPayInfo";
var url = settings.centerOrderUrl() + "action/icapi/springBoard";
var solutionrtn = await this.execClient.execPost(pobj, url);
console.log(solutionrtn);
if (!solutionrtn || !solutionrtn.stdout) {
return system.getResultFail(-5011, "方案查询失败");
}
......@@ -267,6 +266,9 @@ class CenterorderService extends AppServiceBase {
if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败");
}
if (!solutiondata.data) {
return system.getResultFail(-5012, "方案查询数据为空");
}
if (solutiondata.data && solutiondata.data.channelNeedNo) {
pobj.actionBody.needId = solutiondata.data.channelNeedNo;
}
......@@ -276,20 +278,26 @@ class CenterorderService extends AppServiceBase {
pobj.actionBody.regType = "ali.edi";
}
var fqobj = {
"actionType": "getAppInterface",
"actionBody": {
"area": pobj.actionBody.province,
"city": pobj.actionBody.province,
"regType": pobj.actionBody.regType,
"orderNo": pobj.actionBody.channelOrder.channelOrderNo,
"orderPrice": pobj.actionBody.orderPrice,
"phone": pobj.actionBody.publishMobile,
"needId": solutiondata.data.channelNeedNo
actionBody: {
area: pobj.actionBody.province,
city: pobj.actionBody.province,
regType: pobj.actionBody.regType,
orderNo: pobj.actionBody.channelOrder.channelOrderNo,
orderPrice: pobj.actionBody.orderPrice,
phone: pobj.actionBody.publishMobile,
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.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
return system.getResultSuccess();
}
//--------------------------阿里IC---end--------------------------------------------------------
......
......@@ -39,7 +39,7 @@ class UtilsDeliverSystemService extends AppServiceBase {
async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) {
try {
var rtn = await this.restPostUrl(pushQueueUrl, reqParams);
var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
if (rtn.status != 1) {
return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn));
}
......
......@@ -41,16 +41,16 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
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");
}else{
if(pobj.actionBody.channel_type_code==5){
pobj.actionBody.type="ali.icp";
}else{
pobj.actionBody.type="ali.edi";
} else {
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
} else {
pobj.actionBody.type = "ali.edi";
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
}
}
}
return result;
}
......@@ -104,7 +104,7 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
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");
}
// else{
......@@ -162,14 +162,14 @@ class UtilsNeedService extends AppServiceBase {
* @param {*} pobj
* @param {*} actionBody bizId 渠道方案号
*/
async getItemByChannelSolutionNo(pobj, actionBody) {
if (!actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100390");
async getItemByChannelSolutionNo(pobj, actionBody) {
if (!actionBody.bizId) {
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
......@@ -268,13 +268,27 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionType = "receiveIcpStatusNotify";
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
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;
}
/**
* 推送交付信息至企业宝(交付系统)
*/
async pushOrderDelivery2Qfb(pobj,needsolution){
async pushOrderDelivery2Qfb(pobj, needsolution) {
}
async opDownFileInfo(docUrl, result) { //从oss下载到本地并上传到自己oss,之后删除本地文件
......@@ -330,8 +344,8 @@ class UtilsNeedService extends AppServiceBase {
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(sobj, reqUrl);
if(itemResult.status==0){
itemResult.data.channelSolutionNo=pobj.actionBody.channelSolutionNo;
if (itemResult.status == 0) {
itemResult.data.channelSolutionNo = pobj.actionBody.channelSolutionNo;
}
return itemResult;
}
......@@ -346,10 +360,10 @@ class UtilsNeedService extends AppServiceBase {
var self = this;
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
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;
}
async queryExpertApplyCommunicationLogs(pobj) {
if (!pobj.actionBody.BizId) {
return system.getResult(null, "actionBody.BizId can not be empty,100493");
......@@ -357,13 +371,15 @@ class UtilsNeedService extends AppServiceBase {
if (!pobj.actionBody.UserFeedBack) {
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 : "",
EndTime:pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId:pobj.actionBody.BizId,
UserFeedBack:pobj.actionBody.UserFeedBack,
apiVersion: "2019-05-08"
}});
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: pobj.actionBody.BizId,
UserFeedBack: pobj.actionBody.UserFeedBack,
apiVersion: "2019-05-08"
}
});
return res;
}
......
......@@ -7,12 +7,34 @@ class UtilsPushService extends AppServiceBase {
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中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
debugger;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -30,7 +52,7 @@ class UtilsPushService extends AppServiceBase {
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;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
......
......@@ -25,7 +25,7 @@ var settings = {
port: process.env.NODE_PORT || 4012,
opPushQueueUrl: function () {
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 {
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