import { ApiProperty } from '@nestjs/swagger'; import { Column, Entity, JoinTable, ManyToMany, Relation } from 'typeorm'; import { CommonEntity } from '~/common/entity/common.entity'; import { Storage } from '../tools/storage/storage.entity'; @Entity({ name: 'materials_inventory' }) export class MaterialsInventoryEntity extends CommonEntity { @Column({ name: 'company_name', type: 'varchar', length: 255, comment: '公司名称' }) @ApiProperty({ description: '公司名称' }) companyName: number; @Column({ name: 'product', type: 'int', comment: '产品名称(字典)' }) @ApiProperty({ description: '产品名称(字典)' }) product: number; @Column({ name: 'unit', type: 'int', comment: '单位(字典)' }) @ApiProperty({ description: '单位(字典)' }) unit: number; @Column({ name: 'previous_inventory_quantity', type: 'int', default: 0, comment: '之前的库存数量' }) @ApiProperty({ description: '之前的库存数量' }) previousInventoryQuantity: number; @Column({ name: 'previous_unit_price', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '之前的单价' }) @ApiProperty({ description: '之前的单价' }) previousUnitPrice: number; @Column({ name: 'previous_amount', type: 'decimal', precision: 10, scale: 2, default: 0, comment: '之前的金额' }) @ApiProperty({ description: '之前的金额' }) previousAmount: number; @Column({ name: 'inventory_time', type: 'date', nullable: true, comment: '入库时间' }) @ApiProperty({ description: '入库时间' }) inventoryTime: Date; @Column({ name: 'inventory_quantity', type: 'int', default: 0, comment: '入库数量' }) @ApiProperty({ description: '入库数量' }) inventoryQuantity: number; @Column({ name: 'inventory_unit_price', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '入库单价' }) @ApiProperty({ description: '入库单价' }) inventoryUnitPrice: number; @Column({ name: 'inventory_amount', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '入库金额' }) @ApiProperty({ description: '入库金额' }) inventoryAmount: number; @Column({ name: 'out_time', type: 'date', nullable: true, comment: '出库时间' }) @ApiProperty({ description: '出库时间' }) outime: Date; @Column({ name: 'out_quantity', type: 'int', default: 0, comment: '出库数量' }) @ApiProperty({ description: '出库数量' }) outQuantity: number; @Column({ name: 'out_unit_price', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '出库单价' }) @ApiProperty({ description: '出库单价' }) outUnitPrice: number; @Column({ name: 'out_amount', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '出库金额' }) @ApiProperty({ description: '出库金额' }) outAmount: number; @Column({ name: 'current_inventory_quantity', type: 'int', default: 0, comment: '现在的结存数量' }) @ApiProperty({ description: '现在的结存数量' }) currentInventoryQuantity: number; @Column({ name: 'current_unit_price', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '现在的单价' }) @ApiProperty({ description: '现在的单价' }) currentUnitPrice: number; @Column({ name: 'current_amount', type: 'decimal', precision: 10, default: 0, scale: 2, comment: '现在的金额' }) @ApiProperty({ description: '现在的金额' }) currentAmount: number; @Column({ name: 'agent', type: 'varchar', length: 50, comment: '经办人', nullable: true }) @ApiProperty({ description: '经办人' }) agent: string; @Column({ name: 'issuance_number', type: 'varchar', length: 100, comment: '领料单号' }) @ApiProperty({ description: '领料单号' }) issuanceNumber: string; @Column({ name: 'remark', type: 'varchar', length: 255, comment: '备注', nullable: true }) @ApiProperty({ description: '备注' }) remark: string; @Column({ name: 'project', type: 'varchar', length: 255, comment: '项目', nullable: false }) @ApiProperty({ description: '项目' }) project: string; @Column({ name: 'is_delete', type: 'tinyint', default: 0, comment: '是否删除' }) @ApiProperty({ description: '删除状态:0未删除,1已删除' }) isDelete: number; }