| | |
| | | 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; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace WIDESEA_WCS.Services |
| | | { |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åæ¶å·¥ååºåºå¤å |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CancelsorcingWorkOrder(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string compeletor = UserContext.Current.UserName; |
| | | List<string> list = new List<string>(); |
| | | try |
| | | { |
| | | foreach (var Key in saveModel.DelKeys) |
| | | { |
| | | var mes_head = _repository.Find(x => x.mes_id.ToString() == Key.ToString()).FirstOrDefault(); |
| | | if (mes_head != null) |
| | | { |
| | | mes_head.area = null; |
| | | _repository.Update(mes_head, x => new { x.area }, true); |
| | | list.Add(mes_head.jobID); |
| | | } |
| | | } |
| | | content.Data = list; |
| | | content.OK(); |
| | | WriteDBLog.Success("åæ¶å·¥ååºåºå¤å", content, "PCS", compeletor); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | WriteDBLog.Error("åæ¶å·¥ååºåºå¤å", content, "PCS", compeletor); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// å·¥ååºåºå¤å |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent OutsorcingWorkOrder(SaveModel model) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string compeletor = UserContext.Current.UserName; |
| | | List<string> list = new List<string>(); |
| | | try |
| | | { |
| | | 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, x => new { x.area }, true); |
| | | list.Add(mes_head.jobID); |
| | | } |
| | | } |
| | | content.Data = list; |
| | | content.OK(); |
| | | WriteDBLog.Success("æå®å·¥ååºåºå¤å", content, "PCS", compeletor); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | WriteDBLog.Error("æå®å·¥ååºåºå¤å", content, "PCS", compeletor); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// 宿工å |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent FinishWorkOrder(SaveModel model) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | 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; |
| | | } |
| | | } |
| | | } |