已添加16个文件
已修改32个文件
已删除1个文件
已重命名5个文件
| | |
| | | } |
| | | |
| | | else if (process.env.NODE_ENV == 'production') { |
| | | axios.defaults.baseURL = 'http://115.159.85.185:9291/'; |
| | | axios.defaults.baseURL = 'http://127.0.0.1:9291/'; |
| | | } |
| | | if (!axios.defaults.baseURL.endsWith('/')) { |
| | | axios.defaults.baseURL+="/"; |
| | |
| | | icon: "el-icon-document", //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | type: "primary", //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | onClick: function () { |
| | | this.$Message.success("ç¹å»äºæé®"); |
| | | this.$Message.success("å¼å¯æå¡"); |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | const loading = ref(false); |
| | | const codeImgSrc = ref(''); |
| | | const userInfo = reactive({ |
| | | userName: '', |
| | | password: '', |
| | | verificationCode: '', |
| | | userName: 'admin', |
| | | password: '123456', |
| | | verificationCode: '1234', |
| | | UUID: undefined |
| | | }); |
| | | |
| | |
| | | { |
| | | return TaskTypeGroup.OutbondGroup; |
| | | } |
| | | else if (!int.TryParse(Enum.Parse<TaskInStatusEnum>(taskType.ToString()).ToString(), out result)) |
| | | else if (!int.TryParse(Enum.Parse<TaskInboundTypeEnum>(taskType.ToString()).ToString(), out result)) |
| | | { |
| | | return TaskTypeGroup.InboundGroup; |
| | | } |
| | |
| | | /// </summary> |
| | | [Description("空æçåºåº")] |
| | | OutTray = 104, |
| | | |
| | | /// <summary> |
| | | /// 空æçåºåº |
| | | /// </summary> |
| | | [Description("空æçåºåº")] |
| | | OutNG = 105, |
| | | } |
| | | |
| | | public enum TaskRelocationTypeEnum |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net.Http.Headers; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | |
| | | { |
| | | public class HttpHelper |
| | | { |
| | | public static async Task<string> GetAsync(string serviceAddress, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static async Task<string> GetAsync(string serviceAddress, Dictionary<string, object> parameters, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | { |
| | | try |
| | | { |
| | | string result = string.Empty; |
| | | using HttpClient httpClient = new HttpClient(); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 60); |
| | | // å°åæ°æ¼æ¥å°URLä¸ |
| | | string queryString = string.Join("&", parameters.Select(x => $"{x.Key}={x.Value}")); |
| | | serviceAddress += "?" + queryString; |
| | | |
| | | if (headers != null) |
| | | { |
| | | foreach (var header in headers) |
| | | httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); |
| | | } |
| | | |
| | | result = await httpClient.GetAsync(serviceAddress).Result.Content.ReadAsStringAsync(); |
| | | return result; |
| | |
| | | using HttpClient httpClient = new HttpClient(); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 60); |
| | | |
| | | if (headers != null) |
| | | { |
| | | foreach (var header in headers) |
| | | httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); |
| | | |
| | | } |
| | | result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync(); |
| | | } |
| | | return result; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_DTO.MOM |
| | | { |
| | | public class RequestEqptRunDto : BasicDto |
| | | { |
| | | /// <summary> |
| | | /// 人åå¯ç |
| | | /// </summary> |
| | | public string Password { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®¾å¤æ¨¡å¼ |
| | | /// </summary> |
| | | public string EquipmentModel { get; set; } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_DTO.WMS |
| | | namespace WIDESEAWCS_DTO.WMS |
| | | { |
| | | public class RequestTaskDto |
| | | { |
| | |
| | | /// æçå· |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 空æçå¯å
¥å··å° |
| | | /// </summary> |
| | | public string PositionList { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public string RequestType { get; set; } = string.Empty; |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | Dt_Task QueryConveyorLineTask(string deviceNo, string currentAddress); |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæ¥è¯¢è¾éçº¿æªæ§è¡çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | Dt_Task QueryNextConveyorLineTask(string deviceNo, string currentAddress); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æçå·ãå½åå°åæ¥è¯¢è¾éçº¿æªæ§è¡çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="Barcode">æçå·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | Dt_Task QueryBarCodeConveyorLineTask(string Barcode, string currentAddress); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä»»å¡å·ãä¸ä¸å°åæ¥è¯¢è¾é线æ§è¡ä¸çä»»å¡ |
| | | /// </summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.DB.Models; |
| | | |
| | | namespace WIDESEAWCS_Model.Models |
| | | { |
| | | [SugarTable("Dt_Platform", "设å¤å·¥èºåæ°")] |
| | | public class Platform : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// 主é®ID |
| | | /// </summary> |
| | | [ImporterHeader(Name = "主é®")] |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// ç«å°ç¼å·ï¼å¯ä¸æ è¯æ¯ä¸ªç«å°çç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç«å°ç¼å·ï¼å¯ä¸æ è¯æ¯ä¸ªç«å°çç¼å·")] |
| | | [ExporterHeader(DisplayName = "ç«å°ç¼å·ï¼å¯ä¸æ è¯æ¯ä¸ªç«å°çç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°ç¼å·ï¼å¯ä¸æ è¯æ¯ä¸ªç«å°çç¼å·")] |
| | | public string PlatCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°åç§°ï¼ç«å°çåç§°ææè¿° |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç«å°åç§°")] |
| | | [ExporterHeader(DisplayName = "ç«å°åç§°")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°åç§°")] |
| | | public string PlatformName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 对åºå åæº |
| | | /// </summary> |
| | | [ImporterHeader(Name = "对åºå åæº")] |
| | | [ExporterHeader(DisplayName = "对åºå åæº")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对åºå åæº")] |
| | | public string Stacker { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§è¡æ¹æ³ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æ§è¡æ¹æ³")] |
| | | [ExporterHeader(DisplayName = "æ§è¡æ¹æ³")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ§è¡æ¹æ³")] |
| | | public string ExecutionMethod { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°ç±»åï¼ç«å°çç±»å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç«å°ç±»å")] |
| | | [ExporterHeader(DisplayName = "ç«å°ç±»å")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°ç±»å")] |
| | | public string PlatformType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 对åºPLCç¼å·ï¼ä¸ç«å°å¯¹åºçPLCçç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "对åºPLCç¼å·")] |
| | | [ExporterHeader(DisplayName = "对åºPLCç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对åºPLCç¼å·")] |
| | | public string PLCCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°ä½ç½® |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç«å°ä½ç½®")] |
| | | [ExporterHeader(DisplayName = "ç«å°ä½ç½®")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç«å°ä½ç½®")] |
| | | public string Location { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°å®¹é |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç«å°å®¹é")] |
| | | [ExporterHeader(DisplayName = "ç«å°å®¹é")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç«å°å®¹é")] |
| | | public int Capacity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°ç¶æï¼é»è®¤ä¸º'Active' |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç«å°ç¶æ")] |
| | | [ExporterHeader(DisplayName = "ç«å°ç¶æ")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç«å°ç¶æ")] |
| | | public string Status { get; set; } = "Active"; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEAWCS_IProcessRepository; |
| | | |
| | | public interface IPlatFormRepository : IRepository<Platform> |
| | | { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEAWCS_ProcessRepository; |
| | | |
| | | public class PlatFormRepository : RepositoryBase<Platform>, IPlatFormRepository |
| | | { |
| | | public PlatFormRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | throw new Exception("æªæ¾å°å议信æ¯"); |
| | | throw new Exception("æªæ¾å°å议信æ¯:" + deviceChildCode); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | throw new Exception("æªæ¾å°å议信æ¯"); |
| | | throw new Exception("æªæ¾å°å议信æ¯:" + deviceChildCode); |
| | | } |
| | | else |
| | | { |
| | |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | #region ç宿°æ® |
| | | #region 请æ±å
¥åºä»»å¡å··é |
| | | // TODO: è°ç¨æ¥å£è·åä¸ä¸ä¸ªå°å |
| | | //// å建请æ±å¯¹è±¡ |
| | | //RequestTaskDto request = new RequestTaskDto() |
| | | //{ |
| | | // Position = sourceAddress, |
| | | // PalletCode = palletCode, |
| | | //}; |
| | | // å建请æ±å¯¹è±¡ |
| | | RequestTaskDto request = new RequestTaskDto() |
| | | { |
| | | Position = sourceAddress, |
| | | PalletCode = palletCode, |
| | | }; |
| | | |
| | | //// åé请æ±å¹¶çå¾
ååº |
| | | //var result = HttpHelper.PostAsync("http:127.0.0.1:8098/api/Task/RequestTaskAsync", request.ToJsonString()).Result; |
| | | // åé请æ±å¹¶çå¾
ååº |
| | | var result = HttpHelper.PostAsync("http://127.0.0.1:5000/api/Task/RequestTaskAsync", request.ToJsonString()).Result; |
| | | |
| | | //// ååºååååºå
容 |
| | | //content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | // ååºååååºå
容 |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | //// æ£æ¥ç¶æå¹¶è¿å |
| | | //if (!content.Status) |
| | | // return content; |
| | | |
| | | //// ååºåå任塿°æ® |
| | | //WMSTaskDTO task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | |
| | | //// å¤çä»»å¡å¹¶è¿åç»æ |
| | | //content = ReceiveWMSTask(new List<WMSTaskDTO> { task }); |
| | | |
| | | #endregion |
| | | |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | WMSTaskDTO task = new WMSTaskDTO(); |
| | | // æ£æ¥ç¶æå¹¶è¿å |
| | | if (!content.Status) |
| | | { |
| | | task = new WMSTaskDTO() |
| | | { |
| | | TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")), |
| | | Grade = 1, |
| | | PalletCode = palletCode, |
| | | RoadWay = "CHSC01", |
| | | SourceAddress = sourceAddress, |
| | | TargetAddress = "CHSC01", |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TargetAddress = "1020", |
| | | TaskState = (int)TaskOutStatusEnum.Line_OutExecuting, |
| | | Id = 0, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound |
| | | TaskType = (int)TaskOutboundTypeEnum.Outbound |
| | | }; |
| | | |
| | | content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | Dt_Task task1 = _mapper.Map<Dt_Task>(task); |
| | | task1.CurrentAddress = task.SourceAddress; |
| | | task1.NextAddress = "1020"; |
| | | BaseDal.AddData(task1); |
| | | return content.OK(); |
| | | } |
| | | else |
| | | { |
| | | // ååºåå任塿°æ® |
| | | task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | // å¤çä»»å¡å¹¶è¿åç»æ |
| | | content = ReceiveWMSTask(new List<WMSTaskDTO> { task }); |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | public Dt_Task QueryConveyorLineTask(string deviceNo, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæ¥è¯¢è¾éçº¿æªæ§è¡çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryNextConveyorLineTask(string deviceNo, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.NextAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æçå·ãå½åå°åæ¥è¯¢è¾éçº¿æªæ§è¡çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="Barcode">æçå·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryBarCodeConveyorLineTask(string Barcode, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress && x.PalletCode == Barcode, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | if (task.TaskState == (int)TaskInStatusEnum.Line_InFinish) |
| | | { |
| | | Random random = new Random(); |
| | | |
| | | #region å
¥åºè°ç¨æ¥å£è·åè´§ä½å°å |
| | | // TODO: è°ç¨æ¥å£è·åè´§ä½å°å |
| | | // å建请æ±å¯¹è±¡ |
| | | RequestTaskDto taskDto = new RequestTaskDto() |
| | | { |
| | | Position = task.NextAddress, |
| | | PalletCode = task.PalletCode, |
| | | }; |
| | | |
| | | // åé请æ±å¹¶çå¾
ååº |
| | | var abc = HttpHelper.PostAsync("http://127.0.0.1:5000/api/Task/RequestLocationTaskAsync", taskDto.ToJsonString()).Result; |
| | | if (abc == null) |
| | | return content.Error(); |
| | | // ååºååååºå
容 |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(abc); |
| | | |
| | | // æ£æ¥ç¶æå¹¶è¿å |
| | | if (!content.Status) |
| | | return content; |
| | | |
| | | // ååºåå任塿°æ® |
| | | WMSTaskDTO taskResult = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = $"{random.Next(1, 1).ToString().PadLeft(3, '0')}-{random.Next(1, 1).ToString().PadLeft(3, '0')}-{random.Next(1, 1).ToString().PadLeft(3, '0')}"; |
| | | task.NextAddress = taskResult.TargetAddress; |
| | | task.TargetAddress = task.NextAddress; |
| | | |
| | | #region ç宿°æ® |
| | | // TODO: è°ç¨æ¥å£è·åä¸ä¸ä¸ªå°å |
| | | //// å建请æ±å¯¹è±¡ |
| | | //RequestTaskDto request = new RequestTaskDto() |
| | | //{ |
| | | // Position = task.NextAddress, |
| | | // PalletCode = task.PalletCode, |
| | | //}; |
| | | |
| | | //// åé请æ±å¹¶çå¾
ååº |
| | | //var result = HttpHelper.PostAsync("http:127.0.0.1:8098/api/Task/RequestTaskAsync", request.ToJsonString()).Result; |
| | | |
| | | //// ååºååååºå
容 |
| | | //content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | //// æ£æ¥ç¶æå¹¶è¿å |
| | | //if (!content.Status) |
| | | // return content; |
| | | |
| | | //// ååºåå任塿°æ® |
| | | //WMSTaskDTO taskResult = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | |
| | | //task.CurrentAddress = task.NextAddress; |
| | | //task.NextAddress = taskResult.TargetAddress; |
| | | //task.TargetAddress = task.NextAddress; |
| | | #endregion |
| | | |
| | | } |
| | |
| | | BaseDal.UpdateData(task); |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, App.User.UserId > 0 ? $"人工æå¨å°ä»»å¡ç¶æä»ã{oldState}ã跳转å°ã{task.TaskState}ã" : $"ç³»ç»èªå¨æµç¨ï¼ä»»å¡ç¶æä»ã{oldState}ã转å°ã{task.TaskState}ã"); |
| | | |
| | | #region æ´æ°ä»»å¡ç¶æ |
| | | object request = new |
| | | { |
| | | TaskNum = task.TaskNum, |
| | | TaskState = task.TaskState |
| | | }; |
| | | var result = HttpHelper.PostAsync("http://127.0.0.1:5000/api/Task/UpdateTaskStatus", request.ToJsonString()).Result; |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | #endregion |
| | | |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | BaseDal.UpdateData(task); |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºåºåºå®æ"); |
| | | //todo 忥å°WMS |
| | | |
| | | |
| | | //æä¸èèå¤ä¸ªåºåºå£ |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | | { |
| | | //todo |
| | | //todo 忥å°WMS |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | task.TaskState = nextStatus; |
| | | task.ModifyDate = DateTime.Now; |
| | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºå
¥åºå®æ"); |
| | | |
| | | |
| | | //var x = new { taskNum = taskNum }; |
| | | //var result = HttpHelper.GetAsync("http:127.0.0.1:8098/api/Task/CompleteTaskAsync", x.ToJsonString()).Result; |
| | | //content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | //WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | //{ |
| | | // TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")), |
| | | // Grade = 1, |
| | | // PalletCode = task.PalletCode + "S", |
| | | // RoadWay = "SC01", |
| | | // SourceAddress = task.TargetAddress, |
| | | // TargetAddress = "CLOutAreaA", |
| | | // TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | // Id = 0, |
| | | // TaskType = (int)TaskOutboundTypeEnum.Outbound |
| | | //}; |
| | | |
| | | //content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | |
| | | { |
| | | throw new Exception($"ä»»å¡ç±»åé误,æªæ¾å°è¯¥ä»»å¡ç±»å,ä»»å¡å·:ã{taskNum}ã,ä»»å¡ç±»å:ã{task.TaskType}ã"); |
| | | } |
| | | |
| | | |
| | | #region WMS忥任å¡å®æ |
| | | var keys = new Dictionary<string, object>() |
| | | { |
| | | {"taskNum", taskNum} |
| | | }; |
| | | var result = HttpHelper.GetAsync($"http://127.0.0.1:5000/api/Task/CompleteTaskAsync", keys).Result; |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | #endregion |
| | | #region æ´æ°ä»»å¡ç¶æ |
| | | object request = new |
| | | { |
| | | TaskNum = task.TaskNum, |
| | | TaskState = task.TaskState |
| | | }; |
| | | result = HttpHelper.PostAsync("http://127.0.0.1:5000/api/Task/UpdateTaskStatus", request.ToJsonString()).Result; |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | #endregion |
| | | //content = WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IProcessRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class CommonConveyorLineJob : JobBase, IJob |
| | | public partial class CommonConveyorLineJob : JobBase, IJob |
| | | { |
| | | private readonly List<string> _deviceCodes1 = new List<string>() { "1063", "1061", "1060" }; |
| | | private readonly List<string> _deviceCodes2 = new List<string>() { "1067", "1069", "1068" }; |
| | | private readonly string[] HCTrayCode = { "1012", "1013" }; |
| | | private readonly ITaskService _taskService; |
| | | public readonly ITaskService _taskService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IPlatFormRepository _platFormRepository; |
| | | private readonly IMapper _mapper; |
| | | |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository) |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _routerService = routerService; |
| | | _mapper = mapper; |
| | | _taskRepository = taskRepository; |
| | | _platFormRepository = platFormRepository; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //}); |
| | | //tasks.Add(task); |
| | | } |
| | | //for (int i = 0; i < _deviceCodes1.Count; i++) |
| | | //{ |
| | | // ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(_deviceCodes1[i]); |
| | | // if (command.InteractiveSignal != 2) |
| | | // { |
| | | // EmptyTrayReturn(conveyorLine, command, _deviceCodes1[_deviceCodes1.Count - 1], i); |
| | | // } |
| | | //} |
| | | //for (int i = 0; i < _deviceCodes2.Count; i++) |
| | | //{ |
| | | // ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(_deviceCodes2[i]); |
| | | // if (command.InteractiveSignal != 2) |
| | | // { |
| | | // EmptyTrayReturn(conveyorLine, command, _deviceCodes2[_deviceCodes1.Count - 1], i); |
| | | // } |
| | | //} |
| | | foreach (var item in HCTrayCode) |
| | | |
| | | Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active"); |
| | | if (platform != null) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item); |
| | | if (command.InteractiveSignal != 2) |
| | | { |
| | | ChuanhuaOutbound(conveyorLine, command, HCTrayCode[0], 0); |
| | | MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod); |
| | | if (method != null) |
| | | { |
| | | command.InteractiveSignal = commandWrite.WriteInteractiveSignal; |
| | | int count = string.IsNullOrEmpty(platform.Location) ? 0 + 1 : platform.Location.Split(',').Count() + 1; |
| | | method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (!string.IsNullOrEmpty(platform.Location)) |
| | | { |
| | | var strings = platform.Location.Split(',').ToList(); |
| | | foreach (var ite in strings) |
| | | { |
| | | int index = strings.FindIndex(p => p == ite); |
| | | ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite); |
| | | if (command1.InteractiveSignal != 2) |
| | | { |
| | | MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod); |
| | | if (method != null) |
| | | { |
| | | command.InteractiveSignal = commandWrite.WriteInteractiveSignal; |
| | | int count = strings.Count - index; |
| | | method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //}); |
| | | |
| | | //tasks.Add(task); |
| | | Task.WaitAll(tasks.ToArray()); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | //WriteDebug("CommonConveyorLineJob", "test"); |
| | | //Console.Out.WriteLine(DateTime.Now); |
| | | } |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | var taskNew = _taskService.QueryCraneConveyorLineTask(command.Barcode.ObjToInt(), childDeviceCode); |
| | | var Taskout = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (Taskout != null) |
| | | try |
| | | { |
| | | // 空æçä»»å¡ |
| | | if (Taskout.TaskType == (int)TaskOutboundTypeEnum.OutTray) |
| | | { |
| | | if (Taskout.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(Taskout); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | if (command.Barcode == "") |
| | | { |
| | | taskCommand.TargetAddress = 1092; |
| | | } |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | // è·åä¸ä¸ä¸ªä»»å¡ |
| | | var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode); |
| | | //var taskOut = _taskService.QueryNextConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | //return; |
| | | // å¤çåºåºä»»å¡ |
| | | HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(Taskout); |
| | | } |
| | | else if (Taskout.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) |
| | | // å¦ææ²¡æåºåºä»»å¡ï¼å¤çæ°ä»»å¡ |
| | | if (task == null && command.Barcode != "NoRead") |
| | | { |
| | | if (command.Barcode == "") |
| | | HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(Taskout); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | taskCommand.TargetAddress = 1092; |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(Taskout); |
| | | } |
| | | } |
| | | } |
| | | else if (Taskout.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | if (Taskout.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(Taskout); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | if (command.Barcode == "") |
| | | { |
| | | //todo 没ææç¡®å¼å¸¸å£ï¼éå°ç®æ å··éçNGå£ |
| | | //taskCommand.TargetAddress = 1092; |
| | | } |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(Taskout); |
| | | } |
| | | else if (Taskout.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) |
| | | { |
| | | if (command.Barcode == "") |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(Taskout); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | // todo éå°ç®æ å··éçNGå£ |
| | | taskCommand.TargetAddress = 1092; |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(Taskout); |
| | | } |
| | | else |
| | | { |
| | | // todo è°ç¨WMSä»»å¡å®ææ¥å£ |
| | | var x = new { taskNum = Taskout.TaskNum }; |
| | | var result = HttpHelper.GetAsync("http:127.0.0.1:8098/api/Task/CompleteTaskAsync", x.ToJsonString()).Result; |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (content.Status) |
| | | { |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(Taskout); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (taskNew == null) |
| | | { |
| | | if (_taskService.RequestWMSTask(command.Barcode, childDeviceCode).Status) |
| | | { |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(task); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // |
| | | /// <summary> |
| | | /// 空æçåæµ |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | /// <param name="index">读åç第ä¸ä¸ªä½ç½®</param> |
| | | public void EmptyTrayReturn(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int index) |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => (x.TaskState == (int)TaskOutStatusEnum.OutNew || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) && x.TaskType == (int)TaskOutboundTypeEnum.OutTray); |
| | | if (tasks.Count <= index) |
| | | { |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")), |
| | | Grade = 1, |
| | | PalletCode = DateTime.Now.ToString("yyyyMMddHHmmss"), |
| | | RoadWay = "CHSC01", |
| | | SourceAddress = "001-001-001", |
| | | TargetAddress = childDeviceCode, |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | Id = 0, |
| | | TaskType = (int)TaskOutboundTypeEnum.OutTray |
| | | }; |
| | | |
| | | #region ç宿°æ® |
| | | |
| | | // TODO: è°ç¨æ¥å£è·åä¸ä¸ä¸ªå°å |
| | | //RequestTaskDto request = new RequestTaskDto() |
| | | //{ |
| | | // Position = sourceAddress, |
| | | // PalletCode = palletCode, |
| | | //}; |
| | | |
| | | //// åé请æ±å¹¶çå¾
ååº |
| | | //var result = HttpHelper.PostAsync("http:127.0.0.1:8098/api/Task/RequestTaskAsync", request.ToJsonString()).Result; |
| | | |
| | | //// ååºååååºå
容 |
| | | //WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | //// æ£æ¥ç¶æå¹¶è¿å |
| | | ////if (!content.Status) |
| | | //// return content; |
| | | |
| | | //// ååºåå任塿°æ® |
| | | //WMSTaskDTO task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | |
| | | #endregion |
| | | |
| | | var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | if (content.Status) |
| | | { |
| | | Console.WriteLine("空æçå¼å«æå"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éååºåº |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | /// <param name="index">线ä½å½åbool读ååç§»å°å</param> |
| | | public void ChuanhuaOutbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int index) |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => (x.TaskState == (int)TaskOutStatusEnum.OutNew || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) && x.TaskType == (int)TaskOutboundTypeEnum.Outbound); |
| | | if (tasks.Count <= index) |
| | | { |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")), |
| | | Grade = 1, |
| | | PalletCode = DateTime.Now.ToString("MMddHHmmss"), |
| | | RoadWay = "CHSC01", |
| | | SourceAddress = "001-001-001", |
| | | TargetAddress = childDeviceCode, |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | Id = 0, |
| | | TaskType = (int)TaskOutboundTypeEnum.Outbound, |
| | | }; |
| | | |
| | | var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | if (content.Status) |
| | | { |
| | | Console.WriteLine("åºåºå¼å«æå"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Dt_Task task = tasks[index]; |
| | | if (task != null) |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(task); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | } |
| | | } |
| | | } |
| | | #region è¾é线请æ±å
¥åºä¸ä¸å°å |
| | | |
| | | /// <summary> |
| | | /// è¾é线请æ±å
¥åºä¸ä¸å°å |
| | |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | public void RequestInNextAddress(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode) |
| | | { |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | | if (newTask != null) |
| | | { |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(newTask); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | } |
| | | } |
| | | } |
| | | //public void RequestInNextAddress(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode) |
| | | //{ |
| | | // Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | | // if (newTask != null) |
| | | // { |
| | | // ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(newTask); |
| | | // taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | // conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// è¾é线å
¥åºå®æ |
| | |
| | | |
| | | //conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode); |
| | | WebResponseContent content = _taskService.UpdateTaskStatusToNext(task); |
| | | Console.Out.WriteLine(content.Serialize()); |
| | | |
| | | //Console.Out.WriteLine(content.Serialize()); |
| | | } |
| | | } |
| | | |
| | |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | public void RequestOutbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode) |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void RequestOutbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (task != null) |
| | |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | public void ConveyorLineOutFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode) |
| | | public void ConveyorLineOutFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode); |
| | | WebResponseContent content = _taskService.UpdateTaskStatusToNext(task); |
| | | Console.Out.WriteLine(content.Serialize()); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(task); |
| | | taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | if (task.PalletCode != command.Barcode) |
| | | { |
| | | var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity; |
| | | taskCommand.TargetAddress = NGAddress; |
| | | } |
| | | else |
| | | { |
| | | taskCommand.TargetAddress = 0; |
| | | } |
| | | |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | content = _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæµç©ºæçå®çåºåº |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | /// <param name="index">线ä½å½åbool读ååç§»å°å</param> |
| | | public async void EmptyTrayReturn(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int index, Platform platform) |
| | | { |
| | | try |
| | | { |
| | | TaskOutboundTypeEnum taskOutboundTypeEnum; |
| | | if (platform.PlatformType.Contains("OutTray")) |
| | | taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray; |
| | | else |
| | | taskOutboundTypeEnum = TaskOutboundTypeEnum.Outbound; |
| | | await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker.Split(',')[0], platform.Stacker.Split(',').ToList()); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ£æ¥ä»»å¡å¹¶å建æ°ä»»å¡ |
| | | /// </summary> |
| | | private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, List<string> roadways = null) |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode); |
| | | if (tasks.Count < index) |
| | | { |
| | | #region è°ç¨WMSè·ååºåºä»»å¡ |
| | | |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO(); |
| | | object dynamic = new |
| | | { |
| | | position = childDeviceCode, |
| | | tag = (int)taskType, |
| | | areaCdoe = roadWay, |
| | | roadways = roadways |
| | | }; |
| | | var result = await HttpHelper.PostAsync("http://localhost:5000/api/Task/RequestTrayOutTaskAsync", dynamic.ToJsonString()); |
| | | |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | // æ£æ¥ç¶æå¹¶è¿å |
| | | if (!content.Status) |
| | | return; |
| | | |
| | | taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | |
| | | #endregion |
| | | |
| | | CreateAndSendTask(taskDTO); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå»ºä»»å¡ |
| | | /// </summary> |
| | | public WebResponseContent CreateAndSendTask(WMSTaskDTO taskDTO) |
| | | { |
| | | var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | if (content.Status) |
| | | { |
| | | Console.WriteLine($"{taskDTO.TaskType}å¼å«æå"); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using HslCommunication; |
| | | using OfficeOpenXml.ConditionalFormatting; |
| | | using WIDESEAWCS_DTO.WMS; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | public partial class CommonConveyorLineJob |
| | | { |
| | | /// <summary> |
| | | /// å¤çåºåºä»»å¡ |
| | | /// </summary> |
| | | private void HandleTaskOut(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue, Dt_Task taskOut) |
| | | { |
| | | // å¦ææ²¡æä»»å¡ï¼ç´æ¥è¿å |
| | | if (taskOut == null) return; |
| | | |
| | | // æ å°ä»»å¡å½ä»¤ |
| | | var taskCommand = MapTaskCommand(taskOut, command); |
| | | |
| | | // æ ¹æ®ä¸åçä»»å¡ç±»ååç¶ææ§è¡ä¸åçé»è¾ |
| | | bool isOutTray = taskOut.TaskType == (int)TaskOutboundTypeEnum.OutTray; |
| | | bool isOutboundAndOutFinish = taskOut.TaskType == (int)TaskOutboundTypeEnum.Outbound && taskOut.TaskState == (int)TaskOutStatusEnum.SC_OutFinish; |
| | | bool isOutboundAndLineOutExecuting = taskOut.TaskType == (int)TaskOutboundTypeEnum.Outbound && taskOut.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting; |
| | | |
| | | if (isOutTray || isOutboundAndOutFinish || isOutboundAndLineOutExecuting) |
| | | { |
| | | // åéå½ä»¤å°è¾é线 |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | // æ è®°åé宿 |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | // æ´æ°ä»»å¡ç¶æ |
| | | _taskService.UpdateTaskStatusToNext(taskOut); |
| | | } |
| | | else if (taskOut.TaskType == (int)TaskOutboundTypeEnum.OutTray && taskOut.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) |
| | | { |
| | | // 宿WMSä»»å¡ |
| | | CompleteWmsTask(taskOut, command, conveyorLine, childDeviceCode, ProtocalDetailValue); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°ä»»å¡ |
| | | /// </summary> |
| | | private void HandleNewTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | // ç¹å®æ¡ä»¶ä¸å建并åé空æçå
¥åºä»»å¡ |
| | | if ((conveyorLine.DeviceCode == "1003" && childDeviceCode == "1016") || (conveyorLine.DeviceCode == "1005" && childDeviceCode == "1048")) |
| | | { |
| | | // 请æ±WMS空æçä»»å¡ |
| | | CreateAndSendEmptyTrayTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | } |
| | | else if ((conveyorLine.DeviceCode == "1001" && childDeviceCode == "1088") || (conveyorLine.DeviceCode == "1004" && childDeviceCode == "1339")) |
| | | { |
| | | // 请æ±WMSå
¥åºä»»å¡ |
| | | RequestWmsTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | } |
| | | else if ((conveyorLine.DeviceCode == "1001" && childDeviceCode == "1073") || (conveyorLine.DeviceCode == "1003" && childDeviceCode == "1002")) |
| | | { |
| | | //TODO åéç´æ¥å»NGå£ä»»å¡ |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ å°ä»»å¡å½ä»¤ |
| | | /// </summary> |
| | | private ConveyorLineTaskCommand MapTaskCommand(Dt_Task task, ConveyorLineTaskCommand command) |
| | | { |
| | | // 使ç¨mapperæ å°ä»»å¡å½ä»¤ |
| | | var comm = _mapper.Map<ConveyorLineTaskCommand>(task); |
| | | comm.InteractiveSignal = command.InteractiveSignal; |
| | | return comm; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 宿WMSä»»å¡ |
| | | /// </summary> |
| | | private void CompleteWmsTask(Dt_Task taskOut, ConveyorLineTaskCommand command, CommonConveyorLine conveyorLine, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | // å¦ææ²¡ææ¡ç ä¿¡æ¯ï¼åè®¾ç½®ç®æ å°å为NGå°å |
| | | if (command.Barcode == "NoRead") |
| | | { |
| | | var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == taskOut.TargetAddress).Capacity; |
| | | taskOut.TargetAddress = NGAddress.ToString(); |
| | | } |
| | | |
| | | // TODOè°ç¨WMSä»»å¡å®ææ¥å£ |
| | | var keys = new Dictionary<string, object>() |
| | | { |
| | | {"taskNum", taskOut.TaskNum} |
| | | }; |
| | | var result = HttpHelper.GetAsync($"http://127.0.0.1:5000/api/Task/CompleteTaskAsync", keys).Result; |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (content.Status) |
| | | { |
| | | // æ è®°åé宿 |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | // æ´æ°ä»»å¡ç¶æ |
| | | _taskService.UpdateTaskStatusToNext(taskOut); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建并åé空æçä»»å¡ |
| | | /// </summary> |
| | | public void CreateAndSendEmptyTrayTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | if (command.Barcode != "NoRead") |
| | | { |
| | | // å建空æçä»»å¡DTO |
| | | WMSTaskDTO taskDTO = CreateEmptyTrayTaskDto(command.Barcode, childDeviceCode); |
| | | // å建并åéä»»å¡ |
| | | WebResponseContent content = CreateAndSendTask(taskDTO); |
| | | if (content.Status) |
| | | { |
| | | // æ¥è¯¢ä»»å¡ |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | // æ å°ä»»å¡å½ä»¤ |
| | | ConveyorLineTaskCommand taskCommand = MapTaskCommand(task, command); |
| | | // åéå½ä»¤å°è¾é线 |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | // æ è®°åé宿 |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | // æ´æ°ä»»å¡ç¶æ |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建空æçä»»å¡DTO |
| | | /// </summary> |
| | | private WMSTaskDTO CreateEmptyTrayTaskDto(string barcode, string childDeviceCode) |
| | | { |
| | | #region åWMS请æ±ç©ºæçä»»å¡ |
| | | WMSTaskDTO wMSTaskDTO = new WMSTaskDTO(); |
| | | RequestTaskDto request = new RequestTaskDto() |
| | | { |
| | | Position = childDeviceCode, |
| | | PalletCode = barcode, |
| | | }; |
| | | var result = HttpHelper.PostAsync("http://127.0.0.1:5000/api/Task/RequestTrayInTaskAsync", request.ToJsonString()).Result; |
| | | if (result == null) |
| | | return wMSTaskDTO; |
| | | |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | // æ£æ¥ç¶æå¹¶è¿å |
| | | if (!content.Status) |
| | | return wMSTaskDTO; |
| | | |
| | | return JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | |
| | | #endregion åWMS请æ±ç©ºæçä»»å¡ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 请æ±WMSä»»å¡ |
| | | /// </summary> |
| | | private void RequestWmsTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | // 请æ±WMSä»»å¡ |
| | | if (_taskService.RequestWMSTask(command.Barcode, childDeviceCode).Status) |
| | | { |
| | | // æ¥è¯¢ä»»å¡ |
| | | Dt_Task task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | // æ å°ä»»å¡å½ä»¤ |
| | | ConveyorLineTaskCommand taskCommand = MapTaskCommand(task, command); |
| | | // åéå½ä»¤å°è¾é线 |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | // æ è®°åé宿 |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | // æ´æ°ä»»å¡ç¶æ |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (commonStackerCrane != null) |
| | | { |
| | | //EqptRun(commonStackerCrane); |
| | | //EqptAlive(commonStackerCrane); |
| | | //EqptStatus(commonStackerCrane); |
| | | //Console.Out.WriteLine(commonStackerCrane.DeviceName); |
| | | if (!commonStackerCrane.IsEventSubscribed) |
| | | { |
| | |
| | | } |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | else if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | |
| | | return task; |
| | |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä¸MOMç³»ç»å¯¹æ¥ï¼è®¾å¤ä¸çº¿ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane"></param> |
| | | public async void EqptRun(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | if (!commonStackerCrane.StackerOnline) |
| | | { |
| | | BasicDto dto = new BasicDto |
| | | { |
| | | EmployeeNo = "T00001", |
| | | EquipmentCode = commonStackerCrane.DeviceCode, |
| | | RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), |
| | | SessionId = Guid.NewGuid().ToString(), |
| | | Software = commonStackerCrane.DeviceName, |
| | | }; |
| | | var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptRun", dto.ToJsonString()); |
| | | if (respone != null) |
| | | { |
| | | var result = JsonConvert.DeserializeObject<ResponseEqptRunDto>(respone); |
| | | if (result != null && result.Success) |
| | | { |
| | | var process = _processRepository.QueryData(x => x.EquipmentName == commonStackerCrane.DeviceName).FirstOrDefault(); |
| | | if (process == null) |
| | | { |
| | | ResponeRunDto runDto = JsonConvert.DeserializeObject<ResponeRunDto>(respone); |
| | | process = new Dt_EquipmentProcess() |
| | | { |
| | | EquipmentName = commonStackerCrane.DeviceCode, |
| | | EquipmentType = commonStackerCrane.DeviceName.Substring(commonStackerCrane.DeviceCode.IndexOf("å åæº")), |
| | | WipOrderNo = runDto.WipOrderNo, |
| | | ProductDesc = runDto.ProductDesc, |
| | | ProcessValue = JsonConvert.SerializeObject(result) |
| | | }; |
| | | var isResult = await _processRepository.AddDataAsync(process) > 0; |
| | | } |
| | | else |
| | | { |
| | | process.ProcessValue = JsonConvert.SerializeObject(result); |
| | | var isResult = await _processRepository.UpdateDataAsync(process); |
| | | } |
| | | commonStackerCrane.StackerOnline = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设å¤å¿è·³ |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç¶æ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane"></param> |
| | | public async void EqptStatus(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | string code = string.Empty; |
| | | RequestAlertDto requestAlert = new RequestAlertDto() |
| | | { |
| | | EmployeeNo = "T00001", |
| | | EquipmentCode = commonStackerCrane.DeviceCode, |
| | | RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), |
| | | SessionId = Guid.NewGuid().ToString(), |
| | | Software = commonStackerCrane.DeviceName, |
| | | AlertInfo = new List<AlertInfoDto>() |
| | | }; |
| | | switch (commonStackerCrane.Status) |
| | | { |
| | | case DeviceStatus.Idle: |
| | | code = "Waiting"; |
| | | break; |
| | | |
| | | case DeviceStatus.Working: |
| | | code = "Running"; |
| | | break; |
| | | |
| | | case DeviceStatus.Fault: |
| | | code = "Alerting"; |
| | | var alert = new AlertInfoDto() |
| | | { |
| | | AlertCode = "1001", |
| | | AlertDescription = commonStackerCrane.StackerCraneStatusDes, |
| | | AlertReset = "1" |
| | | }; |
| | | requestAlert.AlertInfo.Add(alert); |
| | | |
| | | await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptAlive", requestAlert.ToJsonString()); |
| | | |
| | | break; |
| | | |
| | | case DeviceStatus.Unkonw: |
| | | code = "Down"; |
| | | break; |
| | | |
| | | case DeviceStatus.Offline: |
| | | code = "Maintenance"; |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | if (code != "Alerting") |
| | | { |
| | | requestAlert.AlertInfo = new List<AlertInfoDto>(); |
| | | var alert = new AlertInfoDto() |
| | | { |
| | | AlertCode = "1001", |
| | | AlertDescription = commonStackerCrane.StackerCraneStatusDes, |
| | | AlertReset = "0" |
| | | }; |
| | | await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptAlive", requestAlert.ToJsonString()); |
| | | } |
| | | RequestEqptStatusDto requestEqptStatus = new RequestEqptStatusDto() |
| | | { |
| | | EmployeeNo = "T00001", |
| | | EquipmentCode = commonStackerCrane.DeviceCode, |
| | | RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), |
| | | SessionId = Guid.NewGuid().ToString(), |
| | | Software = commonStackerCrane.DeviceName, |
| | | ChangeTime = DateTime.Now.ToString(), |
| | | Description = commonStackerCrane.StackerCraneStatusDes, |
| | | LocationID = "NA", |
| | | ReasonCode = "123", |
| | | StatusCode = code |
| | | }; |
| | | var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptStatus", requestEqptStatus.ToJsonString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | meta: { |
| | | keepAlive: false |
| | | } |
| | | }, |
| | | { |
| | | path: '/ProductionModel', |
| | | name: 'ProductionModel', |
| | | component: () => import('@/views/widesea_wms/MOM/ProductionModel.vue'), |
| | | meta: { |
| | | keepAlive: false |
| | | } |
| | | } |
| | | ] |
| | | export default tables |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box v-model="showDetialBox" :lazy="true" :height="350" :width="600" :padding="15" title="ææ¡å±æ§ç»´æ¤"> |
| | | <el-form :inline="true" :model="TrayBarcodePropertys" label-width="auto" class="demo-form-inline"> |
| | | <el-form-item label="ææ¡å±æ§:"> |
| | | <el-input v-model="TrayBarcodePropertys.TrayBarcodeProperty" placeholder="ææ¡å±æ§" /> |
| | | </el-form-item> |
| | | <el-form-item label="æç容é:"> |
| | | <el-input v-model="TrayBarcodePropertys.Capacity" placeholder="æç容é" /> |
| | | </el-form-item> |
| | | <el-button @click="addProductType" type="primary">æ·»å 产åå·¥åº</el-button> |
| | | <el-button @click="save" type="success">æäº¤æ°æ®</el-button> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å·¥åº:" v-for="(input, index) in TrayBarcodePropertys.ProcessCodes" |
| | | :key="index"> |
| | | <el-input v-model="input.ProcessCode" placeholder="å·¥åº" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产åç±»å:" v-for="(input, index) in TrayBarcodePropertys.ProductTypes" |
| | | :key="index"> |
| | | <el-input v-model="input.ProductType" placeholder="产åç±»å" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import http from "@/../src/api/http.js"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | TrayBarcodePropertys: { |
| | | TrayBarcodeProperty: '', |
| | | Capacity: 0, |
| | | ProcessCodes: [{ ProcessCode: '', }], |
| | | ProductTypes: [{ ProductType: '', }] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | addProductType() { |
| | | this.TrayBarcodePropertys.ProductTypes.push({ ProductType: '' }) |
| | | this.TrayBarcodePropertys.ProcessCodes.push({ ProcessCode: '' }) |
| | | }, |
| | | open() { |
| | | this.showDetialBox = true |
| | | }, |
| | | save() { |
| | | console.log(this.TrayBarcodePropertys) |
| | | let data = ({...this.TrayBarcodePropertys, ProcessCodes:JSON.stringify(this.TrayBarcodePropertys.ProcessCodes) , ProductTypes:JSON.stringify(this.TrayBarcodePropertys.ProductTypes)}); |
| | | |
| | | debugger; |
| | | http.post('api/Production/AddData', data).then(res => { |
| | | if (res.code == 200) { |
| | | // ElMessage.success(res.msg) |
| | | this.$message.success('æ·»å æå') |
| | | this.$parent.load(); |
| | | } else { |
| | | // ElMessage.error(res.msg) |
| | | this.$message.error(x.message) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /***************************************************************************************** |
| | | ** Author:jxx 2022 |
| | | ** QQ:283591387 |
| | | **宿´ææ¡£è§ï¼http://v2.volcore.xyz/document/api ã代ç çæé¡µé¢ViewGridã |
| | | **常ç¨ç¤ºä¾è§ï¼http://v2.volcore.xyz/document/vueDev |
| | | **åå°æä½è§ï¼http://v2.volcore.xyz/document/netCoreDev |
| | | *****************************************************************************************/ |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from "./Extend/Add.vue"; //èªå®ä¹æ©å±æ¥è¯¢çé¢ä¸è¡¨æ ¼ä½ç»ä»¶ |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® |
| | | this.buttons.unshift({ //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» |
| | | name: 'æé®', //æé®åç§° |
| | | icon: 'el-icon-document', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | onClick: function () { |
| | | console.log("ð ~ onInit ~ gridBody:", gridBody) |
| | | this.$refs.gridBody.open(); |
| | | } |
| | | }); |
| | | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | this.boxOptions.labelWidth = 150; |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wms/material/Dt_MaterielInfo.jsæ¤å¤ç¼å |
| | | --> |
| | | <template> |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "./ProductionModel.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'materielID', |
| | | footer: "Foots", |
| | | cnName: 'ææ¡å±æ§', |
| | | name: 'ProductionModel', |
| | | url: "/Production/", |
| | | sortName: "MaterielID" |
| | | }); |
| | | const editFormFields = ref({ |
| | | "TrayBarcodeProperty": "", |
| | | "Capacity": "", |
| | | |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { "title": "ææ¡å±æ§", "field": "TrayBarcodeProperty", type: "text" }, |
| | | { "title": "æç容é", "field": "Capacity", type: "text" }, |
| | | ] |
| | | ]); |
| | | const searchFormFields = ref({}); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { "title": "ææ¡å±æ§", "field": "TrayBarcodeProperty", type: "text" }, |
| | | { "title": "æç容é", "field": "Capacity", type: "text" }, |
| | | ] |
| | | ]); |
| | | const columns = ref([{ field: 'id', title: 'ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' }, |
| | | { field: 'trayBarcodeProperty', title: 'ææ¡å±æ§', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'processCodes', title: 'å·¥åºéå', type: 'string', width: 120, align: 'left' }, |
| | | { field: 'productTypes', title: 'ç©æç¼ç /å·¥èºåå·éå', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'capacity', title: 'æç容é', type: 'string', width: 110, align: 'left' }]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "" |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | void CommitTran(MethodInfo method); |
| | | void RollbackTran(); |
| | | void RollbackTran(MethodInfo method); |
| | | Task UseTranAsync(Func<Task> action); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public async Task UseTranAsync(Func<Task> action) |
| | | { |
| | | // å¼å§äºå¡ |
| | | _sqlSugarClient.Ado.BeginTran(); |
| | | |
| | | try |
| | | { |
| | | // æ§è¡ä¼ å
¥çæä½ |
| | | await action(); |
| | | |
| | | // æäº¤äºå¡ |
| | | await _sqlSugarClient.Ado.CommitTranAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // åæ»äºå¡ |
| | | await _sqlSugarClient.Ado.RollbackTranAsync(); |
| | | throw new Exception (ex.Message); // éæ°æåºå¼å¸¸ï¼ä»¥ä¾¿è°ç¨æ¹å¯ä»¥å¤ç |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | [ImporterHeader(Name = "å建è
")] |
| | | [ExporterHeader(DisplayName = "å建è
")] |
| | | [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "å建è
")] |
| | | public string Creater { get; set; } |
| | | public string Creater { get; set; } = "Systeam"; |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | |
| | | { |
| | | // ä½¿ç¨ myScopedService æ§è¡ä»»å¡ |
| | | |
| | | //await DBSeed.SeedAsync(_dbContext, _webRootPath); |
| | | await DBSeed.SeedAsync(_dbContext, _webRootPath); |
| | | |
| | | //å¤ç§æ· 忥 |
| | | //await DBSeed.TenantSeedAsync(_dbContext); |
| | |
| | | /// æçå· |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 空æçå¯å
¥å··å° |
| | | /// </summary> |
| | | public string PositionList { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public string RequestType { get; set; } = string.Empty; |
| | | } |
| | | |
| | | public class RequestOutTaskDto |
| | | { |
| | | public string Position { get; set; } |
| | | public int Tag { get; set; } |
| | | public string AreaCdoe { get; set; } |
| | | public List<string> Roadways { get; set; } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO |
| | | { |
| | | public class UpdateStatusDto |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public int TaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskState { get; set; } |
| | | } |
| | | } |
| ÎļþÃû´Ó Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResultTrayCellsStatus.cs ÐÞ¸Ä |
| | |
| | | namespace WIDESEA_DTO.MOM |
| | | { |
| | | /// <summary> |
| | | /// æççµè¯ç¶æ |
| | | /// </summary> |
| | | public class ResultTrayCellsStatus : BasicResult |
| | | { |
| | | /// <summary> |
| | |
| | | /// ç»å®ä»£ç |
| | | /// </summary> |
| | | public string BindCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产产线 |
| | | /// </summary> |
| | | public string ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½åå·¥èºå·¥åºä»£ç |
| | | /// </summary> |
| | | public string ProcessCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ¡å±æ§å表 |
| | |
| | | /// </summary> |
| | | public int PositionNo { get; set; } |
| | | |
| | | //public string BindCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµè¯ç¶æ |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// å·¥åº |
| | | /// </summary> |
| | | public string ProcessCode { get; set; } |
| | | public List<ProcessCodes> ProcessCodes { get; set; } = new List<ProcessCodes>(); |
| | | |
| | | /// <summary> |
| | | /// æç容é |
| | | /// </summary> |
| | | public double Capacity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨ç©æç¼ç /å·¥èºåå· |
| | | /// </summary> |
| | | public List<ProductTypes> ProductType { get; set; } = new List<ProductTypes>(); |
| | | } |
| | | |
| | | public class ProcessCodes |
| | | { |
| | | /// <summary> |
| | | /// å·¥åº |
| | | /// </summary> |
| | | public string ProcessCode { get; set; } |
| | | } |
| | | |
| | | public class ProductTypes |
| | | { |
| | | /// <summary> |
| | | /// éç¨ç©æç¼ç /å·¥èºåå· |
| | | /// </summary> |
| | | public string ProductType { get; set; } |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | [SugarColumn(IsNullable = false, Length = int.MaxValue, ColumnDescription = "å·¥èºåæ°å¼")] |
| | | public string ProcessValue { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 表示工èºè·¯çº¿ä¸è®¾å¤åæ°ä¿¡æ¯ç模åã |
| | | /// </summary> |
| | | public class EBParameterInfo |
| | | { |
| | | /// <summary> |
| | | /// åæ°ç¼ç ã |
| | | /// </summary> |
| | | [Required(ErrorMessage = "åæ°ç¼ç æ¯å¿
填项ã")] |
| | | [StringLength(50, ErrorMessage = "åæ°ç¼ç é¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string ParameterCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°ç±»åã |
| | | /// </summary> |
| | | [Required(ErrorMessage = "åæ°ç±»åæ¯å¿
填项ã")] |
| | | [StringLength(50, ErrorMessage = "åæ°ç±»åé¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string ParameterType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¨èå¼ã |
| | | /// </summary> |
| | | [StringLength(50, ErrorMessage = "æ¨èå¼é¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string TargetValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ã |
| | | /// </summary> |
| | | public string UOMCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§å¶ä¸éå¼ã |
| | | /// </summary> |
| | | [StringLength(50, ErrorMessage = "æ§å¶ä¸éå¼é¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string UpperControlLimit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§å¶ä¸éå¼ã |
| | | /// </summary> |
| | | [StringLength(50, ErrorMessage = "æ§å¶ä¸éå¼é¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string LowerControlLimit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼ä¸éå¼ã |
| | | /// </summary> |
| | | [StringLength(50, ErrorMessage = "è§æ ¼ä¸éå¼é¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string UpperSpecificationsLimit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼ä¸éå¼ã |
| | | /// </summary> |
| | | [StringLength(50, ErrorMessage = "è§æ ¼ä¸éå¼é¿åº¦ä¸è½è¶
è¿50个å符ã")] |
| | | public string LowerSpecificationsLimit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°æè¿°ã |
| | | /// </summary> |
| | | public string Description { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥èºè·¯çº¿ä¸å½å设å¤åæ°ä¿¡æ¯æ¯å¦å¯ç¨ã |
| | | /// TRUE 表示å¯ç¨ï¼FALSE 表示ä¸å¯ç¨ã |
| | | /// </summary> |
| | | [Required(ErrorMessage = "设å¤åæ°ä¿¡æ¯æ¯å¦å¯ç¨æ¯å¿
填项ã")] |
| | | public string EquipmentAvailabilityFlag { get; set; } |
| | | } |
| | | |
| | | |
| | | public class ResponseEqptRunDto : BasicResult |
| | | { |
| | | /// <summary> |
| | | /// 产ååç§° |
| | | /// </summary> |
| | | public string ProductDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¦ä»¶æ°é |
| | | /// </summary> |
| | | public string FirstArticleNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è°æºæ°é |
| | | /// </summary> |
| | | public string DebugNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°çæ¬ä¿¡æ¯ |
| | | /// </summary> |
| | | public string ParamVersion { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦éè¦è¯»ååæ° |
| | | /// </summary> |
| | | public bool ParamRefreshFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°ä¿¡æ¯ |
| | | /// </summary> |
| | | public List<EBParameterInfo> ParameterInfo { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.MOM |
| | | { |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | public class ResponeAgingInputDto : BasicResult |
| | | { |
| | | /// <summary> |
| | | /// ææ¡å±æ§ï¼ç¨äºæ è¯ææ¡çå¯ä¸å±æ§ã |
| | | /// </summary> |
| | | public string TrayBarcodeProperty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åç¼ç æäº§ååå·ï¼ç¨äºå
³èå
·ä½çç产任å¡ã |
| | | /// </summary> |
| | | public string BindCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产产线 |
| | | /// </summary> |
| | | public string ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èå·¥åºè¿åæ¶é´ï¼è®°å½æ³¨æ¶²æéç½®æ¶é¿ã |
| | | /// </summary> |
| | | public string LinedProcessFeedbackTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¹å¾åæ°è¿å(éç½®æ¶é¿) |
| | | /// </summary> |
| | | public string SpecialParameterDuration { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | public string UomCode { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="input">å
¥åºæ°æ®</param> |
| | | /// <returns></returns> |
| | | Task<dynamic> GetOCVInputAsync(AgingInputDto input); |
| | | Task<WebResponseContent> GetOCVInputAsync(AgingInputDto input); |
| | | |
| | | /// <summary> |
| | | /// éç½®\éååºåºï¼æ´æçï¼ |
| | | /// </summary> |
| | | /// <param name="input">åºåºæ°æ®</param> |
| | | /// <returns></returns> |
| | | Task<dynamic> GetOCVOutputAsync(AgingOutputDto input); |
| | | Task<WebResponseContent> GetOCVOutputAsync(AgingOutputDto input); |
| | | } |
| | |
| | | Task<WebResponseContent> CompleteAsync(int taskNum); |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä»»å¡ |
| | | /// 请æ±ä»»å¡å··é |
| | | /// </summary> |
| | | /// <param name="position"></param> |
| | | /// <param name="areaCode"></param> |
| | |
| | | Task<WebResponseContent> RequestTaskAsync(RequestTaskDto input); |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä»»å¡è´§ä½ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input); |
| | | |
| | | /// <summary> |
| | | /// 请æ±ç©ºæçä»»å¡ |
| | | /// </summary> |
| | | /// <param name="position"></param> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<WebResponseContent> RequestTrayTaskAsync(string position); |
| | | Task<WebResponseContent> RequestTrayInTaskAsync(RequestTaskDto input); |
| | | |
| | | /// <summary> |
| | | /// è¯·æ±æçä»»å¡ |
| | | /// </summary> |
| | | /// <param name="position">ç®æ ä½ç½®</param> |
| | | /// <param name="tag">æçç±»åï¼1ï¼å®çï¼2ï¼ç©ºçï¼</param> |
| | | /// <param name="areaCode">åºåç¼ç </param> |
| | | /// <param name="roadways">å··éå表</param> |
| | | /// <returns>è¿åç»æé</returns> |
| | | Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, List<string> roadways); |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æä¿®æ¹ |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | | Task<WebResponseContent> UpdateTaskStatus(int taskNum, int taskState); |
| | | |
| | | } |
| | |
| | | public int BoxingInfoId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// ç©æç¼ç ç»å®ä»£ç |
| | | /// </summary> |
| | | [Required] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | |
| | | public string MaterielName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// åæ®ç¼å· / éé |
| | | /// </summary> |
| | | [Required] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåå· |
| | | /// åºåå·(çµè¯) |
| | | /// </summary> |
| | | [Required] |
| | | [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "åºåå·")] |
| | |
| | | public decimal OutboundQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»çç¶æ |
| | | /// ç»çç¶æ çµè¯ç¶æ |
| | | /// </summary> |
| | | [Required] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç»çç¶æ")] |
| | | public int Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// 夿³¨ // ææ¡å±æ§Json |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | |
| | | public bool IsFull { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// 夿³¨ (éå¶\éåæ¶é´) |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èå·¥åºè¿åæ¶é´ï¼æ³¨æ¶²\éç½®æ¶é¿ï¼ |
| | | /// </summary> |
| | | public string LinedProcessFeedbackTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¹å¾åæ°è¿å(éç½®æ¶é¿) |
| | | /// </summary> |
| | | public string SpecialParameterDuration { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç¼ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåç¼ç ")] |
| | | public string AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåæç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "StockInfoDetails")] |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// 表示ç产è¿ç¨ä¸çææ¡å±æ§åç¸å
³å·¥åºä¿¡æ¯ç模åã |
| | | /// </summary> |
| | | [SugarTable("ProductionModel", "ææ¡å±æ§")] |
| | | public class ProductionModel : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// å¤ æ³¨:主é®ï¼èªå¨å¢é¿ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®ï¼èªå¨å¢é¿")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ¡å±æ§ï¼ç¨äºæ è¯ææ¡çå¯ä¸å±æ§ã |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TrayBarcodeProperty", ColumnDescription = "ææ¡å±æ§", IsNullable = false)] |
| | | public string TrayBarcodeProperty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åºéåï¼å
嫿æç¸å
³çå·¥åºä»£ç ã |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ProcessCodes", ColumnDescription = "å·¥åºéå", IsNullable = false, Length = int.MaxValue)] |
| | | public string ProcessCodes { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨ç©æç¼ç /å·¥èºåå·éåï¼å
嫿æç¸å
³çç©æç¼ç æå·¥èºåå·ã |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ProductTypes", ColumnDescription = "éç¨ç©æç¼ç ", IsNullable = false, Length = int.MaxValue)] |
| | | public string ProductTypes { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æç容éï¼è¡¨ç¤ºææ¡å¯ä»¥æ¿è½½çæå¤§ç©åæ°éã |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Capacity", ColumnDescription = "æç容é", IsNullable = false)] |
| | | public int Capacity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®å·¥åºéåï¼ååºååJSONå符串为List<ProcessCodes>ã |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public List<ProcessCodesDTO> GetProcessCodes |
| | | { |
| | | get { return JsonConvert.DeserializeObject<List<ProcessCodesDTO>>(ProcessCodes); } |
| | | set { ProcessCodes = JsonConvert.SerializeObject(value); } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®éç¨ç©æç¼ç /å·¥èºåå·éåï¼ååºååJSONå符串为List<string>ã |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public List<ProductTypesDTO> GetProductTypes |
| | | { |
| | | get { return JsonConvert.DeserializeObject<List<ProductTypesDTO>>(ProductTypes); } |
| | | set { ProductTypes = JsonConvert.SerializeObject(value); } |
| | | } |
| | | } |
| | | |
| | | public class ProcessCodesDTO |
| | | { |
| | | /// <summary> |
| | | /// å·¥åº |
| | | /// </summary> |
| | | public string ProcessCode { get; set; } |
| | | } |
| | | |
| | | public class ProductTypesDTO |
| | | { |
| | | /// <summary> |
| | | /// éç¨ç©æç¼ç /å·¥èºåå· |
| | | /// </summary> |
| | | public string ProductType { get; set; } |
| | | } |
| | | } |
| | |
| | | using LogLibrary.Log; |
| | | using Masuit.Tools; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices; |
| | |
| | | /// </summary> |
| | | /// <param name="input">å
¥åºæ°æ®</param> |
| | | /// <returns></returns> |
| | | public async Task<dynamic> GetOCVInputAsync(AgingInputDto input) |
| | | public async Task<WebResponseContent> GetOCVInputAsync(AgingInputDto input) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/AgingInput", inputJson); |
| | | if (x != null) |
| | | { |
| | | |
| | | } |
| | | content.OK(data: x); |
| | | |
| | | LogFactory.GetLog("éç½®éåå
¥åºï¼æ´æçï¼").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("éç½®éåå
¥åºï¼æ´æçï¼").Info(true, x); |
| | |
| | | LogFactory.GetLog("éç½®éåå
¥åºï¼æ´æçï¼").Error(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("éç½®éåå
¥åºï¼æ´æçï¼").Error(true, err.StackTrace); |
| | | } |
| | | return Task.FromResult<dynamic>(null); |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="input">åºåºæ°æ®</param> |
| | | /// <returns></returns> |
| | | public async Task<dynamic> GetOCVOutputAsync(AgingOutputDto input) |
| | | public async Task<WebResponseContent> GetOCVOutputAsync(AgingOutputDto input) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); ; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/AgingOutput", inputJson); |
| | | content.OK(data: x); |
| | | LogFactory.GetLog("éç½®éååºåºï¼æ´æçï¼").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("éç½®éååºåºï¼æ´æçï¼").Info(true, x); |
| | | } |
| | |
| | | Console.WriteLine(err.Message.ToString()); |
| | | LogFactory.GetLog("éç½®/éååºåºï¼æ´æçï¼").Error(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("éç½®/éååºåºï¼æ´æç)").Error(true, err.StackTrace); |
| | | content.Error(err.Message); |
| | | } |
| | | return Task.FromResult<dynamic>(null); |
| | | return content; |
| | | } |
| | | } |
| | |
| | | using LogLibrary.Log; |
| | | using Masuit.Tools; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_IStorageBasicService; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices; |
| | | |
| | |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/CellState", inputJson); |
| | | if (x != null) |
| | | { |
| | | ResultCellState result = JsonConvert.DeserializeObject<ResultCellState>(x); |
| | | DtBoxingInfo boxingInfo = new DtBoxingInfo() |
| | | { |
| | | IsFull = true, |
| | | PalletCode = "", |
| | | }; |
| | | var details = new List<DtBoxingInfoDetail>(); |
| | | foreach (var item in result.SerialNos) |
| | | { |
| | | DtBoxingInfoDetail detail = new DtBoxingInfoDetail() |
| | | { |
| | | SerialNumber = item.SerialNo, |
| | | OrderNo = item.BindCode, |
| | | Status = item.SerialNoStatus, |
| | | }; |
| | | details.Add(detail); |
| | | } |
| | | boxingInfo.BoxingInfoDetails = details; |
| | | var abc = await _boxingInfoService.AddBoxingInfoAsync(boxingInfo); |
| | | if (abc.Status) |
| | | return content.OK("ç»çæå"); |
| | | else |
| | | return content.Error("ç»ç失败"); |
| | | } |
| | | #region |
| | | //if (x != null) |
| | | //{ |
| | | // ResultCellState result = JsonConvert.DeserializeObject<ResultCellState>(x); |
| | | // DtBoxingInfo boxingInfo = new DtBoxingInfo() |
| | | // { |
| | | // IsFull = true, |
| | | // PalletCode = "", |
| | | // }; |
| | | // var details = new List<DtBoxingInfoDetail>(); |
| | | // foreach (var item in result.SerialNos) |
| | | // { |
| | | // DtBoxingInfoDetail detail = new DtBoxingInfoDetail() |
| | | // { |
| | | // SerialNumber = item.SerialNo, |
| | | // OrderNo = item.BindCode, |
| | | // Status = item.SerialNoStatus, |
| | | // }; |
| | | // details.Add(detail); |
| | | // } |
| | | // boxingInfo.BoxingInfoDetails = details; |
| | | // var abc = await _boxingInfoService.AddBoxingInfoAsync(boxingInfo); |
| | | // if (abc.Status) |
| | | // return content.OK("ç»çæå"); |
| | | // else |
| | | // return content.Error("ç»ç失败"); |
| | | //} |
| | | #endregion |
| | | |
| | | LogFactory.GetLog("åçµè¯å±æ§è·å").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("åçµè¯å±æ§è·å").Info(true, x); |
| | | return x; |
| | | } |
| | | catch (Exception err) |
| | | { |
| | |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/TrayCellsStatus", inputJson); |
| | | if (x != null) |
| | | { |
| | | ResultTrayCellsStatus result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(x); |
| | | DtBoxingInfo boxingInfo = new DtBoxingInfo() |
| | | { |
| | | IsFull = true, |
| | | PalletCode = result.TrayBarcode, |
| | | }; |
| | | var details = new List<DtBoxingInfoDetail>(); |
| | | foreach (var item in result.SerialNos) |
| | | { |
| | | DtBoxingInfoDetail detail = new DtBoxingInfoDetail() |
| | | { |
| | | SerialNumber = item.SerialNo, |
| | | OrderNo = item.PositionNo.ToString(), |
| | | Status = item.SerialNoStatus, |
| | | Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | MaterielCode = result.BindCode, |
| | | }; |
| | | details.Add(detail); |
| | | } |
| | | boxingInfo.BoxingInfoDetails = details; |
| | | var abc = await _boxingInfoService.AddBoxingInfoAsync(boxingInfo); |
| | | if (abc.Status) |
| | | content.OK("ç»çæå", result); |
| | | else |
| | | content.Error("ç»ç失败"); |
| | | // ååºååResultTrayCellsStatus对象 |
| | | //ResultTrayCellsStatus result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(x); |
| | | |
| | | //// å建DtBoxingInfo对象 |
| | | //DtBoxingInfo boxingInfo = new DtBoxingInfo |
| | | //{ |
| | | // IsFull = true, |
| | | // PalletCode = result.TrayBarcode, |
| | | //}; |
| | | |
| | | //// 使ç¨LINQå建DtBoxingInfoDetail对象å表 |
| | | //var details = result.SerialNos.Select(item => new DtBoxingInfoDetail |
| | | //{ |
| | | // SerialNumber = item.SerialNo, |
| | | // OrderNo = item.PositionNo.ToString(), |
| | | // Status = item.SerialNoStatus, |
| | | // Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | // MaterielCode = result.BindCode, |
| | | //}).ToList(); |
| | | |
| | | //// èµå¼DtBoxingInfoDetails |
| | | //boxingInfo.BoxingInfoDetails = details; |
| | | //var abc = await _boxingInfoService.AddBoxingInfoAsync(boxingInfo); |
| | | content.OK("ç»çæå", x); |
| | | } |
| | | LogFactory.GetLog("æ´ççµè¯å±æ§è·å").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("æ´ççµè¯å±æ§è·å").Info(true, x); |
| | |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputIson = input.ToDictionary(); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/ProcessApply", inputIson); |
| | | if (x != null) |
| | | { |
| | | var ResultProcess = JsonConvert.DeserializeObject<ResultProcessApply>(x); |
| | | content.OK(data: ResultProcess); |
| | | //var ResultProcess = JsonConvert.DeserializeObject<ResultProcessApply>(x); |
| | | content.OK(data: x); |
| | | } |
| | | LogFactory.GetLog("å·¥èºè·¯çº¿ç³è¯·").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("å·¥èºè·¯çº¿ç³è¯·").Info(true, x); |
| | |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.Software = "WMS"; |
| | | input.EquipmentCode = "ECH001-B"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | Console.WriteLine(); |
| | | LogFactory.GetLog("æçåçµè¯è§£ç»1").Info(true, JsonConvert.SerializeObject(inputJson)); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/TrayCellUnbind", inputJson); |
| | | LogFactory.GetLog("æçåçµè¯è§£ç»").Info(true, $"\r\r--------------------------------------"); |
| | |
| | | try |
| | | { |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.Software = "éåæº"; |
| | | input.EquipmentCode = "P1K10040"; |
| | | input.Software = "WMS"; |
| | | input.EquipmentCode = "ECH001-B"; |
| | | input.EmployeeNo = "T00001"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_StorageBasicRepository |
| | | { |
| | | public interface IProductionRepository : IRepository<ProductionModel> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_StorageBasicRepository |
| | | { |
| | | public class ProductionRepository : RepositoryBase<ProductionModel>, IProductionRepository |
| | | { |
| | | public ProductionRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_StorageBasicServices; |
| | | |
| | | public interface IProductionService : IService<ProductionModel> |
| | | { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using WIDESEA_StorageBasicRepository; |
| | | |
| | | namespace WIDESEA_StorageBasicServices; |
| | | |
| | | public class ProductionService : ServiceBase<ProductionModel, IProductionRepository>, IProductionService |
| | | { |
| | | public ProductionService(IProductionRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | } |
| | |
| | | using Mapster; |
| | | using log4net.Core; |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_IStorageBasicRepository; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEA_StorageTaskRepository; |
| | | using WIDESEA_StoragIntegrationServices; |
| | | |
| | | namespace WIDESEA_StorageOutTaskServices; |
| | | |
| | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IDt_OutOrderRepository _outOrderRepository; |
| | | private readonly IStockInfoRepository _stockInfoRepository; |
| | | private readonly IStockInfoDetailRepository _stockInfoDetailRepository; |
| | | private readonly IDt_Task_HtyRepository _task_HtyRepository; |
| | | private readonly IDt_OutOrderAndStockRepository _outOrderAndStockRepository; |
| | | private readonly IDt_OutOrderAndStock_HtyRepository _outOrderAndStock_HtyRepository; |
| | |
| | | private readonly IPointStackerRelationRepository _pointStackerRelationRepository; |
| | | private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository; |
| | | private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; |
| | | private readonly IBoxingInfoRepository _boxingInfoRepository; |
| | | private readonly ICellStateService _cellStateService; |
| | | private readonly IProcessApplyService _processApplyService; |
| | | private readonly IDt_AreaInfoRepository _areaInfoRepository; |
| | | private readonly IBoxingInfoRepository _boxingInfoRepository; //ç»ç |
| | | private readonly ICellStateService _cellStateService; //çµè¯å±æ§ |
| | | private readonly IProcessApplyService _processApplyService; //å·¥èºè·¯çº¿ |
| | | private readonly IDt_AreaInfoRepository _areaInfoRepository; //åºå |
| | | private readonly IAgingInOrOutInputService _agingInOrOutInputService; //éç½®\éå |
| | | private readonly IProductionRepository _productionRepository; //ç产 |
| | | |
| | | public Dt_TaskService(IDt_TaskRepository BaseDal, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | |
| | | IBoxingInfoRepository boxingInfoRepository, |
| | | ICellStateService cellStateService, |
| | | IProcessApplyService processApplyService, |
| | | IDt_AreaInfoRepository areaInfoRepository) : base(BaseDal) |
| | | IDt_AreaInfoRepository areaInfoRepository, |
| | | IAgingInOrOutInputService agingInOrOutInputService, |
| | | IStockInfoDetailRepository stockInfoDetailRepository, |
| | | IProductionRepository productionRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _outOrderRepository = outOrderRepository; |
| | |
| | | _cellStateService = cellStateService; |
| | | _processApplyService = processApplyService; |
| | | _areaInfoRepository = areaInfoRepository; |
| | | _agingInOrOutInputService = agingInOrOutInputService; |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | _productionRepository = productionRepository; |
| | | } |
| | | |
| | | #region å¤é¨æ¥å£æ¹æ³ |
| | | |
| | | #region å åæºåºåºä»»å¡å®æ |
| | | #region åºåºä»»å¡å®æ |
| | | |
| | | /// <summary> |
| | | /// å åæºåºåºä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="saveModel">任塿°æ®åé</param> |
| | | /// <returns>è¿åç»æé</returns> |
| | | |
| | | public async Task<WebResponseContent> CompleteStackTaskAsync(Dt_Task task, DtStockInfo stock) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | // æ´æ°åºåç¶æ |
| | | // 设置åºä½ç¶æä¸ºç©ºé² |
| | | stock.LocationInfo.LocationStatus = LocationEnum.Free.ObjToInt(); |
| | | // 设置åºåç¶æä¸ºåºåº |
| | | stock.StockInfoDetails.ForEach(x => |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | x.Status = 2; |
| | | }); |
| | | var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .FirstAsync(x => x.EquipmentName == task.Roadway); |
| | | var info = JsonConvert.DeserializeObject<ResponseEqptRunDto>(process.ProcessValue); |
| | | |
| | | // æ´æ°ä»»å¡ç¶æ |
| | | task.TaskState = TaskOutStatusEnum.SC_OutFinish.ObjToInt(); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = task.TargetAddress; |
| | | var agingOutputDto = MapToAgingOutputDto(stock, info); |
| | | content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto); |
| | | ValidateResponse(content); |
| | | } |
| | | |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å åæºåºåºå®æ", "æ´æ°åºåç¶æä¸ä»»å¡ç¶æ"); |
| | | // æ´æ°åºåç¶æåä»»å¡ç¶æ |
| | | (var loc, var tas) = UpdateStockAndTaskStatus(stock, task); |
| | | |
| | | // äºå¡å¤ç |
| | | // å¼å§äºå¡ |
| | | _unitOfWorkManage.BeginTran(); |
| | | // æ´æ°åºåä¿¡æ¯ |
| | | var isStockUpdated = _stockInfoRepository.UpdateData(stock); |
| | | // æ´æ°ä»»å¡ä¿¡æ¯ |
| | | var isTaskUpdated = await Update(task); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await UpdateLocationAsync(loc); |
| | | await DeleteStockInfoAsync(stock.Id); |
| | | await DeleteStockInfoDetailsAsync(stock.StockInfoDetails); |
| | | //await DeleteTaskAsync(task.TaskId); |
| | | }); |
| | | |
| | | // 妿åºåä¿¡æ¯åä»»å¡ä¿¡æ¯é½æ´æ°æå |
| | | if (isStockUpdated && isTaskUpdated) |
| | | { |
| | | // è®°å½æ¥å¿ |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å åæºåºåºå®æ", $"äºå¡å¤ç宿ï¼åºåç¶ææ´æ°ï¼{isStockUpdated}ï¼ä»»å¡ç¶ææ´æ°:{isTaskUpdated}"); |
| | | // æäº¤äºå¡ |
| | | _unitOfWorkManage.CommitTran(); |
| | | // è¿åæåç»æ |
| | | return content.OK("ä»»å¡å®ææå"); |
| | | } |
| | | else |
| | | { |
| | | // è®°å½æ¥å¿ |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å åæºåºåºå®æ", $"äºå¡å¤ç失败ï¼åºåç¶ææ´æ°ï¼{isStockUpdated}ï¼ä»»å¡ç¶ææ´æ°:{isTaskUpdated}"); |
| | | // åæ»äºå¡ |
| | | _unitOfWorkManage.RollbackTran(); |
| | | // è¿åå¤±è´¥ç»æ |
| | | return content.Error("任塿åºåæ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | catch (Exception err) |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, $"ç³»ç»å¼å¸¸ï¼å¼å¸¸ä¿¡æ¯ï¼{err.Message}", ""); |
| | | Console.WriteLine(err.Message); |
| | | LogFactory.GetLog("ä»»å¡å®æ").Error(true, $"ç³»ç»å¼å¸¸ï¼å¼å¸¸ä¿¡æ¯ï¼{err.Message}"); |
| | | return content.Error(err.Message); |
| | | } |
| | | } |
| | | |
| | | #endregion å åæºåºåºä»»å¡å®æ |
| | | private AgingOutputDto MapToAgingOutputDto(DtStockInfo stock, ResponseEqptRunDto info) |
| | | { |
| | | // TODO Value弿 ¹æ®MOMä¸åçéç½®æ¶é´å°å½åæ¶é´çåéæ° |
| | | return new AgingOutputDto |
| | | { |
| | | OpFlag = 1, |
| | | Software = "WMS", |
| | | EquipmentCode = "ECH001-B", |
| | | TrayBarcode = stock.PalletCode, |
| | | SerialNos = stock.StockInfoDetails.Select(x => new SerialNoOutDto |
| | | { |
| | | SlotNo = x.OrderNo.ToInt32(), |
| | | SerialNo = x.SerialNumber, |
| | | SerialNoResult = true, |
| | | ParameterInfo = info.ParameterInfo.Select(y => new ParameterInfo() |
| | | { |
| | | LowerLomit = y.LowerControlLimit, |
| | | UpperLimit = y.UpperControlLimit, |
| | | ParameterResult = y.EquipmentAvailabilityFlag, |
| | | ParameterCode = y.ParameterCode, |
| | | ParameterDesc = y.Description, |
| | | TargetValue = y.TargetValue, |
| | | Value = ( DateTime.Parse(stock.LinedProcessFeedbackTime, null, System.Globalization.DateTimeStyles.RoundtripKind).ToLocalTime() - stock.CreateDate).TotalMinutes.ToString(), |
| | | DefectCode = y.UOMCode |
| | | }).ToList() |
| | | }).ToList() |
| | | }; |
| | | } |
| | | |
| | | private void ValidateResponse(WebResponseContent content) |
| | | { |
| | | var result = JsonConvert.DeserializeObject<BasicResult>(content.Data.ToString()); |
| | | if (!result.Success) |
| | | { |
| | | throw new Exception(result.MOMMessage); |
| | | } |
| | | } |
| | | |
| | | private (DtLocationInfo, Dt_Task) UpdateStockAndTaskStatus(DtStockInfo stock, Dt_Task task) |
| | | { |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | var details = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id); |
| | | |
| | | location.LocationStatus = (int)LocationEnum.Free; |
| | | task.TaskState = (int)TaskOutStatusEnum.OutFinish; |
| | | //task.CurrentAddress = task.NextAddress; |
| | | //task.NextAddress = task.TargetAddress; |
| | | |
| | | LogFactory.GetLog("ä»»å¡å®æ").Info(true, "æ´æ°åºåç¶æä¸ä»»å¡ç¶æ"); |
| | | return (location, task); |
| | | } |
| | | |
| | | private async Task DeleteStockInfoAsync(int stockId) |
| | | { |
| | | var isStockUpdated = await _stockInfoRepository.DeleteDataByIdAsync(stockId); |
| | | if (!isStockUpdated) |
| | | { |
| | | throw new Exception("åºåä¿¡æ¯æ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | private async Task UpdateLocationAsync(DtLocationInfo info) |
| | | { |
| | | var isStockUpdated = await _locationRepository.UpdateDataAsync(info); |
| | | if (!isStockUpdated) |
| | | { |
| | | throw new Exception("åºåä¿¡æ¯æ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | private async Task DeleteStockInfoDetailsAsync(IEnumerable<DtStockInfoDetail> details) |
| | | { |
| | | var ids = details.Select(x => (object)x.Id).ToArray(); |
| | | var isStockDetailUpdated = await _stockInfoDetailRepository.DeleteDataByIdsAsync(ids); |
| | | if (!isStockDetailUpdated) |
| | | { |
| | | throw new Exception("åºå详æ
ä¿¡æ¯æ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | private async Task DeleteTaskAsync(int taskId) |
| | | { |
| | | var isTaskUpdated = await BaseDal.DeleteDataByIdAsync(taskId); |
| | | if (!isTaskUpdated) |
| | | { |
| | | throw new Exception("ä»»å¡ä¿¡æ¯æ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | #endregion åºåºä»»å¡å®æ |
| | | |
| | | #region ç§»åºä»»å¡å®æ |
| | | |
| | |
| | | #region å
¥åºä»»å¡å®æ |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡å®æ |
| | | /// 宿å
¥åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="task">任塿°æ®åé</param> |
| | | /// <returns>è¿åç»æé</returns> |
| | | public async Task<WebResponseContent> CompleteInboundTaskAsync(Dt_Task task) |
| | | { |
| | | // åå§åååºå
容 |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | // è·åè£
箱信æ¯åç®æ ä½ç½®ä¿¡æ¯ |
| | | var boxing = await _boxingInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode); |
| | | var locationInf = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress); |
| | | |
| | | // æ´æ°ç®æ ä½ç½®ç¶æä¸ºåºåä¸ |
| | | locationInf.LocationStatus = (int)LocationEnum.InStock; |
| | | |
| | | // å建åå²ä»»å¡å®ä¾æ¨¡å |
| | | var taskHty = CreateHistoricalTask(task); |
| | | |
| | | // æ ¹æ®æ¯å¦æç»çä¿¡æ¯å建åºåå®ä¾æ¨¡å |
| | | DtStockInfo stock = boxing == null ? CreateEmptyPalletStock(task, locationInf) : CreateFullPalletStock(task, locationInf, boxing); |
| | | |
| | | // æ§è¡æ°æ®åºäºå¡ |
| | | bool isResult = await ExecuteTransaction(stock, taskHty, locationInf, task.TaskId); |
| | | if (isResult) |
| | | { |
| | | content.OK("å
¥åºä»»å¡å®ææå"); |
| | | } |
| | | else |
| | | { |
| | | content.Error("å
¥åºä»»å¡å®æå¤±è´¥"); |
| | | } |
| | | } |
| | | catch (Exception err) |
| | | { |
| | | // è®°å½å¼å¸¸ä¿¡æ¯å°æ§å¶å°åæ¥å¿ |
| | | Console.WriteLine(err.Message.ToString()); |
| | | LogFactory.GetLog("ä»»å¡å®æ").Error(true, err); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建空æççåºåå®ä¾æ¨¡å |
| | | /// </summary> |
| | | private DtStockInfo CreateEmptyPalletStock(Dt_Task task, DtLocationInfo locationInf) |
| | | { |
| | | return new DtStockInfo() |
| | | { |
| | | PalletCode = task.PalletCode, |
| | | LocationCode = task.TargetAddress, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "system", |
| | | IsFull = false, |
| | | AreaCode = task.Roadway, |
| | | StockInfoDetails = new List<DtStockInfoDetail>() |
| | | { |
| | | new DtStockInfoDetail() |
| | | { |
| | | MaterielCode = "空æç", |
| | | Id = 0, |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建å®ççåºåå®ä¾æ¨¡åå¹¶è°ç¨MOMå
¥åº |
| | | /// </summary> |
| | | private DtStockInfo CreateFullPalletStock(Dt_Task task, DtLocationInfo locationInf, DtBoxingInfo boxing) |
| | | { |
| | | var boxDetail = boxing.BoxingInfoDetails.Adapt<List<DtStockInfoDetail>>(); |
| | | // å建åºåå®ä¾æ¨¡å |
| | | DtStockInfo stock = new DtStockInfo() |
| | | var stock = new DtStockInfo() |
| | | { |
| | | PalletCode = task.PalletCode, |
| | | LocationCode = task.TargetAddress, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "system", |
| | | IsFull = boxing.IsFull, |
| | | AreaCode = task.Roadway, |
| | | StockInfoDetails = boxDetail, |
| | | LocationInfo = new DtLocationInfo() |
| | | }; |
| | | |
| | | // å建åå²ä»»å¡å®ä¾æ¨¡å |
| | | var taskHty = CreateHistoricalTask(task); |
| | | // å¤ç请æ±åæ° |
| | | AgingInputDto agingInputDto = new AgingInputDto() |
| | | { |
| | | SerialNos = boxing.BoxingInfoDetails |
| | | .Select(item => new SerialNoInDto { SerialNo = item.SerialNumber, PositionNo = item.OrderNo }) |
| | | .ToList(), |
| | | TrayBarcode = task.PalletCode, |
| | | OpFlag = 1, |
| | | EquipmentCode = "ECH001-B", |
| | | Software = "WMS" |
| | | }; |
| | | var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result; |
| | | var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString()); |
| | | stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime; |
| | | stock.SpecialParameterDuration = respone.SpecialParameterDuration; |
| | | |
| | | // ä¿®æ¹è´§ä½ä¿¡æ¯ä¸ºæè´§ |
| | | var locationInf = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress); |
| | | locationInf.LocationStatus = (int)LocationEnum.InStock; |
| | | |
| | | // è®°å½æ¥å¿ |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å
¥åºä»»å¡å®æ", $"è´§ä½å°åï¼{task.TargetAddress},ä¿®æ¹åè´§ä½æ°æ®ï¼{locationInf}"); |
| | | |
| | | // æ§è¡æ°æ®åºäºå¡ |
| | | bool isResult = await ExecuteTransaction(stock, taskHty, locationInf, task.TaskId); |
| | | if (isResult) |
| | | content.OK("å
¥åºä»»å¡å®ææå"); |
| | | else |
| | | content.Error("å
¥åºä»»å¡å®æå¤±è´¥"); |
| | | } |
| | | catch (Exception err) |
| | | { |
| | | Console.WriteLine(err.Message.ToString()); |
| | | } |
| | | return content; |
| | | return stock; |
| | | } |
| | | |
| | | #endregion å
¥åºä»»å¡å®æ |
| | |
| | | #region ä»»å¡å®æ |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// å®æä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns></returns> |
| | | /// <param name="taskNum">ä»»å¡ç¼å·</param> |
| | | /// <returns>è¿åç»æé</returns> |
| | | public async Task<WebResponseContent> CompleteAsync(int taskNum) |
| | | { |
| | | // åå§åååºå
容 |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | // æå任塿°æ® |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "æå任塿°æ®", $"ä»»å¡å·ï¼{taskNum}"); |
| | | |
| | |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "éªè¯ä»»å¡æ¯å¦åå¨", JsonConvert.SerializeObject(task)); |
| | | |
| | | // éªè¯åºåæ¯å¦åå¨ |
| | | var stock = await _stockInfoRepository.QueryFirstAsync(x => x.PalletCode == task.PalletCode); |
| | | if (stock == null) |
| | | var stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode); |
| | | |
| | | // æ ¹æ®ä»»å¡ç±»åè°ç¨ç¸åºç宿任塿¹æ³ |
| | | switch (task.TaskType) |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "åºåä¸åå¨åå¨ï¼å¤ææ¯å¦æ¯å
¥åºä»»å¡", $"{task.TaskType}"); |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | { |
| | | case (int)TaskInboundTypeEnum.Inbound: |
| | | case (int)TaskInboundTypeEnum.InTray: |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å
¥åºä»»å¡", ""); |
| | | return await CompleteInboundTaskAsync(task); |
| | | } |
| | | else |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "åºåä¸åå¨ä¹ä¸æ¯å
¥åºä»»å¡", ""); |
| | | return content.Error("åºåä¸åå¨"); |
| | | } |
| | | } |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "éªè¯åºåæ¯å¦åå¨", JsonConvert.SerializeObject(stock)); |
| | | |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | case (int)TaskOutboundTypeEnum.OutTray: |
| | | case (int)TaskOutboundTypeEnum.Outbound: |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "åºåºä»»å¡", ""); |
| | | if (task.TaskState == TaskOutStatusEnum.SC_OutExecuting.ObjToInt()) |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å åæºåºåºå®æ", ""); |
| | | return await CompleteStackTaskAsync(task, stock); |
| | | } |
| | | else |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "åºåä¸åå¨ä¹ä¸æ¯å
¥åºä»»å¡", ""); |
| | | return content.Error("åºåä¸åå¨"); |
| | | } |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.RelocationIn) |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "ç§»åºä»»å¡å®æ", ""); |
| | | return await CompleteTransferTaskAsync(task, stock); |
| | | } |
| | | else |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, $"ä»»å¡ç¶æå¼å¸¸", "æ åæ°"); |
| | | return content.Error("ä»»å¡ç¶æå¼å¸¸"); |
| | | |
| | | default: |
| | | return content.Error("ä»»å¡ç±»åä¸åå¨"); |
| | | } |
| | | } |
| | | |
| | | #endregion ä»»å¡å®æ |
| | | |
| | | #region 请æ±ä»»å¡ |
| | | #region 请æ±ä»»å¡å
¥åº |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä»»å¡ |
| | | /// 请æ±ä»»å¡å··é |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ¨¡å</param> |
| | | /// <returns>å
å«ä»»å¡ä¿¡æ¯çååºå
容</returns> |
| | |
| | | |
| | | try |
| | | { |
| | | // è°ç¨BaseDal.QueryFirstAsyncæ¹æ³ï¼æ¥è¯¢ä»»å¡ |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | if (task != null) |
| | | { |
| | | //if (task.TaskState == (int)TaskInStatusEnum.InNew) |
| | | { |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | return content.OK(data: taskDTO); |
| | | } |
| | | } |
| | | // å建ä¸ä¸ªTrayCellsStatusDto对象ï¼å¹¶èµå¼ |
| | | TrayCellsStatusDto trayCells = new TrayCellsStatusDto() |
| | | { |
| | | TrayBarcode = input.PalletCode |
| | | Software = "WMS", |
| | | TrayBarcode = input.PalletCode, |
| | | EquipmentCode = "ECH001-B" |
| | | }; |
| | | |
| | | // è°ç¨GetTrayCellStatusAsyncæ¹æ³ï¼è·åæ´ççµè¯ |
| | |
| | | // å¦æç¶æä¸ºfalseï¼åè¿åcontent |
| | | if (!content.Status) return content; |
| | | |
| | | // è°ç¨GetProcessApplyAsyncæ¹æ³ï¼è·åå·¥èºç³è¯· |
| | | ProcessApplyDto process = await GetProcessApplyAsync(content); |
| | | // æ·»å ç»çä¿¡æ¯ |
| | | // å°content.Data转æ¢ä¸ºResultTrayCellsStatus对象 |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | if (result.SerialNos.Count <= 0) |
| | | return content.Error(result.MOMMessage); |
| | | |
| | | // TODO è·åæ¬å°ææ¡å±æ§ä¸æ´ççµè¯å±æ§è·åçå¼è¿è¡å¯¹æ¯ï¼å¦æä¸è´åç»§ç»ï¼å¦åè¿åéè¯¯ä¿¡æ¯ |
| | | var productions = await _productionRepository.QueryDataAsync(x => result.TrayBarcodePropertys.Select(x => x.TrayBarcodeProperty).ToList().Contains(x.TrayBarcodeProperty)); |
| | | if (productions.Count <= 0) |
| | | return content.Error("ææ¡å±æ§ä¸åå¨"); |
| | | |
| | | // è°ç¨CreateBoxingInfoæ¹æ³ï¼å建ç»çä¿¡æ¯ |
| | | |
| | | var boxing = await CreateBoxingInfo(result, input.PalletCode); |
| | | if (boxing == null) return content.Error("ç»ç失败"); |
| | | |
| | | // è°ç¨GetProcessApplyAsyncæ¹æ³ï¼è·åå·¥èºè·¯çº¿ |
| | | ProcessApplyDto process = await GetProcessApplyAsync(result); |
| | | |
| | | // 妿process为nullï¼åè¿åcontent |
| | | if (process == null) return content; |
| | | |
| | | // è°ç¨GetProcessResponseAsyncæ¹æ³ï¼è·åå·¥èºååº |
| | | var processResponse = await GetProcessResponseAsync(process, input.Position); |
| | | // è°ç¨_processApplyService.GetProcessApplyAsyncæ¹æ³ï¼è·åå·¥èºç³è¯· |
| | | content = await _processApplyService.GetProcessApplyAsync(process); |
| | | |
| | | // è°ç¨BaseDal.QueryFirstAsyncæ¹æ³ï¼æ¥è¯¢ä»»å¡ |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | // 妿taskä¸ä¸ºnullï¼åè°ç¨UpdateExistingTaskæ¹æ³ï¼æ´æ°ä»»å¡ï¼å¦åè°ç¨CreateNewTaskæ¹æ³ï¼å建æ°ä»»å¡ |
| | | content = task != null ? await UpdateExistingTask(input, task) : await CreateNewTask(processResponse, input); |
| | | // å¦æç¶æä¸ºfalseï¼åè¿ånull |
| | | if (!content.Status) return content.Error("å·¥èºç³è¯·å¤±è´¥"); |
| | | |
| | | //// è°ç¨GetProcessResponseAsyncæ¹æ³ï¼è·åå·¥èºååº |
| | | //var processResponse = await GetProcessResponseAsync(process, input.Position); |
| | | |
| | | List<string> strings = input.Position == "1088" ? new List<string>() { "CHSC01" } : new List<string>() { "JZSC01" }; |
| | | // è°ç¨CreateNewTaskæ¹æ³ï¼å建æ°ä»»å¡ |
| | | content = await CreateNewTask(input, strings); |
| | | if (content.Status) |
| | | { |
| | | var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | | } |
| | | } |
| | | catch (Exception err) |
| | | { |
| | |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡è´§ä½ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | if (task == null) |
| | | return content.Error($"ææªæ¾å°ã{input.PalletCode}ãçä»»å¡"); |
| | | |
| | | return content = await UpdateExistingTask(input, task); |
| | | |
| | | } |
| | | catch (Exception err) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçå
¥åºç³è¯· |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> RequestTrayInTaskAsync(RequestTaskDto input) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | // è°ç¨BaseDal.QueryFirstAsyncæ¹æ³ï¼æ¥è¯¢ä»»å¡ |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | if (task != null && task.TaskState == (int)TaskInStatusEnum.InNew) |
| | | { |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | return content.OK(data: task); |
| | | } |
| | | |
| | | return await CreateNewTask(input, null, 1); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | // è·åæçåå
æ ¼ç¶æ |
| | | private async Task<WebResponseContent> GetTrayCellStatusAsync(TrayCellsStatusDto trayCells) |
| | | { |
| | |
| | | return await _cellStateService.GetTrayCellStatusAsync(trayCells); |
| | | } |
| | | |
| | | // è·åå·¥èºç³è¯· |
| | | private async Task<ProcessApplyDto> GetProcessApplyAsync(WebResponseContent content) |
| | | // è·åç»çä¿¡æ¯ |
| | | private async Task<DtBoxingInfo> CreateBoxingInfo(ResultTrayCellsStatus result, string palletCode) |
| | | { |
| | | // å¦æç¶æä¸ºfalseï¼åè¿ånull |
| | | if (!content.Status) return null; |
| | | return new DtBoxingInfo |
| | | { |
| | | PalletCode = palletCode, |
| | | IsFull = true, |
| | | BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail |
| | | { |
| | | SerialNumber = serialNoObj.SerialNo, |
| | | OrderNo = serialNoObj.PositionNo.ToString(), |
| | | Status = serialNoObj.SerialNoStatus, |
| | | MaterielCode = result.BindCode, |
| | | Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | }).ToList() |
| | | }; |
| | | } |
| | | |
| | | // å°content.Data转æ¢ä¸ºResultTrayCellsStatus对象 |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | // è·åå·¥èºç³è¯· |
| | | private async Task<ProcessApplyDto> GetProcessApplyAsync(ResultTrayCellsStatus content) |
| | | { |
| | | // å建ä¸ä¸ªProcessApplyDto对象ï¼å¹¶èµå¼ |
| | | return new ProcessApplyDto() |
| | | { |
| | | WipOrderNo = result.BindCode, |
| | | SerialNos = result.SerialNos.Select(item => new SerialNos |
| | | EquipmentCode = "ECH001-B", |
| | | Software = "WMS", |
| | | //WipOrderNo = result.BindCode, |
| | | SerialNos = content.SerialNos.Select(item => new SerialNos |
| | | { |
| | | SerialNo = item.SerialNo |
| | | }).ToList() |
| | |
| | | { |
| | | case "1088": |
| | | return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .Where(x => x.EquipmentType == "éå" && x.WipOrderNo == apply.WipOrderNo && x.ProductDesc == apply.ProductNo) |
| | | .Where(x => x.EquipmentType == "éå" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo) |
| | | .ToList(); |
| | | |
| | | case "1339": |
| | | case "1406": |
| | | return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .Where(x => x.EquipmentType == "éç½®" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo) |
| | | .ToList(); |
| | | |
| | | default: |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion 请æ±ä»»å¡ |
| | | #endregion 请æ±ä»»å¡å
¥åº |
| | | |
| | | #region 请æ±ç©ºæç |
| | | #region 请æ±åºåºï¼å®ç&空çï¼ |
| | | |
| | | public async Task<WebResponseContent> RequestTrayTaskAsync(string position) |
| | | /// <summary> |
| | | /// è¯·æ±æçä»»å¡ |
| | | /// </summary> |
| | | /// <param name="position">ç®æ ä½ç½®</param> |
| | | /// <param name="tag">æçç±»åï¼1ï¼å®çï¼2ï¼ç©ºçï¼</param> |
| | | /// <param name="areaCode">åºåç¼ç </param> |
| | | /// <param name="roadways">å··éç¼ç éå</param> |
| | | /// <returns>è¿åç»æé</returns> |
| | | public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, List<string> roadways) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var area = _areaInfoRepository.QueryFirst(x => x.AreaCode == "CH"); |
| | | // æ ¹æ®æçç±»åæ¥è¯¢åºåä¿¡æ¯ |
| | | DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound |
| | | ? QueryStockInfoForRealTray(areaCode, roadways) |
| | | : QueryStockInfoForEmptyTray(areaCode, roadways); |
| | | |
| | | var stockInfo = _stockInfoRepository.QueryData(x => x.Remark == area.AreaCode && x.StockInfoDetails.Any(z => z.MaterielCode == "空æç")).OrderBy(x => x.CreateDate).FirstOrDefault(); |
| | | // å建æ°ä»»å¡å®ä¾ |
| | | var task = new Dt_Task |
| | | if (stockInfo == null) |
| | | { |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | return content.Error("åºåä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | |
| | | // å建æ°ä»»å¡å®ä¾ |
| | | var task = CreateTask(stockInfo, position, tag); |
| | | var taskId = await BaseDal.AddDataAsync(task); |
| | | bool isResult = taskId > 0; |
| | | if (!isResult) |
| | | { |
| | | return content.Error("ä»»å¡å建失败"); |
| | | } |
| | | |
| | | // å建任å¡DTO |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | | //if (tag == 1) |
| | | { |
| | | // æ´æ°åºåä½ç½®ç¶æä¸ºä¸å¯ç¨ |
| | | stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | await _locationRepository.UpdateDataAsync(stockInfo.LocationInfo); |
| | | } |
| | | |
| | | // è¿åæåååº |
| | | return content.OK(data: taskDTO); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // è®°å½å¼å¸¸ä¿¡æ¯å¹¶æåº |
| | | LogFactory.GetLog("è¯·æ±æçä»»å¡").Error(true, ex); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å®çåºåä¿¡æ¯ |
| | | /// </summary> |
| | | private DtStockInfo QueryStockInfoForRealTray(string areaCode, List<string> roadways) |
| | | { |
| | | // TODOæ¶é´æ ¹æ®MOMç³»ç»é
ç½®çåºåºæ¶é´æ¥è·å,ææ¶ä¸ç¥éMOMè¿åçæ¶é´æ¯ä»ä¹æä»¥è¿éæµè¯æ¶å卿¹ |
| | | return _stockInfoRepository.Db.Queryable<DtStockInfo>().Where(x => x.AreaCode == areaCode && Convert.ToDateTime(x.LinedProcessFeedbackTime) < DateTime.Now && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && roadways.Contains(x.LocationInfo.RoadwayNo)) |
| | | .Includes(x => x.LocationInfo) |
| | | .Includes(x => x.StockInfoDetails) |
| | | .OrderBy(x => x.CreateDate) |
| | | .First(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢ç©ºçåºåä¿¡æ¯ |
| | | /// </summary> |
| | | private DtStockInfo QueryStockInfoForEmptyTray(string areaCode, List<string> roadways) |
| | | { |
| | | return _stockInfoRepository.Db.Queryable<DtStockInfo>().Where(x => x.AreaCode == areaCode && x.StockInfoDetails.Any(z => z.MaterielCode == "空æç") && roadways.Contains(x.LocationInfo.RoadwayNo)) |
| | | .Includes(x => x.LocationInfo) |
| | | .Includes(x => x.StockInfoDetails) |
| | | .OrderBy(x => x.CreateDate) |
| | | .First(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建任å¡å®ä¾ |
| | | /// </summary> |
| | | private Dt_Task CreateTask(DtStockInfo stockInfo, string position, int tag) |
| | | { |
| | | return new Dt_Task |
| | | { |
| | | Grade = 1, |
| | | Roadway = stockInfo.LocationInfo.RoadwayNo, |
| | | TargetAddress = position, |
| | |
| | | OrderNo = null, |
| | | PalletCode = stockInfo.PalletCode, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | TaskType = (int)TaskOutboundTypeEnum.OutTray, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | TaskType = tag == (int)TaskOutboundTypeEnum.Outbound ? (int)TaskOutboundTypeEnum.Outbound : (int)TaskOutboundTypeEnum.OutTray, |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | Creater = "System" // ä¿®æ£æ¼åé误 |
| | | }; |
| | | } |
| | | |
| | | var taskId = await BaseDal.AddDataAsync(task); |
| | | bool isResult = taskId > 0; |
| | | if (isResult) |
| | | /// <summary> |
| | | /// å建任å¡DTO |
| | | /// </summary> |
| | | private WMSTaskDTO CreateTaskDTO(Dt_Task task) |
| | | { |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | return new WMSTaskDTO |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = DateTime.Now.ToString("MMddHHmmss"), |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.TargetAddress, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = (int)TaskOutboundTypeEnum.OutTray |
| | | TaskType = task.TaskType, |
| | | }; |
| | | content.OK(data: taskDTO); |
| | | } |
| | | |
| | | #endregion 请æ±åºåº |
| | | |
| | | #region ä»»å¡ç¶ææ´æ¹ |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ç¶æ&åºåºè§£ç |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="taskState"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> UpdateTaskStatus(int taskNum, int taskState) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = await BaseDal.QueryFirstAsync(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | return content.Error("æªæ¾å°ä»»å¡"); |
| | | |
| | | if (taskState == (int)TaskOutStatusEnum.Line_OutFinish) |
| | | { |
| | | var taskHty = CreateHistoricalTask(task); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | var asb = await BaseDal.DeleteDataByIdAsync(task.TaskId); |
| | | var asbHty = await _task_HtyRepository.AddDataAsync(taskHty) > 0; |
| | | if (asb && asbHty) |
| | | content.OK(); |
| | | else |
| | | throw new Exception(); |
| | | }); |
| | | content.OK(); |
| | | } |
| | | else |
| | | { |
| | | task.TaskState = taskState; |
| | | var asb = await BaseDal.UpdateDataAsync(task); |
| | | if (asb) |
| | | content.OK(); |
| | | else |
| | | content.Error(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion 请æ±ç©ºæç |
| | | #endregion |
| | | |
| | | #region åºåºè§£ç |
| | | |
| | | /// <summary> |
| | | /// åºåºè§£çæ¥å£ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> OutUnblockInterface(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = await BaseDal.QueryFirstAsync(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | return content.Error("æªæ¾å°ä»»å¡"); |
| | | task.TaskState = (int)TaskOutStatusEnum.Line_OutFinish; |
| | | var taskHty = CreateHistoricalTask(task); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion å¤é¨æ¥å£æ¹æ³ |
| | | |
| | |
| | | isUpdateStock = await _stockInfoRepository.AddDataNavAsync(stock); |
| | | } |
| | | |
| | | |
| | | |
| | | // æ·»å åå²ä»»å¡ |
| | | var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; |
| | | |
| | |
| | | DtLocationInfo location = new DtLocationInfo(); |
| | | int beforeStatus = 0; |
| | | |
| | | // æ ¹æ®ä»»å¡ç±»å夿æ¯åºåºä»»å¡è¿æ¯å
¥åºä»»å¡ |
| | | //if (input.Type == (int)TaskTypeEnum.Outbound) |
| | | //{ |
| | | // // å¤çåºåºä»»å¡ |
| | | // toAddress = await GetRoadWayAsync(areaId, task.Roadway, input.Direction, input.Area, input.Type); |
| | | // taskState = (int)TaskOutStatusEnum.SC_OutFinish; |
| | | //} |
| | | //else |
| | | //{ |
| | | // å¤çå
¥åºä»»å¡ |
| | | location = await GetLocationDistributeAsync(task.Roadway); |
| | | toAddress = location.LocationCode; |
| | |
| | | |
| | | // æ´æ°è´§ä½ä¿¡æ¯ |
| | | location.LocationStatus = (int)LocationEnum.Lock; |
| | | //} |
| | | |
| | | // æ´æ°ä»»å¡ä¿¡æ¯ |
| | | //task.SourceAddress = input.Position; |
| | | task.CurrentAddress = input.Position; |
| | | task.TargetAddress = toAddress; |
| | | task.NextAddress = toAddress; |
| | |
| | | /// <param name="areaId">åºåID</param> |
| | | /// <param name="content">ååºå
容</param> |
| | | /// <returns></returns> |
| | | private async Task<WebResponseContent> CreateNewTask(List<Dt_EquipmentProcess> process, RequestTaskDto input) |
| | | private async Task<WebResponseContent> CreateNewTask(RequestTaskDto input, List<string> process = null, int flag = 0) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | List<string> strings = process.Select(x => x.EquipmentName).ToList(); |
| | | |
| | | // è·åç®æ å°å |
| | | string ToAddress = await GetRoadWayAsync(strings); |
| | | string ToAddress = await GetRoadWayAsync(process); |
| | | |
| | | // å建æ°ä»»å¡å®ä¾ |
| | | var task = new Dt_Task |
| | |
| | | PalletCode = input.PalletCode, |
| | | SourceAddress = input.Position, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskType = (int)TaskTypeEnum.Inbound, |
| | | TaskType = flag == 0 ? (int)TaskInboundTypeEnum.Inbound : (int)TaskInboundTypeEnum.InTray, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | }; |
| | | |
| | | // å°è¯æ·»å æ°ä»»å¡ |
| | | var taskId = await BaseDal.AddDataAsync(task); |
| | | bool isResult = taskId > 0; |
| | |
| | | isResult = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(input.PalletCode, input.Position, ToAddress, TaskInStatusEnum.InNew.GetIntegralRuleTypeEnumDesc())); |
| | | if (isResult) |
| | | { |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = 0, |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = DateTime.Now.ToString("MMddHHmmss"), |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = input.Position, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | content.OK(data: taskDTO); |
| | | } |
| | |
| | | { |
| | | var minGroup = _locationRepository.QueryData(x => process.Contains(x.RoadwayNo) && x.LocationStatus == (int)LocationEnum.Free) |
| | | .GroupBy(x => x.RoadwayNo) |
| | | .OrderByDescending(g => g.Count()) // æ ¹æ®æ¯ä¸ªç»çå
ç´ æ°éæåº |
| | | .First(); // ååºæ°éæå¤çç» |
| | | |
| | | string minRoadwayNo = minGroup.Key; // æ°éæå¤çç»çKey |
| | | |
| | | return minRoadwayNo; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åå··éæç«å° |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<string> GetRoadWayAsync(int areaCode) |
| | | { |
| | | var minGroup = _locationRepository.QueryData(x => x.AreaId == areaCode && x.LocationStatus == (int)LocationEnum.Free) |
| | | .GroupBy(x => x.RoadwayNo) |
| | | .OrderBy(g => g.Count()) // æ ¹æ®æ¯ä¸ªç»çå
ç´ æ°éæåº |
| | | .First(); // ååºæ°éæå°çç» |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class ProductionController : ApiBaseController<IProductionService, ProductionModel> |
| | | { |
| | | public ProductionController(IProductionService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | public override ActionResult AddData([FromBody] ProductionModel options) |
| | | { |
| | | return base.AddData(options); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | // POST: api/AgingInOrOut/OCVInput |
| | | [HttpPost("OCVInput")] |
| | | public Task<dynamic> GetOCVInputAsync([FromBody] AgingInputDto input) |
| | | public Task<WebResponseContent> GetOCVInputAsync([FromBody] AgingInputDto input) |
| | | { |
| | | return _agingInOrOutInputService.GetOCVInputAsync(input); |
| | | } |
| | |
| | | /// <returns></returns> |
| | | // POST: api/AgingInOrOut/OCVOutput |
| | | [HttpPost("OCVOutput")] |
| | | public Task<dynamic> GetOCVOutputAsync([FromBody] AgingOutputDto input) |
| | | public Task<WebResponseContent> GetOCVOutputAsync([FromBody] AgingOutputDto input) |
| | | { |
| | | return _agingInOrOutInputService.GetOCVOutputAsync(input); |
| | | } |
| | |
| | | using WIDESEA_DTO; |
| | | using static WIDESEA_DTO.RequestTaskDto; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers; |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡è¯·æ± |
| | | /// 请æ±ä»»å¡å··é |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçè¯·æ± |
| | | /// 请æ±ä»»å¡è´§ä½ |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | | [HttpPost, AllowAnonymous, Route("RequestTrayTaskAsync")] |
| | | public async Task<WebResponseContent> RequestTrayTaskAsync([FromBody] string position) |
| | | [HttpPost, AllowAnonymous, Route("RequestLocationTaskAsync")] |
| | | public async Task<WebResponseContent> UpdateExistingTask([FromBody] RequestTaskDto input) |
| | | { |
| | | return await Service.RequestTrayTaskAsync(position); |
| | | return await Service.UpdateExistingTask(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçå
¥åºè¯·æ± |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | | [HttpPost, AllowAnonymous, Route("RequestTrayInTaskAsync")] |
| | | public async Task<WebResponseContent> RequestTrayInTaskAsync([FromBody] RequestTaskDto input) |
| | | { |
| | | return await Service.RequestTrayInTaskAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æç&满çåºåºè¯·æ± |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | | [HttpPost, AllowAnonymous, Route("RequestTrayOutTaskAsync")] |
| | | public async Task<WebResponseContent> RequestTrayOutTaskAsync([FromBody] RequestOutTaskDto request) |
| | | { |
| | | return await Service.RequestTrayOutTaskAsync(request.Position, request.Tag, request.AreaCdoe, request.Roadways); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æä¿®æ¹ |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | | [HttpPost, AllowAnonymous, Route("UpdateTaskStatus")] |
| | | public async Task<WebResponseContent> UpdateTaskStatus([FromBody] UpdateStatusDto input) |
| | | { |
| | | return await Service.UpdateTaskStatus(input.TaskNum, input.TaskState); |
| | | } |
| | | |
| | | } |
| | |
| | | global using WIDESEA_Core.Authorization; |
| | | global using WIDESEA_Core.Utilities; |
| | | global using WIDESEA_Model; |
| | | global using WIDESEA_StorageBasicServices; |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| | | <PropertyGroup> |
| | | <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> |
| | | <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> |
| | | <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID> |
| | | <Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath> |
| | | <NameOfLastUsedPublishProfile>D:\Git\BaiBuLiKu\Code Management\WMS\WIDESEA_WMSServer\WIDESEA_WMSServer\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | </PropertyGroup> |
| | | </Project> |