Commit 7b297741 by 王昆

Merge branch 'xggsve-order-dev' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-order-dev

parents 7ab7bc29 575b469f
......@@ -87,6 +87,12 @@ class ActionAPI extends APIBase {
case "businessmenPage":
opResult = await this.obusinessmenSve.businessmenPage(action_body);
break;
case "createAccount":
opResult = await this.obusinessmenSve.createAccount(action_body);
break;
case "signing":
opResult = await this.obusinessmenSve.signing(action_body);
break;
//******************************************************************** */
......
......@@ -34,8 +34,8 @@ class ObusinessmenService extends ServiceBase {
*
*/
async signing(params) {
if (!params.hasOwnProperty('credit_code') && !params.credit_code) {
return system.getResult(null, `参数错误 同意社会信用代码不能为空`);
if (!params.id) {
return system.getResult(null, `参数错误 个体户ID不能为空`);
}
if (!params.hasOwnProperty('cost_rate')) {
return system.getResult(null, `参数错误 核定成本费用率不能为空`);
......@@ -84,6 +84,18 @@ class ObusinessmenService extends ServiceBase {
_obusinessmen.tax_rate = this.trim(params.tax_rate);
_obusinessmen.sign_time = new Date();
_obusinessmen.sign_notes = this.trim(params.sign_notes);
if(_obusinessmen.special_other_ladder){
_obusinessmen.special_other_ladder = JSON.stringify(_obusinessmen.special_other_ladder);
}
if(_obusinessmen.special_tax_ladder){
_obusinessmen.special_tax_ladder = JSON.stringify(_obusinessmen.special_tax_ladder);
}
if(_obusinessmen.common_other_ladder){
_obusinessmen.common_other_ladder = JSON.stringify(_obusinessmen.common_other_ladder);
}
if(_obusinessmen.common_tax_ladder){
_obusinessmen.common_tax_ladder = JSON.stringify(_obusinessmen.common_tax_ladder);
}
try {
await _obusinessmen.save();
return system.getResultSuccess();
......@@ -98,14 +110,15 @@ class ObusinessmenService extends ServiceBase {
* @param {*} params
*/
async createAccount(params){
if (!params.hasOwnProperty('credit_code') && !params.credit_code) {
return system.getResult(null, `参数错误 同意社会信用代码不能为空`);
if (!params.id) {
return system.getResult(null, `参数错误 个体工商户ID不能为空`);
}
let _obusinessmen = await this.dao.findById(this.trim(params.id));
if(!_obusinessmen){
return system.getResult(null,`个体户不存在`);
}
if (!_obusinessmen.is_create_account) {
if (_obusinessmen.is_create_account) {
return system.getResult(null,`该个体户已经建帐`);
}
......@@ -171,7 +184,7 @@ class ObusinessmenService extends ServiceBase {
let list = await this.dao.listByCondition(params);
if (list) {
for (var row of list) {
this.handleDate(row, ["created_at", "assignTime"], null, -8);
this.handleDate(row, ["created_at", "assignTime","reg_date","tax_reg_day","updated_at"], null, -8);
}
await this.doSignBtn(list);
}
......
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