|
|
|
|
@ -25,10 +25,11 @@ from io import StringIO
|
|
|
|
|
from django.core.cache import cache
|
|
|
|
|
from service.layer_service import LayerService
|
|
|
|
|
from service.service import PointService
|
|
|
|
|
from service.utils import run_psql_command
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task()
|
|
|
|
|
def raschet(table_name='service_placementpoint'):
|
|
|
|
|
def raschet(table_name='service_placementpoint', need_time=True):
|
|
|
|
|
print('start raschet')
|
|
|
|
|
status, _ = models.TaskStatus.objects.get_or_create(task_name=STATUS_TASK_NAME)
|
|
|
|
|
raschet_objs = models.RaschetObjects.objects.all()
|
|
|
|
|
@ -319,12 +320,15 @@ def raschet(table_name='service_placementpoint'):
|
|
|
|
|
conn2.close()
|
|
|
|
|
cache.clear()
|
|
|
|
|
log_to_telegram('end raschet')
|
|
|
|
|
run_psql_command()
|
|
|
|
|
status.status = 'Перерасчет ML завершен'
|
|
|
|
|
status.save()
|
|
|
|
|
if need_time:
|
|
|
|
|
LastMLCall.objects.all().delete()
|
|
|
|
|
LastMLCall.objects.create()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def load_post_and_pvz(obj_id: int):
|
|
|
|
|
file = models.TempFiles.objects.get(id=obj_id)
|
|
|
|
|
|