Commit b47b2c16 by linboxuan

orderinfoSve add tmRefuse

parent 5dd8ee5d
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class OrderAPI extends APIBase {
constructor() {
super();
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
//--------------------------------ali订单交易 订单操作-----开始
case "tmRefuse":// 2020 0828 lin 新增 ali商标交易 关闭订单接口
opResult = await this.orderinfoSve.tmRefuse(pobj);
break;
//--------------------------------ali订单交易 订单操作-----结束
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = OrderAPI;
\ No newline at end of file
......@@ -1717,6 +1717,22 @@ class OrderInfoService extends ServiceBase {
})
}
// 2020 0828 lin 新增 ali商标交易 关闭订单接口
async tmRefuse(pobj) {
var ab = pobj.actionBody;
var app = pobj.appInfo;
var orderinfo = await this.findOne({ channelOrderNo: ab.bizId, uapp_id: app.uapp_id });
if (!orderinfo) {
return system.getResultFail(-6001, "订单不存在");
}
if (orderinfo.orderStatus != 1) {
return system.getResultFail(-6002, "订单状态不符合关闭需求");
}
orderinfo.orderStatus = 32;
var self = this;
await self.update(orderinfo.dataValues);
// 注意这里 如果没有返回值 则会在api.base报错,拿不到requestId
return system.getResultSuccess();
}
}
module.exports = OrderInfoService;
\ No newline at end of file
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