Commit 1256381b by 任晓松

360状态推送

parent c09ca9db
......@@ -14,7 +14,8 @@ const wangwenStatusDisct = {
//区分渠道的uappid
const uappId = {
'ali':"18", //(阿里icp、edi)
'baidu':"44" //(百度icp、edi)
'baidu':"44", //(百度icp、edi)
'zc360':"50" //360icp、edi
}
//tui song baidu zhuanyong pinyin 2020-11-6
const cityLetter = {
......@@ -79,6 +80,7 @@ class BaseCenterOrderService extends AppServiceBase {
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");//测试用
this.opPushQueueUrl = settings.opPushQueueUrl();
this.baiduclient = system.getObject("util.baiduClient");
this.utils360Sve = system.getObject("service.utilsSve.utils360Sve")
};
//调用center-order
async reqCenterOrderApi(pobj, reqUrl) {
......@@ -724,7 +726,18 @@ class BaseCenterOrderService extends AppServiceBase {
var baiduFlag = -200
}
}
if(aliFlag == 200 || baiduFlag == 200){
if(res.data.uapp_id == uappId.zc360){
pobj.pushObj = res.data;
let zc360 = await this.utils360Sve.pushOrderStatus(pobj);
if(zc360 && zc360.code == 200 && zc360.msg == 'ok' ){
var zc360Flag = 200
}else{
var zc360Flag = -200
}
}
if(aliFlag == 200 || baiduFlag == 200 || zc360Flag == 200){
return system.getResultSuccess();
}
}
......
......@@ -56,23 +56,23 @@ class utils360Sve extends AppServiceBase {
//更新订单状态到360
async pushOrderStatus(pobj) {
try {
var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "status->pushOrderStatus->verifyResult", this.pushlogFailType.FAILLOG);
}
var interface_params_info = verifyResult.data;
// var verifyResult = await this.verifyParam(pobj);
// if (verifyResult.status != 0) {
// return await this.disposePushResultFail(pobj, verifyResult, "status->pushOrderStatus->verifyResult", this.pushlogFailType.FAILLOG);
// }
// var interface_params_info = verifyResult.data;
let token = await this.utilsAuthSve.get360Token();
let url = interface_params_info.opUrl + '?token=' + token.access_token;
let url = settings.pushUrl360() + 'api/v1/eshop/GsbOrderUpdate?token=' + token.access_token;
let order_id = pobj.actionBody.orderNo;
let ApplicationStatus = pobj.pushObj.ApplicationStatus;
let status = 0;
if (Number(ApplicationStatus) < 508) {
status = 30
} else {
let status = 30;
if(Number(ApplicationStatus) > 510){
status = 40;
}
let pushObj = {
order_id, status
order_id,
status,
sub_status:ApplicationStatus
}
let result = await this.restPostUrl(pushObj, url);
if (result.code == 200) {
......
......@@ -17,6 +17,7 @@ class UtilsOrderService extends AppServiceBase {
this.centerAppUrl = settings.centerAppUrl();
this.centerAppPayUrl = settings.centerAppUrl() + "payment/paymentApi/springBoard";
this.paySecret = settings.paySecret()
this.utils360Sve = system.getObject("service.utilsSve.utils360Sve");
};
/*
* 订单验证
......@@ -955,24 +956,32 @@ class UtilsOrderService extends AppServiceBase {
actionBody: opOrderResult.data
}
// 推送
let yfRet = await this.utilsPushSve.pushBusInfo(pobj, "pushOrder", 0);
if(yfRet.status !=0){
return yfRet;
}
if (['icpsq', 'edisq'].includes(opOrderResult.data.product_info.channel_item_code)) {
//创建方案
pobj.salesmanInfo ={
"salesmanId":yfRet.data.orderList[0].operator || "",
"salesmanName":yfRet.data.orderList[0].operatorName || "",
"salesmanMobile":yfRet.data.orderList[0].phone ||"",
"salesmanChannelId":yfRet.data.orderList[0].channelUserId || ""
}
let pushRet = await this.packagingPushData(pobj);
if (pushRet.status != 0) {
throw new Error('推送失败')
}
pobj.actionBody = pushRet.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushDeliveryOrder");
// let yfRet = await this.utilsPushSve.pushBusInfo(pobj, "pushOrder", 0);
// if(yfRet.status !=0){
// return yfRet;
// }
// if (['icpsq', 'edisq'].includes(opOrderResult.data.product_info.channel_item_code)) {
// //创建方案
// pobj.salesmanInfo ={
// "salesmanId":yfRet.data.orderList[0].operator || "",
// "salesmanName":yfRet.data.orderList[0].operatorName || "",
// "salesmanMobile":yfRet.data.orderList[0].phone ||"",
// "salesmanChannelId":yfRet.data.orderList[0].channelUserId || ""
// }
// let pushRet = await this.packagingPushData(pobj);
// if (pushRet.status != 0) {
// throw new Error('推送失败')
// }
// pobj.actionBody = pushRet.data;
// this.utilsPushSve.aliBusiness2Delivery(pobj, "pushDeliveryOrder");
// }
//订单状态 已接单 目前360在用
pobj.actionBody.orderNo = params.orderNo;
pobj.pushObj = {
ApplicationStatus : 30
};
if(pobj.appInfo.uapp_id == '50'){
this.utils360Sve.pushOrderStatus(pobj)
}
opOrderResult.data = null;
return opOrderResult;
......
......@@ -267,6 +267,13 @@ var settings = {
return "https://console.e.360.cn/"//
}
},
pushUrl360: function () {
if (this.env == "dev") {
return "http://180.163.239.98:38086/"// 360测试环境
} else {
return "https://tobadmin.e.360.cn/"//
}
},
aliUappId: function () {
if (this.env == "dev") {
return 18// uapp_id
......
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