瀏覽代碼

添加一个日期判断接口

pengzhibo168 5 年之前
父節點
當前提交
c9134ce487
共有 6 個文件被更改,包括 449 次插入10 次删除
  1. 4 4
      Ansjer/local_settings.py
  2. 3 3
      Ansjer/urls.py
  3. 432 0
      Controller/DateController.py
  4. 4 0
      Controller/OTAEquipment.py
  5. 6 2
      Service/MiscellService.py
  6. 0 1
      Service/TemplateService.py

+ 4 - 4
Ansjer/local_settings.py

@@ -78,10 +78,10 @@ SERVER_HOST = '192.168.136.45'
 DATABASES_USER = 'ansjer'
 DATABASES_USER = 'ansjer'
 DATABASES_PASS = 'ansjer.x.x'
 DATABASES_PASS = 'ansjer.x.x'
 
 
-# DATABASE_DATA = 'AnsjerLocal'
-# SERVER_HOST = 'localhost'
-# DATABASES_USER = 'root'
-# DATABASES_PASS = '123456'
+DATABASE_DATA = 'AnsjerLocal'
+SERVER_HOST = 'localhost'
+DATABASES_USER = 'root'
+DATABASES_PASS = '123456'
 
 
 DATABASES = {'default': {
 DATABASES = {'default': {
     'ENGINE': 'django.db.backends.mysql',
     'ENGINE': 'django.db.backends.mysql',

+ 3 - 3
Ansjer/urls.py

@@ -3,7 +3,7 @@ from django.urls import path, re_path
 
 
 from Controller import FeedBack, EquipmentOTA, EquipmentInfo, AdminManage, AppInfo, \
 from Controller import FeedBack, EquipmentOTA, EquipmentInfo, AdminManage, AppInfo, \
     AccessLog, DynamoDBLog, Test, MealManage, DeviceManage, EquipmentStatus, SysManage, DeviceLog, LogAccess, \
     AccessLog, DynamoDBLog, Test, MealManage, DeviceManage, EquipmentStatus, SysManage, DeviceLog, LogAccess, \
-    AppColophon, \
+    AppColophon, DateController,\
     EquipmentManager, LogManager, PermissionManager, OTAEquipment, shareUserPermission, UidSetController, \
     EquipmentManager, LogManager, PermissionManager, OTAEquipment, shareUserPermission, UidSetController, \
     UserManger, CheckUserData, \
     UserManger, CheckUserData, \
     UserController, CloudVod, OrderContrller, VodBucket, DetectController, DeviceShare, UserBrandController, \
     UserController, CloudVod, OrderContrller, VodBucket, DetectController, DeviceShare, UserBrandController, \
@@ -194,8 +194,8 @@ urlpatterns = [
     url(r'^v3/account/changePwd$', UserController.v3ChangePwdView.as_view()),
     url(r'^v3/account/changePwd$', UserController.v3ChangePwdView.as_view()),
     url(r'^v3/account/resetPwdByCode$', UserController.v3resetPwdByCodeView.as_view()),
     url(r'^v3/account/resetPwdByCode$', UserController.v3resetPwdByCodeView.as_view()),
     url(r'^v3/account/register$', UserController.v3registerView.as_view()),
     url(r'^v3/account/register$', UserController.v3registerView.as_view()),
-    #测试------
-    url(r'^v11/account/changePwd$', UserController.v3ChangePwdView.as_view()),
+    # 判断节假日接口
+    url(r'^date/(?P<operation>.*)$', DateController.DateConView.as_view()),
 
 
     # app 设备消息模板
     # app 设备消息模板
     # 路由加参数参考
     # 路由加参数参考

+ 432 - 0
Controller/DateController.py

@@ -0,0 +1,432 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+@Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
+@AUTHOR: ASJRD018
+@NAME: AnsjerFormal
+@software: PyCharm
+@DATE: 2018/12/5 9:30
+@Version: python3.6
+@MODIFY DECORD:ansjer dev
+@file: CloudVod.py
+@Contact: chanjunkai@163.com
+"""
+import json
+import math
+import time
+import urllib
+from django.http import JsonResponse, HttpResponseRedirect, HttpResponse
+from django.utils.decorators import method_decorator
+from django.views.decorators.csrf import csrf_exempt
+from django.views.generic.base import View
+from Object.ResponseObject import ResponseObject
+from Object.TokenObject import TokenObject
+from Object.UidTokenObject import UidTokenObject
+from Service.CommonService import CommonService
+from Service.ModelService import ModelService
+
+
+
+class DateConView(View):
+    @method_decorator(csrf_exempt)
+    def dispatch(self, *args, **kwargs):
+        return super(DateConView, self).dispatch(*args, **kwargs)
+
+    def get(self, request, *args, **kwargs):
+        request.encoding = 'utf-8'
+        operation = kwargs.get('operation')
+        return self.validation(request.GET, request, operation)
+
+    def post(self, request, *args, **kwargs):
+        request.encoding = 'utf-8'
+        operation = kwargs.get('operation')
+        return self.validation(request.POST, request, operation)
+
+    def validation(self, request_dict, request, operation):
+        response = ResponseObject()
+        if operation is None:
+            return response.json(444, 'error path')
+        elif operation == 'day':
+            return self.do_date(request_dict, response)
+        else:
+            return response.json(414)
+
+    def do_date(self, request_dict,response):
+        h = request_dict.get('h', None)
+        day = [
+        {"dayStr": "20200101", "type": "2"},
+        {"dayStr": "20200102", "type": "0"},
+        {"dayStr": "20200103", "type": "0"},
+        {"dayStr": "20200104", "type": "1"},
+        {"dayStr": "20200105", "type": "1"},
+        {"dayStr": "20200106", "type": "0"},
+        {"dayStr": "20200107", "type": "0"},
+        {"dayStr": "20200108", "type": "0"},
+        {"dayStr": "20200109", "type": "0"},
+        {"dayStr": "20200110", "type": "0"},
+        {"dayStr": "20200111", "type": "1"},
+        {"dayStr": "20200112", "type": "1"},
+        {"dayStr": "20200113", "type": "0"},
+        {"dayStr": "20200114", "type": "0"},
+        {"dayStr": "20200115", "type": "0"},
+        {"dayStr": "20200116", "type": "0"},
+        {"dayStr": "20200117", "type": "0"},
+        {"dayStr": "20200118", "type": "1"},
+        {"dayStr": "20200119", "type": "0"},
+        {"dayStr": "20200120", "type": "0"},
+        {"dayStr": "20200121", "type": "0"},
+        {"dayStr": "20200122", "type": "0"},
+        {"dayStr": "20200123", "type": "0"},
+        {"dayStr": "20200124", "type": "2"},
+        {"dayStr": "20200125", "type": "2"},
+        {"dayStr": "20200126", "type": "2"},
+        {"dayStr": "20200127", "type": "2"},
+        {"dayStr": "20200128", "type": "2"},
+        {"dayStr": "20200129", "type": "2"},
+        {"dayStr": "20200130", "type": "2"},
+        {"dayStr": "20200131", "type": "0"},
+        {"dayStr": "20200201", "type": "0"},
+        {"dayStr": "20200202", "type": "1"},
+        {"dayStr": "20200203", "type": "0"},
+        {"dayStr": "20200204", "type": "0"},
+        {"dayStr": "20200205", "type": "0"},
+        {"dayStr": "20200206", "type": "0"},
+        {"dayStr": "20200207", "type": "0"},
+        {"dayStr": "20200208", "type": "1"},
+        {"dayStr": "20200209", "type": "1"},
+        {"dayStr": "20200210", "type": "0"},
+        {"dayStr": "20200211", "type": "0"},
+        {"dayStr": "20200212", "type": "0"},
+        {"dayStr": "20200213", "type": "0"},
+        {"dayStr": "20200214", "type": "0"},
+        {"dayStr": "20200215", "type": "1"},
+        {"dayStr": "20200216", "type": "1"},
+        {"dayStr": "20200217", "type": "0"},
+        {"dayStr": "20200218", "type": "0"},
+        {"dayStr": "20200219", "type": "0"},
+        {"dayStr": "20200220", "type": "0"},
+        {"dayStr": "20200221", "type": "0"},
+        {"dayStr": "20200222", "type": "1"},
+        {"dayStr": "20200223", "type": "1"},
+        {"dayStr": "20200224", "type": "0"},
+        {"dayStr": "20200225", "type": "0"},
+        {"dayStr": "20200226", "type": "0"},
+        {"dayStr": "20200227", "type": "0"},
+        {"dayStr": "20200228", "type": "0"},
+        {"dayStr": "20200229", "type": "1"},
+        {"dayStr": "20200301", "type": "1"},
+        {"dayStr": "20200302", "type": "0"},
+        {"dayStr": "20200303", "type": "0"},
+        {"dayStr": "20200304", "type": "0"},
+        {"dayStr": "20200305", "type": "0"},
+        {"dayStr": "20200306", "type": "0"},
+        {"dayStr": "20200307", "type": "1"},
+        {"dayStr": "20200308", "type": "1"},
+        {"dayStr": "20200309", "type": "0"},
+        {"dayStr": "20200310", "type": "0"},
+        {"dayStr": "20200311", "type": "0"},
+        {"dayStr": "20200312", "type": "0"},
+        {"dayStr": "20200313", "type": "0"},
+        {"dayStr": "20200314", "type": "1"},
+        {"dayStr": "20200315", "type": "1"},
+        {"dayStr": "20200316", "type": "0"},
+        {"dayStr": "20200317", "type": "0"},
+        {"dayStr": "20200318", "type": "0"},
+        {"dayStr": "20200319", "type": "0"},
+        {"dayStr": "20200320", "type": "0"},
+        {"dayStr": "20200321", "type": "1"},
+        {"dayStr": "20200322", "type": "1"},
+        {"dayStr": "20200323", "type": "0"},
+        {"dayStr": "20200324", "type": "0"},
+        {"dayStr": "20200325", "type": "0"},
+        {"dayStr": "20200326", "type": "0"},
+        {"dayStr": "20200327", "type": "0"},
+        {"dayStr": "20200328", "type": "1"},
+        {"dayStr": "20200329", "type": "1"},
+        {"dayStr": "20200330", "type": "0"},
+        {"dayStr": "20200331", "type": "0"},
+        {"dayStr": "20200401", "type": "0"},
+        {"dayStr": "20200402", "type": "0"},
+        {"dayStr": "20200403", "type": "0"},
+        {"dayStr": "20200404", "type": "2"},
+        {"dayStr": "20200405", "type": "2"},
+        {"dayStr": "20200406", "type": "2"},
+        {"dayStr": "20200407", "type": "0"},
+        {"dayStr": "20200408", "type": "0"},
+        {"dayStr": "20200409", "type": "0"},
+        {"dayStr": "20200410", "type": "0"},
+        {"dayStr": "20200411", "type": "1"},
+        {"dayStr": "20200412", "type": "1"},
+        {"dayStr": "20200413", "type": "0"},
+        {"dayStr": "20200414", "type": "0"},
+        {"dayStr": "20200415", "type": "0"},
+        {"dayStr": "20200416", "type": "0"},
+        {"dayStr": "20200417", "type": "0"},
+        {"dayStr": "20200418", "type": "1"},
+        {"dayStr": "20200419", "type": "1"},
+        {"dayStr": "20200420", "type": "0"},
+        {"dayStr": "20200421", "type": "0"},
+        {"dayStr": "20200422", "type": "0"},
+        {"dayStr": "20200423", "type": "0"},
+        {"dayStr": "20200424", "type": "0"},
+        {"dayStr": "20200425", "type": "1"},
+        {"dayStr": "20200426", "type": "0"},
+        {"dayStr": "20200427", "type": "0"},
+        {"dayStr": "20200428", "type": "0"},
+        {"dayStr": "20200429", "type": "0"},
+        {"dayStr": "20200430", "type": "0"},
+        {"dayStr": "20200501", "type": "2"},
+        {"dayStr": "20200502", "type": "2"},
+        {"dayStr": "20200503", "type": "2"},
+        {"dayStr": "20200504", "type": "2"},
+        {"dayStr": "20200505", "type": "2"},
+        {"dayStr": "20200506", "type": "0"},
+        {"dayStr": "20200507", "type": "0"},
+        {"dayStr": "20200508", "type": "0"},
+        {"dayStr": "20200509", "type": "0"},
+        {"dayStr": "20200510", "type": "1"},
+        {"dayStr": "20200511", "type": "0"},
+        {"dayStr": "20200512", "type": "0"},
+        {"dayStr": "20200513", "type": "0"},
+        {"dayStr": "20200514", "type": "0"},
+        {"dayStr": "20200515", "type": "0"},
+        {"dayStr": "20200516", "type": "1"},
+        {"dayStr": "20200517", "type": "1"},
+        {"dayStr": "20200518", "type": "0"},
+        {"dayStr": "20200519", "type": "0"},
+        {"dayStr": "20200520", "type": "0"},
+        {"dayStr": "20200521", "type": "0"},
+        {"dayStr": "20200522", "type": "0"},
+        {"dayStr": "20200523", "type": "1"},
+        {"dayStr": "20200524", "type": "1"},
+        {"dayStr": "20200525", "type": "0"},
+        {"dayStr": "20200526", "type": "0"},
+        {"dayStr": "20200527", "type": "0"},
+        {"dayStr": "20200528", "type": "0"},
+        {"dayStr": "20200529", "type": "0"},
+        {"dayStr": "20200530", "type": "1"},
+        {"dayStr": "20200531", "type": "1"},
+        {"dayStr": "20200601", "type": "0"},
+        {"dayStr": "20200602", "type": "0"},
+        {"dayStr": "20200603", "type": "0"},
+        {"dayStr": "20200604", "type": "0"},
+        {"dayStr": "20200605", "type": "0"},
+        {"dayStr": "20200606", "type": "1"},
+        {"dayStr": "20200607", "type": "1"},
+        {"dayStr": "20200608", "type": "0"},
+        {"dayStr": "20200609", "type": "0"},
+        {"dayStr": "20200610", "type": "0"},
+        {"dayStr": "20200611", "type": "0"},
+        {"dayStr": "20200612", "type": "0"},
+        {"dayStr": "20200613", "type": "1"},
+        {"dayStr": "20200614", "type": "1"},
+        {"dayStr": "20200615", "type": "0"},
+        {"dayStr": "20200616", "type": "0"},
+        {"dayStr": "20200617", "type": "0"},
+        {"dayStr": "20200618", "type": "0"},
+        {"dayStr": "20200619", "type": "0"},
+        {"dayStr": "20200620", "type": "1"},
+        {"dayStr": "20200621", "type": "1"},
+        {"dayStr": "20200622", "type": "0"},
+        {"dayStr": "20200623", "type": "0"},
+        {"dayStr": "20200624", "type": "0"},
+        {"dayStr": "20200625", "type": "2"},
+        {"dayStr": "20200626", "type": "2"},
+        {"dayStr": "20200627", "type": "2"},
+        {"dayStr": "20200628", "type": "0"},
+        {"dayStr": "20200629", "type": "0"},
+        {"dayStr": "20200630", "type": "0"},
+        {"dayStr": "20200701", "type": "0"},
+        {"dayStr": "20200702", "type": "0"},
+        {"dayStr": "20200703", "type": "0"},
+        {"dayStr": "20200704", "type": "1"},
+        {"dayStr": "20200705", "type": "1"},
+        {"dayStr": "20200706", "type": "0"},
+        {"dayStr": "20200707", "type": "0"},
+        {"dayStr": "20200708", "type": "0"},
+        {"dayStr": "20200709", "type": "0"},
+        {"dayStr": "20200710", "type": "0"},
+        {"dayStr": "20200711", "type": "1"},
+        {"dayStr": "20200712", "type": "1"},
+        {"dayStr": "20200713", "type": "0"},
+        {"dayStr": "20200714", "type": "0"},
+        {"dayStr": "20200715", "type": "0"},
+        {"dayStr": "20200716", "type": "0"},
+        {"dayStr": "20200717", "type": "0"},
+        {"dayStr": "20200718", "type": "1"},
+        {"dayStr": "20200719", "type": "1"},
+        {"dayStr": "20200720", "type": "0"},
+        {"dayStr": "20200721", "type": "0"},
+        {"dayStr": "20200722", "type": "0"},
+        {"dayStr": "20200723", "type": "0"},
+        {"dayStr": "20200724", "type": "0"},
+        {"dayStr": "20200725", "type": "1"},
+        {"dayStr": "20200726", "type": "1"},
+        {"dayStr": "20200727", "type": "0"},
+        {"dayStr": "20200728", "type": "0"},
+        {"dayStr": "20200729", "type": "0"},
+        {"dayStr": "20200730", "type": "0"},
+        {"dayStr": "20200731", "type": "0"},
+        {"dayStr": "20200801", "type": "1"},
+        {"dayStr": "20200802", "type": "1"},
+        {"dayStr": "20200803", "type": "0"},
+        {"dayStr": "20200804", "type": "0"},
+        {"dayStr": "20200805", "type": "0"},
+        {"dayStr": "20200806", "type": "0"},
+        {"dayStr": "20200807", "type": "0"},
+        {"dayStr": "20200808", "type": "1"},
+        {"dayStr": "20200809", "type": "1"},
+        {"dayStr": "20200810", "type": "0"},
+        {"dayStr": "20200811", "type": "0"},
+        {"dayStr": "20200812", "type": "0"},
+        {"dayStr": "20200813", "type": "0"},
+        {"dayStr": "20200814", "type": "0"},
+        {"dayStr": "20200815", "type": "1"},
+        {"dayStr": "20200816", "type": "1"},
+        {"dayStr": "20200817", "type": "0"},
+        {"dayStr": "20200818", "type": "0"},
+        {"dayStr": "20200819", "type": "0"},
+        {"dayStr": "20200820", "type": "0"},
+        {"dayStr": "20200821", "type": "0"},
+        {"dayStr": "20200822", "type": "1"},
+        {"dayStr": "20200823", "type": "1"},
+        {"dayStr": "20200824", "type": "0"},
+        {"dayStr": "20200825", "type": "0"},
+        {"dayStr": "20200826", "type": "0"},
+        {"dayStr": "20200827", "type": "0"},
+        {"dayStr": "20200828", "type": "0"},
+        {"dayStr": "20200829", "type": "1"},
+        {"dayStr": "20200830", "type": "1"},
+        {"dayStr": "20200831", "type": "0"},
+        {"dayStr": "20200901", "type": "0"},
+        {"dayStr": "20200902", "type": "0"},
+        {"dayStr": "20200903", "type": "0"},
+        {"dayStr": "20200904", "type": "0"},
+        {"dayStr": "20200905", "type": "1"},
+        {"dayStr": "20200906", "type": "1"},
+        {"dayStr": "20200907", "type": "0"},
+        {"dayStr": "20200908", "type": "0"},
+        {"dayStr": "20200909", "type": "0"},
+        {"dayStr": "20200910", "type": "0"},
+        {"dayStr": "20200911", "type": "0"},
+        {"dayStr": "20200912", "type": "1"},
+        {"dayStr": "20200913", "type": "1"},
+        {"dayStr": "20200914", "type": "0"},
+        {"dayStr": "20200915", "type": "0"},
+        {"dayStr": "20200916", "type": "0"},
+        {"dayStr": "20200917", "type": "0"},
+        {"dayStr": "20200918", "type": "0"},
+        {"dayStr": "20200919", "type": "1"},
+        {"dayStr": "20200920", "type": "1"},
+        {"dayStr": "20200921", "type": "0"},
+        {"dayStr": "20200922", "type": "0"},
+        {"dayStr": "20200923", "type": "0"},
+        {"dayStr": "20200924", "type": "0"},
+        {"dayStr": "20200925", "type": "0"},
+        {"dayStr": "20200926", "type": "1"},
+        {"dayStr": "20200927", "type": "0"},
+        {"dayStr": "20200928", "type": "0"},
+        {"dayStr": "20200929", "type": "0"},
+        {"dayStr": "20200930", "type": "0"},
+        {"dayStr": "20201001", "type": "2"},
+        {"dayStr": "20201002", "type": "2"},
+        {"dayStr": "20201003", "type": "2"},
+        {"dayStr": "20201004", "type": "2"},
+        {"dayStr": "20201005", "type": "2"},
+        {"dayStr": "20201006", "type": "2"},
+        {"dayStr": "20201007", "type": "2"},
+        {"dayStr": "20201008", "type": "2"},
+        {"dayStr": "20201009", "type": "0"},
+        {"dayStr": "20201010", "type": "0"},
+        {"dayStr": "20201011", "type": "1"},
+        {"dayStr": "20201012", "type": "0"},
+        {"dayStr": "20201013", "type": "0"},
+        {"dayStr": "20201014", "type": "0"},
+        {"dayStr": "20201015", "type": "0"},
+        {"dayStr": "20201016", "type": "0"},
+        {"dayStr": "20201017", "type": "1"},
+        {"dayStr": "20201018", "type": "1"},
+        {"dayStr": "20201019", "type": "0"},
+        {"dayStr": "20201020", "type": "0"},
+        {"dayStr": "20201021", "type": "0"},
+        {"dayStr": "20201022", "type": "0"},
+        {"dayStr": "20201023", "type": "0"},
+        {"dayStr": "20201024", "type": "1"},
+        {"dayStr": "20201025", "type": "1"},
+        {"dayStr": "20201026", "type": "0"},
+        {"dayStr": "20201027", "type": "0"},
+        {"dayStr": "20201028", "type": "0"},
+        {"dayStr": "20201029", "type": "0"},
+        {"dayStr": "20201030", "type": "0"},
+        {"dayStr": "20201031", "type": "1"},
+        {"dayStr": "20201101", "type": "1"},
+        {"dayStr": "20201102", "type": "0"},
+        {"dayStr": "20201103", "type": "0"},
+        {"dayStr": "20201104", "type": "0"},
+        {"dayStr": "20201105", "type": "0"},
+        {"dayStr": "20201106", "type": "0"},
+        {"dayStr": "20201107", "type": "1"},
+        {"dayStr": "20201108", "type": "1"},
+        {"dayStr": "20201109", "type": "0"},
+        {"dayStr": "20201110", "type": "0"},
+        {"dayStr": "20201111", "type": "0"},
+        {"dayStr": "20201112", "type": "0"},
+        {"dayStr": "20201113", "type": "0"},
+        {"dayStr": "20201114", "type": "1"},
+        {"dayStr": "20201115", "type": "1"},
+        {"dayStr": "20201116", "type": "0"},
+        {"dayStr": "20201117", "type": "0"},
+        {"dayStr": "20201118", "type": "0"},
+        {"dayStr": "20201119", "type": "0"},
+        {"dayStr": "20201120", "type": "0"},
+        {"dayStr": "20201121", "type": "1"},
+        {"dayStr": "20201122", "type": "1"},
+        {"dayStr": "20201123", "type": "0"},
+        {"dayStr": "20201124", "type": "0"},
+        {"dayStr": "20201125", "type": "0"},
+        {"dayStr": "20201126", "type": "0"},
+        {"dayStr": "20201127", "type": "0"},
+        {"dayStr": "20201128", "type": "1"},
+        {"dayStr": "20201129", "type": "1"},
+        {"dayStr": "20201130", "type": "0"},
+        {"dayStr": "20201201", "type": "0"},
+        {"dayStr": "20201202", "type": "0"},
+        {"dayStr": "20201203", "type": "0"},
+        {"dayStr": "20201204", "type": "0"},
+        {"dayStr": "20201205", "type": "1"},
+        {"dayStr": "20201206", "type": "1"},
+        {"dayStr": "20201207", "type": "0"},
+        {"dayStr": "20201208", "type": "0"},
+        {"dayStr": "20201209", "type": "0"},
+        {"dayStr": "20201210", "type": "0"},
+        {"dayStr": "20201211", "type": "0"},
+        {"dayStr": "20201212", "type": "1"},
+        {"dayStr": "20201213", "type": "1"},
+        {"dayStr": "20201214", "type": "0"},
+        {"dayStr": "20201215", "type": "0"},
+        {"dayStr": "20201216", "type": "0"},
+        {"dayStr": "20201217", "type": "0"},
+        {"dayStr": "20201218", "type": "0"},
+        {"dayStr": "20201219", "type": "1"},
+        {"dayStr": "20201220", "type": "1"},
+        {"dayStr": "20201221", "type": "0"},
+        {"dayStr": "20201222", "type": "0"},
+        {"dayStr": "20201223", "type": "0"},
+        {"dayStr": "20201224", "type": "0"},
+        {"dayStr": "20201225", "type": "0"},
+        {"dayStr": "20201226", "type": "1"},
+        {"dayStr": "20201227", "type": "1"},
+        {"dayStr": "20201228", "type": "0"},
+        {"dayStr": "20201229", "type": "0"},
+        {"dayStr": "20201230", "type": "0"},
+        {"dayStr": "20201231", "type": "0"}
+        ]
+
+        srt=[{"dayStr": h, "type": "该不支持日期,只支持2020年"}]
+        for i in day:
+            if i['dayStr']==h:
+                print(i)
+                srt=i
+        print(h)
+
+        return response.json(0,srt)

+ 4 - 0
Controller/OTAEquipment.py

@@ -489,16 +489,20 @@ def getNewVerInterface(request):
     else:
     else:
         equipmentValid = Equipment_Version.objects.filter(code=code, status=1, lang='en').order_by(
         equipmentValid = Equipment_Version.objects.filter(code=code, status=1, lang='en').order_by(
             '-data_joined')
             '-data_joined')
+
+    print(equipmentValid)
     if equipmentValid.exists():
     if equipmentValid.exists():
         equipment = equipmentValid[0]
         equipment = equipmentValid[0]
         file_path = equipment.filePath
         file_path = equipment.filePath
         ver = equipment.softwareVersion
         ver = equipment.softwareVersion
         max_ver = equipment.max_ver
         max_ver = equipment.max_ver
+        print(now_ver <= max_ver)
         if now_ver <= max_ver:
         if now_ver <= max_ver:
             # 创建url的token
             # 创建url的token
             tko = UrlTokenObject()
             tko = UrlTokenObject()
             file_path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
             file_path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
             url = SERVER_DOMAIN + 'dlotapack/' + file_path
             url = SERVER_DOMAIN + 'dlotapack/' + file_path
+            print(url)
             # if SERVER_TYPE == 'Ansjer.formal_settings':
             # if SERVER_TYPE == 'Ansjer.formal_settings':
             #     url = SERVER_DOMAIN + 'dlotapack/' + file_path
             #     url = SERVER_DOMAIN + 'dlotapack/' + file_path
             # else:
             # else:

+ 6 - 2
Service/MiscellService.py

@@ -365,9 +365,11 @@ def addLog(request, status_code):
                 request_dict = dict(request_dict)
                 request_dict = dict(request_dict)
                 request_dict.pop('userPwd')
                 request_dict.pop('userPwd')
             content = json.dumps(request_dict)
             content = json.dumps(request_dict)
-            if user != None | user !='':
-                user
+            print(content)
+            if user != '':
+                user = user
             else:
             else:
+                print('空')
                 user = '空'
                 user = '空'
             add_data = {
             add_data = {
                 'user': user,
                 'user': user,
@@ -378,8 +380,10 @@ def addLog(request, status_code):
                 'time': now_time,
                 'time': now_time,
                 'content': content
                 'content': content
             }
             }
+            print(add_data)
             ModelService.addAccessLog(data=add_data)
             ModelService.addAccessLog(data=add_data)
     except Exception as e:
     except Exception as e:
+        print(repr(e))
         pass
         pass
 
 
 
 

+ 0 - 1
Service/TemplateService.py

@@ -53,7 +53,6 @@ class TemplateService:
             'cloudVod/findVod',
             'cloudVod/findVod',
             'cloudVod/aliPayCreateOrder',
             'cloudVod/aliPayCreateOrder',
             'cloudVod/aliPayCallback',
             'cloudVod/aliPayCallback',
-
             'equipment/add',
             'equipment/add',
             'deviceShare/queryUser',
             'deviceShare/queryUser',
             'deviceShare/showShareInfo',
             'deviceShare/showShareInfo',