Commit 076baa2a by 孙亚楠

dd

parent 8b91e952
...@@ -67,8 +67,8 @@ class BusinessmenCtl extends CtlBase { ...@@ -67,8 +67,8 @@ class BusinessmenCtl extends CtlBase {
if (!pobj.hasOwnProperty('credit_code') && !pobj.credit_code) { if (!pobj.hasOwnProperty('credit_code') && !pobj.credit_code) {
return system.getResult(null, `参数错误 同意社会信用代码不能为空`); return system.getResult(null, `参数错误 同意社会信用代码不能为空`);
} }
if (!pobj.hasOwnProperty('cost_rate')) { if (!pobj.hasOwnProperty('cost_rate') || isNaN(pobj.cost_rate)) {
return system.getResult(null, `参数错误 核定成本费用率不能为空`); return system.getResult(null, `参数错误 核定成本费用率不能为空并且必须为数字`);
} }
if (!pobj.hasOwnProperty('add_value_up_type') && !pobj.add_value_up_type) { if (!pobj.hasOwnProperty('add_value_up_type') && !pobj.add_value_up_type) {
return system.getResult(null, `参数错误 增值税累计类型不能为空`); return system.getResult(null, `参数错误 增值税累计类型不能为空`);
...@@ -82,17 +82,18 @@ class BusinessmenCtl extends CtlBase { ...@@ -82,17 +82,18 @@ class BusinessmenCtl extends CtlBase {
if (!pobj.hasOwnProperty('service_end_time')) { if (!pobj.hasOwnProperty('service_end_time')) {
return system.getResult(null, `参数错误 服务结束时间不能为空`); return system.getResult(null, `参数错误 服务结束时间不能为空`);
} }
if (!pobj.hasOwnProperty('service_rate') && !pobj.service_rate) { if (!pobj.hasOwnProperty('service_rate') || !pobj.service_rate || isNaN(pobj.service_rate)) {
return system.getResult(null, `参数错误 服务费比例不能为空`); return system.getResult(null, `参数错误 服务费比例不能为空并且必须为数字`);
} }
if (!pobj.hasOwnProperty('tax_rate') && !pobj.tax_rate) { if (!pobj.hasOwnProperty('tax_rate') || !pobj.tax_rate || isNaN(pobj.tax_rate)) {
return system.getResult(null, `参数错误 含税价百分比不能为空`); return system.getResult(null, `参数错误 含税价百分比不能为空并且必须为数字`);
} }
try { try {
pobj.service_rate=system.y2f(pobj.service_rate); pobj.service_rate = system.y2f(pobj.service_rate);
pobj.tax_rate=system.y2f(pobj.tax_rate); pobj.tax_rate = system.y2f(pobj.tax_rate);
pobj.cost_rate=system.y2f(pobj.cost_rate); pobj.cost_rate = system.y2f(pobj.cost_rate);
return await this.businessmenSve.signing(pobj); return await this.businessmenSve.signing(pobj);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
...@@ -105,11 +106,9 @@ class BusinessmenCtl extends CtlBase { ...@@ -105,11 +106,9 @@ class BusinessmenCtl extends CtlBase {
* @param {*} params * @param {*} params
*/ */
async createAccount(pobj, pobj2, req) { async createAccount(pobj, pobj2, req) {
if (!pobj.hasOwnProperty('credit_code') && !pobj.credit_code) { if (!pobj.id) {
return system.getResult(null, `参数错误 同意社会信用代码不能为空`); return system.getResult(null, `参数错误 个体工商户ID不能为空`);
} }
try { try {
return await this.businessmenSve.createAccount(pobj); return await this.businessmenSve.createAccount(pobj);
} catch (error) { } catch (error) {
......
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