Commit da56d68d by 孙亚楠

d

parent d2192a6a
......@@ -6,8 +6,8 @@ module.exports = function (db, DataTypes) {
return db.define('eorder', {
merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, defaultValue:'',comment:'商户id' },
merchant_name: {type: DataTypes.STRING, field: 'merchant_name', allowNull: true, defaultValue:'',comment:'商户名称' },
sign_name: {type: DataTypes.STRING, field: 'sign_name', allowNull: true,defaultValue:'', comment:'签署名称' },
sign_id: { type: DataTypes.STRING, field: 'sign_id', allowNull: false,defaultValue:'', comment:'签署ID'},
contract_id: { type: DataTypes.STRING, field: 'contract_id', allowNull: false,defaultValue:'', comment:'合同ID'},
contract_name: { type: DataTypes.STRING, field: 'contract_name', allowNull: false,defaultValue:'', comment:'合同名字'},
product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
product_type: {type: DataTypes.STRING, field: 'product_type', allowNull: true,defaultValue:'', comment:'产品类型'},
product_unit_price:{ type: DataTypes.STRING, field: 'product_unit_price', allowNull: true, defaultValue:'',comment:'产品单价'},
......
......@@ -7,6 +7,7 @@ class EorderService extends ServiceBase {
this.eorderproductDao = system.getObject("db.eorder.eorderproductDao");
this.eordersignlogDao = system.getObject("db.eorder.eordersignlogDao");
this.eorderauthlogDao = system.getObject("db.eorder.eorderauthlogDao");
this.redisClient = system.getObject("util.redisClient");
this.GROUP_PRODUCT_TYPE = "2";
this.SIGNLE_PRODUCT_TYPE = "1";
this.AUDIT_STATUS=['10','20','30'];
......@@ -54,11 +55,7 @@ class EorderService extends ServiceBase {
if(!params.live_end){
return system.getResult(null, `参数错误 结束时间不能为空`);
}
params.product_specifications = Number(params.product_specifications || 0);
params.audit_status="10";
params.live_status="10";
params.pay_status="20";
params.pay_date=new Date();
console.log(`eorderSve->saveEorder->params` + JSON.stringify(params));
try{
if(params.id){//更新新操作
......@@ -76,8 +73,8 @@ class EorderService extends ServiceBase {
let _orderBeanProperties={id:_orderBean.id};
_orderBeanProperties.merchant_id = params.merchant_id ? params.merchant_id : _orderBean.merchant_id;
_orderBeanProperties.merchant_name = params.merchant_name ? params.merchant_name : _orderBean.merchant_name;
_orderBeanProperties.sign_id = params.sign_id ? params.sign_id : _orderBean.sign_id;
_orderBeanProperties.sign_name = params.sign_name ? params.sign_name : _orderBean.sign_name;
_orderBeanProperties.contract_id = params.contract_id ? params.contract_id : _orderBean.contract_id;
_orderBeanProperties.contract_name = params.contract_name ? params.contract_name : _orderBean.contract_name;
_orderBeanProperties.product_id = params.product_id ? params.product_id : _orderBean.product_id;
_orderBeanProperties.product_type = params.product_type ? params.product_type : _orderBean.product_type;
_orderBeanProperties.product_unit_price = params.product_unit_price ? params.product_unit_price : _orderBean.product_unit_price;
......@@ -136,6 +133,12 @@ class EorderService extends ServiceBase {
return system.getResult(_orderBeanProperties);
}else{ //新增操作
let orderBean =null;
params.product_specifications = Number(params.product_specifications || 0);
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_name = this.trim(params.contract_name) || "";
await this.db.transaction(async t => {
orderBean=await this.dao.create(params,t);
if(params.product_arr && params.product_arr.length>0){
......
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