Commit 06242d1e by 王昆

gsb

parent d14817f3
......@@ -19,6 +19,7 @@ class ActionAPI extends APIBase {
this.oorderdeliverSve = system.getObject("service.order.oorderdeliverSve");
this.oorderstatusSve = system.getObject("service.order.oorderstatusSve");
this.oprocessSve = system.getObject("service.product.oprocessSve");
this.oproductSve = system.getObject("service.product.oproductSve");
}
/**
* 接口跳转
......@@ -45,9 +46,15 @@ class ActionAPI extends APIBase {
async handleRequest(action_process, action_type, action_body) {
var opResult = null;
try{
switch (action_type) {
case "orderInfo": // 查订单信息
opResult = await this.oorderSve.info(action_body);
break;
case "orderInfoAll": // 查订单信息
opResult = await this.oorderSve.info(action_body);
break;
case "orders": //订单管理(平台)
opResult = await this.oorderSve.orders(action_body);
break;
......@@ -64,6 +71,11 @@ class ActionAPI extends APIBase {
opResult = await this.oorderSve.addSourceOrder(action_body);
break;
case "productDics": // 查询产品字典
opResult = await this.oproductSve.productDics(action_body);
break;
case "allProcess": // 查询业务进度
opResult = await this.oprocessSve.allNames(action_body);
break;
......@@ -94,12 +106,12 @@ class ActionAPI extends APIBase {
case "allOrderList":
opResult = await this.iborderSve.apiAllList(action_body);
break;
case "orderInfo":
opResult = await this.iborderSve.apiInfo(action_body);
break;
case "orderInfoAll":
opResult = await this.iborderSve.apiAllInfo(action_body);
break;
// case "orderInfo":
// opResult = await this.iborderSve.apiInfo(action_body);
// break;
// case "orderInfoAll":
// opResult = await this.iborderSve.apiAllInfo(action_body);
// break;
case "byChannelOrderId":
opResult = await this.iborderSve.apiByChannelOrderId(action_body);
break;
......
......@@ -5,6 +5,22 @@ class OproductDao extends Dao {
super(Dao.getModelName(OproductDao));
}
async dics(params) {
let sql = [];
sql.push("SELECT");
sql.push("id, `name`, `desc`, pid");
sql.push("FROM o_product");
sql.push("WHERE 1 = 1");
if (params.pid) {
sql.push("AND pid = :pid");
}
if (params.hasOwnProperty("is_choose")) {
sql.push("AND is_choose = :is_choose");
}
return this.customQuery(sql.join(" "), params);
}
async findListByPid(pid) {
let sql = "SELECT * FROM o_product WHERE pid = :pid ORDER BY sort ASC";
return await this.customQuery(sql, {pid: pid});
......
......@@ -82,6 +82,25 @@ class OorderService extends ServiceBase {
}
/**
* 查询订单信息
* @param {*} params
*/
async info(params) {
let row = await this.dao.getById(params.id);
if (!row) {
return system.getResult(null, "订单不存在");
}
await this.dao.setRowCodeName(row, "status");
let statusObj = await this.getOrderProcessStatus(row.id, row.status);
row.next_status = statusObj.next_status || {};
row.status_name = statusObj.name;
this.handleDate(row, ["created_at", "assign_time"], null, -8);
return system.getResultSuccess(row);
}
/**
* 新建进度
* @param params
* @returns {Promise<void>}
......
......@@ -9,10 +9,9 @@ class OproductService extends ServiceBase {
this.oproductprocessDao = system.getObject("db.product.oproductprocessDao");
}
async getProcessList(productPid, productIds) {
async productDics(params) {
let list = await this.dao.dics(params);
return system.getResultSuccess(list);
}
/**
......
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