using HH.WMS.Common;
|
using HH.WMS.DAL.Basic;
|
using HH.WMS.Entitys;
|
using HH.WMS.Entitys.Basic;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using HH.WMS.Common.External;
|
|
namespace HH.WMS.BLL.Basic
|
{
|
public class TN_WM_B_STOCK_QTYBLL : DapperBaseBLL
|
{
|
#region REDUCE QTY
|
|
public OperateResult ReduceQtyAndAlloc(List<TN_WM_B_STOCK_QTYEntity> reduceStockQty, IDbTransaction trans, LogPara logPara = null)
|
{
|
var result = CreateDAL<TN_WM_B_STOCK_QTYDAL>().ReduceStockQtyAndAllocQty(reduceStockQty, trans);
|
if(logPara != null)
|
Log.Detail(logPara, "降仓库库存和分配量" + result.Describe());
|
return result;
|
}
|
|
#endregion
|
public OperateResult ReduceStockAlloc(List<TN_WM_B_STOCK_QTYEntity> reduceStockQty, IDbTransaction trans, LogPara logPara = null)
|
{
|
var result = CreateDAL<TN_WM_B_STOCK_QTYDAL>().ReduceStockAllocQty(reduceStockQty, trans);
|
if (logPara != null)
|
Log.Detail(logPara, "降仓库库存和分配量" + result.Describe());
|
return result;
|
}
|
|
public List<TN_WM_B_STOCK_QTYEntity> AddItemWeight(List<TN_WM_B_STOCK_QTYEntity> areaQtys)
|
{
|
foreach (var areaQty in areaQtys)
|
{
|
|
var item = CreateDAL<TN_WMS_ITEMDAL>().GetItemEntity(areaQty.CN_S_ITEM_CODE);
|
if (item != null)
|
{
|
Log.Detail("添加物料净重:", item.CN_F_NW.ToString());
|
areaQty.CN_F_PLANNED_QTY = item.CN_F_NW;
|
}
|
}
|
return areaQtys;
|
}
|
|
public OperateResult AddList(List<TN_WM_B_STOCK_QTYEntity> stockQtyList, IDbTransaction trans, bool isDefaultOwner = false)
|
{
|
Log.Detail("TN_WM_B_AREA_QTYBLL.AddList", "添加仓库量表!");
|
stockQtyList = AddItemWeight(stockQtyList);
|
return CreateDAL<TN_WM_B_STOCK_QTYDAL>().AddStockQty(stockQtyList, trans);
|
}
|
}
|
}
|