using HH.WCS.QingXigongchang.util;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
namespace HH.WCS.QingXigongchang.wms
{
///
/// 密集型库区
///
internal class IntensiveArea
{
static IntensiveArea() {
//InitRowLockTable(new List { "PGKQ", "PGKTK" });
}
///
/// 根据库区和物料获取入库的货位(堆叠先考虑标准的,容量都是一样的,例如均州都是3+3;不考虑峨眉山非标2+2和2+1同时存在)
///
///
/// 如果itemCode是空表示空容器
/// 标准搬运数量
///
public static Location GetLocation4In(string area, string itemCode, string itemBatch, int standardCarryQty = 1) {
Location result = null;
try {
//1.0 获取每一排最大的列
//1.1 判断当前数量是不是满的,如果是满的并且是最大列,需要排除
var listMaxCol = new SqlHelper().GetInstance().Queryable().Where(a => a.S_AREA_CODE == area).OrderByDescending(a => a.N_COL).Take(1).PartitionBy(a => a.N_ROW).ToList();
//1.1 查到所有有容器的排
var db = new SqlHelper