This commit is contained in:
commit
77fc91d1d9
|
@ -964,7 +964,7 @@ def ApiGasPredict(request, element, drainId):
|
||||||
.order_by('-create_time')[0:5].values_list(element, flat=True))
|
.order_by('-create_time')[0:5].values_list(element, flat=True))
|
||||||
element_list.reverse()
|
element_list.reverse()
|
||||||
if len(element_list)>=3:
|
if len(element_list)>=3:
|
||||||
result = GM11(np.array(element_list), 3)
|
result = GM11(np.array(element_list), 1)
|
||||||
element_list.extend(result['predict']['value'])
|
element_list.extend(result['predict']['value'])
|
||||||
ret = {"code":1, "data":[round(i,2) for i in element_list]}
|
ret = {"code":1, "data":[round(i,2) for i in element_list]}
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
|
|
|
@ -193,11 +193,11 @@ def correct_yjz(year:int, month:int, companyid: int = 0):
|
||||||
else:
|
else:
|
||||||
companys = Partment.objects.filter(partid=companyid)
|
companys = Partment.objects.filter(partid=companyid)
|
||||||
for i in companys:
|
for i in companys:
|
||||||
yjjs(i.id, first_day, first_day_of_next_month)
|
yjjs(i.partid, first_day, first_day_of_next_month)
|
||||||
yjjs_px(i.id, first_day, first_day_of_next_month)
|
yjjs_px(i.partid, first_day, first_day_of_next_month)
|
||||||
yjjs_gc(i.id, first_day, first_day_of_next_month)
|
yjjs_gc(i.partid, first_day, first_day_of_next_month)
|
||||||
yjjs_ws(i.id, first_day, first_day_of_next_month)
|
yjjs_ws(i.partid, first_day, first_day_of_next_month)
|
||||||
yjjs_yl(i.id, first_day, first_day_of_next_month)
|
yjjs_yl(i.partid, first_day, first_day_of_next_month)
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def ycjs():
|
def ycjs():
|
||||||
|
@ -207,7 +207,7 @@ def ycjs():
|
||||||
nowmonth = datetime.datetime.now().month
|
nowmonth = datetime.datetime.now().month
|
||||||
objs = Yjyc.objects.exclude(yjz=0,year=nowyear,month=nowmonth)
|
objs = Yjyc.objects.exclude(yjz=0,year=nowyear,month=nowmonth)
|
||||||
for x in companys:
|
for x in companys:
|
||||||
obj = objs.filter(usecomp=x).order_by('-yjycid')[-6:] # 只取半年内的
|
obj = objs.filter(usecomp=x).order_by('-yjycid')[0:5] # 只取半年内的
|
||||||
objv = obj.values('yjycid','yjz')
|
objv = obj.values('yjycid','yjz')
|
||||||
#print(objv)
|
#print(objv)
|
||||||
if len(obj)>1:
|
if len(obj)>1:
|
||||||
|
|
Loading…
Reference in New Issue