using HH.WMS.DAL;
|
using HH.WMS.DAL.Basic;
|
using HH.WMS.Entitys;
|
using HH.WMS.Entitys.Autobom;
|
using HH.WMS.Entitys.Basic;
|
using HH.WMS.Entitys.Common;
|
using HH.WMS.Entitys.Entitys;
|
/********************************************************************************
|
|
** auth: DBS
|
|
** date: 2018/12/3 17:03:13
|
|
** desc: 尚未编写描述
|
|
** Ver.: V1.0.0
|
|
*********************************************************************************/
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace HH.WMS.BLL.Basic
|
{
|
public class TN_WM_LOCATION_EXTBLL : DapperBaseBLL, ITN_WM_LOCATION_EXTBLL
|
{
|
#region 根据巷道获取巷道内的货位状态
|
|
/// <summary>
|
/// 根据巷道获取巷道内的货位状态
|
/// </summary>
|
/// <param name="stockCode">仓库号</param>
|
/// <param name="areaCode">库区号</param>
|
/// <param name="roadway">巷道号</param>
|
/// <returns></returns>
|
/// <History>[Hanhe(DBS)] created 2018/12/03</History>
|
public DataTable ViewState(string stockCode, string areaCode, string roadway)
|
{
|
var dt = CreateDAL<TN_WM_LOCATION_EXTDAL>().ViewState(stockCode, areaCode, roadway);
|
dt.Columns["VIEW_STATE"].ReadOnly = false;
|
foreach (DataRow row in dt.Rows)
|
{
|
if (row["VIEW_STATE"].ToString().Equals("满"))
|
{
|
var trayLocation = CreateDAL<DapperDAL<TN_WM_B_TRAY_LOCATIONEntity>>().GetSingleEntity(new { CN_S_LOCATION_CODE = row["CN_S_LOCATION_CODE"].ToString() });
|
if (trayLocation != null)
|
{
|
var trayInfo = CreateDAL<DapperDAL<TN_WM_B_TRAY_INFOEntity>>().GetSingleEntity(new { CN_S_TRAY_CODE = trayLocation.CN_S_TRAY_CODE });
|
if (trayInfo != null)
|
{
|
if (!string.IsNullOrEmpty(trayInfo.CN_S_USE_STATE) && trayInfo.CN_S_USE_STATE.Trim() != "空")
|
row["VIEW_STATE"] = trayInfo.CN_S_USE_STATE;
|
}
|
}
|
}
|
}
|
return dt;
|
}
|
|
#endregion
|
|
public List<TN_WM_LOCATION_EXTEntity> GetModel(string strWhere)
|
{
|
return CreateDAL<TN_WM_LOCATION_EXTDAL>().GetModel(strWhere);
|
}
|
public List<TN_WM_LOCATION_EXTEntity> GetModelByRow(string strRow, string strArea)
|
{
|
return CreateDAL<TN_WM_LOCATION_EXTDAL>().GetModelByRow(strRow, strArea);
|
}
|
public TN_WM_LOCATION_EXTEntity GetExtModel(string strWhere)
|
{
|
List<TN_WM_LOCATION_EXTEntity> lst = CreateDAL<TN_WM_LOCATION_EXTDAL>().GetModel(strWhere);
|
if (!lst.Any())
|
{
|
return null;
|
}
|
return lst[0];
|
}
|
|
#region 删除
|
/// <summary>
|
/// 删除
|
/// </summary>
|
/// <param name="lstGuid">要删除的ID集合</param>
|
/// <param name="trans"></param>
|
/// <returns></returns>
|
public SqlExecuteResult Delete(string Where)
|
{
|
SqlExecuteResult result = new SqlExecuteResult();
|
result = CreateDAL<TN_WM_LOCATION_EXTDAL>().Delete(Where, null);
|
return result;
|
}
|
#endregion
|
|
public SqlExecuteResult Add(TN_WM_LOCATION_EXTEntity Entity)
|
{
|
SqlExecuteResult result = new SqlExecuteResult();
|
OperateResult Opresult = CreateDAL<DapperDAL<TN_WM_LOCATION_EXTEntity>>().Add(Entity, null);
|
result.Success = Opresult.Success;
|
result.Exception = new Exception(Opresult.Msg);
|
return result;
|
}
|
|
public SqlExecuteResult UpdateSync(TN_WM_LOCATION_EXTEntity Entity)
|
{
|
SqlExecuteResult result = CreateDAL<TN_WM_LOCATION_EXTDAL>().UpdateSync(Entity, null);
|
return result;
|
}
|
|
public SqlExecuteResult UpdateBFState(string where, string tableName)
|
{
|
SqlExecuteResult result = new SqlExecuteResult();
|
result = CreateDAL<TN_WM_LOCATION_EXTDAL>().UpdateBFState(where, tableName, null);
|
return result;
|
}
|
|
#region 更新状态
|
|
public OperateResult UpdateState(string locationCode, string state, string bState)
|
{
|
var result = CreateDAL<TN_WM_LOCATION_EXTDAL>().UpdateLocationExtState(locationCode, state, bState, "", null);
|
return result;
|
}
|
|
public OperateResult UpdateState(string locationCode, string state, string bState, IDbTransaction trans)
|
{
|
var result = CreateDAL<TN_WM_LOCATION_EXTDAL>().UpdateLocationExtState(locationCode, state, bState, "", trans);
|
return result;
|
}
|
|
#endregion
|
|
#region 更新状态根据托盘码
|
|
public OperateResult UpdateStateByTrayCode(string trayCode, string locationState, string useState, IDbTransaction trans)
|
{
|
var result = CreateDAL<TN_WM_LOCATION_EXTDAL>().UpdateStateByTrayCode(trayCode, locationState, useState, trans);
|
return result;
|
}
|
|
#endregion
|
|
#region
|
|
public OperateResult UpdateLocationExtState(string locationCode, string locationState, string locationUseState, string taskNo, IDbTransaction trans)
|
{
|
var result = CreateDAL<TN_WM_LOCATION_EXTDAL>().UpdateLocationExtState(locationCode, locationState, locationUseState, taskNo, trans);
|
return result;
|
}
|
|
#endregion
|
|
#region 查询货位拓展表
|
/// <summary>
|
/// 查询货位拓展表
|
/// </summary>
|
/// <param name="searchModel">实体</param>
|
/// <returns></returns>
|
/// <History>[HANHE(lt)] CREATED BY 2018-12-18</History>
|
public OperateResult GetLocationExtList(SearchModel searchModel)
|
{
|
return CreateDAL<TN_WM_LOCATION_EXTDAL>().GetLocationExtList(searchModel);
|
}
|
#endregion
|
|
/// <summary>
|
/// 根据仓库获取存储情况
|
/// </summary>
|
/// <param name="stockCode">仓库号</param>
|
/// <returns></returns>
|
public DataTable GetAreaStorageInfo(string stockCode,string[] areas)
|
{
|
return CreateDAL<TN_WM_LOCATION_EXTDAL>().GetAreaStorageInfo(stockCode, areas);
|
}
|
|
#region 获取货位列表
|
|
public List<TN_WM_LOCATION_EXTEntity> GetLocationList()
|
{
|
return CreateDAL<TN_WM_LOCATION_EXTDAL>().GetLocationList();
|
}
|
|
#endregion
|
|
#region 获取货位状态数量
|
|
public DataTable GetStateQty(string stockCode)
|
{
|
return CreateDAL<TN_WM_LOCATION_EXTDAL>().GetStateQty(stockCode);
|
}
|
|
#endregion
|
}
|
}
|