分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-16 f0e2d9d2c7c41b311217bdb2c4d114ff53f6a146
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs
@@ -20,6 +20,7 @@
using WIDESEA_Core.EFDbContext;
using WIDESEA_WCS.JobsPart.Common;
using WIDESEA_Core.ManageUser;
using WIDESEA_Comm.LogInfo;
namespace WIDESEA_WCS.Services
{
@@ -40,10 +41,35 @@
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
        public WebResponseContent OutsorcingWorkOrder(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            string compeletor = UserContext.Current.UserName;
            try
            {
                List<string> list = new List<string>();
                foreach (var Key in model.DelKeys)
                {
                    var mes_head = _repository.Find(x => x.mes_id.ToString() == Key.ToString()).FirstOrDefault();
                    if (mes_head != null)
                    {
                        mes_head.area = "外协";
                        _repository.Update(mes_head, true);
                        list.Add(mes_head.jobID);
                    }
                }
                content.OK();
                WriteDBLog.Success("指定工单出库外协", $"工单编号:{list}", "PCS", compeletor);
            }
            catch (Exception ex)
            {
                WriteDBLog.Error("指定工单出库外协", $"错误信息:{ex.Message}", "PCS", compeletor);
            }
            return content;
        }
        public WebResponseContent FinishWorkOrder(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            VOLContext context = new VOLContext();
            try
            {
                string compeletor = UserContext.Current.UserName;