Commit 8236841d by 宋毅

tj

parent 5d7dbd9b
......@@ -10,7 +10,7 @@ class UtilsFqAliyunService extends AppServiceBase {
this.ucommuneOperatorPhone = settings.ucommuneOperatorPhone()
}
async pushOrderBusinessByProductCode2Fq(pobj) {//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
console.log(JSON.stringify(pobj),".................pushOrderBusinessByProductCode2Fq...............pobj");
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var verifyResult = await this.verifyParam(pobj);
var orderInfo = pobj.actionBody.order_info;
var orderContact = pobj.actionBody.order_contact ? pobj.actionBody.order_contact : pobj.actionBody.delivery_content.orderContact;
......@@ -27,7 +27,7 @@ class UtilsFqAliyunService extends AppServiceBase {
if (!productInfo || !productInfo.service_business_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.service_business_code can not be empty,100427");
}
if (!['360.icp','360.edi'].includes(productInfo.service_business_code)) {
if (!['360.icp', '360.edi'].includes(productInfo.service_business_code)) {
if (!productInfo || !productInfo.price_item || !productInfo.price_item.service_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430");
}
......@@ -85,7 +85,7 @@ class UtilsFqAliyunService extends AppServiceBase {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
if (rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + pobj.requestId + ",requestId=" + rtn.requestId);
return system.getResult(null, "推送失败,失败原因:" + (rtn.errorMsg || rtn.errorMessage) + ",selfrequestId=" + pobj.requestId + ",requestId=" + rtn.requestId);
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
......@@ -108,7 +108,7 @@ class UtilsFqAliyunService extends AppServiceBase {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
if (rtn.code != 200 || rtn.success != true) {
return system.getResult(null, "推送失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + pobj.requestId + ",requestId=" + rtn.requestId);
return system.getResult(null, "推送失败,失败原因:" + (rtn.errorMsg || rtn.errorMessage) + ",selfrequestId=" + pobj.requestId + ",requestId=" + rtn.requestId);
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
......@@ -141,8 +141,8 @@ class UtilsFqAliyunService extends AppServiceBase {
}
//下订单到ic
async pushOrder2IC(pobj,opType){
console.log(JSON.stringify(pobj),".................pushOrderBusinessByProductCode2Fq...............pobj");
async pushOrder2IC(pobj, opType) {
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
......@@ -161,15 +161,15 @@ class UtilsFqAliyunService extends AppServiceBase {
}
var interface_params_info = JSON.parse(interface_list_temp[0].params);
//新增订单(商标自助注册) IC
let icOrderParams ={
"idempotentSource":"pcwebsbzc",// 来源编号,写死:pcwebsbzc,必填
"idempotentSourceName":"PC官网",// 来源编号,写死:PC官网,必填
"product_img_url":pobj.actionBody.deliveryData.tm.picUrl,//产品图片
"productId":productInfo.price_item.service_code,// 云服产品skuid,必填
"goodsId":pobj.actionBody.goodsId,// 官网产品id
"customerId":pobj.actionBody.customerId, //客户Id,必填
"product_item":pobj.actionBody.product_item,
"device_token":pobj.actionBody.device_token //设备编号参数
let icOrderParams = {
"idempotentSource": "pcwebsbzc",// 来源编号,写死:pcwebsbzc,必填
"idempotentSourceName": "PC官网",// 来源编号,写死:PC官网,必填
"product_img_url": pobj.actionBody.deliveryData.tm.picUrl,//产品图片
"productId": productInfo.price_item.service_code,// 云服产品skuid,必填
"goodsId": pobj.actionBody.goodsId,// 官网产品id
"customerId": pobj.actionBody.customerId, //客户Id,必填
"product_item": pobj.actionBody.product_item,
"device_token": pobj.actionBody.device_token //设备编号参数
}
pobj.params = icOrderParams;
var result = await this.opICClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
......
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