using Admin.NET.Core.Service; using Elastic.Clients.Elasticsearch; using Furion.Logging; using Qiniu.Storage; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WCS.Application.Entity; namespace WCS.Application; public static class AGVStorageUtil { private static readonly ISqlSugarClient _db = SqlSugarSetup.ITenant.GetConnectionScope(SqlSugarConst.MainConfigId); private static readonly SysCacheService sysCacheService = App.GetRequiredService(); private static readonly SysConfigService _sysConfigService = App.GetRequiredService(); static AGVStorageUtil() { } public static string GetTaskModle(string straLocate,string endLocate,out string type1,out string type2,out string jiebo) { type1 = ""; type2 = ""; jiebo = ""; var taskModle = "";//任务模板 var locate1 = _db.Queryable().First(m => m.IsDelete == false && m.LocatNo == straLocate); var locate2 = _db.Queryable().First(m => m.IsDelete == false && m.LocatNo == endLocate); if (locate1 == null || locate2 == null) { return taskModle; } switch (locate1.WareHouseNo) { case "W02": type1 = "SITE"; break; case "W04": type1 = "STORAGE"; break; default: break; } switch (locate2.WareHouseNo) { case "W02": type2 = "SITE"; break; case "W04": type2 = "STORAGE"; break; default: break; } var AreaAll = new List() { "B06", "B07" };//1002、1003全部区域 var Area1002 = new List() { "B06",""};//1002车间区域 var Area10031 = new List() { ""};//1003 1楼车间区域 var Area10032 = new List() { "B07"};//1003 2楼车间区域 if (Area1002.Contains(locate2.AreaNo)) { jiebo = "1JB";//接驳位 } if (Area10031.Contains(locate2.AreaNo) || Area10032.Contains(locate2.AreaNo)) { jiebo = "2JB"; } if (type1 == "" || type2 == "") { return taskModle; } //判断获取任务模板 STORAGE 货架仓位 SITE 平库仓位 ZONE 区域 switch (type1) { case "STORAGE" when type2 == "SITE": { taskModle = "FJ"; } break; case "SITE" when type2 == "STORAGE": { taskModle = "YCRK"; } break; case "SITE" when type2 == "SITE": { if (Area10032.Contains(locate1.AreaNo) && locate2.AreaNo == "B04") { taskModle = "CPRK"; } else if(Area1002.Contains(locate1.AreaNo) && locate2.AreaNo == "B04") { taskModle = "CPRK2"; } else if ((Area10032.Contains(locate2.AreaNo) || Area10032.Contains(locate2.AreaNo)) && !AreaAll.Contains(locate1.AreaNo)) { taskModle = "YFLSX"; } else if (Area1002.Contains(locate2.AreaNo) && !AreaAll.Contains(locate1.AreaNo)) { taskModle = "YFLSX2"; } } break; default: break; } return taskModle; } }