Commit c4515493 by 王昆

dd

parent c62c5061
...@@ -51,7 +51,9 @@ class ActionAPI extends APIBase { ...@@ -51,7 +51,9 @@ class ActionAPI extends APIBase {
case "invoice": // 查询发票详细信息 case "invoice": // 查询发票详细信息
opResult = await this.iinvoiceSve.queryInvoice(action_body); opResult = await this.iinvoiceSve.queryInvoice(action_body);
break; break;
case "updateAccountCreation": // 查询发票详细信息
opResult = await this.iinvoiceSve.updateAccountCreation(action_body);
break;
// case "verificationAndCalculation": // 发票试算接口 // case "verificationAndCalculation": // 发票试算接口
// opResult = await rule.dispatcher(action_body); // opResult = await rule.dispatcher(action_body);
// break; // break;
......
...@@ -49,6 +49,7 @@ module.exports = (db, DataTypes) => { ...@@ -49,6 +49,7 @@ module.exports = (db, DataTypes) => {
product_id:{ type: DataTypes.STRING(32), allowNull: true ,delaultValue:'',comment:"商品ID"}, product_id:{ type: DataTypes.STRING(32), allowNull: true ,delaultValue:'',comment:"商品ID"},
status: {type: DataTypes.INTEGER, field: 'status', allowNull: true,comment:'订单状态 业务进度' }, status: {type: DataTypes.INTEGER, field: 'status', allowNull: true,comment:'订单状态 业务进度' },
red_status: {type: DataTypes.STRING, field: 'red_status', allowNull: true,comment:'1 未红冲 2 已红冲 3 红冲中' }, red_status: {type: DataTypes.STRING, field: 'red_status', allowNull: true,comment:'1 未红冲 2 已红冲 3 红冲中' },
account_creation: {type: DataTypes.STRING, field: 'account_creation', allowNull: true, defaultValue:0, comment:'是否建账 0未建账 1已建账' },
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW }, created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW }, updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
deleted_at: { type: DataTypes.DATE, allowNull: true }, deleted_at: { type: DataTypes.DATE, allowNull: true },
......
...@@ -339,5 +339,32 @@ class IInvoiceService extends ServiceBase { ...@@ -339,5 +339,32 @@ class IInvoiceService extends ServiceBase {
} }
} }
/**
* 更新建账
* @param {*} params
*/
async updateAccountCreation(params){
if(!params.id){
return system.getResult(null,`参数错误 发票ID 不能为空`);
}
try {
let _invoice = await this.dao.model.findOne({
where:{
id:this.trim(params.id);
}
});
if(!_invoice){
return system.getResult(null,`发票不存在`);
}
_invoice.account_creation=1;
_invoice.save();
return system.getResultSuccess();
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误`);
}
}
} }
module.exports = IInvoiceService; module.exports = IInvoiceService;
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