using HH.WMS.Common; using HH.WMS.DAL.Basic; using HH.WMS.Entitys; using HH.WMS.Entitys.Basic; using HH.WMS.Entitys.Dto; 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_AREA_QTYBLL : DapperBaseBLL { #region GET #endregion #region REDUCE QTY public OperateResult ReduceQtyAndAlloc(List AreaQtyList, string areaCode, IDbTransaction trans, LogPara logPara = null) { var result = CreateDAL().ReduceAreaQtyAndAllocQty(AreaQtyList, areaCode, logPara, trans); if(logPara != null) Log.Detail(logPara, "降库区量表并降分配量" + result.Describe()); return result; } #endregion public OperateResult ReduceQtyAlloc(List AreaQtyList, string areaCode, IDbTransaction trans, LogPara logPara = null) { var result = CreateDAL().ReduceAreaAllocQty(AreaQtyList, areaCode, logPara, trans); if (logPara != null) Log.Detail(logPara, "降库区量表并降分配量" + result.Describe()); return result; } #region 根据条件汇总当前库存 /// /// 根据条件汇总当前库存 /// /// 物料编码 /// 条件 /// /// [HANHE(XDL)] CREATED BY 2018-11-16 public TN_WM_B_AREA_QTYEntity GetAreaSummaryQty(string itemCode, string strWhere) { return CreateDAL().GetAreaSummaryQty(itemCode, strWhere); } #endregion public List GetAreaQtyByOwner(string ownerCode) { return CreateDAL().GetAreaQtyByOwner(ownerCode); } public List AddItemWeight(List areaQtys) { foreach (var areaQty in areaQtys) { var item = CreateDAL().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 areaQtyList, IDbTransaction trans, bool isDefaultOwner = false) { Log.Detail("TN_WM_B_AREA_QTYBLL.AddList", "添加库区量表!"); areaQtyList = AddItemWeight(areaQtyList); return CreateDAL().AddAreaQty(areaQtyList, trans); } } }