using AutoMapper; using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseRepository; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_ISystemServices; using WIDESEAWCS_Model.Models; namespace WIDESEAWCS_SystemServices { public class dt_batchinfoService : ServiceBase>, Idt_BatchinfoService { private readonly IMapper _mapper; public override PageGridData GetPageData(PageDataOptions options) { return base.GetPageData(options); } /// /// 仓储层(数据库访问) /// public IRepository Repository => BaseDal; public dt_batchinfoService(IRepository BaseDal, IMapper mapper) : base(BaseDal) { _mapper = mapper; } /// /// 修改入库批次信息 /// /// /// public WebResponseContent UpdateInBatch(string batch) { WebResponseContent content = new WebResponseContent(); try { var batchibfo = BaseDal.QueryFirst(v=>v.Id==1); batchibfo.InBatch = batch; BaseDal.UpdateData(batchibfo); content = WebResponseContent.Instance.OK(); } catch (Exception ex) { content = WebResponseContent.Instance.Error($"修改入库批次号失败:【{ex.Message}】"); } return content; } /// /// 修改出库批次信息 /// /// /// public WebResponseContent UpdateOutBatch(string batch) { WebResponseContent content = new WebResponseContent(); try { var batchibfo = BaseDal.QueryFirst(v => v.Id == 1); batchibfo.OutBatch = batch; BaseDal.UpdateData(batchibfo); content = WebResponseContent.Instance.OK(); } catch (Exception ex) { content = WebResponseContent.Instance.Error($"修改入库批次号失败:【{ex.Message}】"); } return content; } /// /// 修改出库物料信息,需要出外购还是自产 /// /// /// public WebResponseContent UpdateOutStorageMode(int mode) { WebResponseContent content = new WebResponseContent(); try { var batchibfo = BaseDal.QueryFirst(v => v.Id == 1); batchibfo.materType = mode; BaseDal.UpdateData(batchibfo); content = WebResponseContent.Instance.OK(); } catch (Exception ex) { content = WebResponseContent.Instance.Error($"修改入库批次号失败:【{ex.Message}】"); } return content; } } }