Commit 1a7d9517 by 孙亚楠

dd

parent 6dddc394
...@@ -6,6 +6,8 @@ const ServiceBase = require("../../sve.base") ...@@ -6,6 +6,8 @@ const ServiceBase = require("../../sve.base")
class ObusinessmenService extends ServiceBase { class ObusinessmenService extends ServiceBase {
constructor() { constructor() {
super("order", ServiceBase.getDaoName(ObusinessmenService)); super("order", ServiceBase.getDaoName(ObusinessmenService));
this.oorderDao = system.getObject("service.order.oorderDao");
this.ASSIGN_STATUS = ['1160', '1170', '1180', '1190', '1200'];
} }
/** /**
...@@ -58,10 +60,21 @@ class ObusinessmenService extends ServiceBase { ...@@ -58,10 +60,21 @@ class ObusinessmenService extends ServiceBase {
let _obusinessmen = await this.dao.model.findOne({where:{ let _obusinessmen = await this.dao.model.findOne({where:{
credit_code:this.trim(params.credit_code) credit_code:this.trim(params.credit_code)
}}); }});
let _order = await this.oorderDao.model.findOne({
where:{
id:_obusinessmen.order_id
}
});
if(!_obusinessmen){ if(!_obusinessmen){
return system.getResult(null,`个体户不存在`); return system.getResult(null,`个体户不存在`);
} }
if(!_order){
return system.getResult(null,`订单存在`);
}
if(this.ASSIGN_STATUS.indexOf(_order.status)==-1){
return system.getResult(null,`个体工商户不能签约`);
}
_obusinessmen.cost_rate = this.trim(params.cost_rate); _obusinessmen.cost_rate = this.trim(params.cost_rate);
_obusinessmen.add_value_up_type = this.trim(params.add_value_up_type); _obusinessmen.add_value_up_type = this.trim(params.add_value_up_type);
_obusinessmen.tax_up_type = this.trim(params.tax_up_type); _obusinessmen.tax_up_type = this.trim(params.tax_up_type);
......
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