This commit is contained in:
2026-04-07 09:51:38 +08:00
parent ecba4d726a
commit 00dcd6b6cc
36 changed files with 2857 additions and 505 deletions

View File

@ -233,8 +233,8 @@ class PDRecordDal(BaseDal):
# 确保top为正整数
if not isinstance(top, int) or top <= 0:
raise ValueError("top参数必须是正整数")
# _target_time = datetime.now() - timedelta(hours=4)
_target_time ='2026-02-06 00:00:00'
_target_time = datetime.now() - timedelta(hours=4)
# _target_time ='2026-03-31 00:00:00'
# 查询当前浇筑模具编号的前一条记录
sql = f"""SELECT * FROM PDRecord WHERE CreateTime>? and ID>(
select ID FROM PDRecord WHERE MouldCode=? and CreateTime>?
@ -330,12 +330,23 @@ class PDRecordDal(BaseDal):
print(f"更新PD管片任务失败: {e}")
return False
def update_pd_notify(self, id: int, update_data: dict) -> bool:
"""更新PD官片任务记录"""
try:
# 构建WHERE条件
where_condition = f"ID={id} and Status<>5"
# 使用update方法更新数据
affected_rows = self.db_dao.update("PDRecord", update_data, where_condition)
return affected_rows > 0
except Exception as e:
raise
def update_by_modulecode(self, module_code: str, update_data: dict) -> bool:
"""更新构件派单记录"""
try:
# 构建WHERE条件
_target_time = datetime.now() - timedelta(hours=4)
_target_time ='2026-02-06 00:00:00'
# _target_time ='2026-02-06 00:00:00'
where_condition = f"MouldCode='{module_code}' and CreateTime>='{_target_time}'"
# 使用update方法更新数据
affected_rows = self.db_dao.update("PDRecord", update_data, where_condition)