# Generated by Django 3.0.5 on 2023-05-15 06:53

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


class Migration(migrations.Migration):

    dependencies = [
        ('system', '0022_delete_historicaldict'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('supervision', '0034_auto_20230308_1204'),
    ]

    operations = [
        migrations.CreateModel(
            name='Task2',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('year', models.PositiveSmallIntegerField(default=2023, verbose_name='年份')),
                ('cycle', models.PositiveSmallIntegerField(default=0, help_text='1-6个周期', verbose_name='所属周期')),
                ('type', models.PositiveSmallIntegerField(choices=[(10, '目标制定'), (20, '日常监督')], default=20, verbose_name='任务类型')),
                ('state', models.PositiveSmallIntegerField(choices=[(10, '创建中'), (20, '进行中'), (30, '已关闭')], default=20, verbose_name='任务状态')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='task2_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='task2_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Task2Do',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('count_up', models.PositiveSmallIntegerField(default=0, verbose_name='完成上报内容数')),
                ('count_all', models.PositiveSmallIntegerField(default=8, verbose_name='需上报内容数')),
                ('num_issue', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='已发放报告数量')),
                ('num_expect', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='应发报告数')),
                ('num_error', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='不准确报告数')),
                ('num_overdue', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='超期报告数')),
                ('num_complaint', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='客户投诉数')),
                ('num_pt', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='能力验证数')),
                ('num_risk', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='风险识别数')),
                ('num_ocheck', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='外部检查数')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='task2do_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='task2do_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('task2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task2dept_task2', to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='task2do_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Risk',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('content', models.TextField(verbose_name='内容')),
                ('level', models.PositiveSmallIntegerField(choices=[(10, '主要风险'), (20, '严重风险'), (30, '重大风险')], default=10, verbose_name='风险等级')),
                ('code', models.CharField(max_length=100, verbose_name='风险代码')),
                ('state', models.PositiveSmallIntegerField(choices=[(10, '未整改'), (20, '整改中'), (30, '整改完成')], default=10, verbose_name='整改状态')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='risk_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='risk_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('task2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='risk_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Rc',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('number', models.CharField(max_length=100, verbose_name='报告证书编号')),
                ('etype', models.PositiveSmallIntegerField(choices=[(10, '出错'), (20, '超期')], default=0, verbose_name='异常情况')),
                ('number_correct', models.CharField(blank=True, default='', max_length=100, verbose_name='更改后报告证书编号')),
                ('reason_error', models.CharField(blank=True, default='', max_length=100, verbose_name='出错原因')),
                ('date_accept', models.DateField(blank=True, null=True, verbose_name='业务受理日期')),
                ('date_expect', models.DateField(blank=True, null=True, verbose_name='预计发放日期')),
                ('date_issue', models.DateField(blank=True, null=True, verbose_name='实际发放日期')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rc_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rc_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('task2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rc_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Pt',
            fields=[
                ('id', models.AutoField(auto_created=True, 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=100, verbose_name='名称')),
                ('number', models.CharField(max_length=100, verbose_name='编号')),
                ('organizer', models.CharField(max_length=100, verbose_name='组织方')),
                ('params', models.TextField(verbose_name='参加参数名称')),
                ('result', models.PositiveSmallIntegerField(choices=[(10, '满意'), (20, '有问题'), (30, '不满意')], default=10, verbose_name='结果')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pt_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pt_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('task2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pt_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PgoalDept',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('year', models.PositiveSmallIntegerField(default=2023, verbose_name='年份')),
                ('goal_name', models.CharField(max_length=100, verbose_name='目标名称')),
                ('goal_key', models.CharField(blank=True, default='other', max_length=100, verbose_name='目标key值')),
                ('goal_value_a', models.FloatField(blank=True, default=0, verbose_name='基础值')),
                ('goal_value_b', models.FloatField(default=0, verbose_name='设定值')),
                ('goal_value_c', models.FloatField(blank=True, default=0, verbose_name='实际值')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoaldept_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoaldept_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('goal_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='goal_file', to='system.File', verbose_name='当前文件ID')),
                ('goal_files', models.ManyToManyField(blank=True, related_name='goal_files', to='system.File', verbose_name='历史文件')),
                ('task2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoaldept_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Pgoal',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('year', models.PositiveSmallIntegerField(default=2023, unique=True, verbose_name='年份')),
                ('pgoal_1', models.FloatField(default=0, verbose_name='重大质量事故-基础值')),
                ('pgoal_2', models.FloatField(default=0, verbose_name='报告/证书合格率-基础值')),
                ('pgoal_3', models.FloatField(default=0, verbose_name='报告/证书及时率-基础值')),
                ('pgoal_4', models.FloatField(default=0, verbose_name='能力验证满意率-基础值')),
                ('pgoal_5', models.FloatField(default=0, verbose_name='客户投诉处理满意率-基础值')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('pgoal_1_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_1_file', to='system.File')),
                ('pgoal_2_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_2_file', to='system.File')),
                ('pgoal_3_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_3_file', to='system.File')),
                ('pgoal_4_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_4_file', to='system.File')),
                ('pgoal_5_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_5_file', to='system.File')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pgoal_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Oinspect',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('cate', models.PositiveSmallIntegerField(choices=[(10, '市场监管部门检查'), (20, '行业主管部门检查'), (30, '其他检查')], default=30, verbose_name='检查分类')),
                ('checker', models.CharField(max_length=100, verbose_name='检查方')),
                ('date_inspect', models.DateField(verbose_name='检查日期')),
                ('result', models.TextField(verbose_name='检查结果')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='oinspect_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='oinspect_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('task2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='oinspect_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Complaint',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('complainant', models.CharField(max_length=100, verbose_name='投诉人')),
                ('content', models.TextField(verbose_name='投诉内容')),
                ('date_occurrence', models.DateField(verbose_name='投诉日期')),
                ('date_feedback', models.DateField(verbose_name='反馈日期')),
                ('is_satisfied', models.BooleanField(default=True, verbose_name='是否满意')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='complaint_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='complaint_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('task2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='supervision.Task2', verbose_name='关联任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='complaint_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
