feat: gen_number_with_rule 偏离6小时
This commit is contained in:
parent
024cae6fa3
commit
e2c7847c74
|
@ -36,6 +36,7 @@ from apps.enm.models import EnStat
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from apps.utils.tools import convert_ordereddict, update_dict
|
from apps.utils.tools import convert_ordereddict, update_dict
|
||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
@ -720,7 +721,7 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust
|
||||||
@classmethod
|
@classmethod
|
||||||
def gen_number_with_rule(cls, rule, material_out:Material, gen_count=1):
|
def gen_number_with_rule(cls, rule, material_out:Material, gen_count=1):
|
||||||
from apps.wpmw.models import Wpr
|
from apps.wpmw.models import Wpr
|
||||||
now = timezone.now()
|
now = datetime.now() - timedelta(hours=6, minutes=20)
|
||||||
c_year = now.year
|
c_year = now.year
|
||||||
c_year2 = str(c_year)[-2:]
|
c_year2 = str(c_year)[-2:]
|
||||||
c_month = now.month
|
c_month = now.month
|
||||||
|
|
Loading…
Reference in New Issue