# Generated by Django 3.2.12 on 2025-12-18 08:36

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('system', '0006_auto_20241213_1249'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('pum', '0009_supplieraudit'),
        ('wf', '0006_auto_20251215_1645'),
    ]

    operations = [
        migrations.CreateModel(
            name='AssetLog',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('type', models.CharField(help_text='入库/出库', max_length=50, verbose_name='流水类型')),
                ('start_date', models.DateField(blank=True, null=True, verbose_name='启用日期')),
                ('items', models.JSONField(blank=True, default=list, null=True, verbose_name='资产明细')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assetlog_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('keep_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='system.dept', verbose_name='保管部门')),
                ('ticket', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='assetlog_ticket', to='wf.ticket', verbose_name='关联工单')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assetlog_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AssetCate',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=50, unique=True, verbose_name='类别名称')),
                ('code', models.CharField(blank=True, max_length=50, null=True, unique=True, verbose_name='类别编码')),
                ('default_unit', models.CharField(default='台', max_length=20, verbose_name='默认单位')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assetcate_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assetcate_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Asset',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('card_number', models.CharField(blank=True, max_length=50, null=True, unique=True, verbose_name='卡片编号')),
                ('name', models.CharField(max_length=100, verbose_name='固定资产名称')),
                ('specification', models.CharField(blank=True, max_length=100, null=True, verbose_name='规格型号')),
                ('quantity', models.PositiveIntegerField(default=1, verbose_name='数量')),
                ('start_date', models.DateField(verbose_name='启用日期')),
                ('canuse_year', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='可用年限')),
                ('original_value', models.DecimalField(decimal_places=2, max_digits=15, verbose_name='资产原值')),
                ('storage_location', models.CharField(blank=True, max_length=100, null=True, verbose_name='存放地点')),
                ('state', models.CharField(help_text='在用/闲置', max_length=50, verbose_name='使用状态')),
                ('unit', models.CharField(default='台', max_length=50, verbose_name='计量单位')),
                ('note', models.TextField(blank=True, null=True, verbose_name='备注')),
                ('cate', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='asm.assetcate', verbose_name='资产类别')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='asset_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('keep_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='system.dept', verbose_name='保管部门')),
                ('keeper', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='保管人')),
                ('supplier', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pum.supplier', verbose_name='供应商')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='asset_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
