Commit 5504ece2 by 王昆

gsb

parent aa6e0b25
......@@ -77,6 +77,12 @@ class ActionAPI extends APIBase {
case "invoiceapplySave" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.save(action_body);
break;
case "invoiceapplyBulkSave" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.bulkSave(action_body);
break;
case "invoiceapplyStatus" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.updateStatus(action_body);
break;
case "invoiceapplyById" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.byId(action_body);
break;
......
......@@ -30,6 +30,11 @@ class SaasinvoiceapplyDao extends Dao {
return await this.customQuery(sql.join(" "), params);
}
async updateStatus(params, t) {
let sql = `UPDATE ${this.model.tableName} SET status = :status WHERE id = :id AND status = :preStatus`;
return this.customUpdate(sql, params, t);
}
setCondition(params, sql) {
if(params.saas_merchant_id){
sql.push("AND t1.`saas_merchant_id` = :saas_merchant_id");
......
......@@ -16,6 +16,10 @@ module.exports = function (sequelize, DataTypes) {
allowNull: true,
defaultValue: ''
},
parent_id: {
type: DataTypes.STRING,
allowNull: true
},
batch_no: {
type: DataTypes.STRING,
allowNull: true
......
......@@ -24,10 +24,27 @@ class SaasinvoiceapplyService extends ServiceBase {
return await this.save10(params);
}
}
async bulkSave(params) {
if (params.fee_type == "10") {
return await this.bulkSave10(params);
}
}
async bulkSave10(params) {
let rs = await this.dao.bulkCreate(params.dataList);
if (rs && params.updateStatus) {
await this.updateStatus(params.updateStatus);
}
return system.getResultSuccess(rs);
}
async save10(params) {
let rs = await this.dao.create(params);
return system.getResultSuccess(rs);
}
async updateStatus(params) {
let rs = await this.dao.updateStatus(params);
return system.getResultSuccess(rs);
}
async merchantinvoiceapplyPage(params) {
params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10);
......
......@@ -26,7 +26,7 @@ class Dictionary {
return;
}
for (let field of fields) {
row[field] = this.getDict(module, field)[row[field] || ""] || "";
row[field + "_name"] = this.getDict(module, field)[row[field] || ""] || "";
}
}
......
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