zmh
2 years ago
5 changed files with 724 additions and 97 deletions
@ -0,0 +1,430 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ContractDetail = sequelize.define("contractDetail", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true |
|||
}, |
|||
year: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年度", |
|||
primaryKey: false, |
|||
field: "year ", |
|||
autoIncrement: false |
|||
}, |
|||
serialNo: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "序号", |
|||
primaryKey: false, |
|||
field: "serial_no", |
|||
autoIncrement: false |
|||
}, |
|||
number: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "编号", |
|||
primaryKey: false, |
|||
field: "number", |
|||
autoIncrement: false |
|||
}, |
|||
introduction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "简介", |
|||
primaryKey: false, |
|||
field: "introduction", |
|||
autoIncrement: false |
|||
}, |
|||
contractNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "合同编号", |
|||
primaryKey: false, |
|||
field: "contract_no", |
|||
autoIncrement: false |
|||
}, |
|||
applyDate: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "申请日期", |
|||
primaryKey: false, |
|||
field: "apply_date", |
|||
autoIncrement: false |
|||
}, |
|||
recConDate: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "收到合同日期", |
|||
primaryKey: false, |
|||
field: "rec_con_date", |
|||
autoIncrement: false |
|||
}, |
|||
contractPaper: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "合同纸质版情况", |
|||
primaryKey: false, |
|||
field: "contract_paper", |
|||
autoIncrement: false |
|||
}, |
|||
contractElec: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "合同电子版情况", |
|||
primaryKey: false, |
|||
field: "contract_elec", |
|||
autoIncrement: false |
|||
}, |
|||
department: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "部门", |
|||
primaryKey: false, |
|||
field: "department", |
|||
autoIncrement: false |
|||
}, |
|||
business: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "业务线", |
|||
primaryKey: false, |
|||
field: "business", |
|||
autoIncrement: false |
|||
}, |
|||
sale: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "销售人员", |
|||
primaryKey: false, |
|||
field: "sale", |
|||
autoIncrement: false |
|||
}, |
|||
customer: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "客户名称", |
|||
primaryKey: false, |
|||
field: "customer", |
|||
autoIncrement: false |
|||
}, |
|||
item: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "项目名称", |
|||
primaryKey: false, |
|||
field: "item", |
|||
autoIncrement: false |
|||
}, |
|||
itemType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "项目类型", |
|||
primaryKey: false, |
|||
field: "item_type", |
|||
autoIncrement: false |
|||
}, |
|||
amount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "合同金额", |
|||
primaryKey: false, |
|||
field: "amount", |
|||
autoIncrement: false |
|||
}, |
|||
changeAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变更后合同金额", |
|||
primaryKey: false, |
|||
field: "change_amount", |
|||
autoIncrement: false |
|||
}, |
|||
cInvoicedAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "累计开票金额", |
|||
primaryKey: false, |
|||
field: "c_invoiced_amount", |
|||
autoIncrement: false |
|||
}, |
|||
cBackAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "累计回款金额", |
|||
primaryKey: false, |
|||
field: "c_back_amount", |
|||
autoIncrement: false |
|||
}, |
|||
invoicedBack: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "开票-回款", |
|||
primaryKey: false, |
|||
field: "invoiced_back", |
|||
autoIncrement: false |
|||
}, |
|||
unInvoicedAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "未开票金额", |
|||
primaryKey: false, |
|||
field: "un_invoiced_amount", |
|||
autoIncrement: false |
|||
}, |
|||
remainConAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "剩余合同金额", |
|||
primaryKey: false, |
|||
field: "remain_con_amount", |
|||
autoIncrement: false |
|||
}, |
|||
backPercent: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "回款率", |
|||
primaryKey: false, |
|||
field: "back_percent", |
|||
autoIncrement: false |
|||
}, |
|||
retentionMoney: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "质保金", |
|||
primaryKey: false, |
|||
field: "retention_money", |
|||
autoIncrement: false |
|||
}, |
|||
retentionPercent: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "质保金比例", |
|||
primaryKey: false, |
|||
field: "retention_percent", |
|||
autoIncrement: false |
|||
}, |
|||
retentionTerm: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "质保期", |
|||
primaryKey: false, |
|||
field: "retention_term", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceTax1: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "发票税率金额", |
|||
primaryKey: false, |
|||
field: "invoice_tax1", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceTax2: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "invoice_tax2", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceTax3: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "invoice_tax3", |
|||
autoIncrement: false |
|||
}, |
|||
payType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "合同付款方式", |
|||
primaryKey: false, |
|||
field: "pay_type", |
|||
autoIncrement: false |
|||
}, |
|||
cost: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "预支提成及委外费用", |
|||
primaryKey: false, |
|||
field: "cost", |
|||
autoIncrement: false |
|||
}, |
|||
performanceRatio: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "业绩折算比例", |
|||
primaryKey: false, |
|||
field: "performance_ratio", |
|||
autoIncrement: false |
|||
}, |
|||
realPerformance: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "实际业绩", |
|||
primaryKey: false, |
|||
field: "real_performance", |
|||
autoIncrement: false |
|||
}, |
|||
assessmentPerformance: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "考核业绩", |
|||
primaryKey: false, |
|||
field: "assessment_performance", |
|||
autoIncrement: false |
|||
}, |
|||
acceptanceDate: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "验收日期", |
|||
primaryKey: false, |
|||
field: "acceptance_date", |
|||
autoIncrement: false |
|||
}, |
|||
backConfirmDate: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "收入确认时间", |
|||
primaryKey: false, |
|||
field: "back_confirm_date", |
|||
autoIncrement: false |
|||
}, |
|||
recYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "接单年份", |
|||
primaryKey: false, |
|||
field: "rec_year", |
|||
autoIncrement: false |
|||
}, |
|||
recMonth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "接单月份", |
|||
primaryKey: false, |
|||
field: "rec_month", |
|||
autoIncrement: false |
|||
}, |
|||
cusAttribute: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "客户属性", |
|||
primaryKey: false, |
|||
field: "cus_attribute", |
|||
autoIncrement: false |
|||
}, |
|||
cusType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "客户类型", |
|||
primaryKey: false, |
|||
field: "cus_type", |
|||
autoIncrement: false |
|||
}, |
|||
industry: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "行业", |
|||
primaryKey: false, |
|||
field: "industry", |
|||
autoIncrement: false |
|||
}, |
|||
source: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "信息来源", |
|||
primaryKey: false, |
|||
field: "source", |
|||
autoIncrement: false |
|||
}, |
|||
cusProvince: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "客户省份", |
|||
primaryKey: false, |
|||
field: "cus_province", |
|||
autoIncrement: false |
|||
}, |
|||
cusArea: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "项目所在地", |
|||
primaryKey: false, |
|||
field: "cus_area", |
|||
autoIncrement: false |
|||
}, |
|||
text: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "text", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "contract_detail", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ContractDetail = ContractDetail; |
|||
return ContractDetail; |
|||
}; |
@ -0,0 +1,196 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const InvoiceDetail = sequelize.define("invoiceDetail", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: false |
|||
}, |
|||
year: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "年度:【申请日期】-年份", |
|||
primaryKey: false, |
|||
field: "year", |
|||
autoIncrement: false |
|||
}, |
|||
serialNo: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "序号:自动生成\n(自动升序),每一年自动从1开始", |
|||
primaryKey: false, |
|||
field: "serial_no", |
|||
autoIncrement: false |
|||
}, |
|||
number: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "编号:年份+序号 如2022年1", |
|||
primaryKey: false, |
|||
field: "number", |
|||
autoIncrement: false |
|||
}, |
|||
department: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "部门:申请部门", |
|||
primaryKey: false, |
|||
field: "department", |
|||
autoIncrement: false |
|||
}, |
|||
sale: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "销售人员:申请人", |
|||
primaryKey: false, |
|||
field: "sale", |
|||
autoIncrement: false |
|||
}, |
|||
contractNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "合同编号", |
|||
primaryKey: false, |
|||
field: "contract_no", |
|||
autoIncrement: false |
|||
}, |
|||
customer: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "客户名称:【甲方名称】", |
|||
primaryKey: false, |
|||
field: "customer", |
|||
autoIncrement: false |
|||
}, |
|||
item: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "项目名称", |
|||
primaryKey: false, |
|||
field: "item", |
|||
autoIncrement: false |
|||
}, |
|||
amount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "合同金额:【合同金额\n(元)】", |
|||
primaryKey: false, |
|||
field: "amount", |
|||
autoIncrement: false |
|||
}, |
|||
changeAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "变更后合同金额", |
|||
primaryKey: false, |
|||
field: "change_amount", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "发票号码:《发票申请单》【发票号】一个发票号码一个行数据", |
|||
primaryKey: false, |
|||
field: "invoice_no", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "开票类型:《发票申请单》\n【发票类型】", |
|||
primaryKey: false, |
|||
field: "invoice_type", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceDate: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "开票日期:《发票申请单》\n【开票日期】", |
|||
primaryKey: false, |
|||
field: "invoice_date", |
|||
autoIncrement: false |
|||
}, |
|||
invoiceAmount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "开票金额:《发票申请单》【发票金额】取财务填写数据", |
|||
primaryKey: false, |
|||
field: "invoice_amount", |
|||
autoIncrement: false |
|||
}, |
|||
outputTax: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "销项税额:《发票申请单》-销项税额", |
|||
primaryKey: false, |
|||
field: "output_tax", |
|||
autoIncrement: false |
|||
}, |
|||
total: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "合计:自动算出\n(开票金额+销项税额)", |
|||
primaryKey: false, |
|||
field: "total", |
|||
autoIncrement: false |
|||
}, |
|||
taxRate13: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "税率13%:《发票申请单》", |
|||
primaryKey: false, |
|||
field: "tax_rate13", |
|||
autoIncrement: false |
|||
}, |
|||
taxRate9: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "税率9%:《发票申请单》", |
|||
primaryKey: false, |
|||
field: "tax_rate9", |
|||
autoIncrement: false |
|||
}, |
|||
taxRate6: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "税率6%:《发票申请单》", |
|||
primaryKey: false, |
|||
field: "tax_rate6", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "invoice_detail", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.InvoiceDetail = InvoiceDetail; |
|||
return InvoiceDetail; |
|||
}; |
@ -1,35 +1,35 @@ |
|||
module.exports = { |
|||
// 数据库配置 与 sequelize 相同
|
|||
dbOptions: { |
|||
database: 'hr-dev', |
|||
username: 'postgres', |
|||
password: '123', |
|||
dialect: 'postgres', |
|||
host: '10.8.30.166', |
|||
port: 5432, |
|||
define: { |
|||
underscored: false, |
|||
freezeTableName: false, |
|||
charset: 'utf8mb4', |
|||
timezone: '+00: 00', |
|||
dialectOptions: { |
|||
collate: 'utf8_general_ci', |
|||
}, |
|||
timestamps: false, |
|||
}, |
|||
}, |
|||
options: { |
|||
type: 'freesun', // 指定 models 代码风格
|
|||
camelCase: true, // Models 文件中代码是否使用驼峰命名
|
|||
modalNameSuffix: false, // 模型名称是否带 ‘Model’ 后缀
|
|||
fileNameCamelCase: false, // Model 文件名是否使用驼峰法命名,默认文件名会使用表名,如 `user_post.js`;如果为 true,则文件名为 `userPost.js`
|
|||
dir: './app/lib/models', // 指定输出 models 文件的目录
|
|||
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
|
|||
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
|
|||
tables: ['overtime_day','vacate_day'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
|
|||
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
|
|||
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
|
|||
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面
|
|||
attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false
|
|||
}, |
|||
// 数据库配置 与 sequelize 相同
|
|||
dbOptions: { |
|||
database: 'data_center', |
|||
username: 'FashionAdmin', |
|||
password: '123456', |
|||
dialect: 'postgres', |
|||
host: '10.8.30.36', |
|||
port: 5432, |
|||
define: { |
|||
underscored: false, |
|||
freezeTableName: false, |
|||
charset: 'utf8mb4', |
|||
timezone: '+00: 00', |
|||
dialectOptions: { |
|||
collate: 'utf8_general_ci', |
|||
}, |
|||
timestamps: false, |
|||
}, |
|||
}, |
|||
options: { |
|||
type: 'freesun', // 指定 models 代码风格
|
|||
camelCase: true, // Models 文件中代码是否使用驼峰命名
|
|||
modalNameSuffix: false, // 模型名称是否带 ‘Model’ 后缀
|
|||
fileNameCamelCase: false, // Model 文件名是否使用驼峰法命名,默认文件名会使用表名,如 `user_post.js`;如果为 true,则文件名为 `userPost.js`
|
|||
dir: './app/lib/models', // 指定输出 models 文件的目录
|
|||
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
|
|||
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
|
|||
tables: ['contract_detail', 'invoice_detail'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
|
|||
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
|
|||
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
|
|||
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面
|
|||
attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false
|
|||
}, |
|||
} |
Loading…
Reference in new issue