using System;
using System.Collections.Generic;
using System.Linq;
using HH.WCS.Mobox3.DSZSH.models;
using HH.WCS.Mobox3.DSZSH.util;
using Newtonsoft.Json;
using SqlSugar;
namespace HH.WCS.Mobox3.DSZSH.wms {
///
/// 货位帮助类(包含货位-容器关系的处理)
///
public class LocationHelper
{
private static Dictionary _locationDict = null;
static LocationHelper()
{
try
{
//初始化Location加入到字典缓存
_locationDict = new Dictionary();
var list = GetAllLocList();
if (list.Count > 0)
{
list.ForEach(a =>
{
if (!_locationDict.ContainsKey(a.S_CODE))
{
_locationDict.Add(a.S_CODE, a);
}
});
}
//初始化LocationExt加入到集合缓存
//LocationExts = new Dictionary();
//var exts = GetAllLocExtList();
//if (exts.Count > 0) {
// exts.ForEach(a => {
// LocationExts.Add($"{a.S_LOC_CODE.Trim()}_{a.S_PICKUP_POINT.Trim()}", a);
// });
//}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
///
/// 获取所有货位信息
///
///
internal static List GetAllLocList()
{
var db = new SqlHelper