wxw
2025-03-10 bce24ba3d72a95c265d3ee9f33c12d46c33e3fdf
修改问题
1个文件已修改
42 ■■■■ 已修改文件
Wms/WMS.BLL/BllTransServer/RcsServer.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllTransServer/RcsServer.cs
@@ -70,6 +70,7 @@
                {
                    model.Type = "0";
                }
                string agvMsg = string.Empty;
                switch (model.Type)
                {
                    case "0"://接料设备叫净桶
@@ -288,7 +289,7 @@
                                    throw new Exception($"起始目标储位信息不存在,桶号:{item.LocatNo}");
                                }
                                taskNo = new Common().GetMaxNo("TK");//任务号
                                taskNo = new Common().GetMaxNo("TN");//任务号
                                var logTaskEntry2 = new LogTask
                                {
                                    TaskNo = taskNo,
@@ -322,7 +323,7 @@
                                };
                                //给下车下发任务
                                logTaskEntry2.SendDate = DateTime.Now;//发送时间
                                var agvResult2 = CreateTaskForAgv(task2, url);
                                var agvResult2 = CreateTaskForAgv(task2, url, out agvMsg);
                                if (agvResult2)//成功
                                {
                                    //请求成功修改任务表相应字段状态
@@ -342,6 +343,7 @@
                                else//失败
                                {
                                    logTaskEntry2.IsSuccess = 0;
                                    logTaskEntry2.Information = agvMsg;
                                    Db.Insertable(logTaskEntry2).ExecuteCommand();
                                }
@@ -361,7 +363,7 @@
                    throw new Exception($"起始目标储位信息不存在,桶号:{pallet.LocatNo}");
                }
                taskNo = new Common().GetMaxNo("TK");//任务号
                taskNo = new Common().GetMaxNo("TN");//任务号
                //任务信息
                var logTaskEntry = new LogTask
                {
@@ -397,7 +399,7 @@
                };
                //给下车下发任务
                logTaskEntry.SendDate = DateTime.Now;//发送时间
                var agvResult = CreateTaskForAgv(task, url);
                var agvResult = CreateTaskForAgv(task, url, out agvMsg);
                if (agvResult)//成功
                {
                    //请求成功修改任务表相应字段状态
@@ -417,6 +419,7 @@
                else//失败
                {
                    logTaskEntry.IsSuccess = 0;
                    logTaskEntry.Information = agvMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                    
                }
@@ -642,7 +645,7 @@
                        break;
                }
                taskNo = new Common().GetMaxNo("TK");//任务号
                taskNo = new Common().GetMaxNo("TN");//任务号
                //任务信息
                var logTaskEntry = new LogTask
                {
@@ -674,9 +677,10 @@
                    Crtype = "0",//入库
                    WareHouseNo = houseNo
                };
                string agvMsg = string.Empty;
                //给下车下发任务
                logTaskEntry.SendDate = DateTime.Now;//发送时间
                var agvResult = CreateTaskForAgv(task, url);
                var agvResult = CreateTaskForAgv(task, url, out agvMsg);
                if (agvResult)//成功
                {
                    //请求成功修改任务表相应字段状态
@@ -696,6 +700,7 @@
                else//失败
                {
                    logTaskEntry.IsSuccess = 0;
                    logTaskEntry.Information = agvMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                }
                //提交事务
@@ -780,7 +785,8 @@
                        Crtype = "2",
                    };
                    string taskNo = "";
                    CreateTaskForAgv(ztask, url);
                    string agvMsg = string.Empty;
                    CreateTaskForAgv(ztask, url, out agvMsg);
                    statrtLocat.Status = "3";//出库中
                    //修改起始储位状态
@@ -822,7 +828,8 @@
                    Crtype = "1",
                };
                string taskNo = "";
                CreateTaskForAgv(task,url);
                string agvMsg = string.Empty;
                CreateTaskForAgv(task, url, out agvMsg);
            }
            catch (Exception ex)
            {
@@ -1153,9 +1160,10 @@
                    Pallno = logTaskEntry.PalletNo,
                    Crtype = logTaskEntry.Type,
                };
                string agvMsg = string.Empty;
                //给下车下发任务
                logTaskEntry.SendDate = DateTime.Now;//发送时间
                var agvResult = CreateTaskForAgv(task, url);
                var agvResult = CreateTaskForAgv(task, url, out agvMsg);
                if (agvResult)//成功
                {
                    //请求成功修改任务表相应字段状态
@@ -1175,6 +1183,7 @@
                else//失败
                {
                    logTaskEntry.IsSuccess = 0;
                    logTaskEntry.Information = agvMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                }
@@ -1194,7 +1203,7 @@
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public bool CreateTaskForAgv(TaskDetial taskDetial, string url,string priority=null)
        public bool CreateTaskForAgv(TaskDetial taskDetial, string url, out string agvMsg, string priority=null)
        {
            bool result = false;
@@ -1276,6 +1285,8 @@
            if (agvModel.Code == "0")
            {
                result = true;//给下车下发任务成功
                agvMsg = "";
            }
            else
            {
@@ -1290,6 +1301,8 @@
                }
                var logStr = $@".\log\AGV\AGV{logMsg}" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
                LogFile.SaveLogToFile($"AGV{logMsg}异常:( {agvModel.Message} ),", logStr);
                agvMsg = agvModel.Message;
            }
            return result;
            #endregion
@@ -1381,7 +1394,7 @@
                        #endregion
                        //给下车下发移库任务
                        var taskNo = new Common().GetMaxNo("TK");//任务号
                        var taskNo = new Common().GetMaxNo("TN");//任务号
                        //任务信息
                        var logTaskEntry = new LogTask
                        {
@@ -1415,9 +1428,10 @@
                            Crtype = "1",//叫桶
                            WareHouseNo = palletInfoYi.WareHouseNo//车间编码
                        };
                        string agvMsg = string.Empty;
                        //给下车下发任务
                        logTaskEntry.SendDate = DateTime.Now;//发送时间
                        var agvResult = CreateTaskForAgv(task, url, "70");
                        var agvResult = CreateTaskForAgv(task, url, out agvMsg, "70");
                        if (agvResult)//成功
                        {
                            //请求成功修改任务表相应字段状态
@@ -1437,6 +1451,10 @@
                        }
                        else//失败
                        {
                            logTaskEntry.IsSuccess = 0;
                            logTaskEntry.Information = agvMsg;
                            Db.Insertable(logTaskEntry).ExecuteCommand();
                            throw new Exception($"给小车下发移库任务失败,桶号:{palletInfoYi.PalletNo}");
                        }
                    }