Переезд
This commit is contained in:
1 parent
de8afb44cc
commit
1ed6ee0c6a
5 files changed
+25
-16
No files matched your search
@@ -74,7 +74,7 @@ class getuserAPIView(APIView):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
dt=datetime.now()
|
dt=datetime.now()
|
||||||
queryset = DictEmployee.objects.using('user_directory').get(login=request.query_params.get('userlogin'))
|
queryset = DictEmployee.objects.get(login=request.query_params.get('userlogin'))
|
||||||
r=CardUserSerializer(queryset).data
|
r=CardUserSerializer(queryset).data
|
||||||
print(datetime.now()-dt)
|
print(datetime.now()-dt)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
class="pt-2"
|
class="pt-2"
|
||||||
icon="mdi-file-excel"
|
icon="mdi-file-excel"
|
||||||
color="green-darken-3"
|
color="green-darken-3"
|
||||||
@click="excelOp('round')"
|
@click="excelOp('roundfilse')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<v-icon
|
<v-icon
|
||||||
icon="mdi-download"
|
icon="mdi-download"
|
||||||
color="blue-grey-darken-2"
|
color="blue-grey-darken-2"
|
||||||
@click="onPickFile('round')"
|
@click="onPickFile('roundfilse')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
class="pt-2"
|
class="pt-2"
|
||||||
icon="mdi-file-excel"
|
icon="mdi-file-excel"
|
||||||
color="green-darken-3"
|
color="green-darken-3"
|
||||||
@click="excelOp('vacation')"
|
@click="excelOp('vacationsExcel')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
<v-icon
|
<v-icon
|
||||||
icon="mdi-download"
|
icon="mdi-download"
|
||||||
color="blue-grey-darken-2"
|
color="blue-grey-darken-2"
|
||||||
@click="onPickFile('vacation')"
|
@click="onPickFile('vacationsExcel')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -160,6 +160,9 @@ export default {
|
|||||||
const info = ref({})
|
const info = ref({})
|
||||||
const t_dailyRound = ref('')
|
const t_dailyRound = ref('')
|
||||||
const alert = ref(false)
|
const alert = ref(false)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const excelOp = (ex) => {
|
const excelOp = (ex) => {
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyroundup/?excel=${ex}`).then(result => {
|
axiosApiInstance.get(`api/general_vacation/dailyroundup/?excel=${ex}`).then(result => {
|
||||||
let link = document.createElement("a")
|
let link = document.createElement("a")
|
||||||
|
|||||||
@@ -268,11 +268,11 @@ class loadExcel():
|
|||||||
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
||||||
user=df3['login'][ind], defaults={'position':base})
|
user=df3['login'][ind], defaults={'position':base})
|
||||||
|
|
||||||
pos = DailyRoundUp.objects.values('position__name', 'position').filter(position=6,todaysDate=date.today()).annotate(Count('user'))
|
# pos = DailyRoundUp.objects.values('position__name', 'position').filter(position=6,todaysDate=date.today()).annotate(Count('user'))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return pos
|
return ''
|
||||||
|
|
||||||
def vacationsExcel(self):
|
def vacationsExcel(self):
|
||||||
ed = pd.read_excel(self.file, sheet_name='Запланированные отпуска')
|
ed = pd.read_excel(self.file, sheet_name='Запланированные отпуска')
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ class GeneralVacationAPIView(APIView):
|
|||||||
class DailyRoundUpAPIView(APIView):
|
class DailyRoundUpAPIView(APIView):
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
user = DictEmployee.objects.filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname')
|
user = DictEmployee.objects.filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname')
|
||||||
|
|
||||||
|
|
||||||
re = roundExcel(user)
|
re = roundExcel(user)
|
||||||
if request.GET.get("excel") == 'round':
|
if request.GET.get("excel") == 'round':
|
||||||
file_path = re.excround()
|
file_path = re.excround()
|
||||||
@@ -59,22 +62,24 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
|
print('----------ssssssssssssssssssssssssssssss-------------------------')
|
||||||
user = DictEmployee.objects.filter(deleted=0).values('login', 'id', 'fio')
|
user = DictEmployee.objects.filter(deleted=0).values('login', 'id', 'fio')
|
||||||
|
print(user, '----------ddsfsdfds-------------------------')
|
||||||
re = loadExcel(user, request.data['dailyfiles'])
|
re = loadExcel(user, request.data['dailyfiles'])
|
||||||
pos=''
|
pos=''
|
||||||
mess = 'Файл не найден'
|
mess = 'Файл не найден'
|
||||||
try:
|
try:
|
||||||
|
getattr(re, request.GET.get("excel"))()
|
||||||
print(request.GET.get("excel"), 'request.GET.get("excel")----------------')
|
print(request.GET.get("excel"), 'request.GET.get("excel")----------------')
|
||||||
if request.GET.get("excel") == 'round':
|
# if request.GET.get("excel") == 'round':
|
||||||
|
|
||||||
re.roundfilse()
|
# re.roundfilse()
|
||||||
mess = "Файл загружен"
|
# mess = "Файл загружен"
|
||||||
if request.GET.get("excel") == 'vacation':
|
# if request.GET.get("excel") == 'vacation':
|
||||||
re.vacationsExcel()
|
# re.vacationsExcel()
|
||||||
print(request.data['dailyfiles'], 'request.data[dailyfiles]--------------------')
|
# print(request.data['dailyfiles'], 'request.data[dailyfiles]--------------------')
|
||||||
mess = 'Файл в обраотке'
|
# mess = 'Файл в обраотке'
|
||||||
pos=''
|
# pos=''
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, '-----------------------------')
|
print(e, '-----------------------------')
|
||||||
pass
|
pass
|
||||||
@@ -91,6 +96,7 @@ class DailyloadAPIView(APIView):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
try:
|
try:
|
||||||
user = DictEmployee.objects.filter(deleted=0).values('login', 'department', 'fio', 'post')
|
user = DictEmployee.objects.filter(deleted=0).values('login', 'department', 'fio', 'post')
|
||||||
|
|
||||||
dailyr = DailyRoundUp.objects.filter(todaysDate=date.today()).values_list('user', 'position__name', 'position')
|
dailyr = DailyRoundUp.objects.filter(todaysDate=date.today()).values_list('user', 'position__name', 'position')
|
||||||
df_user = pd.DataFrame.from_records(user)
|
df_user = pd.DataFrame.from_records(user)
|
||||||
df_daily = pd.DataFrame.from_records(dailyr)
|
df_daily = pd.DataFrame.from_records(dailyr)
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user