using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Common.StockEnum; using WIDESEA_Core.BaseRepository; using WIDESEA_Core.BaseServices; using WIDESEA_IStockService; using WIDESEA_Model.Models.Outbound; using WIDESEA_Model.Models.Stock; namespace WIDESEA_StockService { public class StockInfo_HtyService : ServiceBase>, IStockInfo_HtyService { public StockInfo_HtyService(IRepository BaseDal) : base(BaseDal) { } public IRepository Repository => BaseDal; //获取未发送的库存 public List selectStockInfoHty() { List stockinfoHty = new List(); stockinfoHty = BaseDal.QueryData(x => x.StockStatus == (int)StockHtyStatusEmun.未同步).ToList(); return stockinfoHty; } //存储未发送的数据(预防MSE掉线,恢复通信数据提交) public List AddStockInfoHty(List StockInfo) { List StockInfo_Hty = new List(); int s = StockInfo.Count() - 1; for (int i = 0; i <= s; i++) { StockInfo_Hty[i].PalletCode = StockInfo[i].PalletCode; StockInfo_Hty[i].LocationCode = StockInfo[i].LocationCode; StockInfo_Hty[i].StockStatus = (int)StockHtyStatusEmun.未同步; StockInfo_Hty[i].MaterielCode1 = StockInfo[i].MaterielCode1; StockInfo_Hty[i].MaterielCode2 = StockInfo[i].MaterielCode2; StockInfo_Hty[i].MaterielCode3 = StockInfo[i].MaterielCode3; StockInfo_Hty[i].MaterielCode4 = StockInfo[i].MaterielCode4; StockInfo_Hty[i].StockType = StockInfo[i].StockType; StockInfo_Hty[i].MaterielName = StockInfo[i].MaterielName; StockInfo_Hty[i].Remark = StockInfo[i].Remark; } BaseDal.AddData(StockInfo_Hty); return StockInfo_Hty; } } }