| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- using LocalhostMES.Enums;
- using Prism.Mvvm;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LocalhostMES.Models
- {
- public class MesModel
- {
- }
- #region 通用响应模型
- public class ApiResponse<T>
- {
- public string code { get; set; } = "200";
- public bool success { get; set; } = true;
- public string msg { get; set; } = "请求成功";
- public string msgTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- public string traceId { get; set; } = Guid.NewGuid().ToString("N").Substring(0, 24);
- public T data { get; set; }
- }
- public class ErrorResponse
- {
- public string code { get; set; } = "55000";
- public bool success { get; set; } = false;
- public string msg { get; set; }
- public string msgTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- public string traceId { get; set; } = Guid.NewGuid().ToString("N").Substring(0, 24);
- public object data { get; set; } = null;
- }
- #endregion
- #region 2.1 厂级MES下发工单信息
- public class WorkOrderRequest
- {
- public string WorkOrderNo { get; set; } // 工单号
- public string MaterialCode { get; set; } // 成品物料号
- public string MaterialName { get; set; } // 成品物料名称
- public string OrderNo { get; set; } // 订单号
- public string SequenceNo { get; set; } // 工单顺序号
- public string WorkOrderNum { get; set; } // 工单生产数量
- public string PlanOnlineTime { get; set; } // 计划上线时间
- public string PlanOfflineTime { get; set; } // 计划下线时间
- public string Status { get; set; } // 工单状态
- public string FrozenStatus { get; set; } // 冻结状态
- public string ReleaseStatus { get; set; } // 下发状态
- public string LineCode { get; set; } // 线体编码
- }
- public class WorkOrderInfo
- {
- [SqlSugar.SugarColumn(IsPrimaryKey = true)]
- public string WorkOrderNo { get; set; }
- public bool IsLocalhost { get; set;}
- public string OrderNo { get; set; } = "0";
- public string MaterialCode { get; set; }
- public string MaterialName { get; set; }
- public int PlannedQuantity { get; set; }
- public int CompletedQuantity { get; set; }
- public string Status { get; set; }
- public string LineCode { get; set; }
- public DateTime CreateTime { get; set; }
- public DateTime? StartTime { get; set; }
- public DateTime? EndTime { get; set; }
- }
- #endregion
- #region 2.2 SN打印请求
- public class SnPrintRequest
- {
- public string plant { get; set; } // 工厂编码
- public string workShop { get; set; } // 车间
- public string line { get; set; } // 产线
- public string station { get; set; } // 工位编码
- public string site { get; set; } // 站点编码
- public string equipment { get; set; } // 设备编码
- public string orderNo { get; set; } // 订单号
- public string workOrderNo { get; set; } // 工单号
- public int count { get; set; } // 数量
- public int printType { get; set; } // 条码类型
- public string messageTime { get; set; } // 接口同步时间
- }
- public class SnInfo
- {
- [SqlSugar.SugarColumn(IsPrimaryKey = true)]
- public string Sn { get; set; } // SN条码
- public DateTime GenerateTime { get; set; } // 生成时间
- public string WorkOrderNo { get; set; } // 所属工单
- public string PrintType { get; set; } // 条码类型
- public bool IsUsed { get; set; } = false; // 是否已使用
- }
- public class SnPrintResponseData
- {
- public List<SnItem> Sn { get; set; } // SN列表
- public string OrderNo { get; set; } // 订单号
- public string WorkOrderNo { get; set; } // 工单号
- public string Line { get; set; } // 产线
- public string VehicleCode { get; set; } // 成品物料编码
- public string MaterialDesc { get; set; } // 成品物料名称
- }
- public class SnItem
- {
- public string Sn { get; set; }
- }
- #endregion
- #region 2.3 接收SN和关键件
- public class SnKeyComponentRequest
- {
- public string businessTpye { get; set; } = "SCAN_TASK"; // 业务类型
- public string plant { get; set; } // 工厂编码
- public string workShop { get; set; } // 车间
- public string lineCode { get; set; } // 产线
- public string stationCode { get; set; } // 工位编码
- public string positionCode { get; set; } // 站点编码
- public string barcodeBoundProcInfo { get; set; } = "1"; // 绑定关键件加工信息
- public string equipment { get; set; } // 设备编码
- public string scanTime { get; set; } // 扫描时间
- public string taskCode { get; set; } // 任务编码
- public string scanTpye { get; set; } = "1"; // 扫描执行类型
- public string sn { get; set; } // SN
- public string gbCode { get; set; } // 国标码
- public string snStatus { get; set; } // 产品状态
- public string employee { get; set; } // 人员
- public List<PartInfo> part { get; set; } // 关键件信息
- }
- public class PartInfo
- {
- public string partNum { get; set; } // 关键件条码
- public decimal partQty { get; set; } // 关键件数量
- public string materialCode { get; set; } // 关键件物料
- public string oldPartNum { get; set; } // 原关键件条码
- public string materialType { get; set; } // 关键件类型
- public string positionNo { get; set; } // 位置序号
- }
- public class LocalhostPartInfo : BindableBase
- {
- private StationType _FormulaType;
- private string _PartNum; // 关键件条码
- private decimal _PartQty; // 关键件数量
- private string _MaterialCode; // 关键件物料
- private string _OldPartNum; // 原关键件条码
- private string _MaterialType="1"; // 关键件类型
- private string _PositionNo=""; // 位置序号
- public StationType FormulaType { get => _FormulaType; set { SetProperty(ref _FormulaType, value); } }
- public string PartNum { get => _PartNum; set { SetProperty(ref _PartNum, value); } }
- public decimal PartQty { get => _PartQty; set { SetProperty(ref _PartQty, value); } }
- [SqlSugar.SugarColumn(IsPrimaryKey = true)]
- public string MaterialCode { get => _MaterialCode; set { SetProperty(ref _MaterialCode, value); } }
- public string OldPartNum { get => _OldPartNum; set { SetProperty(ref _OldPartNum, value); } }
- public string MaterialType { get => _MaterialType; set { SetProperty(ref _MaterialType, value); } }
- public string PositionNo { get => _PositionNo; set { SetProperty(ref _PositionNo, value); } }
- }
- public class BindRecord
- {
- [SqlSugar.SugarColumn(IsPrimaryKey = true,IsIdentity =true)]
- public int id { get; set; }
- public string Sn { get; set; }
- public string PartNum { get; set; }
- public string StationCode { get; set; }
- public DateTime BindTime { get; set; }
- public string Employee { get; set; }
- public string ScanType { get; set; }
- }
- #endregion
- #region 2.4 接收工件加工参数
- public class ProcessParameterRequest
- {
- public string businessTpye { get; set; } // 业务类型
- public string plant { get; set; } // 工厂编码
- public string workShop { get; set; } // 车间
- public string line { get; set; } // 产线
- public string station { get; set; } // 工位编码
- public string site { get; set; } // 站点编码
- public string sn { get; set; } // SN
- public string barcode { get; set; } // 关键件条码
- public string materialCode { get; set; } // 物料号
- public string equipment { get; set; } // 设备编号
- public string overallResult { get; set; } // 总结果
- public List<TightenResult> tightenResultDetail { get; set; } // 拧紧任务结果详情
- public List<StepResult> stepResultDetail { get; set; } // 工步任务结果详情
- public string reservedField1 { get; set; } // 预留字段1
- public string reservedField2 { get; set; } // 预留字段2
- public string reservedField3 { get; set; } // 预留字段3
- public string messageTime { get; set; } // 接口同步时间
- }
- public class TightenResult
- {
- public int point_num { get; set; } // 拧紧序号
- public int pset { get; set; } // 拧紧程序编号
- public decimal torque { get; set; } // 拧紧扭矩
- public decimal angle { get; set; } // 拧紧角度
- public string tighten_status { get; set; } // 单次拧紧结果
- public string tighten_dt { get; set; } // 拧紧时间
- }
- public class StepResult
- {
- public string tagCode { get; set; } // 参数名
- public string tagValue { get; set; } // 实际值
- public string tagRage { get; set; } // 参数上下限范围
- public string tagResult { get; set; } // 参数结果
- public string tagUnit { get; set; } // 参数单位
- public List<NgCodeInfo> ngCode { get; set; } // 异常代码
- }
- public class NgCodeInfo
- {
- public string ngCode { get; set; } // 异常代码
- public string ngDes { get; set; } // 异常描述
- }
- public class ProcessRecord
- {
- public string Sn { get; set; }
- public string Station { get; set; }
- public string OverallResult { get; set; }
- public DateTime ProcessTime { get; set; }
- public string Equipment { get; set; }
- }
- #endregion
- #region
- /// <summary>
- /// 生产数据
- /// </summary>
- public class ProductionToStation : BindableBase
- {
- private Guid _id = Guid.NewGuid();
- private string _SN;
- private string _PartNum;
- private DateTime _CreateTime;
- private string _FormulaName;
- private FormulaPartType _formulaPart;
- private string _Result;
- private List<ResultInfo> _resultContent = new List<ResultInfo>();
- public Guid Id { get => _id; set { SetProperty(ref _id, value); } }
- public DateTime CreateTime { get => _CreateTime; set { SetProperty(ref _CreateTime, value); } }
- public string FormulaName { get => _FormulaName; set { SetProperty(ref _FormulaName, value); } }
- public FormulaPartType FormulaPart { get => _formulaPart; set { SetProperty(ref _formulaPart, value); } }
- public string Result { get => _Result; set { SetProperty(ref _Result, value); } }
- [SqlSugar.SugarColumn(IsJson = true, ColumnDataType = "nvarchar(2000)")]//必填
- public List<ResultInfo> ResultContent { get => _resultContent; set { SetProperty(ref _resultContent, value); } }
- public string SN { get => _SN; set { SetProperty(ref _SN, value); } }
- public string PartNum { get => _PartNum; set { SetProperty(ref _PartNum, value); } }
- }
- public class ParkingLot : BindableBase
- {
- private int _id = 0;
- private StationType _FormulaType;
- private string _SerialNumber;
- private string _PartNumber;
- private string _PartName;
- private string _PlanNum;
- private string _UseNum;
- private int _CompletedNum;
- public StationType FormulaType { get => _FormulaType; set { SetProperty(ref _FormulaType, value); } }
- /// <summary>
- /// 序号
- /// </summary>
- public string SerialNumber { get => _SerialNumber; set { SetProperty(ref _SerialNumber, value); } }
- /// <summary>
- /// 零件号
- /// </summary>
- public string PartNumber { get => _PartNumber; set { SetProperty(ref _PartNumber, value); } }
- /// <summary>
- /// 零件名称
- /// </summary>
- public string PartName { get => _PartName; set { SetProperty(ref _PartName, value); } }
- /// <summary>
- /// 计划数量
- /// </summary>
- public string PlanNum { get => _PlanNum; set { SetProperty(ref _PlanNum, value); } }
- /// <summary>
- /// 使用数量
- /// </summary>
- public string UseNum { get => _UseNum; set { SetProperty(ref _UseNum, value); } }
- /// <summary>
- /// 已完成数量
- /// </summary>
- public int CompletedNum { get => _CompletedNum; set { SetProperty(ref _CompletedNum, value); } }
- [SqlSugar.SugarColumn(IsPrimaryKey = true,IsIdentity =true)]
- public int Id { get => _id; set { SetProperty(ref _id, value); } }
- }
- public class ResultInfo : BindableBase
- {
- private string resultName;
- private string resultValue;
- private string result;
- public string ResultName { get => resultName; set { SetProperty(ref resultName, value); } }
- public string ResultValue { get => resultValue; set { SetProperty(ref resultValue, value); } }
- public string Result { get => result; set { SetProperty(ref result, value); } }
- }
- #endregion
- }
|