Commit 8236841d by 宋毅

tj

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