Commit 55711554 by 王昆

Merge branch 'xggsve-order' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-order

parents 9220be86 700e3709
...@@ -62,5 +62,18 @@ class OproductDao extends Dao { ...@@ -62,5 +62,18 @@ class OproductDao extends Dao {
return result; 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; module.exports = OproductDao;
\ No newline at end of file
...@@ -447,6 +447,7 @@ class OorderService extends ServiceBase { ...@@ -447,6 +447,7 @@ class OorderService extends ServiceBase {
} }
} }
/** /**
* 格式化订单产品 * 格式化订单产品
* @param {*} orderList * @param {*} orderList
...@@ -463,6 +464,18 @@ class OorderService extends ServiceBase { ...@@ -463,6 +464,18 @@ class OorderService extends ServiceBase {
for (let item of orderList) { for (let item of orderList) {
item.oproduct = productMap[item.product_id] || {} 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 { ...@@ -142,6 +142,8 @@ class OorderstatusService extends ServiceBase {
} }
/** /**
* 业务员完善订单信息 * 业务员完善订单信息
* @param {*} params * @param {*} params
...@@ -151,7 +153,10 @@ class OorderstatusService extends ServiceBase { ...@@ -151,7 +153,10 @@ class OorderstatusService extends ServiceBase {
*/ */
async perfectInformation(params) { 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); let _oorderinforeg = await this.oorderinforegDao.findById(params._order.id);
if (!_oorderinforeg) { if (!_oorderinforeg) {
return system.getResult(null, `订单异常 订单明细不存在,请联系管理员`); 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