# Generated by Django 3.0.2 on 2020-10-20 11:18

import QtCompetence.validators
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 = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='is_audit',
            fields=[
                ('audit_id', models.AutoField(primary_key=True, serialize=False, verbose_name='审核内容编号')),
                ('audit_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='审核日期')),
                ('audit_scope', models.IntegerField(choices=[(16, 'internal'), (17, 'external')], verbose_name='审核类型')),
                ('line', models.CharField(blank=True, max_length=100, null=True, verbose_name='线体/产品')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'ordering': ('-audit_date',),
            },
        ),
        migrations.CreateModel(
            name='is_audit_body',
            fields=[
                ('audit_body_id', models.AutoField(primary_key=True, serialize=False, verbose_name='审核主体编号')),
                ('audit_body_name', models.CharField(max_length=200, verbose_name='审核主体名称')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_audit_department',
            fields=[
                ('audit_department_id', models.AutoField(primary_key=True, serialize=False, verbose_name='审核责任部门编号')),
                ('audit_department_name', models.CharField(max_length=200, verbose_name='审核责任部门名称')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_audit_type',
            fields=[
                ('audit_type_id', models.AutoField(primary_key=True, serialize=False, verbose_name='审核类型编号')),
                ('audit_type_name', models.CharField(max_length=200, verbose_name='审核类型名称')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_competition_rule',
            fields=[
                ('competence_id', models.AutoField(primary_key=True, serialize=False, verbose_name='评价规则编号')),
                ('competence_name', models.CharField(max_length=500, verbose_name='技能名称')),
                ('group', models.IntegerField(choices=[(1, 'Methodology&Tool'), (2, 'Technical'), (3, 'Specialized'), (4, 'Soft Skills'), (20, 'Methodology'), (21, 'Tool')], verbose_name='技能分类')),
                ('scope', models.IntegerField(blank=True, choices=[(5, 'New Hire/Transferred'), (6, 'Formal'), (7, 'All')], null=True, verbose_name='面向对象')),
                ('basic_content', models.TextField(max_length=1000, verbose_name='基本水平要求')),
                ('advanced_content', models.TextField(max_length=1000, verbose_name='高级水平要求')),
                ('expert_content', models.TextField(max_length=1000, verbose_name='专家水平要求')),
                ('training_type', models.IntegerField(blank=True, choices=[(8, 'Monthly'), (9, 'Quarterly'), (10, 'Bi-Monthly'), (11, 'Others')], null=True, verbose_name='培训频次')),
                ('reference', models.CharField(blank=True, max_length=500, null=True, verbose_name='参考文件')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_department',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('department_id', models.IntegerField(verbose_name='部门编号')),
                ('department_name', models.CharField(max_length=30, verbose_name='部门名称')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_IATF',
            fields=[
                ('IATF_id', models.AutoField(primary_key=True, serialize=False, verbose_name='条款编号')),
                ('IATF_title_ch', models.TextField(max_length=500, verbose_name='IATF条款标题中文')),
                ('IATF_content_ch', models.TextField(max_length=2000, verbose_name='IATF条款内容中文')),
                ('IATF_title_en', models.TextField(max_length=500, verbose_name='IATF条款标题英文')),
                ('IATF_content_en', models.TextField(max_length=2000, verbose_name='IATF条款内容英文')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position_id', models.IntegerField(verbose_name='职位编号')),
                ('position_name', models.CharField(max_length=100, verbose_name='职位名称')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='is_user',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('user_id', models.IntegerField(verbose_name='用户编号')),
                ('user_name', models.CharField(error_messages={'unique': 'A user with that 员工ID already exists.'}, help_text='Required. 20 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=20, unique=True, validators=[QtCompetence.validators.UnicodeUsernameValidator()], verbose_name='登录名')),
                ('employ_name', models.CharField(max_length=50, verbose_name='姓名')),
                ('email', models.EmailField(blank=True, max_length=255, null=True, verbose_name='邮箱地址')),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_department')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('position', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_position')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='r_rules_position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('standard_score', models.IntegerField(choices=[(12, '0'), (13, '1'), (14, '2'), (15, '3')], verbose_name='Qualified level')),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('position', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_position')),
                ('rules', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_competition_rule')),
            ],
        ),
        migrations.CreateModel(
            name='r_level',
            fields=[
                ('level_id', models.AutoField(primary_key=True, serialize=False, verbose_name='层级关系编号')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('L1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='L1_user', to=settings.AUTH_USER_MODEL, verbose_name='第一层关系')),
                ('L2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='L2_user', to=settings.AUTH_USER_MODEL, verbose_name='第二层关系')),
                ('L3', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='L3_user', to=settings.AUTH_USER_MODEL, verbose_name='第三层关系')),
                ('L4', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='L4_user', to=settings.AUTH_USER_MODEL, verbose_name='第四层关系')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_permission', to=settings.AUTH_USER_MODEL, verbose_name='员工权限编号')),
            ],
        ),
        migrations.CreateModel(
            name='is_IATF_detail',
            fields=[
                ('IATF_detail_id', models.AutoField(primary_key=True, serialize=False, verbose_name='条款详情编号')),
                ('IATF_detail_title_ch', models.TextField(max_length=500, verbose_name='IATF条款详情标题中文')),
                ('IATF_detail_content_ch', models.TextField(max_length=2000, verbose_name='IATF条款详情内容中文')),
                ('IATF_detail_title_en', models.TextField(max_length=500, verbose_name='IATF条款详情标题英文')),
                ('IATF_detail_content_en', models.TextField(max_length=2000, verbose_name='IATF条款详情内容英文')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('IATF', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='IATF_detail_IATF', to='QtCompetence.is_IATF', verbose_name='IATF条款')),
            ],
        ),
        migrations.CreateModel(
            name='is_finding',
            fields=[
                ('finding_id', models.AutoField(primary_key=True, serialize=False, verbose_name='不符合项内容编号')),
                ('finding_content', models.TextField(max_length=2000, verbose_name='问题内容')),
                ('weight', models.IntegerField(choices=[(18, 'Major Nonconfirming'), (19, 'Minor Nonconfirming'), (20, 'OFI')], verbose_name='问题类型')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建日期')),
                ('IATF', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_IATF', verbose_name='IATF条款')),
                ('IATF_detail', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_IATF_detail', verbose_name='IATF详细条款')),
                ('audit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit', verbose_name='审核信息')),
                ('audit_department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit_department', verbose_name='问题责任部门')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='负责人')),
            ],
            options={
                'ordering': ('-audit__audit_date',),
            },
        ),
        migrations.CreateModel(
            name='is_competition_score',
            fields=[
                ('assessment_id', models.AutoField(primary_key=True, serialize=False, verbose_name='个人能力得分编号')),
                ('self_assessment', models.IntegerField(choices=[(12, '0'), (13, '1'), (14, '2'), (15, '3')], verbose_name='自评分数')),
                ('manager_assessment', models.IntegerField(blank=True, choices=[(12, '0'), (13, '1'), (14, '2'), (15, '3')], null=True, verbose_name='经理分数')),
                ('self_gap', models.IntegerField(verbose_name='自评差距')),
                ('manager_gap', models.IntegerField(blank=True, null=True, verbose_name='经理评价差距')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('competence', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_competition_rule')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='is_competition_rule',
            name='position',
            field=models.ManyToManyField(through='QtCompetence.r_rules_position', to='QtCompetence.is_position'),
        ),
        migrations.AddField(
            model_name='is_competition_rule',
            name='trainer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='培训师'),
        ),
        migrations.CreateModel(
            name='is_audit_body_detail',
            fields=[
                ('audit_body_detail_id', models.AutoField(primary_key=True, serialize=False, verbose_name='审核主体信息详情编号')),
                ('audit_body_detail_name', models.CharField(max_length=200, verbose_name='审核主体信息详情名称')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('audit_body', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit_body', verbose_name='审核主体')),
            ],
        ),
        migrations.AddField(
            model_name='is_audit',
            name='audit_body',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit_body', verbose_name='审核主体'),
        ),
        migrations.AddField(
            model_name='is_audit',
            name='audit_body_detail',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit_body_detail', verbose_name='审核主体详情'),
        ),
        migrations.AddField(
            model_name='is_audit',
            name='audit_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit_type', verbose_name='审核类型信息'),
        ),
        migrations.AddField(
            model_name='is_audit',
            name='department',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_audit_department', verbose_name='部门'),
        ),
        migrations.AddField(
            model_name='is_audit',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_pk', to=settings.AUTH_USER_MODEL, verbose_name='负责人'),
        ),
        migrations.CreateModel(
            name='is_action',
            fields=[
                ('action_id', models.AutoField(primary_key=True, serialize=False, verbose_name='纠正措施编号')),
                ('due_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True, verbose_name='纠正措施截止日期')),
                ('actual_date', models.DateTimeField(blank=True, null=True, verbose_name='实际纠正措施日期')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建日期')),
                ('action_content', models.TextField(blank=True, max_length=2000, null=True, verbose_name='纠正措施')),
                ('rootCause', models.TextField(blank=True, max_length=2000, null=True, verbose_name='根本原因')),
                ('correction', models.TextField(blank=True, max_length=2000, null=True, verbose_name='纠正')),
                ('finding', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='QtCompetence.is_finding', verbose_name='对应问题')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='负责人')),
            ],
            options={
                'ordering': ('-finding__audit__audit_date',),
            },
        ),
    ]
