zhaowc
2025-05-20 d09a1552e45e6cfc8f83c0249cd296b8706c0dc2
Wms/WMS.BLL/BllTransServer/HopperTransportServer.cs
@@ -217,7 +217,7 @@
        /// <param name="lotNo">批次</param>
        /// <param name="userId">操作人</param>
        /// <exception cref="Exception"></exception>
        public void jiaoLiaoHopper(string areaNo,string endLocate,string plnStatus,string standard,string skuNo,string lotNo,string url,int userId)
        public void jiaoLiaoHopper(string areaNo,string endLocate,string plnStatus,string standard,string skuNo,string lotNo,string url, string bindUrl, int userId)
        {
            try
            {
@@ -306,7 +306,7 @@
                    {
                        throw new Exception("未找到对应桶信息");
                    }
                    resultYi = YikuTask(palletModel.PalletNo, taskNo, url);
                    resultYi = YikuTask(palletModel.PalletNo, taskNo, url,bindUrl);
                }
                #endregion
                //起始储位地址信息
@@ -358,6 +358,10 @@
                    string agvMsg = string.Empty;
                    //给下车下发任务
                    logTaskEntry.SendDate = DateTime.Now;//发送时间
                    //下发载具类型
                    var bind = RcsHelper.BindPalletAndSite(palletModel.PalletNo, palletModel.LocatNo, url, out string agvBindMsg);
                    if (bind)
                    {
                    var agvResult = RcsHelper.CreateTaskForAgv(task, url, out agvMsg);
                    if (agvResult)//成功
                    {
@@ -382,6 +386,14 @@
                        Db.Insertable(logTaskEntry).ExecuteCommand();
                    }
                }
                    else
                    {
                        logTaskEntry.IsSuccess = 0;
                        logTaskEntry.Information = "货架与货位绑定失败,原因:"+agvBindMsg;
                        Db.Insertable(logTaskEntry).ExecuteCommand();
                    }
                }
                //提交事务
                Db.CommitTran();
            }
@@ -405,7 +417,7 @@
        /// <param name="lotNo">批次</param>
        /// <param name="userId">操作人</param>
        /// <exception cref="Exception"></exception>
        public void jiaoCheHopper(string areaNo, string StartLocate, string plnNo, string plnStatus, decimal weight,  string skuNo, string lotNo, string url,int userId)
        public void jiaoCheHopper(string areaNo, string StartLocate, string plnNo, string plnStatus, decimal weight,  string skuNo, string lotNo, string url,string bindUrl,int userId)
        {
            try
            {
@@ -550,6 +562,10 @@
                string agvMsg = string.Empty;
                //给下车下发任务
                logTaskEntry.SendDate = DateTime.Now;//发送时间
                //下发载具与货位绑定
                var bind = RcsHelper.BindPalletAndSite(plnNo, StartLocate, bindUrl, out string agvBindMsg);
                if (bind)
                {
                var agvResult = RcsHelper.CreateTaskForAgv(task, url, out agvMsg);
                if (agvResult)//成功
                {
@@ -573,6 +589,15 @@
                    logTaskEntry.Information = agvMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                }
                }
                else
                {
                    logTaskEntry.IsSuccess = 0;
                    logTaskEntry.Information = "货架与货位绑定失败,原因:"+agvBindMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                }
                //提交事务
                Db.CommitTran();
@@ -727,7 +752,7 @@
        /// <param name="deviceStation">叫料点位:”input”-入口(叫脏桶),”output”-出口(净桶申请储位)</param>
        /// <param name="status"></param>
        /// <exception cref="Exception"></exception>
        public void RCSCleanRequest(string deviceID,string deviceStation,string status,string url)
        public void RCSCleanRequest(string deviceID,string deviceStation,string status,string url,string bindUrl)
        {
            try
            {
@@ -859,6 +884,10 @@
                string agvMsg = string.Empty;
                //给下车下发任务
                logTaskEntry.SendDate = DateTime.Now;//发送时间
                //下发载具与货位绑定
                var bind = RcsHelper.BindPalletAndSite(palletModel.PalletNo, palletModel.LocatNo, bindUrl, out string agvBindMsg);
                if (bind)
                {
                var agvResult = RcsHelper.CreateTaskForAgv(task, url, out agvMsg);
                if (agvResult)//成功
                {
@@ -882,6 +911,14 @@
                    logTaskEntry.Information = agvMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                }
                }
                else
                {
                    logTaskEntry.IsSuccess = 0;
                    logTaskEntry.Information = agvBindMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                }
                //提交事务
                Db.CommitTran();
            }
@@ -893,7 +930,7 @@
            }
        }
        private bool YikuTask(string palletNo, string taskNo, string url)
        private bool YikuTask(string palletNo, string taskNo, string url,string bindUrl)
        {
            try
            {
@@ -985,6 +1022,10 @@
                        string agvMsg = string.Empty;
                        //给下车下发任务
                        logTaskEntry.SendDate = DateTime.Now;//发送时间
                                                             //下发载具与货位绑定
                        var bind = RcsHelper.BindPalletAndSite(palletInfoYi.LocatNo, palletInfoYi.PalletNo, bindUrl, out string agvBindMsg);
                        if (bind)
                        {
                        var agvResult = RcsHelper.CreateTaskForAgv(task, url, out agvMsg, "70");
                        if (agvResult)//成功
                        {
@@ -1013,6 +1054,16 @@
                            throw new Exception($"给小车下发移库任务失败,桶号:{palletInfoYi.PalletNo}");
                        }
                    }
                        else
                        {
                            logTaskEntry.IsSuccess = 0;
                            logTaskEntry.Information = agvBindMsg;
                            Db.Insertable(logTaskEntry).ExecuteCommand();
                            throw new Exception($"给小车下发移库任务失败,桶号:{palletInfoYi.PalletNo}");
                        }
                    }
                }
                return true;
            }
@@ -1027,7 +1078,7 @@
        /// <param name="taskNo"></param>
        /// <param name="url"></param>
        /// <exception cref="Exception"></exception>
        public void OutBinAgv(string taskNo,string url)
        public void OutBinAgv(string taskNo,string url, string bindUrl)
        {
            try
            {
@@ -1080,6 +1131,10 @@
                    string agvMsg = string.Empty;
                    //给下车下发任务
                    logTaskInfoZ.SendDate = DateTime.Now;//发送时间
                    //下发载具与货们绑定
                    var bind = RcsHelper.BindPalletAndSite(logTaskInfoZ.PalletNo, logTaskInfoZ.StartLocat, bindUrl, out string agvBindMsg);
                    if (bind)
                    {
                    var agvResult = RcsHelper.CreateTaskForAgv(task, url, out agvMsg, "70");
                    if (agvResult)//成功
                    {
@@ -1108,6 +1163,16 @@
                        throw new Exception($"给小车下发移库任务失败,桶号:{logTaskInfoZ.PalletNo}");
                    }
                }
                    else
                    {
                        logTaskInfoZ.IsSuccess = 0;
                        logTaskInfoZ.Information = agvBindMsg;
                        Db.Insertable(logTaskInfoZ).ExecuteCommand();
                        throw new Exception($"给小车下发移库任务失败,桶号:{logTaskInfoZ.PalletNo}");
                    }
                }
            }
            catch (Exception e)
            {
@@ -1122,7 +1187,7 @@
        /// </summary>
        /// <param name="url"></param>
        /// <exception cref="Exception"></exception>
        public void TransferBackTimer(string url)
        public void TransferBackTimer(string url,string bindUrl)
        {
            try
            {
@@ -1197,6 +1262,10 @@
                        string agvMsg = string.Empty;
                        //给下车下发任务
                        logTaskEntry.SendDate = DateTime.Now;//发送时间
                        //下发载具与货位绑定
                        var bind = RcsHelper.BindPalletAndSite(detailInfo.PalletNo, detailInfo.LocatNo, bindUrl, out string agvBindMsg);
                        if (bind)
                        {
                        var agvResult = RcsHelper.CreateTaskForAgv(task, url, out agvMsg);
                        if (agvResult)//成功
                        {
@@ -1225,6 +1294,16 @@
                            throw new Exception($"给小车下发移库任务失败,桶号:{detailInfo.PalletNo}");
                        }
                    }
                        else
                        {
                            logTaskEntry.IsSuccess = 0;
                            logTaskEntry.Information = agvBindMsg;
                            Db.Insertable(logTaskEntry).ExecuteCommand();
                            throw new Exception($"给小车下发移库任务失败,桶号:{detailInfo.PalletNo}");
                        }
                    }
                }
                //提交事务
                Db.CommitTran();