311 lines
6.7 KiB
Python
311 lines
6.7 KiB
Python
|
|
from dataclasses import dataclass
|
|||
|
|
from typing import Optional, Dict, Any, List
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class LoginRequest:
|
|||
|
|
"""登录请求模型"""
|
|||
|
|
Program: int
|
|||
|
|
SC: str
|
|||
|
|
loginName: str
|
|||
|
|
password: str
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class LoginResponse:
|
|||
|
|
"""登录响应模型"""
|
|||
|
|
Code: int
|
|||
|
|
Message: Optional[str]
|
|||
|
|
Data: Optional[Dict[str, Any]]
|
|||
|
|
|
|||
|
|
@property
|
|||
|
|
def app_id(self) -> Optional[str]:
|
|||
|
|
"""获取AppID"""
|
|||
|
|
return self.Data.get('AppID') if self.Data else None
|
|||
|
|
|
|||
|
|
@property
|
|||
|
|
def expire_time(self) -> Optional[str]:
|
|||
|
|
"""获取过期时间"""
|
|||
|
|
return self.Data.get('ExpireTime') if self.Data else None
|
|||
|
|
|
|||
|
|
@property
|
|||
|
|
def sign_token(self) -> Optional[str]:
|
|||
|
|
"""获取SignToken"""
|
|||
|
|
return self.Data.get('SignToken') if self.Data else None
|
|||
|
|
|
|||
|
|
@property
|
|||
|
|
def zr_jwt(self) -> Optional[str]:
|
|||
|
|
"""获取ZrJwt"""
|
|||
|
|
return self.Data.get('ZrJwt') if self.Data else None
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class ArtifactInfo:
|
|||
|
|
"""管片信息模型"""
|
|||
|
|
#管片编号
|
|||
|
|
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
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class ArtifactInfoModel:
|
|||
|
|
def __init__(self):
|
|||
|
|
pass
|
|||
|
|
"""管片表模型"""
|
|||
|
|
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
|
|||
|
|
#FK_PDID
|
|||
|
|
FK_PDID: int=0
|
|||
|
|
#状态
|
|||
|
|
Status: int=1
|
|||
|
|
#开始时间
|
|||
|
|
BeginTime: str=""
|
|||
|
|
#结束时间
|
|||
|
|
EndTime: str=""
|
|||
|
|
#PStatus
|
|||
|
|
PStatus: int=0
|
|||
|
|
#Source
|
|||
|
|
Source: int=1
|
|||
|
|
#FBetonVolume
|
|||
|
|
FBetonVolume: float=0.0
|
|||
|
|
#OptTime
|
|||
|
|
OptTime: str=""
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class ArtifactResponse:
|
|||
|
|
"""管片信息响应模型"""
|
|||
|
|
Code: int
|
|||
|
|
Message: Optional[str]
|
|||
|
|
Data: Optional[ArtifactInfo]
|
|||
|
|
|
|||
|
|
@classmethod
|
|||
|
|
def from_dict(cls, data: Dict[str, Any]) -> 'ArtifactResponse':
|
|||
|
|
"""
|
|||
|
|
从字典创建响应对象
|
|||
|
|
|
|||
|
|
Args:
|
|||
|
|
data: 响应数据字典
|
|||
|
|
|
|||
|
|
Returns:
|
|||
|
|
ArtifactResponse: 响应对象
|
|||
|
|
"""
|
|||
|
|
response_data = data.get('Data')
|
|||
|
|
artifact_info = None
|
|||
|
|
if response_data:
|
|||
|
|
artifact_info = ArtifactInfo(**response_data)
|
|||
|
|
|
|||
|
|
return cls(
|
|||
|
|
Code=data.get('Code'),
|
|||
|
|
Message=data.get('Message'),
|
|||
|
|
Data=artifact_info
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class TaskInfo:
|
|||
|
|
"""任务单信息模型"""
|
|||
|
|
#任务单ID
|
|||
|
|
TaskID: str
|
|||
|
|
#任务单状态
|
|||
|
|
TaskStatus: int
|
|||
|
|
#任务单状态文本
|
|||
|
|
TaskStatusText: str
|
|||
|
|
#计划生产数量
|
|||
|
|
TaskCount: int
|
|||
|
|
#已生产数量
|
|||
|
|
AlreadyProduceCount: int
|
|||
|
|
#生产进度
|
|||
|
|
Progress: str
|
|||
|
|
#工程名称
|
|||
|
|
ProjectName: str
|
|||
|
|
#计划生产日期
|
|||
|
|
TaskPlanDateText: str
|
|||
|
|
#强度等级
|
|||
|
|
BetonGrade: str
|
|||
|
|
#设计配合比编号
|
|||
|
|
MixID: str
|
|||
|
|
#生产配合比编号
|
|||
|
|
ProduceMixID: str
|
|||
|
|
#计划方量
|
|||
|
|
PlannedVolume: float
|
|||
|
|
#已供方量
|
|||
|
|
ProducedVolume: float
|
|||
|
|
#出洞环标记
|
|||
|
|
HoleRingMarking: str
|
|||
|
|
#注浆管标记
|
|||
|
|
GroutingPipeMarking: str
|
|||
|
|
#聚丙烯纤维标记
|
|||
|
|
PolypropyleneFiberMarking: str
|
|||
|
|
#生产日期
|
|||
|
|
TaskDateText: str
|
|||
|
|
#盘数
|
|||
|
|
PlateCount: int
|
|||
|
|
#任务单下发状态
|
|||
|
|
SendStatus: int
|
|||
|
|
#任务单下发状态
|
|||
|
|
SendStatusText: str
|
|||
|
|
#配合比下发状态
|
|||
|
|
MixSendStatus: int
|
|||
|
|
#配合比下发状态
|
|||
|
|
MixSendStatusText: str
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class TaskResponse:
|
|||
|
|
"""任务单响应模型"""
|
|||
|
|
Code: int
|
|||
|
|
Message: Optional[str]
|
|||
|
|
Data: Optional[TaskInfo]
|
|||
|
|
|
|||
|
|
@classmethod
|
|||
|
|
def from_dict(cls, data: Dict[str, Any]) -> 'TaskResponse':
|
|||
|
|
"""
|
|||
|
|
从字典创建响应对象
|
|||
|
|
|
|||
|
|
Args:
|
|||
|
|
data: 响应数据字典
|
|||
|
|
|
|||
|
|
Returns:
|
|||
|
|
TaskResponse: 响应对象
|
|||
|
|
"""
|
|||
|
|
response_data = data.get('Data')
|
|||
|
|
task_info = None
|
|||
|
|
if response_data:
|
|||
|
|
task_info = TaskInfo(**response_data)
|
|||
|
|
|
|||
|
|
return cls(
|
|||
|
|
Code=data.get('Code'),
|
|||
|
|
Message=data.get('Message'),
|
|||
|
|
Data=task_info
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class NotPourArtifactResponse:
|
|||
|
|
"""未浇筑管片列表响应模型"""
|
|||
|
|
Code: int
|
|||
|
|
Message: Optional[str]
|
|||
|
|
Data: Optional[List[ArtifactInfo]]
|
|||
|
|
|
|||
|
|
@classmethod
|
|||
|
|
def from_dict(cls, data: Dict[str, Any]) -> 'NotPourArtifactResponse':
|
|||
|
|
"""
|
|||
|
|
从字典创建响应对象
|
|||
|
|
|
|||
|
|
Args:
|
|||
|
|
data: 响应数据字典
|
|||
|
|
|
|||
|
|
Returns:
|
|||
|
|
NotPourArtifactResponse: 响应对象
|
|||
|
|
"""
|
|||
|
|
response_data = data.get('Data')
|
|||
|
|
artifacts = None
|
|||
|
|
if response_data:
|
|||
|
|
artifacts = [ArtifactInfo(**item) for item in response_data]
|
|||
|
|
|
|||
|
|
return cls(
|
|||
|
|
Code=data.get('Code'),
|
|||
|
|
Message=data.get('Message'),
|
|||
|
|
Data=artifacts
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
|
|||
|
|
@dataclass
|
|||
|
|
class PDRecordModel:
|
|||
|
|
def __init__(self):
|
|||
|
|
pass
|
|||
|
|
"""管片表模型"""
|
|||
|
|
ID: int
|
|||
|
|
#派单编号
|
|||
|
|
PDCode: str
|
|||
|
|
#任务单号
|
|||
|
|
TaskID: int
|
|||
|
|
#工程名称
|
|||
|
|
ProjectName: str
|
|||
|
|
#生产配合比编号
|
|||
|
|
ProduceMixID: str
|
|||
|
|
#车架号
|
|||
|
|
VinNo: str
|
|||
|
|
#派单方量
|
|||
|
|
BetonVolume: float
|
|||
|
|
#模具编号
|
|||
|
|
MouldCode: str
|
|||
|
|
#骨架编号
|
|||
|
|
SkeletonID: str
|
|||
|
|
#环类型编码
|
|||
|
|
RingTypeCode: str
|
|||
|
|
#尺寸规格
|
|||
|
|
SizeSpecification: str
|
|||
|
|
#埋深
|
|||
|
|
BuriedDepth: str
|
|||
|
|
#块号
|
|||
|
|
BlockNumber: str
|
|||
|
|
# 派单模式(1自动派单 2手动派单0未知 )
|
|||
|
|
Mode: int=0
|
|||
|
|
# 派单状态(1计划中2已下发0未知),默认1
|
|||
|
|
Status: int=1
|
|||
|
|
#搅拌生产状态()
|
|||
|
|
GStatus: int=0
|
|||
|
|
#数据来源(1 api 2离线)
|
|||
|
|
Source: int=1
|
|||
|
|
#创建时间
|
|||
|
|
CreateTime: str=""
|
|||
|
|
#派单时间(下发)
|
|||
|
|
OptTime: str=""
|