添加银行政府后端接口

This commit is contained in:
2025-09-25 15:53:44 +08:00
parent b17bdcc24c
commit 5b6b7e0a96
60 changed files with 5345 additions and 1920 deletions

View File

@@ -21,61 +21,72 @@ const Project = sequelize.define('Project', {
farmName: {
type: DataTypes.STRING(200),
allowNull: false,
field: 'farmName',
comment: '养殖场名称'
},
supervisionObject: {
type: DataTypes.STRING(50),
allowNull: false,
field: 'supervisionObject',
comment: '监管对象'
},
supervisionQuantity: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
field: 'supervisionQuantity',
comment: '监管数量'
},
supervisionPeriod: {
type: DataTypes.STRING(50),
allowNull: false,
field: 'supervisionPeriod',
comment: '监管周期'
},
supervisionAmount: {
type: DataTypes.DECIMAL(15, 2),
allowNull: false,
defaultValue: 0.00,
field: 'supervisionAmount',
comment: '监管金额'
},
startTime: {
type: DataTypes.DATEONLY,
allowNull: false,
field: 'startTime',
comment: '起始时间'
},
endTime: {
type: DataTypes.DATEONLY,
allowNull: false,
field: 'endTime',
comment: '结束时间'
},
earTag: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
field: 'earTag',
comment: '耳标数量'
},
collar: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
field: 'collar',
comment: '项圈数量'
},
host: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
field: 'host',
comment: '主机数量'
},
loanOfficer: {
type: DataTypes.STRING(100),
allowNull: true,
field: 'loanOfficer',
comment: '贷款专员'
},
description: {
@@ -86,16 +97,19 @@ const Project = sequelize.define('Project', {
createdBy: {
type: DataTypes.INTEGER,
allowNull: true,
field: 'createdBy',
comment: '创建人ID'
},
updatedBy: {
type: DataTypes.INTEGER,
allowNull: true,
field: 'updatedBy',
comment: '更新人ID'
}
}, {
tableName: 'projects',
timestamps: true,
underscored: false,
createdAt: 'createdAt',
updatedAt: 'updatedAt',
comment: '项目清单表'
@@ -105,13 +119,15 @@ const Project = sequelize.define('Project', {
Project.associate = (models) => {
// 项目与用户关联(创建人)
Project.belongsTo(models.User, {
foreignKey: 'createdBy',
foreignKey: { name: 'createdBy', field: 'createdBy' },
targetKey: 'id',
as: 'creator'
});
// 项目与用户关联(更新人)
Project.belongsTo(models.User, {
foreignKey: 'updatedBy',
foreignKey: { name: 'updatedBy', field: 'updatedBy' },
targetKey: 'id',
as: 'updater'
});
};