using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using WMS.IData; using WMS.Model.RK; using WMS.Common; using WMS.Business.Base; using WMS.Model.Base; namespace WMS.Business.RK { /// /// 入库商品清单 /// public class BussWareNoticeTab : IBussFactory { /// /// 查询箱子的状态 /// /// /// /// public List GetPrintBoxData(string orderId, string GoodsId) { List boxCodeList = new List(); DataTable table = DataProvider.Instance.WareNoticeTab.GetPrintBoxData(orderId, GoodsId); if(table != null) { boxCodeList = ConvertHelper.ConvertToList(table); } return boxCodeList; } /// /// 打印成功更改打印标记 /// /// /// /// public string UpdatePrint(string orderId, string GoodsId) { DataProvider.Instance.WareNoticeTab.UpdatePrint(orderId, GoodsId); WareNoticeModel note = new WareNoticeModel(); note.WAREHOUSING_ID = orderId; note.STATE = "1"; DataProvider.Instance.WareNotice.updateWareNoticeState(note); logList.Add(DataProvider.Instance.logData); Transaction = DataProvider.Instance.TranOracle; TaCmtOrRak(); return ErrText; } /// /// 查询打印数据 /// /// /// /// public DataTable GetPrintData(string orderId, string goodsId) { return DataProvider.Instance.WareNoticeTab.GetPrintData(orderId, goodsId); } public int GetCtPringCs(string orderId, string GoodsId) { int printsts = 0; DataTable tb= DataProvider.Instance.WareNoticeTab.GetCtPringCs(orderId, GoodsId); if(tb!=null) { if(tb.Rows.Count>0) { printsts = int.Parse(tb.Rows[0]["PrintSts"].ToString()); } } return printsts; } /// /// 更新打印标记和装箱数 /// /// /// /// /// public string UpdatePrintSts(string measureId,string orderId, string GoodsId, string GOODSVOLUME, int BOXCT) { DataProvider.Instance.WareNoticeTab.UpdatePrintSts(measureId,orderId, GoodsId, GOODSVOLUME, BOXCT); return ErrText; } /// /// 获取入库商品清单 /// /// 入库通知单 /// 入库商品清单 public List GetWareNoticeTabList(WareNoticeTabModel model) { DataTable table = DataProvider.Instance.WareNoticeTab.GetWareNoticeTabDT(model); List WareNoticeTabModel = ConvertHelper.ConvertToList(table); if (DataLogErrWrite(table, "获取入库商品明细:")) { return WareNoticeTabModel; } return null; } /// /// 插入或修改入库商品清单 /// /// 入库通知单详细Model /// 操作表示符 0:新增; 1:修改 /// 是否成功 public string InsertOrUpdateWareNoticeTab(WareNoticeTabModel wareNoticeTabModel, int Flag) { //根据数量计算总金额、体积、重量 decimal amount = wareNoticeTabModel.AMOUNT; BussGoods bg = new BussGoods(); //GoodsInfoModel gm = bg.GetGoodsList(wareNoticeTabModel.GOODS_ID,"","","")[0]; //wareNoticeTabModel.TOTAL_MONEY = gm.PRICE * amount; //wareNoticeTabModel.TOTAL_NET_WEIGH = gm.NET_WEIGHT * amount; //wareNoticeTabModel.TOTAL_ROUGH_WEIGHT = gm.GROSS_WEIGHT * amount; //wareNoticeTabModel.TOTAL_VOLUME = gm.GVOLUME * amount; //DataProvider.Instance.WareNoticeTab.InsertOrUpdateWareNoticeTab(wareNoticeTabModel, Flag); DataLogErrWrite("插入或修改入库商品明细:"); return ErrText; } /// /// 删除入库商品清单 /// /// 入库商品清单Model /// 是否成功 public string DeleteWareNoticeTab(WareNoticeTabModel model) { DataProvider.Instance.WareNoticeTab.DeleteWareNoticeTab(model); logList.Add(DataProvider.Instance.logData); Transaction = DataProvider.Instance.TranOracle; TaCmtOrRak(); return ErrText; } /// /// 通过入库通知单编号集合查出入库商品清单信息的集合 /// /// 类似于(1,2,3,4) /// public List GetWareNoticeTabByList(string strListID) { DataTable tb= DataProvider.Instance.WareNoticeTab.GetWareNoticeTabByList(strListID); if (tb != null) { List WareNoticeTabModel = ConvertHelper.ConvertToList(tb); return WareNoticeTabModel; } return null; } ///// ///// 根据角色编号返回角色所属仓库、库区 ///// ///// 用户角色编号 ///// 角色所属仓库、库区 //public RoleStorageModel GetRoleStorageArea(string roleID) //{ // DataTable table = DataProvider.Instance.WareNoticeTab.GetRoleStorageAreaDT(roleID); // RoleStorageModel model = ConvertHelper.ConvertToList(table)[0]; // if (DataLogErrWrite(table, "根据角色编号返回角色所属仓库、库区")) // { // return model; // } // return null; //} } }