1
zxx
8 天以前 44007a5e9ef385346d7ae0e107b9f983109ee479
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/wms/LocationHelper.cs
@@ -469,42 +469,7 @@
            }
            return res;
        }
        /// <summary>
        /// 货位绑定货架 小米
        /// </summary>
        /// <param name="loc"></param>
        /// <param name="cntrs"></param>
        /// <returns></returns>
        public static bool BindingLocHj(string loc, string frame)
        {
            var res = false;
            var db = new SqlHelper<object>().GetInstance();
            var location = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == loc).First();
            try
            {
                var lcrList = db.Queryable<LocCntrRel>().Includes(a => a.Container).Where(a => a.S_LOC_CODE.Trim() == loc).ToList();
                db.BeginTran();
                int count = 0;
                if (lcrList.Count(b => b.S_CNTR_CODE.Trim() == frame) == 0)
                {
                    db.Insertable<LocCntrRel>(new LocCntrRel { S_LOC_CODE = loc, S_FRAME_CODE = frame }).ExecuteCommand();
                    count++;
                }
                location.N_CURRENT_NUM = lcrList.Count + count;
                location.N_LOCK_STATE = 0;
                location.S_LOCK_STATE = "无";
                db.Updateable(location).UpdateColumns(it => new { it.N_CURRENT_NUM, it.S_LOCK_STATE, it.N_LOCK_STATE }).ExecuteCommand();
                db.CommitTran();
                res = true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                db.RollbackTran();
            }
            return res;
        }
        /// <summary>
        /// 判断逻辑库区是否有可用货位
        /// </summary>