| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | using HH.WCS.Mobox3.DSZSH.util; |
| | | |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace HH.WCS.Mobox3.DSZSH.api { |
| | |
| | | public List<object> result { get; set; } = new List<object>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 构建 <see cref="SimpleResult"/> 返回值 |
| | | /// </summary> |
| | | /// <param name="code"></param> |
| | | /// <param name="message"></param> |
| | | /// <returns></returns> |
| | | public static SimpleResult NewSimpleResult(int code, string message) { |
| | | public static SimpleResult NewSimpleResult(int code, string message, string name = "") { |
| | | LogHelper.Info(message, name); |
| | | return new SimpleResult { resultCode = code, resultMsg = message }; |
| | | } |
| | | |
| | | public static SimpleResult NewSimpleResult(Exception ex, string preLog = "", int errCode = -1) { |
| | | LogHelper.InfoEx(ex, preLog); |
| | | return new SimpleResult { resultCode = errCode, resultMsg = $"发生了[异常]:{ex.Message}" }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //public int station_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请求上线/下线的的站台库位名称,例如work6、work8 |
| | | /// 请求上线/下线的的站台库位名称,例如work6,work8 |
| | | /// </summary> |
| | | public string station_name { get; set; } |
| | | |
| | |
| | | public string ResultMsg { get; set; } |
| | | } |
| | | |
| | | public static ReturnResult NewReturnResult(int code, string message) { |
| | | public static ReturnResult NewReturnResult(int code, string message, bool log = true) { |
| | | if (log) { LogHelper.Info(message); } |
| | | return new ReturnResult { ResultCode = code, ResultMsg = message }; |
| | | } |
| | | |
| | |
| | | |
| | | public class OtherModel { |
| | | /// <summary> |
| | | /// 好运箱-满箱下线入库(PDA)数据类 |
| | | /// 满箱下线入库 |
| | | /// </summary> |
| | | public class GoodpackOfflineInfo { |
| | | /// <summary> |
| | |
| | | [JsonProperty("n_num")] |
| | | public int Num { get; set; } |
| | | /// <summary> |
| | | /// 起点货位信息(起点货位货区要求:MXCZQ 满箱操作区) |
| | | /// 起点货位信息 (起点货位货区要求:MXCZQ 满箱操作区) |
| | | /// </summary> |
| | | [JsonProperty("s_start_loc")] |
| | | public string StartLoc { get; set; } |
| | |
| | | [JsonProperty("cntr_code")] |
| | | public string CntrCode { get; set; } |
| | | /// <summary> |
| | | /// 容器类型(必须为 '空托盘’ 或 ‘空好运箱') |
| | | /// 容器类型 (必须为 '空托盘’ 或 ‘空好运箱') |
| | | /// </summary> |
| | | [JsonProperty("cntr_type")] |
| | | public string CntrType { get; set; } |
| | | /// <summary> |
| | | /// 终点库区编码(托盘是 KTCFQ 空托存放区;好运箱是 CXHJQ 空箱货架区) |
| | | /// 终点库区编码 (托盘是 KTCFQ 空托存放区;好运箱是 CXHJQ 空箱货架区) |
| | | /// </summary> |
| | | [JsonProperty("end_area")] |
| | | public string EndArea { get; set; } |
| | | /// <summary> |
| | | /// 起点货位(托盘是 KTJBQ 空托入库接驳区;好运箱是 KXJBQ 空箱入库接驳区) |
| | | /// 起点货位 (托盘是 KTJBQ 空托入库接驳区;好运箱是 KXJBQ 空箱入库接驳区) |
| | | /// </summary> |
| | | [JsonProperty("start_loc")] |
| | | public string StartLoc { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// 空箱上线信息 |
| | | /// 空托上线信息 |
| | | /// </summary> |
| | | public class EmptyOnlinePalletInfo { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 不合格移库数据类 |
| | | /// </summary> |
| | | public class UnqualifiedShiftInfo : QualifiedBackInfo { |
| | | public class UnqualifiedShiftInfo { |
| | | /// <summary> |
| | | /// 不合格移库终点库区(必须是 CJYCQ 抽检异常区) |
| | | /// 物料编码 |
| | | /// </summary> |
| | | [JsonProperty("item_code")] |
| | | public string ItemCode { get; set; } |
| | | /// <summary> |
| | | /// 容器编码 |
| | | /// </summary> |
| | | [JsonProperty("cntr_code")] |
| | | public string CntrCode { get; set; } |
| | | /// <summary> |
| | | /// 不合格移库终点库区 (必须是 CJYCQ 抽检异常区) |
| | | /// </summary> |
| | | [JsonProperty("end_area")] |
| | | public string EndArea { get; set; } |
| | |
| | | [JsonProperty("qualityGrade")] |
| | | public string QualityGrade { get; set; } |
| | | /// <summary> |
| | | /// 料箱编号(待定) |
| | | /// 料箱编号 (待定) |
| | | /// </summary> |
| | | [JsonProperty("cntrCode")] |
| | | public string CntrCode { get; set; } |
| | | /// <summary> |
| | | /// 物料数量 (待定) |
| | | /// </summary> |
| | | [JsonProperty("itemNum")] |
| | | public int ItemNum { get; set; } |
| | | ///// <summary> |
| | | ///// 产线号(待定,好运箱有2条产线,对应2个下线货位,这里暂定为:3和4) |
| | | ///// 产线号 (待定,好运箱有2条产线,对应2个下线货位,这里暂定为:3和4) |
| | | ///// </summary> |
| | | //[JsonProperty("prodLineId")] |
| | | //public string ProdLineId { get; set; } |
| | |
| | | public int Result { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否成功 True-成功,False:失败 |
| | | /// 是否成功 True-成功,False:失败 |
| | | /// </summary> |
| | | [JsonProperty("success")] |
| | | public bool Success { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 这里是string类型,对结果的描述 |
| | | /// 这里是string类型,对结果的描述 |
| | | /// </summary> |
| | | [JsonProperty("data")] |
| | | public string Data { get; set; } |
| | | } |
| | | |
| | | public static MesResult NewMesResult(int code, string message = "", bool printLog = true) { |
| | | /// <summary> |
| | | /// 仅当 Code = 0 表示成功 |
| | | /// </summary> |
| | | /// <param name="code"></param> |
| | | /// <param name="message"></param> |
| | | /// <param name="log"></param> |
| | | /// <returns></returns> |
| | | public static MesResult NewMesResult(int code, string message = "", bool log = true) { |
| | | if (log) { LogHelper.Info(message); } |
| | | return new MesResult { |
| | | Result = code, |
| | | Success = code == 0, // 仅当code=0时,success=true |
| | | Success = code == 0, // 仅当code=0时,success=true |
| | | Data = message, |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 反馈 ERP 的数据类型 |
| | | /// </summary> |
| | | public class ErpResult { |
| | | [JsonProperty("code")] |
| | | public int Code { get; set; } |
| | | [JsonProperty("message")] |
| | | public string Message { get; set; } |
| | | } |
| | | |
| | | public static ErpResult NewErpResult(int code, string message) { |
| | | return new ErpResult { Code = code, Message = message }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ERP 下发出库任务的数据类型 |
| | | /// </summary> |
| | | public class ErpSendOutboundOrderInfo { |
| | | public string ErpNo { get; set; } // ERP 单号 |
| | | /// <summary> |
| | | /// 物料编码 |
| | | /// </summary> |
| | | [JsonProperty("item_code")] |
| | | public string ItemCode { get; set; } |
| | | /// <summary> |
| | | /// 物料规格 |
| | | /// </summary> |
| | | [JsonProperty("spe")] |
| | | public string Spe { get; set; } |
| | | /// <summary> |
| | | /// 批次号 |
| | | /// </summary> |
| | | [JsonProperty("batch_no")] |
| | | public string BatchNo { get; set; } |
| | | /// <summary> |
| | | /// 需出库数量 |
| | | /// </summary> |
| | | [JsonProperty("qty")] |
| | | public int Qty { get; set; } |
| | | /// <summary> |
| | | /// 容器类型 |
| | | /// </summary> |
| | | [JsonProperty("cntr_type")] |
| | | public string CntrType { get; set; } |
| | | /// <summary> |
| | | /// 出库终点货区 |
| | | /// </summary> |
| | | [JsonProperty("end_area")] |
| | | public string EndArea { get; set; } |
| | | /// <summary> |
| | | /// 是否强制出库 |
| | | /// </summary> |
| | | [JsonProperty("force_out")] |
| | | public bool ForcedOut { get; set; } |
| | | |
| | | } |
| | | |
| | | public class PickUpReturnErpInfo { |
| | | public string LocCode { get; set; } |
| | | |
| | | } |
| | | } |
| | | } |