Commit e78d9b7f by 王昆

gsb

parent bffad7c5
...@@ -72,6 +72,9 @@ class ActionAPI extends APIBase { ...@@ -72,6 +72,9 @@ class ActionAPI extends APIBase {
case "invoiceapplySave" : //发票申请列表(平台) case "invoiceapplySave" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.save(action_body); opResult = await this.saasinvoiceapplySve.save(action_body);
break; break;
case "invoiceapplyById" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.byId(action_body);
break;
// case "verificationAndCalculation": // 发票试算接口 // case "verificationAndCalculation": // 发票试算接口
// opResult = await rule.dispatcher(action_body); // opResult = await rule.dispatcher(action_body);
......
...@@ -37,6 +37,9 @@ class SaasinvoiceapplyDao extends Dao { ...@@ -37,6 +37,9 @@ class SaasinvoiceapplyDao extends Dao {
if (params.apply_no) { if (params.apply_no) {
sql.push("AND t1.`apply_no` = :apply_no"); sql.push("AND t1.`apply_no` = :apply_no");
} }
if (params.owner_type) {
sql.push("AND t1.`owner_type` = :owner_type");
}
if (params.begin_time) { if (params.begin_time) {
sql.push("AND t1.`created_at` >= :begin_time"); sql.push("AND t1.`created_at` >= :begin_time");
} }
......
...@@ -34,6 +34,11 @@ module.exports = function (sequelize, DataTypes) { ...@@ -34,6 +34,11 @@ module.exports = function (sequelize, DataTypes) {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true
}, },
invoice_amount: {
type: DataTypes.BIGINT,
allowNull: true,
defaultValue: 0
},
status: { status: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true
...@@ -123,6 +128,22 @@ module.exports = function (sequelize, DataTypes) { ...@@ -123,6 +128,22 @@ module.exports = function (sequelize, DataTypes) {
type: DataTypes.BIGINT, type: DataTypes.BIGINT,
allowNull: true allowNull: true
}, },
unit: {
type: DataTypes.STRING,
allowNull: true
},
quantity: {
type: DataTypes.INTEGER,
allowNull: true
},
price: {
type: DataTypes.BIGINT,
allowNull: true
},
remark: {
type: DataTypes.STRING,
allowNull: true
},
created_at: { created_at: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
......
...@@ -10,18 +10,21 @@ class SaasinvoiceapplyService extends ServiceBase { ...@@ -10,18 +10,21 @@ class SaasinvoiceapplyService extends ServiceBase {
super("invoice", ServiceBase.getDaoName(SaasinvoiceapplyService)); super("invoice", ServiceBase.getDaoName(SaasinvoiceapplyService));
this.dictionary = system.getObject("util.dictionary"); this.dictionary = system.getObject("util.dictionary");
} }
async byId(params) {
let apply = this.dao.getById(params.id);
this.handleDate(apply, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
this.dictionary.setRowName("SAAS_INVOICE_APPLY",apply,["owner_type","fee_type","invoice_type","invoice_join"]);
return system.getResult(apply);
}
async save(params) { async save(params) {
if (params.fee_type == "10") { if (params.fee_type == "10") {
return await this.save10(params); return await this.save10(params);
} }
} }
async save10(params) { async save10(params) {
let rs = await this.dao.create(params); let rs = await this.dao.create(params);
return system.getResultSuccess(rs); return system.getResultSuccess(rs);
} }
async merchantinvoiceapplyPage(params) { async merchantinvoiceapplyPage(params) {
params.currentPage = Number(params.currentPage || 1); params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10); params.pageSize = Number(params.pageSize || 10);
...@@ -37,7 +40,7 @@ class SaasinvoiceapplyService extends ServiceBase { ...@@ -37,7 +40,7 @@ class SaasinvoiceapplyService extends ServiceBase {
for (var item of list) { for (var item of list) {
this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss'); this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
// this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD'); // this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this.dictionary.setRowName("SAAS_INVOICE_APPLY",item,["owner_type","fee_type","invoice_type","invoice_join"]); this.dictionary.setRowName("SAAS_INVOICE_APPLY",item,["owner_type","fee_type","invoice_type","invoice_join", "status"]);
} }
} }
return system.getResultSuccess({count: total, rows: list}); return system.getResultSuccess({count: total, rows: list});
...@@ -58,7 +61,7 @@ class SaasinvoiceapplyService extends ServiceBase { ...@@ -58,7 +61,7 @@ class SaasinvoiceapplyService extends ServiceBase {
for (var item of list) { for (var item of list) {
this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss'); this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
// this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD'); // this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this.dictionary.setRowName("SAAS_INVOICE_APPLY",item,["owner_type","fee_type","invoice_type","invoice_join"]); this.dictionary.setRowName("SAAS_INVOICE_APPLY",item,["owner_type","fee_type","invoice_type","invoice_join", "status"]);
} }
} }
return system.getResultSuccess({count: total, rows: list}); return system.getResultSuccess({count: total, rows: list});
......
...@@ -12,6 +12,7 @@ class Dictionary { ...@@ -12,6 +12,7 @@ class Dictionary {
owner_type: {"00": "商户发票", "10": "平台发票"}, owner_type: {"00": "商户发票", "10": "平台发票"},
fee_type: {"00": "注册订单费用", "10": "平台转账费用", "20": "商户转账费用"}, fee_type: {"00": "注册订单费用", "10": "平台转账费用", "20": "商户转账费用"},
invoice_type: {"10": "增值税专用发票", "20": " 增值税普通发票", "30": "普通发票"}, invoice_type: {"10": "增值税专用发票", "20": " 增值税普通发票", "30": "普通发票"},
status: {"1000":"待审核", "1010":"审核通过", "1020":"审核不通过", "1030":"发票办理", "1040":"发票开具", "1050":"平台办理中", "1060":"办理完成"},
} }
} }
......
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