using Common;
|
using DataBase;
|
using Model;
|
using Model.ApiModel;
|
using Model.WcsModel;
|
using Newtonsoft.Json;
|
using NLog;
|
using NPOI.SS.Formula;
|
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.PTG;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Data.SqlTypes;
|
using System.Reflection;
|
using System.Text;
|
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
|
|
namespace BLL.DAL
|
{
|
[Obsolete]
|
public class DALWcsMessage
|
{
|
#region JC09
|
/// <summary>
|
/// 获取与PLC交互的所有IP地址
|
/// </summary>
|
/// <returns></returns>
|
public DataTable GetPlcIps()
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"select * from WCSIP where isDel = 0;");
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
|
return null;
|
}
|
|
/// <summary>
|
/// 获取与设备交互信息
|
/// </summary>
|
/// <returns></returns>
|
public DataTable GetPlcInfos()
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"select tb1.*,tb2.IP from WCSPlcInfo as tb1 " +
|
$"left join WCSIP as tb2 on tb1.PlcIP = tb2.Id where tb1.isDel = 0; ");
|
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
|
return null;
|
}
|
|
/// <summary>
|
/// 判断WCS是否自动模式 链接DB1
|
/// </summary>
|
/// <returns>true:自动模式 false:手动模式</returns>
|
public bool GetIsWcsAutoDB1()
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select code from [dbo].[Dictionary] where TypeName = 'WCSAuto';");
|
DataRow row = DataFactory.SqlDataBaseDB1().GetDataRowBySQL(sqlString);
|
if (row != null)
|
{
|
if (row["code"].ToString() == "0")
|
{
|
bl = true;
|
}
|
}
|
|
return bl;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
|
/// <summary>
|
/// 判断WCS是否自动模式 链接db2
|
/// </summary>
|
/// <returns>true:自动模式 false:手动模式</returns>
|
public bool GetIsWcsAutoDB2()
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select code from [dbo].[Dictionary] where TypeName = 'WCSAuto';");
|
DataRow row = DataFactory.SqlDataBaseDB2().GetDataRowBySQL(sqlString);
|
if (row != null)
|
{
|
if (row["code"].ToString() == "0")
|
{
|
bl = true;
|
}
|
}
|
|
return bl;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 获取当前工位偏移量信息
|
/// </summary>
|
/// <param name="plcInfoId">工位Id</param>
|
/// <returns></returns>
|
public DataTable GetPlcPos(string plcInfoId)
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"select * from WCSPlcPos where isDel = 0 and PlcInfoId = '{plcInfoId}';");
|
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
|
return null;
|
}
|
|
/// <summary>
|
/// 调用WMS接口获取储位地址
|
/// </summary>
|
/// <param name="palletNo">托盘号</param>
|
/// <param name="startLocat">起始工位</param>
|
/// <param name="endLocat">目标工位号(取货工位)</param>
|
/// <param name="taskNo">任务号</param>
|
/// <returns>返回wms反馈的信息</returns>
|
public string GetLocations(string palletNo, string startLocat, ref string endLocat, ref string taskNo)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
try
|
{
|
string returnStr = "";
|
StringBuilder sqlString = new StringBuilder();
|
// 先判断此托盘的任务是否已生成任务
|
sqlString.Append("select * from WCSTasks where Status in ('0','1') and Type = '0' ");
|
sqlString.Append($"and PalletNo = '{palletNo}' and isdel = '0';");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt == null || dt.Rows.Count <= 0)
|
{
|
LocatModel model = new LocatModel();
|
model.PalletNo = palletNo;
|
model.HouseNo = "W01";
|
model.RoadwayNo = "";
|
string json = JsonConvert.SerializeObject(model);
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/RequestLocation", json);
|
logger.Error(palletNo + "申请储位:" + response);
|
Tasks taskModels = JsonConvert.DeserializeObject<Tasks>(response);
|
if (taskModels.Success == "0")
|
{
|
// 永远只返回一条信息,因为是集合所以用循环插入写法;
|
DALWMSApi dal = new DALWMSApi();
|
var task = taskModels.TaskList;
|
task.Type = "0"; // 任务类型 0:入库任务 1出库任务 2 移库任务
|
task.Origin = "WMS";
|
task.StartLocate = startLocat; // 起始位置
|
WCSResultModel result = dal.AddWcsTask(task);
|
taskNo = taskModels.TaskList.TaskNo; //任务号
|
if (result.stateCode == "1")
|
{
|
//修改储位信息 任务类型 执行状态 起始位置 目标位置
|
EditLocaetStatus("0", "0", "", task.EndLocate);
|
|
endLocat = task.EndRoadway;
|
returnStr = task.EndLocate;//"托盘号:" + palletNo + "\n" + "储位地址:" + task.EndLocate + "\n";
|
}
|
else
|
{
|
returnStr = "-1:" + result.errMsg;
|
return returnStr;
|
}
|
}
|
else
|
{
|
returnStr = "-1:" + taskModels.Message;
|
return returnStr;
|
}
|
}
|
else
|
{
|
returnStr = dt.Rows[0]["EndLocat"].ToString();
|
endLocat = dt.Rows[0]["EndRoadway"].ToString();
|
taskNo = dt.Rows[0]["TaskNo"].ToString();
|
}
|
|
// 确定取货工位
|
switch (endLocat)
|
{
|
case "R01":
|
endLocat = "10";
|
break;
|
case "R02":
|
endLocat = "6";
|
break;
|
}
|
|
//returnStr = endLocat;
|
return returnStr;
|
}
|
catch (Exception ex)
|
{
|
logger.Error("程序错误:" + ex.Message);
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// WCS自申请储位
|
/// </summary>
|
/// <param name="palletNo">托盘号</param>
|
/// <param name="startLocat">起始工位</param>
|
/// <param name="endLocat">目标工位号(取货工位)</param>
|
/// <param name="taskNo">任务号</param>
|
/// <returns>返回wms反馈的信息</returns>
|
public string GetWcsLocations(string palletNo, string startLocat, ref string endLocat, ref string taskNo)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
try
|
{
|
string returnStr = "";
|
StringBuilder sqlString = new StringBuilder();
|
// 先判断此托盘的任务是否已生成任务
|
// 验证任务是否已存在
|
sqlString.Append($"select * from WCSTasks where IsDel = '0' and (Status = '0' or Status = '1') and PalletNo = '{palletNo}';");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt != null || dt.Rows.Count > 0)
|
{
|
returnStr = "托盘" + palletNo + ";任务已存在!";
|
return returnStr;
|
}
|
if (dt == null || dt.Rows.Count <= 0)
|
{
|
var response = GetLocateByRoadways(); //申请储位
|
logger.Error(palletNo + "申请储位:" + response);
|
// 永远只返回一条信息,因为是集合所以用循环插入写法;
|
DALWMSApi dal = new DALWMSApi();
|
WCSTasks task = new WCSTasks();
|
task.Type = "0"; // 任务类型 0:入库任务 1出库任务 2 移库任务
|
task.Origin = "WCS"; //来源
|
task.StartLocate = startLocat; // 起始位置
|
task.EndLocate = response.LocatNo; // 目标位置
|
task.EndRoadway = response.RoadwayNo; // 目标巷道
|
task.PalletNo = palletNo; // 托盘号
|
WCSResultModel result = dal.AddItsWcsTask(task);
|
if (result.stateCode == "1")
|
{
|
//修改储位信息 任务类型 执行状态 起始位置 目标位置
|
var IsUptLocate = EditLocaetStatus("0", "0", "", response.LocatNo);
|
if (IsUptLocate)
|
{
|
endLocat = response.RoadwayNo;
|
returnStr = response.LocatNo;
|
}
|
else
|
{
|
returnStr = "-1:" + "申请储位后任务储位修改失败";
|
return returnStr;
|
}
|
}
|
else
|
{
|
returnStr = "-1:" + result.errMsg;
|
return returnStr;
|
}
|
}
|
else
|
{
|
returnStr = "-1:" + "申请储位失败";
|
return returnStr;
|
}
|
|
// 确定取货工位
|
switch (endLocat)
|
{
|
case "R01":
|
endLocat = "1";
|
break;
|
case "R02":
|
endLocat = "2";
|
break;
|
case "R03":
|
endLocat = "3";
|
break;
|
case "R04":
|
endLocat = "4";
|
break;
|
case "R05":
|
endLocat = "5";
|
break;
|
case "R06":
|
endLocat = "6";
|
break;
|
case "R07":
|
endLocat = "7";
|
break;
|
}
|
|
//returnStr = endLocat;
|
return returnStr;
|
}
|
catch (Exception ex)
|
{
|
logger.Error("程序错误:" + ex.Message);
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 插入任务明细表
|
/// </summary>
|
/// <param name="model">任务明细信息</param>
|
public bool AddWCSTasksMonitor(WCSTasksMonitor model)
|
{
|
bool bl = false;
|
StringBuilder sqlString = new StringBuilder();
|
try
|
{
|
// 判断任务号是否位""
|
if (model.TaskNo == "")
|
{
|
// 根据托盘号获取对应的任务号
|
sqlString.Append($"select TaskNo from WCSTasks where Status = '1' and IsDel = '0' and PalletNo = '{model.PalletNo}';");
|
DataRow row = DataFactory.SqlDataBase().GetDataRowBySQL(sqlString);
|
if (row != null)
|
{
|
model.TaskNo = row["TaskNo"].ToString();
|
}
|
}
|
|
if (model.TaskNo == "")
|
{
|
return bl;
|
}
|
|
// 插入任务明细表
|
sqlString.Clear();
|
sqlString.Append(@"INSERT INTO WCSTasksMonitor
|
( TaskNo , PlcId , PlcName , StartLocat , EndLocat , InteractiveMsg
|
, ErrorMsg,PalletNo,Status,IsDel ) VALUES (");
|
sqlString.Append($"'{model.TaskNo}',{model.PlcId},'{model.PlcName}','{model.StartLocat}','{model.EndLocat}',");
|
sqlString.Append($"'{model.InteractiveMsg}','{model.ErrorMsg}','{model.PalletNo}','{model.Status}','0');");
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
bl = true;
|
}
|
}
|
catch (Exception ex)
|
{
|
// 记录日志文件
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "AddWCSTasksMonitor添加任务明细失败!");
|
|
return bl;
|
}
|
|
return bl;
|
}
|
|
/// <summary>
|
/// 更新任务状态
|
/// </summary>
|
/// <param name="TrayCode">托盘号</param>
|
/// <param name="StateValue">任务状态 0: 等待执行 1: 正在执行 2: 执行完成 3: 异常结束 4: 任务取消</param>
|
/// <returns>true:成功 flase:失败</returns>
|
public bool SetWCSTasks(string palletNo, string StateValue, string EndLocatNo, string taskNo = "")
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"Update WCSTasks set FinishDate = '{DateTime.Now}', Status = '{StateValue}' ");
|
//判断目标工位是否为空
|
if (!string.IsNullOrEmpty(EndLocatNo))
|
{
|
sqlString.Append($" ,EndLocat = '{EndLocatNo}'");
|
}
|
if (StateValue == "1")
|
{
|
//任务状态为正在执行时修改为最高优先级
|
sqlString.Append($" ,Levels = '2'");
|
}
|
else if (StateValue == "2")
|
{
|
//任务状态为执行完成时修改为正常优先级
|
sqlString.Append($" ,Levels = '2'");
|
}
|
sqlString.Append(" where Status not in ('3','2','4') ");
|
if (!string.IsNullOrWhiteSpace(palletNo))
|
{
|
sqlString.Append($" and PalletNo = '{palletNo}' ");
|
|
}
|
if (!string.IsNullOrWhiteSpace(taskNo))
|
{
|
sqlString.Append($" and TaskNo = '{taskNo}' ");
|
}
|
else
|
{
|
sqlString.Append(" ;");
|
}
|
|
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
bl = true;
|
}
|
|
return bl;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 获取任务信息
|
/// </summary>
|
/// <param name="status">0 等待执行 1 正在执行 2 执行完成 3 异常结束 4 任务取消</param>
|
/// <param name="type">0 入库任务 1 出库任务 2 移库任务</param>
|
/// <param name="palletNo">托盘号</param>
|
/// <returns></returns>
|
public DataTable GetWCSTasks(string status, string type, string palletNo = "", string startRoadway = "", string taskNo = "", string endRoadway = "")
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select top 1 * from WCSTasks ");
|
sqlString.Append($"where Status = '{status}' and IsDel = '0' ");
|
if (taskNo != "")
|
{
|
sqlString.Append($" and TaskNo = '{taskNo}' ");
|
}
|
if (palletNo != "")
|
{
|
sqlString.Append($" and palletNo = '{palletNo}' ");
|
}
|
if (startRoadway != "")
|
{
|
sqlString.Append($" and startRoadway = '{startRoadway}' ");
|
}
|
if (endRoadway != "")
|
{
|
sqlString.Append($" and endRoadway = '{endRoadway}' ");
|
}
|
if (type != "")
|
{
|
sqlString.Append($" and Type = '{type}' ");
|
}
|
|
sqlString.Append(" order by Levels,Status,StartLocat,CreateTime asc; ");
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
|
return null;
|
}
|
|
/// <summary>
|
/// 获取储位任务信息
|
/// </summary>
|
/// <param name="startlocat">起始货位</param>
|
/// <returns></returns>
|
public DataTable GetLocateTasks(string startlocat = "",string endlocat = "")
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select top 1 * from WCSTasks ");
|
sqlString.Append($"where IsDel = '0'");
|
if (startlocat != "")
|
{
|
sqlString.Append($" and StartLocat = '{startlocat}' ");
|
}
|
if (endlocat != "")
|
{
|
sqlString.Append($" and EndLocat = '{endlocat}' ");
|
}
|
sqlString.Append(" order by Levels,Status,StartLocat,CreateTime asc; ");
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
|
/// <summary>
|
/// 获取储位任务信息
|
/// </summary>
|
/// <param name="startlocat">起始货位</param>
|
/// <returns></returns>
|
public DataTable GetWCSDX(string skuno = "")
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select top 1 * from WCSMaterialRules where SkuNo = "+skuno);
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
|
/// <summary>
|
/// 调用WMS接口反馈任务接口
|
/// </summary>
|
/// <param name="model">任务完成状态</param>
|
/// <returns></returns>
|
public bool RequestTasks(TaskReques model)
|
{
|
bool bl = false;
|
Logger logger = LogManager.GetCurrentClassLogger();
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
string json = JsonConvert.SerializeObject(model);
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/ReceiveWcsSignal", json);
|
logger.Error(model.taskNo + "任务反馈:" + response);
|
|
//var response1 = JsonConvert.DeserializeObject(response);
|
ResponseTasks taskModels = JsonConvert.DeserializeObject<ResponseTasks>(response);
|
if (taskModels.StatusCode == "0")
|
{
|
|
sqlString.Append($"Update WCSTasks set IsSuccess = '0' where TaskNo = '{model.taskNo}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
bl = true;
|
}
|
else
|
{
|
sqlString.Append($"Update WCSTasks set IsSuccess = '1',Information='{taskModels.Message}' where TaskNo = '{model.taskNo}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
bl = false;
|
}
|
}
|
catch (Exception ex)
|
{
|
logger.Error("程序错误:" + ex.Message);
|
}
|
|
return bl;
|
}
|
|
/// <summary>
|
/// 调用WMS接口反馈任务满入异常接口
|
/// </summary>
|
/// <param name="model">任务信息</param>
|
/// <returns></returns>
|
public string RequestFullException(TaskReques model, string startLocat, ref string taskNo)
|
{
|
string returnStr = "";
|
taskNo = ""; //任务号
|
Logger logger = LogManager.GetCurrentClassLogger();
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
string json = JsonConvert.SerializeObject(model);
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/FullException", json);
|
logger.Error(model.taskNo + "任务反馈:" + response);
|
|
//var response1 = JsonConvert.DeserializeObject(response);
|
Tasks taskModels = JsonConvert.DeserializeObject<Tasks>(response);
|
if (taskModels.Success == "0")
|
{
|
// 永远只返回一条信息,因为是集合所以用循环插入写法;
|
DALWMSApi dal = new DALWMSApi();
|
var task = taskModels.TaskList;
|
task.Type = "0"; // 任务类型 0:入库任务 1出库任务 2 移库任务
|
task.Origin = "WMS";
|
task.StartLocate = startLocat; // 起始位置
|
WCSResultModel result = dal.AddWcsTask(task);
|
|
if (result.stateCode == "1")
|
{
|
taskNo = taskModels.TaskList.TaskNo; //任务号
|
returnStr = task.EndLocate;
|
}
|
else
|
{
|
returnStr = "-1:" + result.errMsg;
|
}
|
sqlString.Append($"Update WCSTasks set IsSuccess = '0', where TaskNo = '{model.taskNo}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
}
|
else
|
{
|
returnStr = "-1:" + taskModels.Message;
|
sqlString.Append($"Update WCSTasks set IsSuccess = '1', where TaskNo = '{model.taskNo}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
}
|
}
|
catch (Exception ex)
|
{
|
returnStr = "-1程序错误:" + ex.Message;
|
logger.Error(returnStr);
|
}
|
|
return returnStr;
|
}
|
|
/// <summary>
|
/// 调用WMS接口反馈空取异常接口
|
/// </summary>
|
/// <param name="model">任务信息</param>
|
/// <returns></returns>
|
public bool RequestEmptyException(TaskReques model)
|
{
|
bool bl = false;
|
Logger logger = LogManager.GetCurrentClassLogger();
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
string json = JsonConvert.SerializeObject(model);
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/EmptyException", json);
|
logger.Error(model.taskNo + "任务反馈:" + response);
|
|
//var response1 = JsonConvert.DeserializeObject(response);
|
ResponseTasks taskModels = JsonConvert.DeserializeObject<ResponseTasks>(response);
|
if (taskModels.Success == "0")
|
{
|
|
sqlString.Append($"Update WCSTasks set IsSuccess = '0' where TaskNo = '{model.taskNo}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
bl = true;
|
}
|
else
|
{
|
sqlString.Append($"Update WCSTasks set IsSuccess = '1',Information='{taskModels.Message}' where TaskNo = '{model.taskNo}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
bl = false;
|
}
|
}
|
catch (Exception ex)
|
{
|
logger.Error("-1程序错误:" + ex.Message);
|
}
|
|
return bl;
|
}
|
|
/// <summary>
|
/// 向赋码系统获取箱码信息
|
/// </summary>
|
/// <param name="boxCode"></param>
|
/// <returns></returns>
|
public WcsBoxInfo GetBoxInfo(string boxCode)
|
{
|
try
|
{
|
//获取是否存在当前箱码信息
|
StringBuilder sqlString = new StringBuilder();
|
// 先判断此托盘的任务是否已生成任务
|
sqlString.Append($"select * from WcsBoxInfo where IsDel = '0' and BoxNo = '{boxCode}' ");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
//调用赋码系统
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/RequestLocation", boxCode);
|
WcsBoxInfo boxInfo = JsonConvert.DeserializeObject<WcsBoxInfo>(response);
|
|
//添加箱码信息
|
sqlString.Clear();
|
sqlString.Append("insert into WcsBoxInfo (OrderCode,Line_No,LineDao,PORT,BoxNo,BoxNo2,BoxNo3,PalletNo,Qty,FullQty,Aflag,Status,SkuNo,SkuName,LotNo,LotText,Custom,CustomName,ProductionTime,ExpirationTime,CompleteTime,InspectMark,BitBoxMark,Standard,PackageStandard,StoreTime,QtyCount,QtyOrd,Opuser,IsDel,CreateTime,CreateUser,UpdateTime,UpdateUser)");
|
sqlString.Append($"Values ('{boxInfo.OrderCode}','{boxInfo.Line_No}','{boxInfo.LineDao}','{boxInfo.PORT}','{boxInfo.BoxNo}','{boxInfo.BoxNo2}','{boxInfo.BoxNo3}','','{boxInfo.Qty}','{boxInfo.FullQty}','{boxInfo.Aflag}','{boxInfo.Status}','{boxInfo.SkuNo}','{boxInfo.SkuName}','{boxInfo.LotNo}','{boxInfo.LotText}','{boxInfo.Custom}','{boxInfo.CustomName}','{boxInfo.ProductionTime}','{boxInfo.ExpirationTime}','{boxInfo.CompleteTime}','{boxInfo.InspectMark}','{boxInfo.BitBoxMark}','{boxInfo.Standard}','{boxInfo.PackageStandard}','{boxInfo.StoreTime}','{boxInfo.QtyCount}','{boxInfo.QtyOrd}','{boxInfo.Opuser}','0',getdate(),null,null,null)");
|
int isAdd = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (isAdd == 1)
|
{
|
return boxInfo;
|
}
|
else
|
{
|
return null;
|
}
|
|
|
}
|
else
|
{
|
return null;
|
}
|
}
|
catch (Exception ex)
|
{
|
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 变更储位(需要的值 任务类型 状态 (入库与PLC:目标位置、出库:起始位置、移库两个都需要)
|
/// </summary>
|
/// <param name="type">任务类型 0:入库 1:出库 2:移库 3:PLC申请</param>
|
/// <param name="status">执行状态 0 等待执行 1 正在执行 2 执行完成 3 异常结束 4 任务取消</param>
|
/// <param name="startLocat">起始位置</param>
|
/// <param name="endLocat">目标位置</param>
|
/// <returns></returns>
|
public bool EditLocaetStatus(string type, string status, string startLocat, string endLocat)
|
{
|
try
|
{
|
bool isTrue = false;
|
int upt = 0;
|
StringBuilder sqlString = new StringBuilder();
|
#region 赋值状态
|
|
string start = ""; //起始储位状态
|
string end = ""; //目标储位状态
|
string qita = ""; //用于WMS
|
//修改的状态 0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移除中
|
//任务类型 0入 1出 2移 3 PLC申请
|
switch (type)
|
{
|
case "0"://入库
|
case "3"://PLC入库
|
//任务状态
|
switch (status)
|
{
|
case "0": //等待执行
|
case "1": //正在执行
|
end = "2"; //目标储位状态 //入库中
|
break;
|
case "2": //执行完成
|
end = "1"; //目标储位状态 //有物品
|
break;
|
case "3": //异常结束
|
//不变
|
break;
|
case "4": //取消
|
end = "0"; //目标储位状态 //空储位
|
break;
|
default: //其它
|
break;
|
}
|
|
break;
|
case "1": //出库
|
//任务状态
|
switch (status)
|
{
|
case "0": //等待执行
|
case "1": //正在执行
|
start = "3"; //起始储位状态 出库中
|
break;
|
case "2": //执行完成
|
start = "0"; //起始储位状态 空储位
|
break;
|
case "3": //异常结束
|
//不变
|
break;
|
case "4": //取消
|
start = "1"; //起始储位状态 有物品
|
break;
|
default: //其它
|
break;
|
}
|
|
break;
|
case "2": //移库
|
//任务状态
|
switch (status)
|
{
|
case "0": //等待执行
|
case "1": //正在执行
|
end = "4"; //目标储位状态 移入中
|
start = "5"; //起始储位状态 移出中
|
break;
|
case "2": //执行完成
|
end = "1"; //目标储位状态 有物品
|
start = "0"; //起始储位状态 空储位
|
break;
|
case "3": //异常结束
|
//不变
|
break;
|
case "4": //取消
|
end = "0"; //目标储位状态 空储位
|
start = "1"; //起始储位状态 有物品
|
break;
|
default: //其它
|
break;
|
}
|
|
break;
|
default:
|
|
break;
|
}
|
|
#endregion
|
//验证起始状态或目标状态不为空
|
if (!string.IsNullOrEmpty(end))
|
{
|
sqlString.Append($"update WCSStorageLocat set Status = '{end}' where LocatNo = '{endLocat}';");
|
}
|
if (!string.IsNullOrEmpty(start))
|
{
|
sqlString.Append($"update WCSStorageLocat set Status = '{start}' where LocatNo = '{startLocat}';");
|
}
|
if (!string.IsNullOrEmpty(end) || !string.IsNullOrEmpty(start))
|
{
|
upt = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
}
|
|
if (upt >= 1)
|
{
|
isTrue = true;
|
}
|
return isTrue;
|
}
|
catch (Exception ex)
|
{
|
|
throw ex;
|
}
|
}
|
#endregion
|
|
#region 申请储位
|
|
//申请储位(包含组托的信息)
|
public WCSStorageLocat RequestLocation()
|
{
|
try
|
{
|
#region
|
|
try
|
{
|
WCSStorageLocat locate = new WCSStorageLocat();
|
locate = GetLocateByRoadways();
|
|
return locate;
|
}
|
catch (Exception ex)
|
{
|
throw new Exception(ex.Message);
|
}
|
#endregion
|
|
}
|
catch (Exception e)
|
{
|
throw new Exception(e.Message);
|
}
|
}
|
|
/// <summary>
|
/// 申请储位(包含组托的信息)
|
/// <returns></returns>
|
private WCSStorageLocat GetLocateByRoadways()
|
{
|
try
|
{
|
#region 入库分配规则
|
StringBuilder sqlString = new StringBuilder();
|
WCSStorageLocat locate = new WCSStorageLocat();
|
//string txt = !string.IsNullOrEmpty(roadway) ? $" and RoadwayNo = '{roadway}'" : "";
|
sqlString.Append("select RoadwayNo from WCSStorageLocat where IsDel = '0' and WareHouseNo = 'W01' group by RoadwayNo order by RoadwayNo");
|
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
for (int i = 0; i < dt.Rows.Count; i++)
|
{
|
locate = GetLocateByRoadway(dt.Rows[i]["RoadwayNo"].ToString());
|
if (locate != null)
|
{
|
break;
|
}
|
}
|
}
|
|
#endregion
|
|
return locate;
|
}
|
catch (Exception e)
|
{
|
throw new Exception(e.Message);
|
}
|
}
|
|
/// <summary>
|
/// 取当前巷最优位置
|
/// </summary>
|
/// <param name="roadwayNo">巷道号</param>
|
/// <returns></returns>
|
private WCSStorageLocat GetLocateByRoadway(string roadwayNo)
|
{
|
var str = "''";
|
StringBuilder sqlString = new StringBuilder();
|
//查询该巷道并且标志为正常的的储位
|
do
|
{
|
sqlString.Clear();
|
//var sql = $"select * from WCSStorageLocat where IsDel = 0 and Flag = 0 and [Status] = 0 and RoadwayNo = '{roadwayNo}' and LocatNo not in({str}) ";
|
//sql += "order by ";
|
//sql += "Row , Depth desc, ";
|
sqlString.Append($"select * from WCSStorageLocat where IsDel = 0 and Flag = 0 and [Status] = 0 and RoadwayNo = '{roadwayNo}' and LocatNo not in({str}) order by Row , Depth desc");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
List<WCSStorageLocat> list = (List<WCSStorageLocat>)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt);
|
if (dt != null || dt.Rows.Count >= 1)
|
{
|
foreach (var item in list)
|
{
|
var isOk = LocateIsOk(item);
|
if (isOk)
|
{
|
return item;
|
}
|
else
|
{
|
if (str.Length > 0)
|
{
|
str += ",";
|
}
|
str += $"'{item.LocatNo}'";
|
}
|
}
|
}
|
else
|
{
|
return null;
|
}
|
|
} while (true);
|
}
|
|
|
public bool LocateIsOk(WCSStorageLocat model)
|
{
|
|
if (model.Depth == "01")
|
{
|
return true;
|
}
|
else
|
{
|
//获取深度为1的储位信息
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"select top 1 * from WCSStorageLocat where IsDel = '0' and [Row] = {model.Row} and [Column] = {model.Column} and Layer = {model.Layer} and Depth = '01' ");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
//var locate = db.Queryable<WCSStorageLocat>().First(m => m.IsDel == "0" && m.LocateGroup == model.LocateGroup && m.Depth == "01");
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
return false;
|
}
|
else
|
{
|
//前面储位状态为空且不能是损坏状态的
|
if (dt.Rows[0]["Status"].ToString() == "0" && dt.Rows[0]["Flag"].ToString() != "2")
|
{
|
return true;
|
}
|
else
|
{
|
return false;
|
}
|
}
|
}
|
}
|
|
#endregion
|
|
|
|
#region 标准版数据交互
|
|
|
|
/// <summary>
|
/// 根据托盘号获取组盘信息
|
/// </summary>
|
/// <param name="palletNo"></param>
|
/// <returns></returns>
|
public DataRow GetWcsPalletBind(string palletNo)
|
{
|
try
|
{
|
//select Top 1 * from WCSPalletBind where PalletNo = 'T2300017'
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Clear();
|
sqlString.Append("select Top 1 * from WCSPalletBind ");
|
sqlString.Append($" where palletNo = '{palletNo}' ");
|
sqlString.Append(" order by CreateTime desc ");
|
DataRow aa = DataFactory.SqlDataBase().GetDataRowBySQL(sqlString);
|
return aa;
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
return null;
|
}
|
|
/// <summary>
|
/// 获取空托盘任务信息
|
/// </summary>
|
/// <param name="status">0 等待执行 1 正在执行 2 执行完成 3 异常结束 4 任务取消</param>
|
/// <param name="type">0 入库任务 1 出库任务 2 移库任务</param>
|
/// <param name="lotNo">批次号</param>
|
/// <returns></returns>
|
public DataTable GetWCSSupallTasks(string status, string type, string lotNo = "")
|
{
|
bool bl = false;
|
try
|
{
|
//获取空托盘入库任务
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select top 1 * from WCSTasks ");
|
sqlString.Append($"where Status = '{status}' and IsDel = '0' ");
|
if (lotNo != "")
|
{
|
sqlString.Append($" and LotNo = '{lotNo}' ");
|
}
|
if (type != "")
|
{
|
sqlString.Append($" and Type = '{type}' ");
|
}
|
|
sqlString.Append(" and StartRoadway != '' order by Levels desc,CreateTime asc; ");
|
var taskList = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
//获取数据后清空sqlString
|
sqlString.Clear();
|
//修改空托盘入库任务改为出库任务
|
sqlString.Append($"Update WCSTasks set Type);");
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
bl = true;
|
return taskList;
|
}
|
return null;
|
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
|
return null;
|
}
|
|
/// <summary>
|
/// 获取指定入口货物信息
|
/// </summary>
|
/// <param name="conveyor">入库口</param>
|
/// <returns></returns>
|
public DataTable GetWCSConveyorInfo(string conveyor = "")
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select * from WCSConveyorInfo ");
|
sqlString.Append("where Status = '1' and IsDel = '0' and isEndLot = '0' ");
|
if (!string.IsNullOrWhiteSpace(conveyor))
|
{
|
sqlString.Append($" and Conveyor = '{conveyor}';");
|
}
|
|
return DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "系统错误:");
|
}
|
|
return null;
|
}
|
|
/// <summary>
|
/// 存储托盘组托信息
|
/// </summary>
|
/// <param name="model">组托信息</param>
|
/// <returns>true:成功 false:失败</returns>
|
public bool AddWCSPalletBind(WCSPalletBind model)
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append(@"INSERT INTO WCSPalletBind
|
( LocatNo , PalletNo , SkuQty , SkuWeight , Status , ErrorMsg
|
, TaskType , SkuType , SubPallet , LotNo , LotText , SupplierLot , IsBale ,
|
IsBelt ) VALUES (");
|
sqlString.Append($"'{model.LocatNo}','{model.PalletNo}','{model.SkuQty}','{model.SkuWeight}','{model.Status}',");
|
sqlString.Append($"'{model.ErrorMsg}','{model.TaskType}','{model.SkuType}','{model.SubPallet}','{model.LotNo}',");
|
sqlString.Append($"'{model.LotText}','{model.SupplierLot}','{model.IsBale}','{model.IsBelt}');");
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
bl = true;
|
}
|
}
|
catch (Exception ex)
|
{
|
// 记录日志文件
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "SetWCSPalletBind存储组盘信息失败");
|
|
return bl;
|
|
}
|
|
return bl;
|
}
|
|
/// <summary>
|
/// 调用WMS接口获取储位地址
|
/// </summary>
|
/// <param name="PalletNo">托盘号</param>
|
/// <param name="model">组盘信息</param>
|
/// <param name="endLocat">目标工位号(取货工位)</param>
|
/// <returns>返回wms反馈的信息</returns>
|
public string GetLocation(string palletNo, WCSPalletBind model, ref string endLocat)
|
{
|
try
|
{
|
string returnStr = "";
|
StringBuilder sqlString = new StringBuilder();
|
// 先判断此托盘的任务是否已生成任务
|
sqlString.Append("select * from WCSTasks where Status in ('0','1') and Type = '0' ");
|
sqlString.Append($"and PalletNo = '{palletNo}' and isdel = '0';");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt == null || dt.Rows.Count <= 0)
|
{
|
string json = JsonConvert.SerializeObject(model);
|
var response = Utility.Extra.HttpHelper.DoPost("http://192.168.220.130:8081/api/DownAPi/RequestLocation", json);
|
ResponseTasks taskModels = JsonConvert.DeserializeObject<ResponseTasks>(response);
|
//Logger logger = LogManager.GetCurrentClassLogger();
|
//logger.Error("申请储位原因:", response);
|
if (taskModels.Success == "0")
|
{
|
// 永远只返回一条信息,因为是集合所以用循环插入写法;
|
DALWMSApi dal = new DALWMSApi();
|
WCSTasks task = taskModels.TaskList;
|
|
// 添加任务信息
|
task.StartLocate = model.StationNum;
|
task.LotNo = model.LotNo;
|
task.SupplierLot = model.SupplierLot;
|
task.PalletType = model.SubPallet == "0" ? "0" : "1";
|
WCSResultModel result = dal.AddWcsTask(task);
|
if (result.stateCode == "1")
|
{
|
endLocat = task.EndRoadway;
|
returnStr = "托盘号:" + palletNo + "\n" + "储位地址:" + task.EndLocate + "\n";
|
// 插入组托信息
|
this.AddWCSPalletBind(model);
|
|
// 插入任务明细表
|
WCSTasksMonitor tasksMonitor = new WCSTasksMonitor();
|
tasksMonitor.TaskNo = task.TaskNo;
|
tasksMonitor.PlcId = int.Parse(model.PlcId);
|
tasksMonitor.PlcName = model.StationNum;
|
tasksMonitor.StartLocat = model.StationNum;
|
tasksMonitor.InteractiveMsg = "向WMS申请储位信息成功";
|
tasksMonitor.PalletNo = palletNo;
|
tasksMonitor.EndLocat = task.EndLocate;
|
tasksMonitor.Status = "2"; // 执行完成
|
this.AddWCSTasksMonitor(tasksMonitor);
|
}
|
else
|
{
|
returnStr = "-1:" + result.errMsg;
|
return returnStr;
|
}
|
|
}
|
else
|
{
|
returnStr = "-1:" + taskModels.Message;
|
return returnStr;
|
}
|
}
|
else
|
{
|
endLocat = dt.Rows[0]["EndRoadway"].ToString();
|
}
|
|
// 确定取货工位
|
switch (endLocat)
|
{
|
case "R11":
|
endLocat = "2";
|
break;
|
case "R12":
|
endLocat = "6";
|
break;
|
case "R13":
|
endLocat = "10";
|
break;
|
}
|
|
// 记录日志文件
|
returnStr = endLocat;
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(returnStr, "申请储位");
|
|
return returnStr;
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "程序异常:申请储位失败!");
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 调用WMS接口申请空托盘垛
|
/// </summary>
|
/// <param name="skuNo">物料号</param>
|
/// <param name="endLocat">送货工位号</param>
|
/// <returns></returns>
|
public string GetSupperPalletLocation(string skuNo = "", string endLocat = "")
|
{
|
try
|
{
|
return "";
|
//string returnStr = "";
|
//StringBuilder sqlString = new StringBuilder();
|
//sqlString.Clear();
|
//string json = JsonConvert.SerializeObject(skuNo);
|
//var response = Utility.Extra.HttpHelper.DoPost("http://192.168.220.130:8081/api/DownAPi/PalletLocation", json);
|
////var response = Utility.Extra.HttpHelper.DoPost("http://localhost:13243/api/DownAPi/PalletLocation", json);
|
//var taskModels = JsonConvert.DeserializeObject<Tasks>(response);
|
|
|
//if (taskModels.Success == "0")
|
//{
|
// if (taskModels.Message == "任务已申请!")
|
// {
|
// return null;
|
// }
|
// // 永远只返回一条信息,因为是集合所以用循环插入写法;
|
// DALWMSApi dal = new DALWMSApi();
|
// foreach (var item in taskModels.TaskList)
|
// {
|
// WCSTasks task = item;
|
// //根据托盘号获取
|
|
// // 添加任务信息
|
// task.EndLocat = item.EndLocat != "" ? item.EndLocat : skuNo == "100099" ? "41" : skuNo == "100098" ? "23" : "33";
|
// task.LotNo = "";
|
// task.SupplierLot = "";
|
// task.PalletType = "";
|
// WCSResultModel result = dal.AddWcsTask(task);
|
// if (result.stateCode == "1")
|
// {
|
// endLocat = task.EndRoadway;
|
// returnStr = "托盘号:" + task.PalletNo + "\n" + "储位地址:" + task.StartLocat + "\n";
|
|
// // 插入任务明细表
|
// WCSTasksMonitor tasksMonitor = new WCSTasksMonitor();
|
// tasksMonitor.TaskNo = task.TaskNo;
|
// tasksMonitor.PlcId = 0;
|
// tasksMonitor.PlcName = "";
|
// tasksMonitor.StartLocat = task.StartLocat;
|
// tasksMonitor.InteractiveMsg = "向WMS申请空托盘信息成功";
|
// tasksMonitor.PalletNo = task.PalletNo;
|
// tasksMonitor.EndLocat = task.EndLocat;
|
// tasksMonitor.Status = "2"; // 执行完成
|
// this.AddWCSTasksMonitor(tasksMonitor);
|
// }
|
// else
|
// {
|
// returnStr = "-1:" + result.errMsg;
|
// return returnStr;
|
// }
|
|
// // 确定取货工位
|
// switch (task.StartRoadway)
|
// {
|
// case "R11":
|
// endLocat = "3";
|
// break;
|
// case "R12":
|
// endLocat = "4";
|
// break;
|
// case "R13":
|
// endLocat = "11";
|
// break;
|
// }
|
|
// // 记录日志文件
|
// returnStr += "目标位置:" + endLocat + "\n";
|
// Logger logger = LogManager.GetCurrentClassLogger();
|
// logger.Error(returnStr, "申请空托盘");
|
|
|
// }
|
|
// return returnStr;
|
|
|
//}
|
//else
|
//{
|
// returnStr = "-1:" + taskModels.Message;
|
// return returnStr;
|
//}
|
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "程序异常:申请空托盘失败!");
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 获取报警基础信息
|
/// </summary>
|
/// <returns>报警信息基础表</returns>
|
public DataTable GetWcsAlarmInfo()
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select * from WCSAlarmInfo order by PlcIP;");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
return dt;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
|
|
|
|
|
#endregion
|
|
#region 07版本,标准版弄好后删除
|
|
|
/// <summary>
|
/// 获取未完成的任务自动
|
/// </summary>
|
/// <param name="state">任务状态0:未下发 1:已下发 3:已完成</param>
|
/// <returns>任务信息</returns>
|
public DataTable GetWmsTasks(string state, string taskType, string Palno = "")
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select top 1 * from TaskMonitor ");
|
sqlString.Append("where State = '" + state + "' and Source = 'WMS' and IsDel = '0' ");
|
if (Palno != "")
|
{
|
sqlString.Append(" and Palno = '" + Palno + "' ");
|
}
|
sqlString.Append(" and taskType = '" + taskType + "' ");
|
sqlString.Append(" order by PriorityLevel desc,CreateTime asc; ");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
return null;
|
}
|
|
return dt;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 根据出入库口获取正在执行的出入库任务
|
/// </summary>
|
/// <param name="InitialAddre">通道口</param>
|
/// <param name="taskType">in:入库 out:出库</param>
|
/// <returns>true:不存在任务 false:存在任务</returns>
|
public bool GetTasks(string InitialAddre, string taskType)
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select * from TaskMonitor ");
|
sqlString.Append("where State = '1' and Source = 'WMS' and IsDel = '0' ");
|
sqlString.Append("and taskType = '" + taskType + "' and InitialAddre = '" + InitialAddre + "' ");
|
sqlString.Append("order by PriorityLevel desc,CreateTime asc; ");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
bl = true;
|
}
|
|
return bl;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 创建任务
|
/// </summary>
|
/// <param name="taskModel">任务表实体类</param>
|
public int SetTaskMonitor(TaskMonitorDto taskModel)
|
{
|
try
|
{
|
int isSucceed = 0;
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append(@"INSERT INTO TaskMonitor(TaskNo,TaskType,InitialAddre
|
, Palno, TargetAddre, State, IsSucceed, ErrorStr, PriorityLevel, Source
|
, Demo, CreateTime, IsDel) values ('");
|
sqlString.Append(taskModel.TaskNo + "','" + taskModel.TaskType + "','" + taskModel.InitialAddre + "','");
|
sqlString.Append(taskModel.Palno + "','" + taskModel.TargetAddre + "',0,'0','0','0','WMS','',GETDATE(),'0')");
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
return isSucceed;
|
}
|
else
|
{
|
return -1;
|
}
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 更新任务状态
|
/// </summary>
|
/// <param name="TrayCode">托盘号</param>
|
/// <param name="StateValue">任务状态</param>
|
/// <returns>true:成功 flase:失败</returns>
|
public bool SetWmsTasks(string TrayCode, string StateValue)
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("Update TaskMonitor set State = '" + StateValue + "' where Palno = '" + TrayCode + "' and State != '3';");
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
bl = true;
|
}
|
|
return bl;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 获取报警基础信息
|
/// </summary>
|
/// <returns>报警信息基础表</returns>
|
public DataTable GetErrorInfor()
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select * from [CS_AlarmInfo] order by M;");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
return dt;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 向报警表写入错误信息
|
/// </summary>
|
public void SetErrorMessage(string errorType, string errorCode, string messageStr)
|
{
|
try
|
{
|
// State: 0=未处理 1=已处理
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("insert into CS_Alarm (Name,ErrorCode,AlarmName,State) ");
|
sqlString.Append("VALUES ('" + errorType + "','" + errorCode + "','" + messageStr + "','0');");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 判断当前报警信息是否已存在
|
/// </summary>
|
/// <param name="errorCode">MB点位</param>
|
/// <returns>false:不存在 true:已存在</returns>
|
public bool GetErrorMessage(string errorCode)
|
{
|
bool bl = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("select count(*) from CS_Alarm where errorCode = '" + errorCode + "';");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt.Rows[0][0].ToString() != "0")
|
{
|
bl = true;
|
}
|
|
return bl;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 删除跺机和运输线所有报警信息
|
/// </summary>
|
public void DelErrorMessage()
|
{
|
try
|
{
|
// State: 0=未处理 1=已处理
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append("delete from CS_Alarm;");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 通知wms任务完成
|
/// </summary>
|
/// <param name="palNo">托盘号</param>
|
/// <param name="locationCode">储位地址</param>
|
/// <param name="taskType">任务类型 1 入库任务 2:出库任务</param>
|
public void WcsinWms(string palNo, string locationCode, string taskType)
|
{
|
try
|
{
|
string returnStr = "";
|
DALWMSApi api = new DALWMSApi();
|
var LocationModel = new ApiLocationModel();
|
if (taskType == "1")
|
{
|
// 入库完成
|
LocationModel = api.PutStorage(palNo, locationCode);
|
}
|
else
|
{
|
// 出库完成
|
LocationModel = api.OutStorage(palNo, locationCode);
|
}
|
|
if (LocationModel.Code == "01")
|
{
|
returnStr = "托盘号:'" + palNo + "'任务完成";
|
}
|
else
|
{
|
this.SetErrorMessage(LocationModel.OutMode, LocationModel.Code, palNo + "任务失败!");
|
returnStr = "托盘号:'" + palNo + "'任务失败";
|
//switch (LocationModel.Code)
|
//{
|
// case "-11": returnStr = palNo + ":-11参数错误!"; break;
|
// case "-101": returnStr = palNo + ":-101无组盘信息!"; break;
|
// case "-102": returnStr = palNo + ":-102非仓库托盘"; break;
|
// default: break;
|
//}
|
}
|
|
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 调用WMS接口获取储位地址
|
/// </summary>
|
/// <param name="Palno">托盘号</param>
|
/// <returns>返回wms反馈的信息</returns>
|
public string GetLocation(string palNo, string height, string inPort)
|
{
|
try
|
{
|
string returnStr = "";
|
// 向WMS申请储位
|
LocationInfo location = new LocationInfo();
|
location.palNo = palNo;
|
location.height = int.Parse(height);
|
string json = JsonConvert.SerializeObject(location);
|
DALWMSApi api = new DALWMSApi();
|
var LocationModel = api.GetLocation(palNo, int.Parse(height));
|
// Liudl 2022-12-31 Edit 接口调用改为程序内部调用
|
//var response = Utility.Extra.HttpHelper.DoPost("192.168.1.35:57061/api/WMSApi/getLocation", json);
|
//ApiLocationModel LocationModel = JsonConvert.DeserializeObject<ApiLocationModel>(response);
|
// 判断储位是否申请成功 01:成功 -11:参数错误 -101:没有组盘信息 -102:没有此托盘
|
if (LocationModel.Code == "01")
|
{
|
// 生成入库任务,插入任务表
|
TaskMonitorDto taskModel = new TaskMonitorDto();
|
taskModel.TaskNo = "in";
|
taskModel.TaskType = "in";
|
taskModel.InitialAddre = inPort;
|
taskModel.Palno = palNo;
|
taskModel.TargetAddre = LocationModel.LocationCode;
|
taskModel.State = "0";
|
taskModel.IsSucceed = LocationModel.Code;
|
taskModel.ErrorStr = LocationModel.OutMode;
|
taskModel.PriorityLevel = 0;
|
taskModel.Source = "WMS";
|
taskModel.IsDel = 0;
|
|
this.SetTaskMonitor(taskModel);
|
|
returnStr = "托盘号:'" + palNo + "'申请储位成功,储位地址为:'" + LocationModel.LocationCode + "'";
|
}
|
else
|
{
|
// 向led屏幕插入信息 Liudl 未完成
|
// 插入报警信息
|
this.SetErrorMessage(LocationModel.OutMode, LocationModel.Code, palNo + "申请储位地址失败!");
|
switch (LocationModel.Code)
|
{
|
case "-11": returnStr = palNo + ":-S11参数错误!"; break;
|
case "-101": returnStr = palNo + ":-S101无组盘信息!"; break;
|
case "-102": returnStr = palNo + ":-S102非仓库托盘"; break;
|
default: break;
|
}
|
}
|
|
// 记录日志文件
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(returnStr, "申请储位");
|
|
return returnStr;
|
}
|
catch (Exception ex)
|
{
|
Logger logger = LogManager.GetCurrentClassLogger();
|
logger.Error(ex.Message, "程序异常:申请储位失败!");
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 判断此托盘是否已分配任务
|
/// </summary>
|
/// <param name="palNo">托盘号</param>
|
/// <returns></returns>
|
public string IsTaskMonitor(string palNo)
|
{
|
string Location = "";
|
try
|
{
|
StringBuilder strSQL = new StringBuilder();
|
strSQL.Append($"select TargetAddre from TaskMonitor where Palno ='{palNo}' and TaskType = 'in' and IsDel = '0' and State <> '3';");
|
DataTable dtI = DataFactory.SqlDataBase().GetDataTableBySQL(strSQL);
|
if (dtI != null && dtI.Rows.Count > 0)
|
{
|
Location = "托盘号:'" + palNo + "'申请储位成功,储位地址为:'" + dtI.Rows[0]["TargetAddre"] + "'";
|
}
|
|
return Location;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
#endregion
|
|
|
#region 分拣方法
|
/// <summary>
|
/// 查询任务是否绑定并获取分道
|
/// </summary>
|
/// <param name="barcode">条码信息</param>
|
/// <returns></returns>
|
public string GetBarcodeAndRoute(string barcode)
|
{
|
StringBuilder sqlString = new StringBuilder();
|
try
|
{
|
sqlString.Append($"select * from WCSBoxInfo where BoxNo = '{barcode}' ;");
|
DataRow row = DataFactory.SqlDataBase().GetDataRowBySQL(sqlString);
|
//已获取箱支关系
|
if (row != null)
|
{
|
sqlString.Clear();
|
DataTable dt2 = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
var SkuNo = dt2.Rows[0]["SkuNo"].ToString();
|
var LotNo = dt2.Rows[0]["LotNo"].ToString();
|
var SkuName = dt2.Rows[0]["SkuName"].ToString();
|
var EndLotFlag = dt2.Rows[0]["EndLotFlag"].ToString(); //结批标识0:未结批,1:已结批
|
//更改分拣任务状态为预结批
|
if (EndLotFlag == "1")
|
{
|
sqlString.Clear();
|
sqlString.Append($"update WCSPickLinoBind set IDState = '2' where SkuNo = '{SkuNo}' and LotNo = '{LotNo}';");
|
int count = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (count == 0)
|
{
|
return "4";
|
}
|
}
|
|
sqlString.Append($"select * from WCSPickLinoBind where SkuNo = '{SkuNo}' and LotNo = '{LotNo}' and IDState = '1' ;");
|
int rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
//箱码已绑定
|
if (rowCount >= 1)
|
{
|
//下发分道信息(预留:在同一种物料绑定多个通道时,通过随机数,随机分配物料已绑定的道号)
|
//PS:需要和PLC确定访问方式,分配完成后是否需要清空扫码仪缓存位,如果不清空,则需要在
|
//WcsBoxInfo表中添加“已分配状态”,用来控制每次的分道号和上次分配的是一样的
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
int[] array = new int[rowCount];
|
|
for (int j = 0; j < rowCount; j++)
|
{
|
array[j] = int.Parse(dt.Rows[j]["LineDao"].ToString());
|
}
|
Random random = new Random();
|
int randomIndex = random.Next(0, array.Length);
|
int randomElement = array[randomIndex];
|
Console.WriteLine("随机取出的分道为: " + randomElement);
|
|
//给PLC下发道号码垛规则等信息
|
string lineDao = randomElement.ToString();
|
PickLinoBind LineInfo = new PickLinoBind();
|
LineInfo.Chang = dt.Rows[randomElement]["Chang"].ToString();
|
LineInfo.Kuan = dt.Rows[randomElement]["Kuan"].ToString();
|
LineInfo.Gao = dt.Rows[randomElement]["Gao"].ToString();
|
//通过PLC提供的地址写入
|
//写入………
|
|
|
return "0";
|
}
|
//箱码未绑定
|
else
|
{
|
//自动绑定分道,并下发给PLC道号
|
sqlString.Clear();
|
sqlString.Append($"select * from WCSPickLino where PickType = 0 and Picked < '4' and IDState =0 ;");
|
rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
|
if (rowCount >= 1)//有可分配的码垛工位
|
{
|
|
//获取码垛规则
|
StringBuilder skuSql = new StringBuilder();
|
skuSql.Append($"select * from WCSMaterialRules where SkuNo = '{SkuNo}' and IsDel = '0' ;");
|
DataTable sku = DataFactory.SqlDataBase().GetDataTableBySQL(skuSql);
|
if (sku == null || sku.Rows.Count == 0)
|
{
|
return "1";//未获取到该品种码垛规则,需要人工维护
|
}
|
|
//创建到PickLindBind表该物料的绑定任务
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
//查找可用道号
|
int[] array = { 1, 2, 3, 4 };
|
StringBuilder LineDao = new StringBuilder();
|
LineDao.Append($"select * from WCSPickLinoBind where " +
|
$"PickLinoID = {int.Parse(dt.Rows[0]["ID"].ToString())} and LineDao = {""}");
|
DataTable dt1 = DataFactory.SqlDataBase().GetDataTableBySQL(skuSql);
|
|
PickLinoBind locat = new PickLinoBind()
|
{
|
PickLinoID = int.Parse(dt.Rows[0]["ID"].ToString()),
|
TaskNo = "固定值,测试",
|
Type = "固定值,测试",
|
LotNo = LotNo,
|
SkuNo = SkuNo,
|
SkuName = SkuName,
|
Chang = sku.Rows[0]["Chang"].ToString(),//……需要修改通过物料
|
Kuan = sku.Rows[0]["Kuan"].ToString(),
|
Gao = sku.Rows[0]["Gao"].ToString(),
|
AddTime = DateTime.Parse(DateTime.Now.ToString()),
|
IDState = "1",
|
LineDao = dt1.Rows[0]["LineDao"].ToString(),
|
Level = "1",
|
};
|
//将locat insert到pickLinoBind中
|
// 插入任务明细表
|
sqlString.Clear();
|
sqlString.Append(@"INSERT INTO WCSPickLinoBind
|
( PickLinoID , TaskNo , Type , LotNo , SkuNo , SkuName
|
, Chang,Kuan,Gao,AddTime,IDState,LineDao,Level) VALUES (");
|
sqlString.Append($"{locat.PickLinoID},{locat.TaskNo},'{locat.Type}','{locat.LotNo}','{locat.SkuNo}',");
|
sqlString.Append($"'{locat.SkuName}','{locat.Chang}','{locat.Kuan}','{locat.Gao}',{locat.AddTime},");
|
sqlString.Append($"'1','{locat.LineDao}','1');");
|
rowCount = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (rowCount > 0)
|
{
|
//给PLC下发道号码垛规则等信息
|
string lineDao = locat.LineDao;
|
PickLinoBind LineInfo = new PickLinoBind();
|
LineInfo.Chang = locat.Chang;
|
LineInfo.Kuan = locat.Kuan;
|
LineInfo.Gao = locat.Gao;
|
//通过PLC提供的地址写入
|
//写入………
|
|
return "0";
|
}
|
else
|
{
|
return "3";
|
}
|
|
}
|
else//码垛工位已满,不分配
|
{
|
return "2";
|
}
|
}
|
}
|
//未获取箱支关系
|
else
|
{
|
//未获取到箱码信息,调用赋码系统接口程序获取箱信息,并将箱信息写入WCSPickLinoBind表中
|
WcsBoxInfo BoxInfo = new WcsBoxInfo();
|
BoxInfo = GetBoxInfo(barcode);
|
return "5";
|
}
|
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 机器人请求插码
|
/// </summary>
|
/// <param name="model">任务信息</param>
|
/// <returns></returns>
|
public string GetBarcodeIN(string barcode, string palletNo)
|
{
|
StringBuilder sqlString = new StringBuilder();
|
try
|
{
|
if (palletNo.Length > 8)
|
{
|
return "1";//托盘号错误
|
}
|
if (CheckBarcodeRepeat(barcode))
|
{
|
return "2";//箱码重复
|
}
|
//允许插码,更改箱支关系表中此箱码Aflag状态为2
|
sqlString.Append($"UPDATE WCSBoxInfo set Aflag = '2' where BoxNo = '{barcode}' and Aflag = '1' and Status = '0';");
|
int IsUptLocate = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
|
if (IsUptLocate == 1)
|
{
|
return "0";
|
}
|
else
|
{
|
return "3";//修改插码状态失败
|
}
|
}
|
catch (Exception)
|
{
|
|
throw;
|
}
|
}
|
|
public bool CheckBarcodeRepeat(string barcode)
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"select * from WCSBoxInfo where BoxNo = '{barcode}' and Aflag in ('0','2');");//查找当前箱码是否 0:未分道或 2:已插码
|
DataRow row = DataFactory.SqlDataBase().GetDataRowBySQL(sqlString);
|
if (row == null)
|
{
|
return false;
|
}
|
return true;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 组盘
|
/// </summary>
|
/// <param name="model">任务信息</param>
|
/// <returns></returns>
|
public bool GroupPallno(string stationNum, string palletNo)
|
{
|
bool T = false;
|
StringBuilder sqlString = new StringBuilder();
|
try
|
{
|
sqlString.Append($"select * form WCSPickLinoBind where LineDao = '{stationNum}'");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
var Sku = dt.Rows[0]["Sku"].ToString();
|
var LotNo = dt.Rows[0]["LotNo"].ToString();
|
|
//判断箱支表已插码未组盘的当前托盘号箱信息
|
sqlString.Clear();
|
sqlString.Append($"select * from WCSBoxInfo where Sku = '{Sku}' and LotNo = '{LotNo}'" +
|
$" and PalletNo = '{palletNo}' and Aflag = '2'");
|
DataTable dt1 = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt1.Rows.Count == 0)
|
{
|
return T;//空托盘不需要组盘
|
}
|
|
//提交组盘信息……
|
foreach (var item in dt1.Rows)
|
{
|
//提交当前托盘上的箱支关系
|
if (GroupBoxInfo(palletNo))
|
{
|
//提交成功后更改组盘状态
|
sqlString.Clear();
|
sqlString.Append($"UPDATE WCSBoxInfo set Status = '1' where Sku = '{Sku}' and LotNo = '{LotNo}'" +
|
$" and PalletNo = '{palletNo}' and Aflag = '2'");
|
int count = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (count == 0)
|
{
|
return T;//修改组盘状态失败
|
}
|
T = true;
|
}
|
}
|
return T;
|
}
|
catch (Exception ex)
|
{
|
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 向WMS提交组盘信息
|
/// </summary>
|
/// <param name="palletNo"></param>
|
/// <returns></returns>
|
public bool GroupBoxInfo(string palletNo)
|
{
|
try
|
{
|
//获取是否存在当前箱码信息
|
StringBuilder sqlString = new StringBuilder();
|
sqlString.Append($"select * from WcsBoxInfo where IsDel = '0' and PalletNo = '{palletNo}' ");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
//调用WMS系统
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/RequestLocation", palletNo);
|
WcsBoxInfo boxInfo = JsonConvert.DeserializeObject<WcsBoxInfo>(response);
|
|
//添加箱码信息
|
sqlString.Clear();
|
sqlString.Append("insert into WcsBoxInfo (OrderCode,Line_No,LineDao,PORT,BoxNo,BoxNo2,BoxNo3,PalletNo,Qty,FullQty,Aflag,Status,SkuNo,SkuName,LotNo,LotText,Custom,CustomName,ProductionTime,ExpirationTime,CompleteTime,InspectMark,BitBoxMark,Standard,PackageStandard,StoreTime,QtyCount,QtyOrd,Opuser,IsDel,CreateTime,CreateUser,UpdateTime,UpdateUser)");
|
sqlString.Append($"Values ('{boxInfo.OrderCode}','{boxInfo.Line_No}','{boxInfo.LineDao}','{boxInfo.PORT}','{boxInfo.BoxNo}','{boxInfo.BoxNo2}','{boxInfo.BoxNo3}','','{boxInfo.Qty}','{boxInfo.FullQty}','{boxInfo.Aflag}','{boxInfo.Status}','{boxInfo.SkuNo}','{boxInfo.SkuName}','{boxInfo.LotNo}','{boxInfo.LotText}','{boxInfo.Custom}','{boxInfo.CustomName}','{boxInfo.ProductionTime}','{boxInfo.ExpirationTime}','{boxInfo.CompleteTime}','{boxInfo.InspectMark}','{boxInfo.BitBoxMark}','{boxInfo.Standard}','{boxInfo.PackageStandard}','{boxInfo.StoreTime}','{boxInfo.QtyCount}','{boxInfo.QtyOrd}','{boxInfo.Opuser}','0',getdate(),null,null,null)");
|
int isAdd = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
if (isAdd == 1)
|
{
|
return true;
|
}
|
else
|
{
|
return false;
|
}
|
|
|
}
|
else
|
{
|
return false;
|
}
|
}
|
catch (Exception ex)
|
{
|
|
throw ex;
|
}
|
}
|
|
#endregion
|
}
|
|
/// <summary>
|
/// 返回wms实体类
|
/// </summary>
|
public class ExportLibraryDto
|
{
|
/// <summary>
|
/// 任务号
|
/// </summary>
|
public string TaskNo { get; set; }
|
/// <summary>
|
/// 任务类型
|
/// </summary>
|
public string TaskType { get; set; }
|
/// <summary>
|
/// 托盘编码
|
/// </summary>
|
public string StockCode { get; set; }
|
/// <summary>
|
/// 储位编码
|
/// </summary>
|
public string SlotCode { get; set; }
|
/// <summary>
|
/// 目标地址(可能是仓库口、可能是移库后的储位)
|
/// </summary>
|
public string TargetPosition { get; set; }
|
/// <summary>
|
/// 托盘要经过的巷道口
|
/// </summary>
|
public string LaneWayPosition { get; set; }
|
/// <summary>
|
/// 目标储位经过的巷道口
|
/// </summary>
|
public string TargetLaneWayPosition { get; set; }
|
|
public int Order { get; set; }
|
|
}
|
|
/// <summary>
|
/// 任务监控实体类
|
/// </summary>
|
public class TaskMonitorDto
|
{
|
/// <summary>
|
/// 任务号
|
/// </summary>
|
public string TaskNo { get; set; }
|
/// <summary>
|
/// 任务类型
|
/// </summary>
|
public string TaskType { get; set; }
|
/// <summary>
|
/// 托盘编码
|
/// </summary>
|
public string Palno { get; set; }
|
/// <summary>
|
/// 起始地址
|
/// </summary>
|
public string InitialAddre { get; set; }
|
/// <summary>
|
/// 目标地址
|
/// </summary>
|
public string TargetAddre { get; set; }
|
|
/// <summary>
|
/// 状态 01等待 02进行中 03已完成
|
/// </summary>
|
public string State { get; set; }
|
|
/// <summary>
|
/// 是否成功
|
/// </summary>
|
public string IsSucceed { get; set; }
|
|
/// <summary>
|
/// 错误信息
|
/// </summary>
|
public string ErrorStr { get; set; }
|
|
/// <summary>
|
/// 优先级
|
/// </summary>
|
public int? PriorityLevel { get; set; }
|
|
/// <summary>
|
/// 来源
|
/// </summary>
|
public string Source { get; set; }
|
|
/// <summary>
|
/// 是否成功
|
/// </summary>
|
public string Demo { get; set; }
|
|
/// <summary>
|
/// 是否删除
|
/// </summary>
|
public int? IsDel { get; set; }
|
}
|
|
/// <summary>
|
/// 申请储位实体类
|
/// </summary>
|
public class LocationInfo
|
{
|
/// <summary>
|
/// 托盘号
|
/// </summary>
|
public string palNo { get; set; }
|
/// <summary>
|
/// 高度
|
/// </summary>
|
public int height { get; set; }
|
}
|
}
|