分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-01 19c66ba052a7fb26c4d27deaa75ae46479eee342
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs
@@ -17,6 +17,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_WCS.IRepositories;
using WIDESEA_Core.EFDbContext;
using WIDESEA_WCS.JobsPart.Common;
using WIDESEA_Core.ManageUser;
namespace WIDESEA_WCS.Services
{
@@ -37,5 +40,28 @@
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
  }
        public WebResponseContent FinishWorkOrder(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            VOLContext context = new VOLContext();
            try
            {
                string compeletor = UserContext.Current.UserName;
                foreach (var Key in model.DelKeys)
                {
                    var mes_head = _repository.Find(x => x.mes_id.ToString() == Key.ToString()).FirstOrDefault();
                    if (mes_head != null)
                    {
                        AutoUpdateWork.AddHtyMesWork(mes_head, _repository, compeletor, "手动完成");
                    }
                }
                content.OK();
            }
            catch (Exception ex)
            {
            }
            return content;
        }
    }
}