1
This commit is contained in:
1 parent
3120090399
commit
636bd12043
5 files changed
+15
-8
No files matched your search
@@ -6,5 +6,5 @@ urlpatterns = [
|
||||
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
|
||||
path('dailyroundup/', DailyRoundUpAPIView.as_view(), name='dailyroundup'),
|
||||
path('dailyload/', DailyloadAPIView.as_view(), name='dailyload'),
|
||||
path('searchuser/', SearchUserAPIView.as_view(), name='searchuser'),
|
||||
|
||||
]
|
||||
@@ -23,6 +23,7 @@ from django.db.models import Count
|
||||
|
||||
class GeneralVacationAPIView(APIView):
|
||||
def get(self, request):
|
||||
"""В работе. Необходимо для учета отпуска сотрудников"""
|
||||
general = GeneralVacation.objects.all()
|
||||
plan = PlanCalendar.objects.all()
|
||||
|
||||
@@ -39,13 +40,14 @@ class GeneralVacationAPIView(APIView):
|
||||
return Response({"Отпуск": serializer_for_basecrit.data, "План-график": serializer_for_plan.data})
|
||||
|
||||
class DailyRoundUpAPIView(APIView):
|
||||
"""Принимает файл и в параметр excel передается имя функции,"""
|
||||
|
||||
def get(self, request):
|
||||
|
||||
"""Принимает файл и в параметр excel передается имя функции, которую нужно использовать. excround - На формирование файла"""
|
||||
user = DictEmployee.objects.filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname').order_by('id_dict_department__order_department')
|
||||
|
||||
|
||||
re = roundExcel(user)
|
||||
print( request.GET.get("excel"), '-------------------------------')
|
||||
file_path = getattr(re, request.GET.get("excel"))()
|
||||
# if request.GET.get("excel") == 'round':
|
||||
# file_path = re.excround()
|
||||
@@ -63,6 +65,7 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
|
||||
def post(self, request):
|
||||
"""Принимает файл и в параметр excel передается имя функции, которую нужно использовать. roundfilse - на загрузку в бд"""
|
||||
user = DictEmployee.objects.filter(deleted=0).values('login', 'id', 'fio')
|
||||
re = loadExcel(user, request.data['dailyfiles'])
|
||||
pos=''
|
||||
@@ -128,9 +131,4 @@ class DailyloadAPIView(APIView):
|
||||
daily=""
|
||||
return Response({'daily':daily, 'position':pos})
|
||||
|
||||
class SearchUserAPIView(APIView):
|
||||
def post(self, request):
|
||||
f= DictEmployee.objects.values('familyname').filter(fio__icontains=request.data['searchname'])
|
||||
|
||||
return Response('')
|
||||
|
||||
Reference in new issue
Block a user