| | |
| | | using HH.WCS.JiaTong.wms; |
| | | using Newtonsoft.Json; |
| | | using NLog.Fluent; |
| | | using S7.Net; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | var dploc = db.Queryable<Location>().Where(a => a.S_NOTE.Trim() == "叠盘" && a.N_LAYER == startloc.N_LAYER && a.S_WH_CODE.Trim() == startloc.S_WH_CODE).ToList(); |
| | | if (dploc.Count > 0) |
| | | { |
| | | LogHelper.Info($"获取叠盘货位:{JsonConvert.SerializeObject(dploc)}"); |
| | | // LogHelper.Info($"获取叠盘货位:{JsonConvert.SerializeObject(dploc)}"); |
| | | loc = dploc.FindAll(a => a.N_LOCK_STATE == 0 && a.N_CURRENT_NUM < 6).OrderByDescending(a => a.N_CURRENT_NUM).FirstOrDefault(); |
| | | if (loc == null) |
| | | { |
| | |
| | | return result; |
| | | } |
| | | } |
| | | else if (startloc.S_NOTE == "PM") |
| | | { |
| | | //找块胶堆叠区 |
| | | var KjDploc = db.Queryable<Location>().Where(a => a.S_NOTE.Trim() == "片胶堆叠位" && a.S_WH_CODE.Trim() == startloc.S_WH_CODE).ToList(); |
| | | if (KjDploc.Count > 0) |
| | | { |
| | | loc = KjDploc.FindAll(a => a.N_LOCK_STATE == 0 && a.N_CURRENT_NUM < 6).OrderByDescending(a => a.N_CURRENT_NUM).FirstOrDefault(); |
| | | if (loc == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"叠盘货位不可用"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | return result; |
| | | } |
| | | else |
| | | { |
| | | endlayer = loc.N_CURRENT_NUM + 1; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"根据货位备注:片胶堆叠位,货位仓库:{startloc.S_WH_CODE},找不到叠盘货位"); |
| | | result.code = "1"; |
| | | result.msg = $"叠盘货位不可用"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | return result; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | #region 根据托盘找呼叫空托任务,并获得出库库区 |