| | |
| | | input.SessionId = Guid.NewGuid().ToString(); |
| | | input.EmployeeNo = "MITest"; |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | var inputJson = Masuit.Tools.ObjectExtensions.ToDictionary(input); |
| | | var configs = _configService.GetConfigsByCategory(CateGoryConst.SYS_MOMIPAddress); |
| | | var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.MOMBaseIP)?.ConfigValue; |
| | | var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ProcessApply)?.ConfigValue; |
| | |
| | | var wmsIpAddress = wmsBase + ipAddress; |
| | | |
| | | var result = HttpsClient.PostAsync(wmsIpAddress, inputJson).Result; |
| | | //var x = await HttpsClient.PostAsync("http://c24-cellmi3:12020/api/MachineIntegration/ProcessApply", inputJson); |
| | | |
| | | if (result != null) |
| | | { |
| | | //var ResultProcess = JsonConvert.DeserializeObject<ResultProcessApply>(x); |
| | | content.OK(data: result); |
| | | |
| | | //var respone = JsonConvert.DeserializeObject<ResultProcessApply>(result.ToString()); |
| | | //if (!respone.Success) |
| | | //{ |
| | | // MoMErrorMsg.AddMoMErrorMsg(0, input.WipOrderNo, respone.MOMMessage, SysConfigConst.TrayCellsStatus); |
| | | //} |
| | | //else |
| | | //{ |
| | | // MoMErrorMsg.DeleteMoMErrorMsg(0, input.WipOrderNo); |
| | | //} |
| | | } |
| | | LogFactory.GetLog("工艺路线申请").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("工艺路线申请").Info(true, result); |
| | |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | if (result.SerialNos.Count > 0) |
| | | { |
| | | var stockHty = await SqlSugarHelper.DbWMS.Queryable<DtStockInfo>().IncludesAllFirstLayer().FirstAsync(); |
| | | if (stockHty != null) |
| | | var stock = await SqlSugarHelper.DbWMS.Queryable<DtStockInfo>().FirstAsync(x => x.PalletCode == palletCode); |
| | | if (stock != null) |
| | | { |
| | | var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stockHty.ParameterInfos).FirstOrDefault(y => y.Description.Contains("时间")); |
| | | var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stock.ParameterInfos).FirstOrDefault(y => y.Description.Contains("时间")); |
| | | if (parameterInfo == null) throw new Exception(""); |
| | | |
| | | var outHours = (DateTime.Now - (stockHty.LinedProcessFeedbackTime == null ? stockHty.ModifyDate.Value : stockHty.LinedProcessFeedbackTime.ToDateTime())).TotalHours; |
| | | var outHours = (DateTime.Now - (stock.LinedProcessFeedbackTime == null ? stock.ModifyDate.Value : stock.LinedProcessFeedbackTime.ToDateTime())).TotalHours; |
| | | var isNG = outHours > parameterInfo.LowerSpecificationsLimit.ToDouble() && outHours < parameterInfo.UpperSpecificationsLimit.ToDouble(); |
| | | |
| | | var defectCode = string.Empty; |
| | |
| | | ParameterDesc = parameterInfo.Description, |
| | | ParameterResult = "OK", //isNG.ToString(), |
| | | TargetValue = parameterInfo.TargetValue, |
| | | LowerLomit = parameterInfo.LowerSpecificationsLimit, |
| | | LowerLimit = parameterInfo.LowerSpecificationsLimit, |
| | | UpperLimit = parameterInfo.UpperSpecificationsLimit, |
| | | DefectCode = defectCode, |
| | | UOMCode = parameterInfo.UOMCode, |
| | |
| | | }; |
| | | content = await _gingInOrOutInputService.GetOCVOutputAsync(outputDto); |
| | | } |
| | | else |
| | | { |
| | | var stockHty = await SqlSugarHelper.DbWMS.Queryable<DtStockInfo_Hty>().Where(x => x.PalletCode == palletCode).OrderByDescending(x => x.CreateDate).FirstAsync(); |
| | | if (stockHty != null) |
| | | { |
| | | var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stockHty.ParameterInfos).FirstOrDefault(y => y.Description.Contains("时间")); |
| | | if (parameterInfo == null) throw new Exception(""); |
| | | |
| | | var outHours = (DateTime.Now - (stockHty.LinedProcessFeedbackTime == null ? "2025-01-08 15:59:34.310".ToDateTime() : stockHty.LinedProcessFeedbackTime.ToDateTime())).TotalHours; |
| | | var isNG = outHours > parameterInfo.LowerSpecificationsLimit.ToDouble() && outHours < parameterInfo.UpperSpecificationsLimit.ToDouble(); |
| | | |
| | | var defectCode = string.Empty; |
| | | if (!isNG) defectCode = "TQCK"; |
| | | var outputDto = new AgingOutputDto |
| | | { |
| | | OpFlag = 1, |
| | | Software = area.Spare3, |
| | | EquipmentCode = area.Spare2, |
| | | TrayBarcode = palletCode, |
| | | SerialNos = result.SerialNos.Select(x => new SerialNoOutDto |
| | | { |
| | | SlotNo = x.PositionNo, |
| | | SerialNo = x.SerialNo, |
| | | SerialNoResult = true, //isNG, |
| | | ParameterInfo = new List<ParameterInfoOutput> { |
| | | new ParameterInfoOutput() { |
| | | Value = outHours.ToString(), |
| | | ParameterCode =parameterInfo.ParameterCode, |
| | | ParameterDesc = parameterInfo.Description, |
| | | ParameterResult = "OK", //isNG.ToString(), |
| | | TargetValue = parameterInfo.TargetValue, |
| | | LowerLimit = parameterInfo.LowerSpecificationsLimit, |
| | | UpperLimit = parameterInfo.UpperSpecificationsLimit, |
| | | DefectCode = defectCode, |
| | | UOMCode = parameterInfo.UOMCode, |
| | | } |
| | | } |
| | | }).ToList() |
| | | }; |
| | | content = await _gingInOrOutInputService.GetOCVOutputAsync(outputDto); |
| | | } |
| | | else |
| | | { |
| | | content.Error("杀杀杀"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |