feat: 增加水泥包装
This commit is contained in:
parent
33a7e7320b
commit
4960ee7fac
|
@ -37,7 +37,8 @@ def translate_eval_formula(exp_str: str, year: int, month: int, day: int, hour:
|
||||||
try:
|
try:
|
||||||
rval = eval(exp_str2)
|
rval = eval(exp_str2)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
myLogger.error(f"表达式计算错误: {e}")
|
myLogger.error(f"表达式计算错误: {e}, {exp_str}, --{exp_str2}")
|
||||||
|
|
||||||
return rval
|
return rval
|
||||||
|
|
||||||
def transfer_mpoint_val_to_ep_running_state(current_val, base_val: float, expr_str: str):
|
def transfer_mpoint_val_to_ep_running_state(current_val, base_val: float, expr_str: str):
|
||||||
|
@ -342,7 +343,7 @@ def insert_mplogx_item(code: str, val, timex: datetime, enp_mpoints_dict):
|
||||||
# 控制采集间隔
|
# 控制采集间隔
|
||||||
can_save = False
|
can_save = False
|
||||||
if mpoint_last_timex:
|
if mpoint_last_timex:
|
||||||
if (timex - mpoint_last_timex).total_seconds() > mpoint_interval:
|
if (timex - mpoint_last_timex).total_seconds() > mpoint_interval or timex < mpoint_last_timex:
|
||||||
can_save = True
|
can_save = True
|
||||||
else:
|
else:
|
||||||
can_save = True
|
can_save = True
|
||||||
|
|
|
@ -84,7 +84,7 @@ def db_ins_mplogx():
|
||||||
query = """
|
query = """
|
||||||
SELECT id, de_real_quantity, CONCAT('x', inv_name) AS inv_name, bill_date
|
SELECT id, de_real_quantity, CONCAT('x', inv_name) AS inv_name, bill_date
|
||||||
FROM sa_weigh_view
|
FROM sa_weigh_view
|
||||||
WHERE bill_date > %s
|
WHERE bill_date > %s and de_real_quantity > 0
|
||||||
ORDER BY bill_date
|
ORDER BY bill_date
|
||||||
"""
|
"""
|
||||||
cursor.execute(query, (bill_date,))
|
cursor.execute(query, (bill_date,))
|
||||||
|
|
Loading…
Reference in New Issue