feat: translate_eval_formula 打印报错信息
This commit is contained in:
parent
7e09b872cf
commit
75b2a420b7
|
|
@ -35,7 +35,11 @@ def translate_eval_formula(exp_str: str, year: int, month: int, day: int, hour:
|
||||||
for match in matches:
|
for match in matches:
|
||||||
mpst = MpointStat.objects.filter(mpoint__code=match, type="hour", year=year, month=month, day=day, hour=hour).first()
|
mpst = MpointStat.objects.filter(mpoint__code=match, type="hour", year=year, month=month, day=day, hour=hour).first()
|
||||||
if mpst is None:
|
if mpst is None:
|
||||||
mpoint = Mpoint.objects.get(code=match)
|
try:
|
||||||
|
mpoint = Mpoint.objects.get(code=match)
|
||||||
|
except Exception as e:
|
||||||
|
myLogger.error(f"找不到该测点: exp_str: {exp_str} code: {match} {e}")
|
||||||
|
raise
|
||||||
mpst, _ = MpointStat.objects.get_or_create(mpoint=mpoint, type="hour", year=year, month=month, day=day, hour=hour, defaults={"val": 0})
|
mpst, _ = MpointStat.objects.get_or_create(mpoint=mpoint, type="hour", year=year, month=month, day=day, hour=hour, defaults={"val": 0})
|
||||||
myLogger.error(f"找不到该测点的时间线数据: {match}, {year}, {month}, {day}, {hour}, 赋予0值")
|
myLogger.error(f"找不到该测点的时间线数据: {match}, {year}, {month}, {day}, {hour}, 赋予0值")
|
||||||
if mpst:
|
if mpst:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue