qinchulong
2025-03-02 547436626cfe9cb01ae95b0bde9886b9cf46a9f2
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/dt_batchinfoService.cs
@@ -5,6 +5,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_ISystemServices;
@@ -24,5 +25,73 @@
            _mapper = mapper;
        }
        /// <summary>
        /// ä¿®æ”¹å…¥åº“批次信息
        /// </summary>
        /// <param name="batch"></param>
        /// <returns></returns>
        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;
        }
        /// <summary>
        /// ä¿®æ”¹å‡ºåº“批次信息
        /// </summary>
        /// <param name="batch"></param>
        /// <returns></returns>
        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;
        }
        /// <summary>
        /// ä¿®æ”¹å‡ºåº“物料信息,需要出外购还是自产
        /// </summary>
        /// <param name="batch"></param>
        /// <returns></returns>
        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;
        }
    }
}