refector: 更新库版本.修改bug

This commit is contained in:
caoqianming 2023-05-23 14:55:24 +08:00
parent 90900bf71e
commit 91ac2f29f9
15 changed files with 55 additions and 16 deletions

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class AbilityConfig(AppConfig): class AbilityConfig(AppConfig):
name = 'ability' name = 'apps.ability'

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class QualityConfig(AppConfig): class QualityConfig(AppConfig):
name = 'consulting' name = 'apps.consulting'

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class CrmConfig(AppConfig): class CrmConfig(AppConfig):
name = 'crm' name = 'apps.crm'

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class ExamConfig(AppConfig): class ExamConfig(AppConfig):
name = 'exam' name = 'apps.exam'

View File

@ -2,5 +2,5 @@ from django.apps import AppConfig
class OpsConfig(AppConfig): class OpsConfig(AppConfig):
name = 'ops' name = 'apps.ops'
verbose_name = '系统监控' verbose_name = '系统监控'

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class QualityConfig(AppConfig): class QualityConfig(AppConfig):
name = 'quality' name = 'apps.quality'

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class SupervisionConfig(AppConfig): class SupervisionConfig(AppConfig):
name = 'supervision' name = 'apps.supervision'

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2023-05-23 06:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('supervision', '0041_auto_20230522_1518'),
]
operations = [
migrations.AlterField(
model_name='pgoaldept',
name='goal_value_b',
field=models.FloatField(blank=True, null=True, verbose_name='设定值'),
),
]

View File

@ -189,7 +189,7 @@ class PgoalDept(CommonBModel):
goal_key = models.CharField('目标key值', max_length=100, default='other', blank=True) goal_key = models.CharField('目标key值', max_length=100, default='other', blank=True)
goal_value_a = models.FloatField('基础值') goal_value_a = models.FloatField('基础值')
goal_o_file = models.ForeignKey(File, related_name='goal_o_file', verbose_name='原文件ID', on_delete=models.SET_NULL, null=True, blank=True) goal_o_file = models.ForeignKey(File, related_name='goal_o_file', verbose_name='原文件ID', on_delete=models.SET_NULL, null=True, blank=True)
goal_value_b = models.FloatField('设定值') goal_value_b = models.FloatField('设定值', null=True, blank=True)
goal_value_c = models.FloatField('实际值', null=True, blank=True) goal_value_c = models.FloatField('实际值', null=True, blank=True)
goal_file = models.ForeignKey(File, related_name='goal_file', verbose_name='当前文件ID', on_delete=models.SET_NULL, null=True, blank=True) goal_file = models.ForeignKey(File, related_name='goal_file', verbose_name='当前文件ID', on_delete=models.SET_NULL, null=True, blank=True)
goal_files = models.ManyToManyField(File, related_name='goal_files', verbose_name='历史文件', blank=True) goal_files = models.ManyToManyField(File, related_name='goal_files', verbose_name='历史文件', blank=True)

View File

@ -434,7 +434,7 @@ class Task2ViewSet(CreateUpdateCustomMixin, ModelViewSet):
return Response() return Response()
@transaction.atomic @transaction.atomic
@action(methods=['put'], detail=True, perms_map = {'put':'task2'}) @action(methods=['put'], detail=True, perms_map = {'put':'task2'}, serializer_class=serializers.Serializer)
def start(self, request, *args, **kwargs): def start(self, request, *args, **kwargs):
""" """
开始执行 开始执行
@ -450,13 +450,13 @@ class Task2ViewSet(CreateUpdateCustomMixin, ModelViewSet):
except: except:
raise ParseError('未配置年度基础目标') raise ParseError('未配置年度基础目标')
for i in tds: for i in tds:
for k, v in enumerate(Pgoal.basedict): for key in Pgoal.basedict:
pds = PgoalDept.objects.filter(task2do=i, goal_key=k) pds = PgoalDept.objects.filter(task2do=i, goal_key=key)
if pds.exists(): if pds.exists():
pds.update(**{'goal_name': v, 'goal_value_a': getattr(pg, k), 'goal_o_file': getattr(pg, k+'_file')}) pds.update(**{'goal_name': Pgoal.basedict[key], 'goal_value_a': getattr(pg, key), 'goal_o_file': getattr(pg, key+'_file')})
else: else:
PgoalDept.objects.create(**{'year': i.task2.year, 'task2do': i, 'belong_dept': i.belong_dept, PgoalDept.objects.create(**{'year': i.task2.year, 'task2do': i, 'belong_dept': i.belong_dept,
'goal_name': v, 'goal_key': k, 'goal_value_a': getattr(pg, k), 'goal_o_file': getattr(pg, k+'_file')}) 'goal_name': Pgoal.basedict[key], 'goal_key': key, 'goal_value_a': getattr(pg, key), 'goal_o_file': getattr(pg, key+'_file')})
obj.state = Task2.TASK2_DOING obj.state = Task2.TASK2_DOING
obj.save() obj.save()
return Response() return Response()
@ -557,7 +557,7 @@ class Domixin:
def countup_task2do(self, task2do): def countup_task2do(self, task2do):
if task2do.task2.type == Task2.TASK2_F: if task2do.task2.type == Task2.TASK2_F:
task2do.count_up = PgoalDept.objects.filter(task2do=task2do).count() task2do.count_up = PgoalDept.objects.filter(task2do=task2do).exclude(goal_value_b=None).count()
task2do.save() task2do.save()
elif task2do.task2.type == Task2.TASK2_S: elif task2do.task2.type == Task2.TASK2_S:
self.countnum_task2do_field(task2do) self.countnum_task2do_field(task2do)

View File

@ -2,5 +2,5 @@ from django.apps import AppConfig
class RbacConfig(AppConfig): class RbacConfig(AppConfig):
name = 'system' name = 'apps.system'
verbose_name = '系统管理' verbose_name = '系统管理'

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2023-05-23 06:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0022_delete_historicaldict'),
]
operations = [
migrations.AlterField(
model_name='user',
name='first_name',
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
),
]

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class VodConfig(AppConfig): class VodConfig(AppConfig):
name = 'vod' name = 'apps.vod'

Binary file not shown.

View File

@ -126,6 +126,9 @@ USE_TZ = True
CORS_ALLOW_CREDENTIALS = True CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_ALLOW_ALL = True
# 默认主键
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/ # https://docs.djangoproject.com/en/3.0/howto/static-files/