Commit 16847669 by 任晓松

推送IC订单

parent a05d96b4
......@@ -82,7 +82,7 @@ class UtilsFqAliyunService extends AppServiceBase {
try {
var rc = system.getObject("util.aliyunClient");
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.getResultSuccess(null, "推送成功");
......@@ -114,20 +114,25 @@ class UtilsFqAliyunService extends AppServiceBase {
}
//下订单到ic
async pushOrder2IC(pobj){
async pushOrder2IC(pobj,opType){
console.log(JSON.stringify(pobj),".................pushOrderBusinessByProductCode2Fq...............pobj");
var verifyResult = await this.verifyParam(pobj);
var productInfo = pobj.actionBody.product_info;
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushAliBusiness2Fq->verifyResult", this.pushlogFailType.FQ);
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
}
var interface_list_temp = interface_list.filter(f => f.op_type == opType)
if (!interface_list_temp || interface_list_temp.length == 0) {
return system.getResult(null, "暂无【" + opType + "】的推送配置");
}
var verifyResult = system.getResultSuccess();
var productInfo = pobj.actionBody.product_info;
if (!productInfo || !productInfo.service_business_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.service_business_code can not be empty,100427");
}
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");
}
var interface_params_info = verifyResult.data;
var interface_params_info = JSON.parse(interface_list_temp[0].params);
//新增订单(商标自助注册) IC
let icOrderParams ={
"idempotentSource":"pcwebsbzc",// 来源编号,写死:pcwebsbzc,必填
......
......@@ -8,6 +8,7 @@ class UtilsOrderService extends AppServiceBase {
constructor() {
super();
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.utilsFqAliyunSve = system.getObject("service.utilsSve.utilsFqAliyunSve");
this.logCtl = system.getObject("service.common.oplogSve");
this.centerOrderUrl = settings.centerOrderUrl();
this.qifuPayAfterH5JumpUrl = settings.qifuPayAfterH5JumpUrl();
......@@ -1181,8 +1182,13 @@ class UtilsOrderService extends AppServiceBase {
}
actionBody.product_item = product_item;
//新增订单(商标自助注册) IC
let icOrderResult = await this.utilsPushSve.pushBusInfo(pobj, "pushOrder2IC", 0);
let icOrderResult = await this.utilsFqAliyunSve.pushOrder2IC(pobj, "pushOrder2IC");
if(icOrderResult.status !=0){
for(let i =0;i<product_item.length;i++){
actionBody.orderNo = product_item[i].idempotentId;
pobj.actionType = 'delOrder';
this.restPostUrl(pobj,url);
}
return icOrderResult;
}
let ids = icOrderResult.data.orderList;
......
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