diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 3e88fe5..9b73922 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -7614,6 +7614,79 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer } #endregion + #region 叉车搬运结束后回调(入库) + public static ForkLiftResult ForkLiftTaskEndIn(ForkLiftCallBackModel JsonData, string Jsonstr) + { + var language = LanguageHelper.GetName("WMSAPIInfo"); + DataTable table = new DataTable(); + string msg = ""; + using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString)) + { + conn.Open(); + SqlCommand cmd = new SqlCommand(); + cmd.Connection = conn; + try + { + #region 记录叉车回调日志 + string logsql = @"INSERT INTO ICSForkLiftCallBackLog + (ID,TaskID,InputJSON,Result,Message) + SELECT NEWID(),'{0}','{1}','',''"; + logsql = string.Format(logsql, JsonData.TaskID, Jsonstr); + DBHelper.ExecuteNonQuery(connString, CommandType.Text, logsql); + #endregion + ForkLiftResult res = new ForkLiftResult(); + if (string.IsNullOrEmpty(JsonData.TaskID)) + { + msg = "传入AGV任务ID不能为空!"; + } + if (msg != "") + { + #region 更新叉车回调日志 + logsql = @"update ICSForkLiftCallBackLog set Result='失败',Message='{1}' + where TaskID='{0}'"; + logsql = string.Format(logsql, JsonData.TaskID, msg); + DBHelper.ExecuteNonQuery(connString, CommandType.Text, logsql); + #endregion + res.Ret = 0; + res.RetMsg = msg;// "接口调用失败!"; + return res; + } + else + { + ICSWareHouseLotInfoService.ActionForkLiftTaskEnd(JsonData.TaskID, cmd, language); + } + res.Ret = 1; + res.RetMsg = "success";// "接口调用成功!"; + return res; + } + catch (Exception ex) + { + #region 更新叉车回调日志 + string logsql = @"update ICSForkLiftCallBackLog set Result='失败',Message='{1}' + where TaskID='{0}'"; + logsql = string.Format(logsql, JsonData.TaskID, ex.Message); + DBHelper.ExecuteNonQuery(connString, CommandType.Text, logsql); + #endregion + if (cmd.Transaction != null) + cmd.Transaction.Rollback(); + log.Error(ex.Message); + ForkLiftResult res = new ForkLiftResult(); + res.Ret = 0; + res.RetMsg = ex.Message;// "接口调用失败!"; + return res; + } + finally + { + if (conn.State == ConnectionState.Open) + { + conn.Close(); + } + conn.Dispose(); + } + } + } + #endregion + #region 形态转换源头单据信息 /// /// 形态转换源头单据信息 @@ -8347,7 +8420,7 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer ,SUM(A.Quantity) AS Quantity from ICSWareHouseLotInfo A INNER JOIN ICSInventoryLot B ON B.LotNo=A.LotNo AND B.WorkPoint=A.WorkPoint INNER JOIN ICSExtension C ON C.ID=B.ExtensionID AND C.WorkPoint=B.WorkPoint - where 1=1 "; + where A.Quantity>0 AND 1=1 "; if (!string.IsNullOrEmpty(JsonData.INVCode)) { sql += $@" AND A.InvCode='{JsonData.INVCode}'"; @@ -8442,7 +8515,7 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer ,SUM(A.Quantity) AS Quantity from ICSWareHouseLotInfoLog A INNER JOIN ICSInventoryLot B ON B.LotNo=A.LotNo AND B.WorkPoint=A.WorkPoint INNER JOIN ICSExtension C ON C.ID=B.ExtensionID AND C.WorkPoint=B.WorkPoint - where TransCode in (select DocNO from #temp) + where TransCode in (select DocNO from #temp) AND SUM(A.Quantity)>0 and TransType=3 AND BusinessCode IN ('6','19','24','14','21') "; if (!string.IsNullOrEmpty(JsonData.INVCode)) { diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/ForkLiftCallBackModel.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/ForkLiftCallBackModel.cs new file mode 100644 index 0000000..078097b --- /dev/null +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/ForkLiftCallBackModel.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ICSSoft.Entity +{ + public class ForkLiftCallBackModel + { + /// + ///叉车编号 + /// + public string ForkliftCode { get; set; } + + /// + /// 仓库编号 + /// + public string WareCode { get; set; } + /// + /// 巷道 + /// + public string LaneCode { get; set; } + /// + /// 任务编号 + /// + public string TaskID { get; set; } + /// + /// 任务类型【PTWY上架,RETN返仓,INTL移库,PICK出库,INVE盘点】 + /// + public string TaskType { get; set; } + /// + /// 托盘号 + /// + public string PalletID { get; set; } + /// + /// 源地址 + /// + public string SourceBin { get; set; } + /// + /// 目标地址 + /// + public string DestBin { get; set; } + /// + /// 任务下发时间 + /// + public DateTime DownTime { get; set; } + /// + /// 任务状态 + /// + public string Status { get; set; } + } +} diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/ForkLiftResult.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/ForkLiftResult.cs new file mode 100644 index 0000000..8aa60bf --- /dev/null +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/ForkLiftResult.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ICSSoft.Entity +{ + public class ForkLiftResult + { + /// + /// 结果编码(0:成功) + /// + public int Ret { get; set; } + /// + /// 返回信息 + /// + public string RetMsg { get; set; } + } + + +} diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs index e1b6d01..e15aa47 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs @@ -23,6 +23,7 @@ namespace ICSSoft.WebAPI.Controllers HttpResponseMessage result = new HttpResponseMessage(); Result res = new Result(); AGVResult agvres = new AGVResult(); + ForkLiftResult forkliftres = new ForkLiftResult(); string str = string.Empty; /// /// 多语言 diff --git a/WMS-BS/NFine.Application/WMS/ICSToSAPApp .cs b/WMS-BS/NFine.Application/WMS/ICSToSAPApp .cs index bb27be6..bd5cf6d 100644 --- a/WMS-BS/NFine.Application/WMS/ICSToSAPApp .cs +++ b/WMS-BS/NFine.Application/WMS/ICSToSAPApp .cs @@ -82,7 +82,7 @@ namespace NFine.Application.WMS INNER JOIN ICSExtension C ON C.ID=B.ExtensionID AND C.WorkPoint=B.WorkPoint where BusinessCode='19' AND TransCode='{0}' and TransSequence='{1}' and A.WorkPoint='{2}'"; - lotsql = string.Format(lotsql, dr["SDNCode"].ToString(), dr["SAPSequence"].ToString(), WorkPoint); + lotsql = string.Format(lotsql, dr["SDNCode"].ToString(), dr["Sequence"].ToString(), WorkPoint); DataTable lotdt = SqlHelper.GetDataTableBySql(lotsql); foreach (DataRow lotdr in lotdt.Rows) {