Commit 2bd47366 by wangxiaodong

完税管理列表

parent e35d4438
var system = require("../../../system")
const CtlBase = require("../../ctl.base");
//完税
class TaxCompanyInfoCtl extends CtlBase {
constructor() {
super("all", CtlBase.getServiceName(TaxCompanyInfoCtl));
}
async allList(qobj){
var params = qobj || {};
if (params.month) {
let date = this.getMonthDays(params.month);
params.signBegin =date[0];
params.signEnd =date[date.length-1];
}
this.doTimeCondition(params, ["signBegin", "signEnd"]);
try {
var page = await this.service.signPage(params);
return system.getResult2(page);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
}
module.exports = TaxCompanyInfoCtl;
\ No newline at end of file
const system = require("../../../system");
const Dao = require("../../dao.base");
class TaxCompanyInfoDao extends Dao {
constructor() {
super(Dao.getModelName(TaxCompanyInfoDao));
}
}
module.exports = TaxCompanyInfoDao;
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
return sequelize.define('taxcompanyinfo', {
company_name : DataTypes.STRING,
usc_code : DataTypes.STRING,
tax_month : DataTypes.DATE,
actual_amount : DataTypes.STRING,
income_tax : DataTypes.STRING,
added_value_tax : DataTypes.STRING,
tax_time : DataTypes.DATE,
people_number : DataTypes.STRING,
sign_body_id : DataTypes.INTEGER,
sign_body : DataTypes.STRING,
tax_url : DataTypes.STRING,
redundance_1 : DataTypes.STRING,
redundance_2 : DataTypes.STRING,
redundance_3 : DataTypes.STRING,
redundance_4 : DataTypes.STRING,
}, {
paranoid: true,//假的删除
underscored: true,
version: false,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'tax_company_info',
validate: {
},
indexes:[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
};
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class TaxCompanyInfoService extends ServiceBase {
constructor() {
super("all", ServiceBase.getDaoName(TaxCompanyInfoService));
}
async signPage(params) {
var currentPage = Number(params.currentPage || 0);
var pageSize = Number(params.pageSize || 10);
var where = {};
if (params.company_name) {
where.company_name = {
[this.db.Op.like]: "%" + params.company_name + "%"
};
}
if(params.sign_body_id){
where.sign_body_id = params.sign_body_id;
}
let id_no = this.trim(params.id_no);
if(id_no){
where.id_no = id_no;
}
this.addWhereTime(where, 'tax_time', params.signBegin, params.signEnd, true);
var orderby = [
["id", 'desc']
];
var page = await this.getPageList(currentPage, pageSize, where, orderby);
if (page && page.rows) {
for (var row of page.rows) {
this.handleDate(row, ["tax_time"], "YYYY-MM-DD", -8);
}
}
return page;
}
}
module.exports = TaxCompanyInfoService;
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