Commit 3f5cbd63 by 王昆

gsb

parent 97f621a6
......@@ -36,17 +36,27 @@ class OorderstatusService extends ServiceBase {
return system.getResult(null, `订单不存在`);
}
let _orderStatus = await this.getOrderProcessStatus(_order.id, _order.status);
let nextStatus = JSON.parse(_orderStatus.next_status);
var statuses = [];
for (var ns of nextStatus) {
statuses.push(ns.next_status);
let nextList = JSON.parse(_orderStatus.next_status);
let flag = false;
let nextNames = [];
for (var nextItem of nextList) {
nextNames.push(nextItem.next_name);
if(nextItem.next_status == params.status) {
flag = true;
break;
}
}
if (statuses.indexOf(params.status) == -1) {
return system.getResult(null, `订单状态错误,下一订单状态应该是${nextStatus.next_name}`);
if (!flag) {
nextNames = nextNames.join("或");
return system.getResult(null, `订单状态错误,下一订单状态应该是${nextNames}`);
}
let nextStatus = await this.oorderprocessDao.findByOrderIdAndStatus(_order.id, params.status);
params._order = _order;
//调用对应的方法 TODO SOMETHING .....
// 调用func
// await this[nextStatus.func](params);
} catch (error) {
......
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