杨前锦
2025-07-07 c8f338feee0b6003d8f069b1d37fd9b90dd1b7f4
HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/wms/WMSHelper.cs
@@ -519,26 +519,6 @@
        /// <summary>
        /// 查询接驳位关联属性
        /// 注:
        /// 1.查询异常区货位
        /// </summary>
        /// <param name="areaCode">库区</param>
        /// <param name="type">动作类型(0.人工接驳位 1.入库接驳位 2.出库接驳位)</param>
        /// <param name="property">货位属性(1.直连 2.非直连)</param>
        /// <returns></returns>
        public static Location GetTransfeRelevanceLoc(string areaCode  ,int type ,int property )
        {
            Location loc = null;
            var db = new SqlHelper<object>().GetInstance();
            loc = db.Queryable<Location>()
                .LeftJoin<TransfeRelevance>((a,b)=> a.S_CODE == b.S_LOC_CODE)
                .Where((a, b) => b.S_RELE_AREA.Trim() == areaCode && b.N_PROPERTY == property && b.N_TYPE == type && a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.C_ENABLE == "Y")
                .First();
            return loc;
        }
        /// <summary>
        /// 查询接驳位关联属性
        /// </summary>
        /// <param name="locCode"></param>
        /// <param name="isManual">货位属性 (0.非人工 1.人工)</param>
@@ -556,16 +536,15 @@
        /// 注:查询任务最少的接驳位
        /// </summary>
        /// <param name="areaCode">库区</param>
        /// <param name="property">货位属性 ( 1.直连 2.非直连)</param>
        /// <param name="type">动作类型 (1.入库接驳位  2.出库接驳位)</param>
        /// <returns></returns>
        public static Location GetMinTaskTransfeLoc(string areaCode ,int type, int property)
        public static Location GetMinTaskTransfeLoc(string areaCode ,int type)
        {
            var db = new SqlHelper<object>().GetInstance();
            var loc = db.Queryable<Location>()
                .LeftJoin<TransfeRelevance>((a,b) => a.S_CODE == b.S_LOC_CODE)
                .LeftJoin<WCSTask>((a,b,c) => a.S_CODE == c.S_END_LOC && c.N_B_STATE < 3)
                .Where((a, b, c) => b.S_RELE_AREA.Trim() == areaCode  && b.N_TYPE == type && b.N_PROPERTY == property  && a.N_LOCK_STATE < 3 && a.C_ENABLE == "Y")
                .Where((a, b, c) => b.S_RELE_AREA.Trim() == areaCode  && b.N_TYPE == type && a.N_LOCK_STATE < 3 && a.C_ENABLE == "Y")
                .GroupBy((a, b, c) => a.S_CODE)
                .Select((a, b, c) => new {
                    count = SqlFunc.AggregateCount(c.S_END_LOC),