using HH.MData;
|
using HH.WMS.Entitys.Basic;
|
using MongoDB.Driver;
|
using MongoDB.Driver.Builders;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace HH.WMS.DAL.Basic
|
{
|
public class TN_AB_STOCK_LOCATIONDAL:BaseDAL
|
{
|
#region 根据货位编号查询货位实体(MongoDB)
|
/// <summary>
|
/// 根据货位编号查询货位实体(MongoDB)
|
/// </summary>
|
/// <param name="location"></param>
|
/// <returns></returns>
|
/// <History>[Hanhe(XDL)] CREATED 2018-11-13</History>
|
public AutoBomLocationEntity GetLocationModel(string CN_S_LOCATION_CODE)
|
{
|
IMongoQuery query = Query.And(Query.EQ("CN_S_LOCATION_CODE", CN_S_LOCATION_CODE));
|
return MongoDBSingleton.Instance.FindOne<AutoBomLocationEntity>(query, "TN_AB_STOCK_LOCATION");
|
}
|
#endregion
|
|
#region 根据货位编号查询货位实体(MongoDB)
|
/// <summary>
|
/// 根据货位编号查询货位实体(MongoDB)
|
/// </summary>
|
/// <param name="location"></param>
|
/// <returns></returns>
|
/// <History>[Hanhe(DBS)] created 2018-3-31</History>
|
public AutoBomLocationEntity GetModel(string location)
|
{
|
IMongoQuery query = Query.And(Query.EQ("CN_S_LOCATION_CODE", location));
|
return MongoDBSingleton.Instance.FindOne<AutoBomLocationEntity>(query, "TN_AB_STOCK_LOCATION");
|
}
|
#endregion
|
|
#region 根据货位编号查询货位实体重载(MongoDB)
|
/// <summary>
|
/// 根据货位编号查询货位实体(MongoDB)
|
/// </summary>
|
/// <param name="location"></param>
|
/// <returns></returns>
|
/// <History>[Hanhe(zh)] created 2018-5-3</History>
|
public AutoBomLocationEntity GetModel(string location, string stock)
|
{
|
IMongoQuery query = Query.And(Query.EQ("CN_S_LOCATION_CODE", location));
|
if (!string.IsNullOrEmpty(stock))
|
{
|
query = Query.And(query, Query.EQ("CN_S_STOCK_CODE", stock));
|
}
|
return MongoDBSingleton.Instance.FindOne<AutoBomLocationEntity>(query, "TN_AB_STOCK_LOCATION");
|
}
|
#endregion
|
|
#region 更新库区编号获取库区下的所有货位
|
/// <summary>
|
/// 更新库区编号获取库区下的所有货位
|
/// </summary>
|
/// <param name="areaCode">库区编号</param>
|
/// <returns></returns>
|
/// <History>[Hanhe(DBS)] CREATED 2018-11-29</History>
|
public List<AutoBomLocationEntity> GetAreaLocations(string areaCode)
|
{
|
IMongoQuery query = Query.And(Query.EQ("CN_S_AREA_CODE", areaCode));
|
return MongoDBSingleton.Instance.Find<AutoBomLocationEntity>(query,"TN_AB_STOCK_LOCATION");
|
}
|
#endregion
|
|
#region 根据货位获取仓库库区实体(MongoDB)
|
/// <summary>
|
/// 根据货位获取仓库库区实体(MongoDB)
|
/// </summary>
|
/// <param name="areaCode">库区编号</param>
|
/// <returns></returns>
|
/// <History>[Hanhe(XDL)] created 2018-4-18</History>
|
/// <History>[Hanhe(DBS)] created 2018-5-18</History>
|
public AutoBomStockAreaEntity GetAreaModelByLocation(string locationCode)
|
{
|
AutoBomLocationEntity locationModel = GetModel(locationCode);
|
if (locationModel == null)
|
return null;
|
IMongoQuery query = Query.And(Query.EQ("CN_S_AREA_CODE", locationModel.CN_S_AREA_CODE));
|
return MongoDBSingleton.Instance.FindOne<AutoBomStockAreaEntity>(query, "TN_AB_B_STOCK_AREA");
|
}
|
#endregion
|
}
|
}
|