Commit 553b4db1 by 孙亚楠

d

parent ee8a9911
......@@ -18,7 +18,7 @@ module.exports = function (db, DataTypes) {
live_start: {type: DataTypes.DATE, field: 'live_start', allowNull: true, defaultValue:null, comment:'生效时间' },
live_end: {type: DataTypes.DATE, field: 'live_end', allowNull: true, defaultValue:null, comment:'结束时间' },
audit_status: {type: DataTypes.STRING, field: 'audit_status', allowNull: true, defaultValue:'10', comment:'审核状态10 待审核 20 审核成功 30 审核失败' },
audit_date: {type: DataTypes.STRING, field: 'audit_date', allowNull: true, defaultValue:null, comment:'审核时间' },
audit_date: {type: DataTypes.DATE, field: 'audit_date', allowNull: true, defaultValue:null, comment:'审核时间' },
audit_remark: {type: DataTypes.STRING, field: 'audit_remark', allowNull: true, defaultValue:'', comment:'审核备注' },
audit_user_id: {type: DataTypes.STRING, field: 'audit_user_id', allowNull: true, defaultValue:'', comment:'审核人' },
live_status: {type: DataTypes.STRING, field: 'live_status', allowNull: true, defaultValue:'10', comment:'生效状态10 待生效 20 已生效 30 已终止' },
......
......@@ -127,7 +127,8 @@ class EorderService extends ServiceBase {
_orderBeanProperties.eorderProducts=eorderProductProperties;
await this.eorderproductDao.bulkCreate(eorderProductProperties,t);
}else{
await this.eorderproductDao.create({order_id: _orderBean.id, product_id: this.trim(params.product_id),price:this.trim(params.product_unit_price)},t);
await this.eorderproductDao.create({order_id: _orderBean.id, product_id: this.trim(params.product_id),price:this.trim(params.product_unit_price),
product_property:this.trim(params.product_property),product_name:this.trim(params.product_name)},t);
}
});
return system.getResult(_orderBeanProperties);
......@@ -137,7 +138,7 @@ class EorderService extends ServiceBase {
params.audit_status="10";
params.live_status="10";
params.pay_status="20";
params.contract_id=await this.redisClient.genrateId(`esign_sve_order_contract_id`); ;
params.contract_id=await this.redisClient.genrateId(`esign_sve_order_contract_id`);
params.contract_name = this.trim(params.contract_name) || "";
await this.db.transaction(async t => {
orderBean=await this.dao.create(params,t);
......@@ -160,7 +161,8 @@ class EorderService extends ServiceBase {
}
await this.eorderproductDao.bulkCreate(eorderProductProperties,t);
}else{
await this.eorderproductDao.create({order_id: orderBean.id, product_id: this.trim(params.product_id),price:this.trim(params.product_unit_price)},t);
await this.eorderproductDao.create({order_id: orderBean.id, product_id: this.trim(params.product_id),
price:this.trim(params.product_unit_price),product_property:this.trim(params.product_property),product_name:this.trim(params.product_name)},t);
}
});
this.handleDate(orderBean.dataValues, ['live_start', 'live_end', 'created_at'], null, null);
......@@ -199,7 +201,8 @@ class EorderService extends ServiceBase {
}
try{
let orderProperties = {id:orderBean.id,audit_status:this.trim(params.audit_status),audit_remark:this.trim(params.audit_remark) || ""};
let orderProperties = {id:orderBean.id,audit_status:this.trim(params.audit_status),audit_remark:this.trim(params.audit_remark)
|| "",audit_user_id:params.audit_user_id,audit_date:new Date()};
orderProperties.live_status = params.audit_status == '20' ? params.audit_status : '30';
await this.dao.update(orderProperties);
return system.getResultSuccess();
......@@ -273,7 +276,7 @@ class EorderService extends ServiceBase {
where:{
order_id:orderBean.id
},
attributes:['product_id','product_name','price','order_id']
attributes:['product_id','product_name','price','order_id','product_property']
});
orderBean.product_arr = productChildren;
......
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