| | |
| | | //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, command.ConveyorLineBarcode, childDeviceCode); |
| | | var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList(); |
| | | if (GWTask.Count >= 2 && childDeviceCode == "1039"&&task.Roadway.Contains("GWSC2")) |
| | | if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2")) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"æçå·ï¼ã{command.ConveyorLineBarcode}ã髿¸©äºå·²åå¨ã{GWTask.Count}ã个任å¡å¤§äº2个任å¡ä¸å¯ä¸å"); |
| | | return; |
| | |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, content.Message); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | ConsoleHelper.WriteErrorLine($"ã{conveyorLine.DeviceName}ãæçå·ï¼ã{command.ConveyorLineBarcode}ã请æ±ç¹ä½ï¼ã{childDeviceCode}ãå¼å¸¸ä¿¡æ¯ã{content.Message}ã"); |
| | | WriteInfo(conveyorLine.DeviceName, $"ã{conveyorLine.DeviceName}ãæçå·ï¼ã{command.ConveyorLineBarcode}ã请æ±ç¹ä½ï¼ã{childDeviceCode}ãå¼å¸¸ä¿¡æ¯ã{content.Message}ã"); |
| | | //_taskRepository.AddData(taskGW); |
| | | if (content.Message != "请æ±è¿äºé¢ç¹ï¼è¯·ç¨ååè¯") |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, content.Message); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | ConsoleHelper.WriteErrorLine($"ã{conveyorLine.DeviceName}ãæçå·ï¼ã{command.ConveyorLineBarcode}ã请æ±ç¹ä½ï¼ã{childDeviceCode}ãå¼å¸¸ä¿¡æ¯ã{content.Message}ã"); |
| | | WriteInfo(conveyorLine.DeviceName, $"ã{conveyorLine.DeviceName}ãæçå·ï¼ã{command.ConveyorLineBarcode}ã请æ±ç¹ä½ï¼ã{childDeviceCode}ãå¼å¸¸ä¿¡æ¯ã{content.Message}ã"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | meta: { |
| | | keepAlive: false |
| | | } |
| | | },{ |
| | | path: '/Dt_Changeovers', |
| | | name: 'Dt_Changeovers', |
| | | component: () => import('@/views/widesea_wms/basicinfo/Dt_Changeovers.vue'), |
| | | meta: { |
| | | keepAlive: false |
| | | } |
| | | }, |
| | | ] |
| | | export default tables |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wms/basicinfo/Dt_AreaInfo.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 "@/extension/widesea_wms/basicinfo/Dt_Changeovers.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'id', |
| | | footer: "Foots", |
| | | cnName: 'æ¢åä¿¡æ¯', |
| | | name: 'basicinfo/Dt_Changeovers', |
| | | url: "/Dt_Changeovers/", |
| | | sortName: "createDate" |
| | | }); |
| | | const editFormFields = ref({ |
| | | "materielCode": "", |
| | | "productionLine": "", |
| | | "processCode": "", |
| | | "status": "", |
| | | "areaDesc": "" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { "title": "ç©æç¼å·", "field": "materielCode", type: "text" }, |
| | | { "title": "ç产产线", "field": "productionLine", type: "select", dataKey: "ProductionLine", data: [] }, |
| | | |
| | | ], |
| | | [ |
| | | { "title": "å·¥åº", "field": "processCode", type: "select", dataKey: "AreaType", data: [] }, |
| | | { "title": "ç¶æ", "field": "status", "type": "select", dataKey: "EnalbeStatus", data: [] }, |
| | | ] |
| | | ]); |
| | | const searchFormFields = ref({}); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { "title": "ç©æç¼å·", "field": "materielCode", type: "text" }, |
| | | { "title": "ç产产线", "field": "productionLine", type: "select", dataKey: "ProductionLine", data: [] }, |
| | | |
| | | ], |
| | | [ |
| | | { "title": "å·¥åº", "field": "processCode", type: "select", dataKey: "AreaType", data: []}, |
| | | { "title": "ç¶æ", "field": "status", type: "text" }, |
| | | ] |
| | | ]); |
| | | const columns = ref([{ field: 'id', title: 'id', type: 'int', sort: true, hidden: true, width: 110, readonly: true, require: true, align: 'left' }, |
| | | { field: 'materielCode', title: 'ç©æç¼å·', type: 'string', sort: true, width: 110, require: true, align: 'left', sort: true }, |
| | | { field: 'productionLine', title: '产线', type: 'string', width: 70, align: 'left', bind: { key: "ProductionLine", data: [] } }, |
| | | { field: 'processCode', title: 'å·¥åº', type: 'string', sort: true, width: 110, align: 'left' ,bind: { key: "AreaType", data: [] }}, |
| | | { field: 'status', title: 'ç¶æ', type: 'int', sort: true, width: 110, align: 'left', bind: { key: "EnalbeStatus", data: [] } }, |
| | | { field: 'creater', title: 'å建人', type: 'string', sort: true, width: 110, align: 'left' }, |
| | | { field: 'createDate', title: 'å建æ¶é´', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, |
| | | { field: 'modifier', title: 'ä¿®æ¹äºº', type: 'string', sort: true, width: 100, align: 'left' }, |
| | | { field: 'modifyDate', title: 'ä¿®æ¹æ¶é´', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "" |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <None Include="Dt_ChangeoversService.cs" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_BusinessesRepository\WIDESEA_BusinessesRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_Core\WIDESEA_Core.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IBusinessesRepository\WIDESEA_IBusinessesRepository.csproj" /> |
| | |
| | | // å°è£
ä¸ä¸ªç¨HttpClientåéPost请æ±çæ¹æ³æåæ° |
| | | public static async Task<string> PostAsync(string url, Dictionary<string, object> parameters) |
| | | { |
| | | // å建ä¸ä¸ªæ°çåå
¸ï¼æé¤ RequestTime å SessionId |
| | | var filteredParameters = parameters.Where(p => p.Key != "RequestTime"&& p.Key != "SessionId").ToDictionary(p => p.Key, p => p.Value); |
| | | |
| | | string requestKey = $"{url}:{JsonConvert.SerializeObject(filteredParameters)}"; |
| | | // æ£æ¥è¯·æ±æ¬¡æ°åæ¶é´éå¶ |
| | | if (requestTracker.TryGetValue(requestKey, out var requestInfo)) |
| | | try |
| | | { |
| | | if (requestInfo.Count >= 5 && DateTime.Now < requestInfo.LastRequestTime.AddMinutes(3)) |
| | | // å建ä¸ä¸ªæ°çåå
¸ï¼æé¤ RequestTime å SessionId |
| | | var filteredParameters = parameters.Where(p => p.Key != "RequestTime" && p.Key != "SessionId").ToDictionary(p => p.Key, p => p.Value); |
| | | |
| | | string requestKey = $"{url}:{JsonConvert.SerializeObject(filteredParameters)}"; |
| | | // æ£æ¥è¯·æ±æ¬¡æ°åæ¶é´éå¶ |
| | | if (requestTracker.TryGetValue(requestKey, out var requestInfo)) |
| | | { |
| | | // å¦æè¯·æ±æ¬¡æ°è¶
è¿éå¶ä¸æªè¶
è¿10åéï¼æåºå¼å¸¸ |
| | | throw new InvalidOperationException("è¯·æ±æ¬¡æ°å·²è¾¾å°éå¶ï¼è¯·ç¨ååè¯ã"); |
| | | if (requestInfo.Count >= 5 && DateTime.Now < requestInfo.LastRequestTime.AddMinutes(3)) |
| | | { |
| | | // å¦æè¯·æ±æ¬¡æ°è¶
è¿éå¶ä¸æªè¶
è¿10åéï¼æåºå¼å¸¸ |
| | | throw new InvalidOperationException("è¯·æ±æ¬¡æ°å·²è¾¾å°éå¶ï¼è¯·ç¨ååè¯ã"); |
| | | } |
| | | } |
| | | |
| | | // æ´æ°è¯·æ±è·è¸ªä¿¡æ¯ |
| | | if (requestTracker.ContainsKey(requestKey)) |
| | | { |
| | | requestTracker[requestKey] = (requestInfo.Count + 1, DateTime.Now); |
| | | } |
| | | else |
| | | { |
| | | requestTracker[requestKey] = (1, DateTime.Now); |
| | | } |
| | | |
| | | |
| | | // è®°å½è¯·æ±åæ° |
| | | LogRequestParameters(parameters, url); |
| | | |
| | | // å建HttpClientå®ä¾ |
| | | using (HttpClient client = new HttpClient()) |
| | | { |
| | | // å°åæ°è½¬æ¢ä¸ºFormUrlEncodedContent |
| | | string content = JsonConvert.SerializeObject(parameters); |
| | | |
| | | //client.Timeout = TimeSpan.from; |
| | | |
| | | var request = new HttpRequestMessage(HttpMethod.Post, url); |
| | | |
| | | request.Content = new StringContent(content, Encoding.UTF8, "application/json"); |
| | | //var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); |
| | | //// åéPOST请æ±å¹¶è·åååº |
| | | //HttpResponseMessage response = await client.PostAsync(url, content); |
| | | HttpResponseMessage response = await client.SendAsync(request); |
| | | |
| | | // ç¡®ä¿ååºæå |
| | | response.EnsureSuccessStatusCode(); |
| | | |
| | | // 读åååºå
容 |
| | | string responseBody = await response.Content.ReadAsStringAsync(); |
| | | |
| | | // è®°å½ååºåæ° |
| | | LogResponseParameters(responseBody, url); |
| | | |
| | | // è¿åååºå
容 |
| | | return responseBody; |
| | | } |
| | | } |
| | | |
| | | // æ´æ°è¯·æ±è·è¸ªä¿¡æ¯ |
| | | if (requestTracker.ContainsKey(requestKey)) |
| | | catch (Exception ex) |
| | | { |
| | | requestTracker[requestKey] = (requestInfo.Count + 1, DateTime.Now); |
| | | LogErrorParameters(ex.StackTrace,ex.Message, url); |
| | | return ex.Message; |
| | | } |
| | | else |
| | | { |
| | | requestTracker[requestKey] = (1, DateTime.Now); |
| | | } |
| | | |
| | | |
| | | // è®°å½è¯·æ±åæ° |
| | | LogRequestParameters(parameters, url); |
| | | |
| | | // å建HttpClientå®ä¾ |
| | | using (HttpClient client = new HttpClient()) |
| | | { |
| | | // å°åæ°è½¬æ¢ä¸ºFormUrlEncodedContent |
| | | string content = JsonConvert.SerializeObject(parameters); |
| | | |
| | | //client.Timeout = TimeSpan.from; |
| | | |
| | | var request = new HttpRequestMessage(HttpMethod.Post, url); |
| | | |
| | | request.Content = new StringContent(content, Encoding.UTF8, "application/json"); |
| | | //var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); |
| | | //// åéPOST请æ±å¹¶è·åååº |
| | | //HttpResponseMessage response = await client.PostAsync(url, content); |
| | | HttpResponseMessage response = await client.SendAsync(request); |
| | | |
| | | // ç¡®ä¿ååºæå |
| | | response.EnsureSuccessStatusCode(); |
| | | |
| | | // 读åååºå
容 |
| | | string responseBody = await response.Content.ReadAsStringAsync(); |
| | | |
| | | // è®°å½ååºåæ° |
| | | LogResponseParameters(responseBody, url); |
| | | |
| | | // è¿åååºå
容 |
| | | return responseBody; |
| | | } |
| | | |
| | | } |
| | | |
| | | private static void LogErrorParameters(string errordetail, string error, string url = "") |
| | | { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("---------------------------------------------"); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("url:" + url + "å¼å¸¸è¯¦ç»ä¿¡æ¯: " + JsonConvert.SerializeObject(error)); |
| | | builder.Append("url:" + url + "å¼å¸¸ä¿¡æ¯: " + JsonConvert.SerializeObject(error)); |
| | | LogFactory.GetLog("APIæ¥å£å¼å¸¸").Error(true, builder); |
| | | } |
| | | private static void LogRequestParameters(Dictionary<string, object> parameters, string url = "") |
| | | { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | LogFactory.GetLog("APIæ¥å£").Info(true, builder); |
| | | } |
| | | |
| | | |
| | | |
| | | private static IEnumerable<KeyValuePair<string, string>> ConvertToKeyValuePairs(Dictionary<string, object> parameters) |
| | | { |
| | | foreach (var kvp in parameters) |
| | |
| | | private readonly IAgingInOrOutInputService _agingInOrOutInputService; //éç½®\éå |
| | | private readonly IDt_StationManagerRepository _stationManagerRepository; |
| | | private readonly ISys_ConfigService _configService; |
| | | private readonly IDt_ChangeoversRepository _dt_ChangeoversRepository; |
| | | private readonly ISimpleCacheService _simpleCacheService; |
| | | |
| | | public Dt_TaskService(IDt_TaskRepository BaseDal, |
| | |
| | | IStockInfoDetailRepository stockInfoDetailRepository, |
| | | IDt_StationManagerRepository stationManagerRepository, |
| | | ISys_ConfigService configService, |
| | | ISimpleCacheService simpleCacheService) : base(BaseDal) |
| | | ISimpleCacheService simpleCacheService, |
| | | IDt_ChangeoversRepository dt_ChangeoversRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoRepository = stockInfoRepository; |
| | |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _configService = configService; |
| | | _simpleCacheService = simpleCacheService; |
| | | _dt_ChangeoversRepository = dt_ChangeoversRepository; |
| | | } |
| | | |
| | | #region å¤é¨æ¥å£æ¹æ³ |
| | |
| | | else |
| | | { |
| | | // å¤çå¼å¸¸çµè¯æ
åµ |
| | | var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); |
| | | if (serialNosError.Count > 0) |
| | | { |
| | | return await HandleErrorCells(input, area, serialNosError); |
| | | } |
| | | |
| | | #region çµè¯åç»æå¼å¸¸ä¸éè¦æä»¬å¤ç |
| | | //var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); |
| | | //if (serialNosError.Count > 0) |
| | | //{ |
| | | // return await HandleErrorCells(input, area, serialNosError); |
| | | //} |
| | | #endregion |
| | | var boxing = CreateBoxingInfo(result, input.PalletCode); |
| | | if (boxing == null) return content.Error("ç»ç失败"); |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel"); |
| | | //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel"); |
| | | var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList(); |
| | | |
| | | List<string>? materielCodes = outBoundMateriel.Count != 0 |
| | | ? outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == area.AreaCode) |
| | | .Select(x => x.MaterielCode) |
| | |
| | | // materielCodes = outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == areaCodes[0]).Select(x => x.MaterielCode).ToList(); |
| | | //} |
| | | |
| | | var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel"); |
| | | //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel"); |
| | | var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList(); |
| | | List<string>? materielCodes = outBoundMateriel.Count != 0 |
| | | ? outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == areaCodes[0]) |
| | | .Select(x => x.MaterielCode) |
| | |
| | | } |
| | | |
| | | #region æ´æ°åºåä¿¡æ¯ï¼ææ¶ä¸éè¦ï¼ |
| | | //if (stock.IsFull) |
| | | //{ |
| | | // // æ¥è¯¢ç¬¦åæ¡ä»¶çåºåä¿¡æ¯ |
| | | // var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); |
| | | if (stock.IsFull) |
| | | { |
| | | // æ¥è¯¢ç¬¦åæ¡ä»¶çåºåä¿¡æ¯ |
| | | var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); |
| | | |
| | | // // æ¥è¯¢ä»»å¡ä¿¡æ¯ |
| | | // var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList(); |
| | | // æ¥è¯¢ä»»å¡ä¿¡æ¯ |
| | | var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList(); |
| | | |
| | | // if (stocks != null && stocks.Count > 0) |
| | | // { |
| | | // // è¿æ»¤åºéè¦æ´æ°çåºåä¿¡æ¯ |
| | | // var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList(); |
| | | // foreach (var item in stocksToUpdate) |
| | | // { |
| | | // // æ´æ°åºåä¿¡æ¯çç¹å®åæ° |
| | | // item.SpecialParameterDuration = stock.SpecialParameterDuration; |
| | | // item.ParameterInfos = stock.ParameterInfos; |
| | | // item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); |
| | | // } |
| | | // if (stocksToUpdate.Count > 0) |
| | | // { |
| | | // // 弿¥æ´æ°åºåä¿¡æ¯ |
| | | // var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate); |
| | | // } |
| | | // } |
| | | //} |
| | | if (stocks != null && stocks.Count > 0) |
| | | { |
| | | // è¿æ»¤åºéè¦æ´æ°çåºåä¿¡æ¯ |
| | | var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList(); |
| | | foreach (var item in stocksToUpdate) |
| | | { |
| | | // æ´æ°åºåä¿¡æ¯çç¹å®åæ° |
| | | item.SpecialParameterDuration = stock.SpecialParameterDuration; |
| | | item.ParameterInfos = stock.ParameterInfos; |
| | | item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); |
| | | } |
| | | if (stocksToUpdate.Count > 0) |
| | | { |
| | | // 弿¥æ´æ°åºåä¿¡æ¯ |
| | | var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | // æ·»å åå²ä»»å¡ |
| | |
| | | } |
| | | |
| | | // å¤çå¼å¸¸çµè¯æ
åµ |
| | | var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); |
| | | if (serialNosError.Count > 0) |
| | | { |
| | | if (stationManager.stationType != 3) |
| | | { |
| | | var taskNG = new Dt_Task |
| | | { |
| | | CurrentAddress = input.Position, |
| | | Grade = 1, |
| | | Roadway = input.Roadways, |
| | | TargetAddress = stationManager.stationNGLocation, |
| | | Dispatchertime = DateTime.Now, |
| | | MaterialNo = "", |
| | | NextAddress = stationManager.stationNGChildCode, |
| | | OrderNo = null, |
| | | PalletCode = input.PalletCode, |
| | | SourceAddress = stationManager.stationLocation, |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "System", |
| | | ProductionLine = result.ProductionLine, |
| | | ProcessCode = result.ProcessCode, |
| | | }; |
| | | return taskNG; |
| | | } |
| | | else |
| | | { |
| | | Console.WriteLine($"ç«å°{stationManager.stationChildCode}MOMè¿åçµè¯å¼å¸¸:{result.MOMMessage}"); |
| | | return null; |
| | | } |
| | | } |
| | | //var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); |
| | | //if (serialNosError.Count > 0) |
| | | //{ |
| | | // if (stationManager.stationType != 3) |
| | | // { |
| | | // var taskNG = new Dt_Task |
| | | // { |
| | | // CurrentAddress = input.Position, |
| | | // Grade = 1, |
| | | // Roadway = input.Roadways, |
| | | // TargetAddress = stationManager.stationNGLocation, |
| | | // Dispatchertime = DateTime.Now, |
| | | // MaterialNo = "", |
| | | // NextAddress = stationManager.stationNGChildCode, |
| | | // OrderNo = null, |
| | | // PalletCode = input.PalletCode, |
| | | // SourceAddress = stationManager.stationLocation, |
| | | // TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | // TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | // TaskNum = await BaseDal.GetTaskNo(), |
| | | // Creater = "System", |
| | | // ProductionLine = result.ProductionLine, |
| | | // ProcessCode = result.ProcessCode, |
| | | // }; |
| | | // return taskNG; |
| | | // } |
| | | // else |
| | | // { |
| | | // Console.WriteLine($"ç«å°{stationManager.stationChildCode}MOMè¿åçµè¯å¼å¸¸:{result.MOMMessage}"); |
| | | // return null; |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // throw new Exception($"ç«å°{stationManager.stationChildCode}MOMè¿åçµè¯å¼å¸¸:{result.MOMMessage}"); |
| | |
| | | .Where(x => x.DeviceCode.Contains("CWSC")) // è¿æ»¤æ¡ä»¶ |
| | | .ToList().Select(x => x.DeviceCode).ToList(); |
| | | |
| | | var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel"); |
| | | //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel"); |
| | | var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList(); |
| | | List<string>? materielCodes = outBoundMateriel.Count != 0 |
| | | ? outBoundMateriel.Where(x => x.ProductionLine == station.productLine && x.ProcessCode == "CWSC3") |
| | | .Select(x => x.MaterielCode) |