111
lss
2 天以前 9ddec4808631025d36d3c5a816d55ef77a29d4c7
HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/api/ApiHelper.cs
@@ -47,6 +47,7 @@
        /// <returns></returns>
        internal static Result Createtask(CreateTask model)
        {
            Result result = new Result() { code = "0", msg = "创建成功" };
            if (model == null)
            {
@@ -187,13 +188,6 @@
                                }
                            }
                            //else
                            //{
                            //    result.code = "1";
                            //    result.msg = $"根据起点{Start},未找到托盘货位绑定关系";
                            //    AddErrorInfo("托盘查找失败", result.msg, Source);
                            //    return result;
                            //}
                        }
                        else
@@ -589,6 +583,15 @@
                                AddErrorInfo("库区查找失败", result.msg);
                                return result;
                            }
                            int pri = 1;
                            var area = Settings.wareLoc.Where(a => a.AreaCode == endloc.S_WH_CODE).First();
                            if (area != null)
                            {
                                if (area.XbAreaCodes.Contains(endloc.S_AREA_CODE))
                                {
                                    pri = 2;
                                }
                            }
                            //创建wcs任务
                            var wcsTask = new WCSTask
                            {
@@ -603,7 +606,7 @@
                                S_END_AREA = endloc.S_AREA_CODE,
                                N_SCHEDULE_TYPE = 1,
                                S_CNTR_CODE = CntrCode,
                                N_PRIORITY = taskData.priority,
                                N_PRIORITY = pri,
                                Z_TYPE = n_type,
                                N_START_LAYER = 1,
                                N_END_LAYER = 1,
@@ -768,7 +771,7 @@
                {
                    //创建托盘数据绑定关系
                    if (ContainerHelper.CreateCntrItem(model.Rfid, model.PartNumber, model.PartDesc, model.LotNumber, model.Weight, model.Qty, model.ProductionTime, model.MaturityTime))
                    if (ContainerHelper.CreateCntrItemTray(model.Rfid, model.PartNumber, model.PartDesc, model.LotNumber, model.Weight, model.Qty, model.ProductionTime, model.MaturityTime, model.PowderType))
                    {
                        //创建成功流程
                    }
@@ -792,6 +795,176 @@
        }
        public static object _Point = new object();
        /// <summary>
        /// 点对点接口
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        internal static Result Point(PointModel model)
        {
            Result result = new Result() { code = "200", msg = "入平库任务下发成功" };
            string Source = "Mes";
            if (model == null)
            {
                result.code = "1";
                result.msg = "参数为null";
                AddErrorInfo("参数为空", result.msg, Source);
                return result;
            }
            //1.出平库,2入平库,3平库空工装呼叫,4平库余料回库,5粉料空托返回。
            var db = new SqlHelper<object>().GetInstance();
            string type = "";
            Location startloc = null;
            Location endloc = null;
            switch (model.Status)
            {
                case "1":
                    type = "出平库";
                    break;
                case "2":
                    type = "入平库";
                    break;
                case "3":
                    type = "平库空工装呼叫";
                    break;
                case "4":
                    type = "平库余料回库";
                    break;
                case "5":
                    type = "粉料空托返回";
                    break;
            }
            if (string.IsNullOrEmpty(type))
            {
                result.code = "1";
                result.msg = $"任务类型{model.Status},不在规定范围";
                AddErrorInfo("任务类型错误", result.msg, Source);
                return result;
            }
            try
            {
                lock (_Point)
                {
                    startloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == model.InitialLocation).First();
                    if (startloc == null)
                    {
                        result.code = "1";
                        result.msg = $"根据起点{model.InitialLocation},找不到对应货位,请检查货位表";
                        AddErrorInfo("货位查找失败", result.msg, Source);
                        return result;
                    }
                    else
                    {
                        //判断起点是否绑定其他托盘
                        var CntrRel = LocationHelper.GetLocCntrRel(startloc.S_CODE).OrderBy(a => a.T_CREATE).FirstOrDefault();
                        if (CntrRel != null)
                        {
                            if (CntrRel.S_CNTR_CODE != model.Rfid)
                            {
                                result.code = "1";
                                result.msg = $"根据起点:{model.InitialLocation}获取托盘:{CntrRel.S_CNTR_CODE}与下发托盘:{model.Rfid}不一致,请检查托盘码是否正确";
                                AddErrorInfo("托盘码校检失败", result.msg, Source);
                                return result;
                            }
                        }
                        else
                        {
                            LocationHelper.BindingLoc(startloc.S_CODE, new List<string> { model.Rfid });
                        }
                    }
                    endloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == model.TargetLocation).First();
                    if (endloc == null)
                    {
                        result.code = "1";
                        result.msg = $"根据终点{model.TargetLocation},找不到对应货位,请检查货位表";
                        AddErrorInfo("货位查找失败", result.msg, Source);
                        return result;
                    }
                    #region 创建任务
                    if (endloc != null && startloc != null)
                    {
                        if (startloc.N_LOCK_STATE != 0)
                        {
                            result.code = "1";
                            result.msg = $"创建任务失败,起点:{startloc.S_CODE}有锁";
                            AddErrorInfo("货位有锁", result.msg, Source);
                            return result;
                        }
                        //创建wcs任务
                        var wcsTask = new WCSTask
                        {
                            S_CODE = WCSHelper.GenerateTaskNo(),
                            S_TYPE = type,
                            S_EQ_NO = model.TaskNumber,
                            S_START_LOC = startloc.S_CODE,
                            S_END_LOC = endloc.S_CODE,
                            S_START_WH = startloc.S_WH_CODE,
                            S_START_AREA = startloc.S_AREA_CODE,
                            S_END_WH = endloc.S_WH_CODE,
                            S_END_AREA = endloc.S_AREA_CODE,
                            N_CNTR_COUNT = 1,
                            N_SCHEDULE_TYPE = 1,
                            S_CNTR_CODE = model.Rfid,
                            N_START_LAYER = 1,
                            N_END_LAYER = 1,
                            N_PRIORITY = 1,
                            Z_TYPE = 5
                        };
                        LogHelper.Info("创建点对点任务:" + JsonConvert.SerializeObject(wcsTask));
                        if (WCSHelper.CreateTask(wcsTask))
                        {
                            if (type == "平库余料回库")
                            { //创建任务成功 更新余料信息
                                var CntrItem = db.Queryable<CntrItemDetail>().Where(a => a.S_CNTR_CODE.Trim() == model.Rfid).First();
                                if (CntrItem != null)
                                {
                                    CntrItem.F_WEIGHT = model.Weight.ToString();
                                    CntrItem.S_BS_TYPE = "余料";
                                    //CntrItem.F_QTY = float.Parse(model.qty);
                                    //CntrItem.S_ITEM_STATE = model..QualityStatus;
                                    db.Updateable(CntrItem).UpdateColumns(a => new { a.F_WEIGHT, a.S_BS_TYPE }).ExecuteCommand();
                                }
                            }
                            LocationHelper.LockLoc(startloc.S_CODE, 2);
                            LocationHelper.LockLoc(endloc.S_CODE, 1);
                            LogHelper.Info("创建任务成功");
                        }
                        else
                        {
                            result.code = "1";
                            result.msg = $"任务创建失败";
                            AddErrorInfo("任务创建失败", result.msg, Source);
                            return result;
                        }
                    }
                    else
                    {
                        result.code = "1";
                        result.msg = "创建任务失败,未找到对应的取货点或卸货点";
                        return result;
                    }
                    #endregion
                }
                return result;
            }
            catch (Exception ex)
            {
                result.code = "1";
                result.msg = ex.ToString();
                LogHelper.Error("Putin Error:" + ex.ToString(), ex);
                return result;
            }
        }
        public static object _Putin = new object();
@@ -961,6 +1134,7 @@
                            S_CNTR_CODE = model.Rfid,
                            N_START_LAYER = 1,
                            N_END_LAYER = 1,
                            N_PRIORITY = 1,
                            Z_TYPE = n_type
                        };
                        LogHelper.Info("创建入平库任务:" + JsonConvert.SerializeObject(wcsTask));
@@ -1089,27 +1263,51 @@
                    #region 根据物料编码计算出库货位,送往线边位置
                    Location Endloc = null;
                    //根据物料编码计算出库货位
                    var loc = airlift(areacode, itemcode, model.PartLevel);
                    var loc = airlift(areacode, itemcode, model.PartLevel, model.PowderType);
                    if (loc != null)
                    {
                        Start = loc.S_CODE;
                        //根据出库货位找到绑定托盘,获取入机台货位
                        var CntrRel = LocationHelper.GetLocCntrRel(loc.S_CODE).FirstOrDefault();
                        CntrCode = CntrRel.S_CNTR_CODE;
                        Endloc = Computeloc(CntrCode, model.WorkCenter, cntrType);
                        if (Endloc != null)
                        //给终点用终点,没给终点用机台库区计算货位
                        if (string.IsNullOrEmpty(model.TargetLocation))
                        {
                            End = Endloc.S_CODE;
                            Endloc = Computeloc(CntrCode, model.WorkCenter, cntrType);
                            if (Endloc != null)
                            {
                                End = Endloc.S_CODE;
                            }
                            else
                            {
                                result.code = "1";
                                result.msg = $"Computeloc==》根据机台编码:{model.WorkCenter},工装类型:{cntrType} 未找到空货位数据,请检查货位表";
                                LogHelper.Info($"ItemBack:{result.msg}");
                                AddErrorInfo("查找库区失败", result.msg, Source);
                                return result;
                            }
                        }
                        else
                        {
                            result.code = "1";
                            result.msg = $"Computeloc==》根据机台编码:{model.WorkCenter},工装类型:{cntrType} 未找到空货位数据,请检查货位表";
                            LogHelper.Info($"ItemBack:{result.msg}");
                            AddErrorInfo("查找库区失败", result.msg, Source);
                            return result;
                            Endloc = db.Queryable<Location>().Where(a => a.S_CODE == model.TargetLocation).First();
                            if (Endloc != null)
                            {
                                End = Endloc.S_CODE;
                            }
                            else
                            {
                                result.code = "1";
                                result.msg = $"Computeloc==》根据终点货位:{model.TargetLocation} 未找到货位数据,请检查货位表";
                                LogHelper.Info($"ItemBack:{result.msg}");
                                AddErrorInfo("查找库区失败", result.msg, Source);
                                return result;
                            }
                        }
                    }
                    else
                    {
@@ -1159,6 +1357,7 @@
                        S_CNTR_CODE = CntrCode,
                        N_START_LAYER = 1,
                        N_END_LAYER = 1,
                        N_PRIORITY = 1,
                        Z_TYPE = n_type
                    };
@@ -1418,6 +1617,8 @@
                            S_CNTR_CODE = model.Rfid,
                            N_START_LAYER = 1,
                            N_END_LAYER = endlayer,
                            N_PRIORITY = 1,
                            S_B_STATE = "等待推送",
                            Z_TYPE = 5
                        };
                        LogHelper.Info("创建空托回库任务:" + JsonConvert.SerializeObject(wcsTask));
@@ -1597,6 +1798,7 @@
                            N_START_LAYER = 1,
                            N_END_LAYER = 1,
                            Z_TYPE = 5,
                            N_PRIORITY = 1,
                            S_NOTE = "粉料"
                        };
                        LogHelper.Info("创建呼叫空托任务:" + JsonConvert.SerializeObject(wcsTask));
@@ -1821,6 +2023,7 @@
                            S_CNTR_CODE = model.Rfid,
                            N_START_LAYER = 1,
                            N_END_LAYER = 1,
                            N_PRIORITY = 1,
                            Z_TYPE = 5
                        };
@@ -2072,6 +2275,7 @@
                        S_CNTR_CODE = CntrCode,
                        N_START_LAYER = 1,
                        N_END_LAYER = 1,
                        N_PRIORITY = 1,
                        //  N_TYPE = n_type
@@ -2176,8 +2380,8 @@
                    string[] state = new string[] { "执行中", "开始取货", "取货完成", "开始卸货", "卸货完成" };
                    var elevatorLoc = db.Queryable<Location>().Where(a =>  a.S_CODE == eleLoc.TN_Location).First();
                    if (elevatorLoc==null)
                    var elevatorLoc = db.Queryable<Location>().Where(a => a.S_CODE == eleLoc.TN_Location).First();
                    if (elevatorLoc == null)
                    {
                        result.code = "1";
                        result.msg = $"根据电梯配置文件货位:{eleLoc.TN_Location}未找到对于货位数据,请检查货位表";
@@ -2208,6 +2412,7 @@
                        S_CNTR_CODE = cntr.S_CNTR_CODE,
                        N_END_LAYER = 1,
                        Z_TYPE = 6,
                        N_PRIORITY = 1,
                        S_B_STATE = "电梯推送"
                    };
@@ -2269,6 +2474,47 @@
        }
        /// <summary>
        /// 电梯任务推送
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        internal static Result DT(DTModel model)
        {
            Result result = new Result() { code = "200", msg = "电梯任务推送成功" };
            string Source = "WMS";
            if (model == null)
            {
                result.code = "1";
                result.msg = "参数为null";
                AddErrorInfo("参数为空", result.msg, Source);
                return result;
            }
            try
            {
                if (model.prepare == "1")
                {
                    var db = new SqlHelper<object>().GetInstance();
                    //修改对应电梯任务进行推送
                    return result;
                }
                else
                {
                    result.code = "1";
                    result.msg = $"一楼电梯搬运任务推送失败 prepare{model.prepare}不为1";
                    LogHelper.Info(result.msg);
                    return result;
                }
            }
            catch (Exception ex)
            {
                result.code = "1";
                result.msg = $"电梯任务推送失败 错误信息:{ex}";
                LogHelper.Error("点对点任务 Error:" + ex.ToString(), ex);
                return result;
            }
        }
        /// <summary>
        /// 货位信息上传
        /// </summary>
@@ -2437,10 +2683,9 @@
                    var location = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == loc).First();
                    if (location != null)
                    {
                        var loccntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == loc).ToList();
                        var loccntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == loc.Trim()).ToList();
                        if (loccntr.Count > 0)
                        {
                            var cntrcodes = loccntr.Select(a => a.S_CNTR_CODE.Trim()).ToList();
                            if (LocationHelper.Clear(loc, cntrcodes))
                            {
@@ -2497,30 +2742,30 @@
            var db = new SqlHelper<HangChaAGV>().GetInstance();
            DeviceInfoModel device = new DeviceInfoModel();
            List<DeviceInfos> deviceInfos = new List<DeviceInfos>();//叠盘机报错信息
           // List<DeviceInfos> deviceInfos = new List<DeviceInfos>();//叠盘机报错信息
                                                                    // List<AgvInfos> agvInfos = new List<AgvInfos>();//agv报错信息
            //获取内存中叠盘机的报错信息
            foreach (var dpjInfo in DeviceProcess.DpjInfoDirectory)
            {
                deviceInfos.Add(new DeviceInfos() { Device = dpjInfo.Value.DeviceName, DeviceInfo = dpjInfo.Value.ErrorInfo });
            }
            //foreach (var dpjInfo in DeviceProcess.DpjInfoDirectory)
            //{
            //    deviceInfos.Add(new DeviceInfos() { Device = dpjInfo.Value.DeviceName, DeviceInfo = dpjInfo.Value.ErrorInfo });
            //}
            //  device.DeviceInfos = deviceInfos;
            //获取车辆报警信息
            var agvDeviceInfo = db.Queryable<HangChaAGV>().ToList();
            if (agvDeviceInfo.Count > 0)
            {
                device.AgvQty = agvDeviceInfo.Count;
                device.AgvErrorQty = agvDeviceInfo.FindAll(a => a.agvErrCode != "0" || a.agvErrCode != "0" || a.faildCode != "0").Count;
                device.AgvChargeQty = agvDeviceInfo.FindAll(a => a.agvErrCode == "1").Count;
                device.AgvRunQty = agvDeviceInfo.FindAll(a => a.agvErrCode == "1").Count;
                foreach (var agv in agvDeviceInfo)
                {
                    string agvErrorInfo = GetAgvAlarmSendCodeTwo(agv.agvErrCode, agv.errCode2, agv.faildCode);
                    deviceInfos.Add(new DeviceInfos() { AgvNo = agv.agvNo, AgvInfo = agvErrorInfo });
                }
                device.AgvErrorQty = agvDeviceInfo.FindAll(a => a.agvErrCode != "0" || int.Parse(a.errCode2) > 1 || int.Parse(a.faildCode) > 1).Count;
                device.AgvChargeQty = agvDeviceInfo.FindAll(a => a.errCode2 == "1").Count;
                device.AgvRunQty = agvDeviceInfo.FindAll(a => a.agvErrCode == "0" && a.errCode2 == "0" && a.faildCode == "1").Count;
                //foreach (var agv in agvDeviceInfo)
                //{
                //    string agvErrorInfo = GetAgvAlarmSendCodeTwo(agv.agvNo, agv.agvErrCode, agv.errCode2, agv.faildCode);
                //    deviceInfos.Add(new DeviceInfos() { AgvNo = agv.agvNo, AgvInfo = agvErrorInfo });
                //}
            }
            device.DeviceInfos = deviceInfos;
          //  device.DeviceInfos = deviceInfos;
            return device;
        }
@@ -2528,56 +2773,65 @@
        /// <summary>
        /// agv小车故障码处理
        /// </summary>
        ///<param name="agvNo">车号</param>
        /// <param name="errCode1">错误码1</param>
        /// <param name="errCode2">错误码2</param>
        /// <param name="faildCode">错误码3</param>
        /// <returns></returns>
        private static string GetAgvAlarmSendCodeTwo(string errCode1, string errCode2, string faildCode)
        private static string GetAgvAlarmSendCodeTwo(string agvNo, string errCode1, string errCode2, string faildCode)
        {
            string result = "";
            //将报警信息整合
            string binSW1 = Convert.ToString(int.Parse(errCode1), 2).PadLeft(22, '0');
            string binSW1 = Convert.ToString(int.Parse(errCode1), 2).PadLeft(25, '0');
            string binSW2 = Convert.ToString(int.Parse(errCode1), 2).PadLeft(20, '0');
            string binFc = Convert.ToString(int.Parse(errCode1), 2).PadLeft(16, '0');
            var arr1 = binSW1.ToArray();
            var arr2 = binSW2.ToArray();
            var arr3 = binFc.ToArray();
            for (int i = 0; i <= arr1.Length; i++)
            var AgvError = Settings.agvError.Where(a => a.agvNo.Contains(agvNo)).FirstOrDefault();
            if (AgvError != null)
            {
                if (arr1[i] == '1')
                for (int i = 0; i <= arr1.Length; i++)
                {
                    var ErrorInfo = Settings.agvErrorCode1.Where(a => a.ErrorCode == i).FirstOrDefault();
                    if (ErrorInfo != null)
                    if (arr1[i] == '1')
                    {
                        result = result + "," + $"{ErrorInfo.ErrorInfo}";
                    }
                        var ErrorInfo = AgvError.AgvErrorCode1.Find(a => a.ErrorCode == i);
                        if (ErrorInfo != null)
                        {
                            result = result + "," + $"{ErrorInfo.ErrorInfo}";
                        }
                    }
                }
                for (int i = 0; i <= arr2.Length; i++)
                {
                    if (arr1[i] == '1')
                    {
                        var ErrorInfo = AgvError.AgvErrorCode2.Find(a => a.ErrorCode == i);
                        if (ErrorInfo != null)
                        {
                            result = result + "," + $"{ErrorInfo.ErrorInfo}";
                        }
                    }
                }
                for (int i = 0; i <= arr3.Length; i++)
                {
                    if (arr1[i] == '1')
                    {
                        var ErrorInfo = AgvError.AgvFaildCode.Find(a => a.ErrorCode == i);
                        if (ErrorInfo != null)
                        {
                            result = result + "," + $"{ErrorInfo.ErrorInfo}";
                        }
                    }
                }
            }
            for (int i = 0; i <= arr2.Length; i++)
            else
            {
                if (arr1[i] == '1')
                {
                    var ErrorInfo = Settings.agvErrorCode2.Where(a => a.ErrorCode == i).FirstOrDefault();
                    if (ErrorInfo != null)
                    {
                        result = result + "," + $"{ErrorInfo.ErrorInfo}";
                    }
                }
            }
            for (int i = 0; i <= arr3.Length; i++)
            {
                if (arr1[i] == '1')
                {
                    var ErrorInfo = Settings.agvFaildCode.Where(a => a.ErrorCode == i).FirstOrDefault();
                    if (ErrorInfo != null)
                    {
                        result = result + "," + $"{ErrorInfo.ErrorInfo}";
                    }
                }
            }
            return result;
        }
@@ -2624,8 +2878,10 @@
        /// <param name="areacode"></param>
        /// <param name="itemcode"></param>
        /// <param name="level">物料等级</param>
        /// <param name="powderType">机型</param>
        /// <returns></returns>
        internal static Location airlift(string areacode, string itemcode, string level = "")
        internal static Location
            airlift(string areacode, string itemcode, string level, string powderType)
        {
            var db = new SqlHelper<object>().GetInstance();
            Location result = null;
@@ -2682,8 +2938,8 @@
            //}
            #endregion
            var loc = LocationHelper.GetLocByItemCode(areacode, itemcode, level);
            LogHelper.Info($"airlift=>根据库区编码:{areacode},物料编码:{itemcode},物料等级计算出有托盘货位{JsonConvert.SerializeObject(loc)}");
            var loc = LocationHelper.GetLocByItemCode(areacode, itemcode, level, powderType);
            LogHelper.Info($"airlift=>根据库区编码:{areacode},物料编码:{itemcode},机型{powderType},物料等级计算出有托盘货位{JsonConvert.SerializeObject(loc)}");
            // result = FindStartcolByLoclist(loc);
            if (loc.Count > 0)
            {
@@ -2765,12 +3021,16 @@
            lock (_lockLocation)
            {
                var loc = db.Queryable<Location>().Where(a => a.S_AREA_CODE.Trim() == jtcode.Trim() && a.S_NOTE == cntrType && a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.S_LOCK_STATE == "无").First();
                if (loc != null)
                if (string.IsNullOrEmpty(cntrType))
                {
                    End = loc;
                    End = db.Queryable<Location>().Where(a => a.S_AREA_CODE.Trim() == jtcode.Trim() && a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.S_LOCK_STATE == "无").First();
                }
                else
                {
                    End = db.Queryable<Location>().Where(a => a.S_AREA_CODE.Trim() == jtcode.Trim() && a.S_NOTE == cntrType && a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.S_LOCK_STATE == "无").First();
                }
                if (End == null)
                {
                    LogHelper.Info($"Computeloc==》根据机台分组:{jtcode},工装类型:{cntrType} 未找到空货位数据,请检查货位表");
                }
@@ -2818,6 +3078,48 @@
        }
        /// <summary>
        /// 合肥佳通接口调用信息
        /// </summary>
        /// <param name="source">系统来源</param>
        /// <param name="name">接口名称</param>
        /// <param name="type">请求地址类型</param>
        /// <param name="body">请求参数</param>
        /// <param name="url">请求地址</param>
        /// <param name="err">错误信息</param>
        /// <returns></returns>
        public static bool AddInfo(string source, string name, string body, string err, string type, string url)
        {
            bool result = false;
            var db = new SqlHelper<object>().GetInstance();
            try
            {
                var error = new GT_Interface_Exc
                {
                    S_SOURCE = source,
                    S_NAME = name,
                    S_TYPE = type,
                    S_URL = url,
                    S_BODY = body,
                    S_ERR = err
                };
                if (result = db.Insertable<GT_Interface_Exc>(error).ExecuteCommand() > 0)
                {
                }
                //else
                //{
                //    //添加失败重新添加
                //    AddErrorInfo(errorInfo, remake, areacode, taskno);
                //}
            }
            catch (Exception ex)
            {
                LogHelper.Info($"AddInfo Error:{ex.Message}");
            }
            return result;
        }
        /// <summary>
        /// 找终点空货位
        /// </summary>
        /// <param name="locations"></param>
@@ -2834,14 +3136,14 @@
                {
                    var rowList = locations.Where(r => r.N_ROW == rows[i]).ToList();
                  //  LogHelper.Info($"当前排:{rows[i]},获得货位{JsonConvert.SerializeObject(rowList)}");
                    //  LogHelper.Info($"当前排:{rows[i]},获得货位{JsonConvert.SerializeObject(rowList)}");
                    if (rowList.Count(a => a.N_CURRENT_NUM == 0) > 0)
                    {
                        Location other = null;
                        //当前排没有锁并且有空位置
                        // other = rowList.OrderBy(a => a.N_COL).Where(a => a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.C_ENABLE == "Y").FirstOrDefault();
                        other = rowList.OrderBy(a => a.N_COL).Where(a => a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 ).FirstOrDefault();
                        other = rowList.OrderBy(a => a.N_COL).Where(a => a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0).FirstOrDefault();
                        //if (full == null)
                        //{
                        //    //没有满位,那就找最小的空位
@@ -3012,7 +3314,6 @@
        {
            lock (AGVDeviceReceiveLock)
            {
                var db = new SqlHelper<HangChaAGV>().GetInstance();
                var agvDeviceInfo = db.Queryable<HangChaAGV>().Where(a => a.agvNo.Trim() == forkliftNo).First();
                if (agvDeviceInfo == null)