Commit 64b29bb8 by 孙亚楠

d

parent 42544b26
......@@ -56,6 +56,12 @@ class OrderCtl extends CtlBase {
if(pobj.product_type=='1'){ //如果是单个产品 需要转化单价
pobj.product_unit_price = system.y2f(pobj.product_unit_price);
}
//格式化产品价格(组合产品 的子产品价格)
if(pobj.product_type=='2' && pobj.product_arr && pobj.product_arr.length>0){
for (let item of pobj.product_arr) {
item.price = system.y2f(item.price);
}
}
// 需要去调用商户钱包 扣钱
if(pobj.id){
let reduceAccountBalanceRes = await this.merchantaccountSve.addordelavailable({merchant_id: this.trim(pobj.merchant_id),amount:pobj.price*(-1)});
......@@ -67,11 +73,12 @@ class OrderCtl extends CtlBase {
let res = await this.orderSve.saveEorder(pobj);
if(res.status==0 && res.data && res.data.price && res.data.product_type){
res.data.price = system.f2y(res.data.price) || 0;
res.data.product_unit_price = system.f2y(res.data.product_unit_price) || 0;
if(res.data.product_type=='2'){ //如果是组合产品
res.data.product_specifications = system.f2y(res.data.product_specifications) || 0;
}
}
return system.getResult(res);
return res;
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
......@@ -152,8 +159,13 @@ class OrderCtl extends CtlBase {
return system.getResult(null, `订单【${pobj.id}】不存在`);
}
let res = await this.orderSve.getEorderById(pobj);
if(res.status==0 && res.data.productChildren){
for(let item of res.data.productChildren){
item.price = system.f2y(item.price);
}
}
// 计费
// await this.feeSve.setRowsFee([res.data], "engine_account_id");
let feeRes = await this.feeSve.setRowsFee([res.data], "engine_account_id");
return res;
}catch (e) {
console.log(e);
......@@ -230,23 +242,6 @@ class OrderCtl extends CtlBase {
}
}
/**
* fn:查看日志
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async pageEorderLog(pobj, pobj2, req, res){
if(pobj.product_property=='1'){
return await this.orderauthlogCtl.pageEorderAuthLog(pobj);
}else if(pobj.product_property=='2'){
return await this.ordersignlogSve.pageEorderSignLog(pobj);
}else{
return system.getResult(null, `参数错误 产品类型属性不存在`);
}
}
}
module.exports = OrderCtl;
\ No newline at end of file
......@@ -184,13 +184,13 @@ class System {
var path = "/api/op/action/springboard";
if (settings.env == "dev") {
let local = "http://127.0.0.1";
let liangwenkai = "http://192.168.210.210";
let liangwenkai = "http://192.168.200.183";
let dev = "http://39.107.234.14";
return {
// 产品引擎
engine_product: liangwenkai + ":3571" + path,
engine_product: local + ":3571" + path,
// 计费引擎
engine_fee: local + ":3572" + path,
engine_fee: dev + ":3572" + path,
// 认证引擎
engine_auth: local + ":3573" + path,
// 签约引擎
......
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