变频器集成以及增加点动控制(0209)
This commit is contained in:
@ -3,12 +3,11 @@
|
||||
|
||||
# # 添加项目根目录到Python路径
|
||||
# sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||
|
||||
from dataclasses import fields
|
||||
from typing import List, Optional, Dict, Any
|
||||
from datetime import datetime
|
||||
from .models import ArtifactInfoModel, PDRecordModel
|
||||
from .dals import ArtifactDal, PDRecordDal
|
||||
from busisness.models import ArtifactInfoModel, PDRecordModel
|
||||
from busisness.dals import ArtifactDal, PDRecordDal
|
||||
|
||||
|
||||
class ArtifactBll:
|
||||
@ -26,37 +25,54 @@ class ArtifactBll:
|
||||
"""更新管片任务状态"""
|
||||
return self.dal.update_artifact(artifact_id, {"Status": status})
|
||||
|
||||
def finish_artifact_task(self, artifact_id: str,beton_volume) -> bool:
|
||||
def start_produce(self, code: str) -> bool:
|
||||
"""开始管片生产"""
|
||||
return self.dal.update_by_modulecode(code, {'Status': 2,'BeginTime':datetime.now()})
|
||||
|
||||
def finish_produce(self, code: str,weight:float) -> bool:
|
||||
"""完成管片生产"""
|
||||
return self.dal.update_by_modulecode(code, {'Status': 3,'EndTime':datetime.now(),'FBetonVolume':weight})
|
||||
|
||||
|
||||
def finish_artifact_task(self, artifact_id: str,beton_volume:float) -> bool:
|
||||
"""完成管片任务"""
|
||||
return self.dal.update_artifact(artifact_id, {"Status": 3,"BetonVolume":beton_volume,"EndTime":datetime.now()})
|
||||
|
||||
def insert_artifact_task(self,model:ArtifactInfoModel) -> bool:
|
||||
|
||||
"""插入管片任务"""
|
||||
if self.dal.exists_by_id(model.ArtifactID):
|
||||
return False
|
||||
return self.dal.insert_artifact({
|
||||
"ArtifactID": model.ArtifactID,
|
||||
"ArtifactActionID": model.ArtifactActionID,
|
||||
"ArtifactIDVice1": model.ArtifactIDVice1,
|
||||
"ProduceRingNumber": model.ProduceRingNumber,
|
||||
"MouldCode": model.MouldCode,
|
||||
"SkeletonID": model.SkeletonID,
|
||||
"RingTypeCode": model.RingTypeCode,
|
||||
"SizeSpecification": model.SizeSpecification,
|
||||
"BuriedDepth": model.BuriedDepth,
|
||||
"BlockNumber": model.BlockNumber,
|
||||
"BetonVolume": model.BetonVolume,
|
||||
"BetonTaskID": model.BetonTaskID,
|
||||
"HoleRingMarking": model.HoleRingMarking,
|
||||
"GroutingPipeMarking": model.GroutingPipeMarking,
|
||||
"PolypropyleneFiberMarking": model.PolypropyleneFiberMarking,
|
||||
"PStatus":1,
|
||||
"Status": 2,
|
||||
"Source": model.Source,
|
||||
"BeginTime": model.BeginTime,
|
||||
"OptTime": datetime.now(),
|
||||
})
|
||||
if self.dal.get_artifactid(model.MouldCode):
|
||||
return False
|
||||
return self.dal.insert_artifact(model)
|
||||
|
||||
def save_artifact_task(self,model:ArtifactInfoModel) -> int:
|
||||
|
||||
"""保存管片任务(存在ModuleCode更新,不存在插入,存在ArtifactID不处理)"""
|
||||
_artifactid=self.dal.get_artifactid(model.MouldCode)
|
||||
if _artifactid is None:
|
||||
return self.dal.insert_artifact(model)
|
||||
else:
|
||||
if not _artifactid and model.ArtifactID:
|
||||
update_dict={
|
||||
'ArtifactID':model.ArtifactID,
|
||||
'ArtifactActionID':model.ArtifactActionID,
|
||||
'ArtifactIDVice1':model.ArtifactIDVice1,
|
||||
'ProduceRingNumber':model.ProduceRingNumber,
|
||||
'SkeletonID':model.SkeletonID,
|
||||
'RingTypeCode':model.RingTypeCode,
|
||||
'SizeSpecification':model.SizeSpecification,
|
||||
'BuriedDepth':model.BuriedDepth,
|
||||
'BlockNumber':model.BlockNumber,
|
||||
'HoleRingMarking':model.HoleRingMarking,
|
||||
'GroutingPipeMarking':model.GroutingPipeMarking,
|
||||
'PolypropyleneFiberMarking':model.PolypropyleneFiberMarking,
|
||||
'BetonVolume':model.BetonVolume,
|
||||
'BetonTaskID':model.BetonTaskID,
|
||||
}
|
||||
return self.dal.update_by_modulecode(model.MouldCode, update_dict)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
def insert_artifact_bycode(self,model: dict) -> bool:
|
||||
|
||||
@ -93,24 +109,77 @@ class PDRecordBll:
|
||||
"""获取PD官片任务数据"""
|
||||
return self.dal.get_top_pd(5, "ID desc")
|
||||
|
||||
def get_last_pds(self,mould_code:str) -> List[PDRecordModel]:
|
||||
"""获取当前浇筑的后三片的派据(有可能其中一项为空,但需要保证第一条有记录)"""
|
||||
return self.dal.get_last_pds(1,mould_code)
|
||||
|
||||
def insert_PD_record(self,model:PDRecordModel) -> bool:
|
||||
"""保存PD官片任务(存在更新,不存在插入)"""
|
||||
if self.dal.exists_artifactid(model.ArtifactActionID):
|
||||
return False
|
||||
# return self.update_PD_record(model.ArtifactActionID,{"Status": model.Status,"OptTime": datetime.now()})
|
||||
else:
|
||||
return self.dal.insert_PD_record(model)
|
||||
|
||||
def finish_pd(self, code: str,status:int) -> bool:
|
||||
"""完成管片生产"""
|
||||
return self.dal.update_by_modulecode(code, {'Status': status,'EndTime':datetime.now()})
|
||||
|
||||
def start_pd(self, code: str,volumn:float) -> bool:
|
||||
"""开始管片生产"""
|
||||
return self.dal.update_by_modulecode(code, {'Status': 2,'OptTime':datetime.now(),'FBetonVolume':volumn})
|
||||
|
||||
def update_PD_record(self,artifact_action_id: int, update_fields: dict) -> bool:
|
||||
"""更新PD官片任务状态"""
|
||||
return self.dal.update_pd(artifact_action_id, update_fields)
|
||||
|
||||
def save_PD_record(self,model:PDRecordModel) -> int:
|
||||
|
||||
"""保存PD官片任务(存在ModuleCode更新,不存在插入,存在ArtifactID不处理)"""
|
||||
_artifactid=self.dal.get_artifactid(model.MouldCode)
|
||||
if _artifactid is None:
|
||||
return self.dal.insert_PD_record(model)
|
||||
else:
|
||||
if not _artifactid and model.ArtifactID:
|
||||
update_dict={
|
||||
'ArtifactID':model.ArtifactID,
|
||||
'ArtifactActionID':model.ArtifactActionID,
|
||||
'TaskID':model.TaskID,
|
||||
'ProjectName':model.ProjectName,
|
||||
'ProduceMixID':model.ProduceMixID,
|
||||
'BetonVolume':model.BetonVolume,
|
||||
'BetonGrade':model.BetonGrade,
|
||||
'BuriedDepth':model.BuriedDepth,
|
||||
'SkeletonID':model.SkeletonID,
|
||||
'RingTypeCode':model.RingTypeCode,
|
||||
'SizeSpecification':model.SizeSpecification,
|
||||
'BlockNumber':model.BlockNumber,
|
||||
'BetonVolume':model.BetonVolume,
|
||||
'PlannedVolume':model.PlannedVolume
|
||||
}
|
||||
return self.dal.update_by_modulecode(model.MouldCode, update_dict)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
artifact_dal = ArtifactBll()
|
||||
# artifact_dal = ArtifactBll()
|
||||
|
||||
artifacts = artifact_dal.get_artifact_task()
|
||||
# artifacts = artifact_dal.get_artifact_task()
|
||||
|
||||
print("\n打印artifacts数据:")
|
||||
for i, artifact in enumerate(artifacts):
|
||||
artifact_id = artifact.ArtifactID
|
||||
# 如果是数据类对象,转换为字典输出
|
||||
print(artifact.MouldCode)
|
||||
if hasattr(artifact, "__dataclass_fields__"):
|
||||
print(f"第{i+1}条: {artifact.__dict__}")
|
||||
else:
|
||||
print(f"第{i+1}条: {artifact}")
|
||||
# print("\n打印artifacts数据:")
|
||||
# for i, artifact in enumerate(artifacts):
|
||||
# artifact_id = artifact.ArtifactID
|
||||
# # 如果是数据类对象,转换为字典输出
|
||||
# print(artifact.MouldCode)
|
||||
# if hasattr(artifact, "__dataclass_fields__"):
|
||||
# print(f"第{i+1}条: {artifact.__dict__}")
|
||||
# else:
|
||||
# print(f"第{i+1}条: {artifact}")
|
||||
|
||||
pdrecord_dal = PDRecordBll()
|
||||
pdrecords = pdrecord_dal.get_PD_record()
|
||||
pdrecords = pdrecord_dal.get_last_pds("SHR2B2-11")
|
||||
# print(pdrecords[0].MouldCode)
|
||||
print("\n打印pdrecords数据:")
|
||||
for i, record in enumerate(pdrecords):
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
from dataclasses import fields
|
||||
from typing import List, Optional, Dict, Any
|
||||
from datetime import datetime
|
||||
from .models import ArtifactInfoModel,PDRecordModel
|
||||
from datetime import datetime, timedelta
|
||||
from busisness.models import ArtifactInfoModel,PDRecordModel
|
||||
from common.sqlite_handler import SQLiteHandler
|
||||
|
||||
|
||||
@ -33,8 +36,8 @@ class ArtifactDal(BaseDal):
|
||||
artifacts = []
|
||||
for row in results:
|
||||
# 过滤字典,只保留模型中定义的字段
|
||||
filtered_data = filter_dict_for_model(dict(row), ArtifactInfoModel)
|
||||
artifact = ArtifactInfoModel(**filtered_data)
|
||||
# filtered_data = filter_dict_for_model(dict(row), ArtifactInfoModel)
|
||||
artifact = ArtifactInfoModel(**row)
|
||||
artifacts.append(artifact)
|
||||
|
||||
return artifacts
|
||||
@ -57,26 +60,9 @@ class ArtifactDal(BaseDal):
|
||||
artifacts = []
|
||||
for row in results:
|
||||
# 保证row的变量和模板变量一致
|
||||
artifact = ArtifactInfoModel()
|
||||
artifact.ArtifactID=row["ArtifactID"]
|
||||
artifact.ArtifactActionID=row["ArtifactActionID"]
|
||||
artifact.ArtifactIDVice1=row["ArtifactIDVice1"]
|
||||
artifact.ProduceRingNumber=row["ProduceRingNumber"]
|
||||
artifact.MouldCode=row["MouldCode"]
|
||||
artifact.SkeletonID=row["SkeletonID"]
|
||||
artifact.RingTypeCode=row["RingTypeCode"]
|
||||
artifact.SizeSpecification=row["SizeSpecification"]
|
||||
artifact.BuriedDepth=row["BuriedDepth"]
|
||||
artifact.BlockNumber=row["BlockNumber"]
|
||||
artifact.BetonVolume=row["BetonVolume"]
|
||||
artifact.BetonTaskID=row["BetonTaskID"]
|
||||
artifact.HoleRingMarking=row["HoleRingMarking"]
|
||||
artifact.GroutingPipeMarking=row["GroutingPipeMarking"]
|
||||
artifact.PolypropyleneFiberMarking=row["PolypropyleneFiberMarking"]
|
||||
artifact.Status=row["Status"]
|
||||
artifact.BeginTime=row["BeginTime"]
|
||||
artifact = ArtifactInfoModel(**row)
|
||||
artifacts.append(artifact)
|
||||
|
||||
|
||||
return artifacts
|
||||
except Exception as e:
|
||||
print(f"获取top构件任务失败: {e}")
|
||||
@ -103,7 +89,6 @@ class ArtifactDal(BaseDal):
|
||||
try:
|
||||
sql = "SELECT count(1) FROM ArtifactTask WHERE MouldCode = ? and OptTime>?"
|
||||
results = self.db_dao.execute_read(sql, (module_code,datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)))
|
||||
|
||||
rows = list(results)
|
||||
if rows[0][0] == 1:
|
||||
return True
|
||||
@ -112,6 +97,20 @@ class ArtifactDal(BaseDal):
|
||||
except Exception as e:
|
||||
print(f"根据ID获取构件任务失败: {e}")
|
||||
return False
|
||||
|
||||
def get_artifactid(self, module_code: str) -> Optional[str]:
|
||||
"""根据模具编号查找ID,根据ID确认是否扫码"""
|
||||
try:
|
||||
sql = "SELECT ArtifactID FROM ArtifactTask WHERE MouldCode = ? and OptTime>?"
|
||||
_target_time = datetime.now() - timedelta(hours=4)
|
||||
results = self.db_dao.fetch_one(sql, (module_code,_target_time))
|
||||
if results is None:
|
||||
return None
|
||||
else:
|
||||
return results['ArtifactID']
|
||||
except Exception as e:
|
||||
print(f"根据ID获取构件任务失败: {e}")
|
||||
return None
|
||||
|
||||
def get_by_id(self, artifact_id: int) -> Optional[ArtifactInfoModel]:
|
||||
"""根据构件ID获取构件任务"""
|
||||
@ -129,27 +128,43 @@ class ArtifactDal(BaseDal):
|
||||
return None
|
||||
|
||||
|
||||
def insert_artifact(self, artifact_data: dict) -> Optional[int]:
|
||||
def insert_artifact(self, model: ArtifactInfoModel) -> int:
|
||||
"""插入一条构件任务记录"""
|
||||
try:
|
||||
# 使用insert方法插入数据
|
||||
row_id = self.db_dao.insert("ArtifactTask", artifact_data)
|
||||
model.OptTime=datetime.now()
|
||||
model.__dict__.pop("ProductionProcessCode", None)
|
||||
model.__dict__.pop("ID", None)
|
||||
row_id = self.db_dao.insert("ArtifactTask", model.__dict__)
|
||||
return row_id
|
||||
except Exception as e:
|
||||
print(f"插入构件任务失败: {e}")
|
||||
return None
|
||||
return 0
|
||||
|
||||
def update_artifact(self, artifact_id: int, update_data: dict) -> bool:
|
||||
def update_artifact(self, artifact_id: int, update_data: dict) -> int:
|
||||
"""更新构件任务记录"""
|
||||
try:
|
||||
# 构建WHERE条件
|
||||
where_condition = f"ArtifactID='{artifact_id}'"
|
||||
# 使用update方法更新数据
|
||||
affected_rows = self.db_dao.update("ArtifactTask", update_data, where_condition)
|
||||
return affected_rows > 0
|
||||
return affected_rows
|
||||
except Exception as e:
|
||||
print(f"更新构件任务失败: {e}")
|
||||
return False
|
||||
return 0
|
||||
|
||||
def update_by_modulecode(self, module_code: str, update_data: dict) -> int:
|
||||
"""更新构件任务记录"""
|
||||
try:
|
||||
# 构建WHERE条件
|
||||
_target_time = datetime.now() - timedelta(hours=4)
|
||||
where_condition = f"MouldCode='{module_code}' and OptTime>='{_target_time}'"
|
||||
# 使用update方法更新数据
|
||||
affected_rows = self.db_dao.update("ArtifactTask", update_data, where_condition)
|
||||
return affected_rows
|
||||
except Exception as e:
|
||||
print(f"更新构件任务失败: {e}")
|
||||
return 0
|
||||
|
||||
def validate_artifact(self, artifact_info: ArtifactInfoModel) -> bool:
|
||||
"""验证构件信息是否符合业务规则"""
|
||||
@ -186,11 +201,11 @@ class PDRecordDal(BaseDal):
|
||||
#
|
||||
pdrecord = PDRecordModel()
|
||||
pdrecord.ID=row["ID"]
|
||||
pdrecord.PDCode=row["PDCode"]
|
||||
pdrecord.ArtifactID=row["ArtifactID"]
|
||||
pdrecord.TaskID=row["TaskID"]
|
||||
pdrecord.ProjectName=row["ProjectName"]
|
||||
pdrecord.ProduceMixID=row["ProduceMixID"]
|
||||
pdrecord.VinNo=row["VinNo"]
|
||||
pdrecord.FBetonVolume=row["FBetonVolume"]
|
||||
pdrecord.BetonVolume=row["BetonVolume"]
|
||||
pdrecord.MouldCode=row["MouldCode"]
|
||||
pdrecord.SkeletonID=row["SkeletonID"]
|
||||
@ -210,14 +225,115 @@ class PDRecordDal(BaseDal):
|
||||
print(f"获取top PD官片任务失败: {e}")
|
||||
return []
|
||||
|
||||
|
||||
|
||||
def get_last_pds(self, top: int,mould_code:str) -> List[PDRecordModel]:
|
||||
"""获取派单的记录进行派单"""
|
||||
try:
|
||||
# 确保top为正整数
|
||||
if not isinstance(top, int) or top <= 0:
|
||||
raise ValueError("top参数必须是正整数")
|
||||
_target_time = datetime.now() - timedelta(hours=4)
|
||||
# 查询指定数量的记录,按ID降序排列
|
||||
sql = f"""SELECT * FROM PDRecord WHERE CreateTime>? and ID>(
|
||||
select ID FROM PDRecord WHERE MouldCode=? and CreateTime>?
|
||||
)
|
||||
order by ID asc LIMIT ?"""
|
||||
results = self.db_dao.execute_read(sql, (_target_time,mould_code,_target_time,top))
|
||||
|
||||
pdrecords = []
|
||||
for row in results:
|
||||
pdrecord = PDRecordModel(**row)
|
||||
pdrecords.append(pdrecord)
|
||||
return pdrecords
|
||||
except Exception as e:
|
||||
print(f"获取top PD官片任务失败: {e}")
|
||||
return []
|
||||
|
||||
def get_artifactid(self, module_code: str) -> Optional[str]:
|
||||
"""根据模具编号查找ID,根据ID确认是否扫码"""
|
||||
try:
|
||||
sql = "SELECT ArtifactID FROM PDRecord WHERE MouldCode = ? and CreateTime>?"
|
||||
_target_time = datetime.now() - timedelta(hours=4)
|
||||
results = self.db_dao.fetch_one(sql, (module_code,_target_time))
|
||||
if results is None:
|
||||
return None
|
||||
else:
|
||||
return results['ArtifactID']
|
||||
except Exception as e:
|
||||
print(f"根据ID获取构件任务失败: {e}")
|
||||
return None
|
||||
|
||||
def exists_by_module_code(self, module_code: str) -> bool:
|
||||
"""根据模具编号获取PD官片任务"""
|
||||
try:
|
||||
sql = "SELECT count(1) FROM PDRecord WHERE MouldCode = ? and OptTime>?"
|
||||
results = self.db_dao.execute_read(sql, (module_code,datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)))
|
||||
|
||||
rows = list(results)
|
||||
if rows[0][0] == 1:
|
||||
return True
|
||||
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"PDRecord(exists_by_module_code)失败: {e}")
|
||||
return False
|
||||
|
||||
def exists_artifactid(self, artifact_action_id: str) -> bool:
|
||||
"""根据构件动作编号获取PD官片任务"""
|
||||
try:
|
||||
sql = "SELECT count(1) FROM PDRecord WHERE ArtifactActionID = ?"
|
||||
results = self.db_dao.execute_read(sql, (artifact_action_id,))
|
||||
|
||||
rows = list(results)
|
||||
if rows[0][0] == 1:
|
||||
return True
|
||||
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"PDRecord(exists_by_module_code)失败: {e}")
|
||||
return False
|
||||
|
||||
def insert_PD_record(self, model: PDRecordModel) -> int:
|
||||
"""插入一条PD官片任务记录"""
|
||||
try:
|
||||
# 使用insert方法插入数据
|
||||
model.CreateTime=datetime.now()
|
||||
model.__dict__.pop("ID", None)
|
||||
row_id = self.db_dao.insert("PDRecord", model.__dict__)
|
||||
return row_id
|
||||
except Exception as e:
|
||||
print(f"插入PD官片任务失败: {e}")
|
||||
return 0
|
||||
|
||||
def update_pd(self, artifact_action_id: int, update_data: dict) -> bool:
|
||||
"""更新PD官片任务记录"""
|
||||
try:
|
||||
# 构建WHERE条件
|
||||
where_condition = f"ArtifactActionID='{artifact_action_id}'"
|
||||
# 使用update方法更新数据
|
||||
affected_rows = self.db_dao.update("PDRecord", update_data, where_condition)
|
||||
return affected_rows > 0
|
||||
except Exception as e:
|
||||
print(f"更新PD管片任务失败: {e}")
|
||||
return False
|
||||
|
||||
def update_by_modulecode(self, module_code: str, update_data: dict) -> int:
|
||||
"""更新构件派单记录"""
|
||||
try:
|
||||
# 构建WHERE条件
|
||||
_target_time = datetime.now() - timedelta(hours=4)
|
||||
where_condition = f"MouldCode='{module_code}' and CreateTime>='{_target_time}'"
|
||||
# 使用update方法更新数据
|
||||
affected_rows = self.db_dao.update("PDRecord", update_data, where_condition)
|
||||
return affected_rows
|
||||
except Exception as e:
|
||||
print(f"更新PD官片任务失败: {e}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
artifact_dal = ArtifactDal()
|
||||
|
||||
artifacts = artifact_dal.get_artifact_task()
|
||||
artifacts = artifact_dal.get_top_artifact(5, "ID desc")
|
||||
|
||||
# 显示获取到的数据
|
||||
print(f"获取到 {len(artifacts)} 条构件任务数据:")
|
||||
|
||||
@ -41,90 +41,62 @@ class LoginResponse:
|
||||
|
||||
@dataclass
|
||||
class ArtifactInfo:
|
||||
"""管片信息模型"""
|
||||
"""管片信息基础模型"""
|
||||
#管片编号
|
||||
ArtifactID: str
|
||||
ArtifactID: str = ""
|
||||
#管片ID
|
||||
ArtifactActionID: int
|
||||
ArtifactActionID: int = 0
|
||||
#管片副标识1
|
||||
ArtifactIDVice1: str
|
||||
ArtifactIDVice1: str = ""
|
||||
#产品环号
|
||||
ProduceRingNumber: int
|
||||
ProduceRingNumber: int = 0
|
||||
#模具编号
|
||||
MouldCode: str
|
||||
MouldCode: str = ""
|
||||
#骨架ID
|
||||
SkeletonID: str
|
||||
SkeletonID: str = ""
|
||||
#环类型编码
|
||||
RingTypeCode: str
|
||||
RingTypeCode: str = ""
|
||||
#尺寸规格
|
||||
SizeSpecification: str
|
||||
SizeSpecification: str = ""
|
||||
#埋深
|
||||
BuriedDepth: str
|
||||
BuriedDepth: str = ""
|
||||
#块号
|
||||
BlockNumber: str
|
||||
BlockNumber: str = ""
|
||||
#环号标记
|
||||
HoleRingMarking: str
|
||||
HoleRingMarking: str = ""
|
||||
#出管标记
|
||||
GroutingPipeMarking: str
|
||||
GroutingPipeMarking: str = ""
|
||||
#聚丙烯纤维标记
|
||||
PolypropyleneFiberMarking: str
|
||||
PolypropyleneFiberMarking: str = ""
|
||||
# 浇筑方量
|
||||
BetonVolume: float
|
||||
BetonVolume: float = 0.0
|
||||
# 任务单号(混凝土)
|
||||
BetonTaskID: str
|
||||
BetonTaskID: str = ""
|
||||
#接口中的字段
|
||||
ProductionProcessCode: int = 0
|
||||
|
||||
|
||||
@dataclass
|
||||
class ArtifactInfoModel:
|
||||
def __init__(self):
|
||||
pass
|
||||
class ArtifactInfoModel(ArtifactInfo):
|
||||
"""管片表模型"""
|
||||
ID: int
|
||||
#管片编号
|
||||
ArtifactID: str
|
||||
#管片ID
|
||||
ArtifactActionID: int
|
||||
#管片副标识1
|
||||
ArtifactIDVice1: str
|
||||
#产品环号
|
||||
ProduceRingNumber: int
|
||||
#模具编号
|
||||
MouldCode: str
|
||||
#骨架ID
|
||||
SkeletonID: str
|
||||
#环类型编码
|
||||
RingTypeCode: str
|
||||
#尺寸规格
|
||||
SizeSpecification: str
|
||||
#埋深
|
||||
BuriedDepth: str
|
||||
#块号
|
||||
BlockNumber: str
|
||||
#环号标记
|
||||
HoleRingMarking: str
|
||||
#出管标记
|
||||
GroutingPipeMarking: str
|
||||
#聚丙烯纤维标记
|
||||
PolypropyleneFiberMarking: str
|
||||
# 浇筑方量
|
||||
BetonVolume: float
|
||||
# 任务单号
|
||||
BetonTaskID: str
|
||||
# 继承基础模型的所有字段
|
||||
ID: int = 0
|
||||
#FK_PDID
|
||||
FK_PDID: int=0
|
||||
FK_PDID: int = 0
|
||||
#状态
|
||||
Status: int=1
|
||||
Status: int = 1
|
||||
#开始时间
|
||||
BeginTime: str=""
|
||||
BeginTime: str = ""
|
||||
#结束时间
|
||||
EndTime: str=""
|
||||
#PStatus
|
||||
PStatus: int=0
|
||||
#Source
|
||||
Source: int=1
|
||||
EndTime: str = ""
|
||||
#生产中状态(1正常、2警告、3异常)
|
||||
PStatus: int = 1
|
||||
#数据来源(1 api 2离线RFID)
|
||||
Source: int = 1
|
||||
#FBetonVolume
|
||||
FBetonVolume: float=0.0
|
||||
FBetonVolume: float = 0.0
|
||||
#OptTime
|
||||
OptTime: str=""
|
||||
OptTime: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -161,49 +133,49 @@ class ArtifactResponse:
|
||||
class TaskInfo:
|
||||
"""任务单信息模型"""
|
||||
#任务单ID
|
||||
TaskID: str
|
||||
TaskID: str=""
|
||||
#任务单状态
|
||||
TaskStatus: int
|
||||
TaskStatus: int=0
|
||||
#任务单状态文本
|
||||
TaskStatusText: str
|
||||
#计划生产数量
|
||||
TaskCount: int
|
||||
#已生产数量
|
||||
AlreadyProduceCount: int
|
||||
TaskStatusText: str=""
|
||||
# #计划生产数量
|
||||
# TaskCount: int=0
|
||||
# #已生产数量
|
||||
# AlreadyProduceCount: int=0
|
||||
#生产进度
|
||||
Progress: str
|
||||
# Progress: str=""
|
||||
#工程名称
|
||||
ProjectName: str
|
||||
ProjectName: str=""
|
||||
#计划生产日期
|
||||
TaskPlanDateText: str
|
||||
# TaskPlanDateText: str=""
|
||||
#强度等级
|
||||
BetonGrade: str
|
||||
BetonGrade: str=""
|
||||
#设计配合比编号
|
||||
MixID: str
|
||||
MixID: str=""
|
||||
#生产配合比编号
|
||||
ProduceMixID: str
|
||||
#计划方量
|
||||
PlannedVolume: float
|
||||
#已供方量
|
||||
ProducedVolume: float
|
||||
ProduceMixID: str=""
|
||||
# #计划方量
|
||||
PlannedVolume: float=0.0
|
||||
# #已供方量
|
||||
# ProducedVolume: float=0.0
|
||||
#出洞环标记
|
||||
HoleRingMarking: str
|
||||
#注浆管标记
|
||||
GroutingPipeMarking: str
|
||||
#聚丙烯纤维标记
|
||||
PolypropyleneFiberMarking: str
|
||||
# HoleRingMarking: str=""
|
||||
# #注浆管标记
|
||||
# GroutingPipeMarking: str=""
|
||||
# #聚丙烯纤维标记
|
||||
# PolypropyleneFiberMarking: str=""
|
||||
#生产日期
|
||||
TaskDateText: str
|
||||
# TaskDateText: str=""
|
||||
#盘数
|
||||
PlateCount: int
|
||||
#任务单下发状态
|
||||
SendStatus: int
|
||||
#任务单下发状态
|
||||
SendStatusText: str
|
||||
#配合比下发状态
|
||||
MixSendStatus: int
|
||||
#配合比下发状态
|
||||
MixSendStatusText: str
|
||||
# PlateCount: int=0
|
||||
# #任务单下发状态
|
||||
# SendStatus: int=0
|
||||
# #任务单下发状态
|
||||
# SendStatusText: str=""
|
||||
# #配合比下发状态
|
||||
# MixSendStatus: int=0
|
||||
# #配合比下发状态
|
||||
# MixSendStatusText: str=""
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -268,34 +240,40 @@ class NotPourArtifactResponse:
|
||||
|
||||
@dataclass
|
||||
class PDRecordModel:
|
||||
def __init__(self):
|
||||
pass
|
||||
# def __init__(self):
|
||||
# pass
|
||||
"""管片表模型"""
|
||||
ID: int
|
||||
ID: int=0
|
||||
#派单编号
|
||||
PDCode: str
|
||||
ArtifactID: str=""
|
||||
|
||||
ArtifactActionID: int=0
|
||||
#任务单号
|
||||
TaskID: int
|
||||
TaskID: str=""
|
||||
#工程名称
|
||||
ProjectName: str
|
||||
ProjectName: str=""
|
||||
#生产配合比编号
|
||||
ProduceMixID: str
|
||||
#车架号
|
||||
VinNo: str
|
||||
ProduceMixID: str=""
|
||||
#派单方量
|
||||
BetonVolume: float
|
||||
BetonVolume: float=0.0
|
||||
#实际派单方量
|
||||
FBetonVolume: float=0.0
|
||||
#实际派单方量
|
||||
PlannedVolume: float=0.0
|
||||
#强度等级
|
||||
BetonGrade: str=""
|
||||
#模具编号
|
||||
MouldCode: str
|
||||
MouldCode: str=""
|
||||
#骨架编号
|
||||
SkeletonID: str
|
||||
SkeletonID: str=""
|
||||
#环类型编码
|
||||
RingTypeCode: str
|
||||
RingTypeCode: str=""
|
||||
#尺寸规格
|
||||
SizeSpecification: str
|
||||
SizeSpecification: str=""
|
||||
#埋深
|
||||
BuriedDepth: str
|
||||
BuriedDepth: str=""
|
||||
#块号
|
||||
BlockNumber: str
|
||||
BlockNumber: str=""
|
||||
# 派单模式(1自动派单 2手动派单0未知 )
|
||||
Mode: int=0
|
||||
# 派单状态(1计划中2已下发0未知),默认1
|
||||
@ -306,6 +284,8 @@ class PDRecordModel:
|
||||
Source: int=1
|
||||
#创建时间
|
||||
CreateTime: str=""
|
||||
#创建时间
|
||||
EndTime: str=""
|
||||
#派单时间(下发)
|
||||
OptTime: str=""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user