1
pulg
2025-05-14 5a640911f7e7ef3a003775993f077e1a0e9ac130
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using HH.WCS.Hexafluo.util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace HH.WCS.Hexafluo.wms
{
    /// <summary>
    /// 普通库区
    /// </summary>
    internal class NormalArea
    {
        /// <summary>
        /// 没有特殊要求货架区随便找一个空位
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        internal static Location GetLocation4In(string area) {
            var db = new SqlHelper<object>().GetInstance();
            return db.Queryable<Location>().Where(a => a.S_AREA_CODE.Trim() == area && a.N_CURRENT_NUM == 0 && a.S_LOCK_STATE.Trim() == "无").First();
        }
 
        /// <summary>
        /// 没有特殊要求,出一个相同物料的就可以
        /// </summary>
        /// <param name="area"></param>
        /// <param name="itemCode"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        internal static Location GetLocation4Out(string area, string itemCode) {
            var db = new SqlHelper<object>().GetInstance();
            //查找所有有托盘的货位
            return db.Queryable<Location>().Where(a => a.S_AREA_CODE.Trim() == area && a.N_CURRENT_NUM == 1 && a.S_LOCK_STATE.Trim() == "无" && a.LocCntrRel.CntrItemRel.S_ITEM_CODE.Trim() == itemCode).Includes(a => a.LocCntrRel, a => a.CntrItemRel).First();
        }
    }
}