Commit 700e3709 by 孙亚楠

dd

parent 16c84808
......@@ -62,5 +62,18 @@ class OproductDao extends Dao {
return result;
}
async findMapAll() {
let result = {};
let sql = "SELECT * FROM o_product ORDER BY sort ASC";
let list= await this.customQuery(sql, {});
if (!list || list.length == 0) {
return result;
}
for (var item of list) {
result[item.id] = item;
}
return result;
}
}
module.exports = OproductDao;
\ No newline at end of file
......@@ -440,6 +440,7 @@ class OorderService extends ServiceBase {
}
}
/**
* 格式化订单产品
* @param {*} orderList
......@@ -456,6 +457,18 @@ class OorderService extends ServiceBase {
for (let item of orderList) {
item.oproduct = productMap[item.product_id] || {}
}
let productAllMap = await this.oproductDao.findMapAll();
for (let item of orderList) {
if(!item.service_items){
continue;
}
let childProductServiceItem = "";
for(let ele of item.service_items.split(',')){
childProductServiceItem += `${productAllMap[ele].name}、`;
}
item.oproduct.childProductServiceItem = childProductServiceItem || "";
}
}
/**
......
......@@ -142,6 +142,8 @@ class OorderstatusService extends ServiceBase {
}
/**
* 业务员完善订单信息
* @param {*} params
......@@ -151,7 +153,10 @@ class OorderstatusService extends ServiceBase {
*/
async perfectInformation(params) {
//验证参数
this.verificationPerfectInformation(params);
let r = this.verificationPerfectInformation(params);
if( r && r.status != 0){
return r;
}
let _oorderinforeg = await this.oorderinforegDao.findById(params._order.id);
if (!_oorderinforeg) {
return system.getResult(null, `订单异常 订单明细不存在,请联系管理员`);
......
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