| | |
| | | IAccessInterfaceLogService accessInterfaceLog, |
| | | IRepository<ThreadStatusMonitor, MasterDbContextLocator> threadStatusMonitorRep, |
| | | IRepository<DataCaptureConfig, MasterDbContextLocator> dataCaptureConfigRep, |
| | | IRepository<WorkPieceProcess, MasterDbContextLocator> workPieceProcessRep, WorkPieceInfoService WorkPieceInfoService, |
| | | IRepository<WorkPieceInfoLog, MasterDbContextLocator> workPieceInfoLog, |
| | | IRepository<EquipmentCurrentMonitor, MasterDbContextLocator> equipmentCurrentMonitorRep, |
| | | IRepository<WorkPieceProcess, MasterDbContextLocator> workPieceProcessRep, WorkPieceInfoService WorkPieceInfoService, |
| | | IRepository<WorkPieceInfoLog, MasterDbContextLocator> workPieceInfoLog, |
| | | IRepository<EquipmentCurrentMonitor, MasterDbContextLocator> equipmentCurrentMonitorRep, |
| | | IRepository<EquipmentBaseInfo, MasterDbContextLocator> equipmentBaseInfoRep, ISysDictTypeService dict |
| | | , IRepository<ProductionPlanInfo, MasterDbContextLocator> productionPlanInfoRep |
| | | , IRepository<ShiftInfo, MasterDbContextLocator> shiftInfoRep) |
| | |
| | | { |
| | | addLog.IpAddress = ipAddress.MapToIPv4().ToString(); |
| | | } |
| | | AddQualityDataInfoInputV2 input = null; |
| | | try |
| | | { |
| | | var input = JsonConvert.DeserializeObject<AddQualityDataInfoInputV2>(json); |
| | | input = JsonConvert.DeserializeObject<AddQualityDataInfoInputV2>(json); |
| | | addLog.Key = input.WorkPieceID; |
| | | |
| | | if (input == null || string.IsNullOrEmpty(input.WorkPieceID) || input.QualityState == 0) |
| | |
| | | } |
| | | updateinfo.WorkPieceState = (int)WorkPieceState.WIP;//推出后和SPC抽检后 质量录入时状态修改回在制品 |
| | | updateinfo.QualityState = (int)EnumQualityState.Suspected; |
| | | updateinfo.QualityErrorInfo = $"工件{update.WorkPieceID}在工序{input.WorkingProcedure}抽检不合格,相关工件质量状态变更为疑似";; |
| | | updateinfo.QualityErrorInfo = $"工件{update.WorkPieceID}在工序{input.WorkingProcedure}抽检不合格,相关工件质量状态变更为疑似"; ; |
| | | updateinfo.QualityStateUpdateUser = input.QualityStateUpdateUser; |
| | | updateinfo.QualityStateUpdateTime = now; |
| | | updateinfo.QualityStateUpdateMode = EnumQualityStateUpdateMode.SPC.ToString(); |
| | |
| | | { |
| | | try |
| | | { |
| | | addLog.WorkPieceID = input.WorkPieceID; |
| | | addLog.WorkingProcedureCurrent = input.WorkingProcedure; |
| | | |
| | | await _accessInterfaceLog.AddInterfaceLogAsync(addLog); |
| | | } |
| | |
| | | .ProjectToType<EquipmentCurrentMonitorOutputV2>() |
| | | .OrderBy(o => o.EquipmentID) |
| | | .ToListAsync(); |
| | | |
| | | |
| | | return equipmentCurrentMonitors; |
| | | } |
| | | |
| | |
| | | List<ProduceCompletionStatus> list = new List<ProduceCompletionStatus>(); |
| | | |
| | | //获取当前年的第一天 |
| | | var yearOneDay= DateTime.Now.AddDays(-((int)DateTime.Now.DayOfYear - 1)).Date; |
| | | var yearOneDay = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfYear - 1)).Date; |
| | | //获取月份计划 |
| | | var productionPlanInfos = _productionPlanInfoRep.DetachedEntities |
| | | .Where(o=>o.IsDeleted==false&& o.PlanType.Equals("2")).ToList(); |
| | | .Where(o => o.IsDeleted == false && o.PlanType.Equals("2")).ToList(); |
| | | try |
| | | { |
| | | //获取最近一年下线工件的成品 |
| | |
| | | } |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | |
| | | var day = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | //获取当前月份计划 |
| | | var productionPlanInfos = _productionPlanInfoRep.DetachedEntities.ProjectToType<ProductionPlanInfoOutput>().ToList() |
| | | .Where(o => o.PlanType.Equals("2")&& o.PlanTimeHand.Equals(month)).FirstOrDefault(); |
| | | .Where(o => o.PlanType.Equals("2") && o.PlanTimeHand.Equals(month)).FirstOrDefault(); |
| | | //获取最近月下线工件的成品 |
| | | try |
| | | { |
| | | |
| | | var MonthCompletionnNum = _workPieceInfoRep.DetachedEntities.ProjectToType<WorkPieceInfoOutput>().ToList() |
| | | .Where(o => o.WorkPieceLastOfflineTimeHand.Equals(month) |
| | | && o.WorkPieceState == (int)WorkPieceState.FinishedProducts).Count(); |
| | | var MonthCompletionnNum = _workPieceInfoRep.DetachedEntities.ProjectToType<WorkPieceInfoOutput>().ToList() |
| | | .Where(o => o.WorkPieceLastOfflineTimeHand.Equals(month) |
| | | && o.WorkPieceState == (int)WorkPieceState.FinishedProducts).Count(); |
| | | currentProduceInfo.CurrentMonthProduceNum = MonthCompletionnNum; |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | |
| | | && o.WorkPieceState == (int)WorkPieceState.FinishedProducts).Count(); |
| | | |
| | | //获取班次班组信息 |
| | | var shiftlist = _shiftInfoRep.DetachedEntities.ProjectToType<ShiftInfoOutput>().ToList().Where(o=>o.StartTime<DateTime.Now&&o.EndTime> DateTime.Now).FirstOrDefault(); |
| | | var shiftlist = _shiftInfoRep.DetachedEntities.ProjectToType<ShiftInfoOutput>().ToList().Where(o => o.StartTime < DateTime.Now && o.EndTime > DateTime.Now).FirstOrDefault(); |
| | | |
| | | currentProduceInfo.CurrentShiftProduceNum = DayCompletionnNum; |
| | | currentProduceInfo.CurrentShiftPlanNum = 0; |
| | | currentProduceInfo.CurrentMonthPlanNum = (productionPlanInfos==null?0: productionPlanInfos.PlanProductionNum); |
| | | currentProduceInfo.CurrentMonthPlanNum = (productionPlanInfos == null ? 0 : productionPlanInfos.PlanProductionNum); |
| | | |
| | | if(shiftlist==null) |
| | | if (shiftlist == null) |
| | | { |
| | | currentProduceInfo.CurrentTime = DateTime.Now; |
| | | currentProduceInfo.CurrentTeamLeader = "袁班长"; |
| | |
| | | { |
| | | //获取班次计划 |
| | | var shiftplan = _productionPlanInfoRep.DetachedEntities.ProjectToType<ProductionPlanInfoOutput>().ToList() |
| | | .Where(o => o.PlanType.Equals("1")&&o.TeamType.Equals(shiftlist.ShiftName)&& o.PlanTimeDayHand.Equals(day)).FirstOrDefault(); |
| | | .Where(o => o.PlanType.Equals("1") && o.TeamType.Equals(shiftlist.ShiftName) && o.PlanTimeDayHand.Equals(day)).FirstOrDefault(); |
| | | currentProduceInfo.CurrentTime = DateTime.Now; |
| | | currentProduceInfo.CurrentTeamLeader = shiftlist.ShiftRemark; |
| | | currentProduceInfo.CurrentTeamName = shiftlist.ShiftName; |
| | | if(shiftplan!=null) |
| | | if (shiftplan != null) |
| | | { |
| | | currentProduceInfo.CurrentShiftPlanNum = shiftplan.PlanProductionNum; |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | currentProduceInfo.CurrentSafeProductionDay = "异常"; |
| | | } |
| | |
| | | case "OP10连杆厚度": |
| | | qualityDataDisplay.QualityType = str; |
| | | var datas = _qualityDataInfoRep.DetachedEntities.ProjectToType<QualityDataInfoOutput>() |
| | | .Where(o=>!string.IsNullOrEmpty(o.QualityOP10To1)&& !string.IsNullOrEmpty(o.WorkPieceID)) |
| | | .Where(o => !string.IsNullOrEmpty(o.QualityOP10To1) && !string.IsNullOrEmpty(o.WorkPieceID)) |
| | | .OrderByDescending(o => o.OP10QualityReceiveTime) |
| | | .Select(o=>new QualityData() { WorkPieceID = o.WorkPieceID, QualityDataVaule = double.Parse( o.QualityOP10To1) }) |
| | | .Select(o => new QualityData() { WorkPieceID = o.WorkPieceID, QualityDataVaule = double.Parse(o.QualityOP10To1) }) |
| | | .Take(10).Reverse().ToList(); |
| | | qualityDataDisplay.list = datas; |
| | | break; |
| | | case "OP30涨断力矩": |
| | | qualityDataDisplay.QualityType = str; |
| | | var dataop30ch1 = _qualityDataInfoRep.DetachedEntities.ProjectToType<QualityDataInfoOutput>() |
| | | .Where(o => !string.IsNullOrEmpty(o.QualityOP30To1)&&!string.IsNullOrEmpty(o.WorkPieceID)) |
| | | .Where(o => !string.IsNullOrEmpty(o.QualityOP30To1) && !string.IsNullOrEmpty(o.WorkPieceID)) |
| | | .OrderByDescending(o => o.OP30QualityReceiveTimeCH3) |
| | | .Select(o => new QualityData() { WorkPieceID = o.WorkPieceID, QualityDataVaule = double.Parse(o.QualityOP30To1.Replace("kN", "")) }) |
| | | .Take(10).Reverse().ToList(); |
| | |
| | | case "OP35压装力矩": |
| | | qualityDataDisplay.QualityType = str; |
| | | var dataop35 = _qualityDataInfoRep.DetachedEntities.ProjectToType<QualityDataInfoOutput>() |
| | | .Where(o => !string.IsNullOrEmpty(o.QualityOP35To1)&&!string.IsNullOrEmpty(o.WorkPieceID)) |
| | | .Where(o => !string.IsNullOrEmpty(o.QualityOP35To1) && !string.IsNullOrEmpty(o.WorkPieceID)) |
| | | .OrderByDescending(o => o.OP35QualityReceiveTime) |
| | | .Select(o => new QualityData() { WorkPieceID = o.WorkPieceID, QualityDataVaule = double.Parse(o.QualityOP35To1) }) |
| | | .Take(10).Reverse().ToList(); |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | |
| | | var dicts = await _dict.GetDictTreeOutput(); |
| | | var dict = dicts.Where(o => o.Code.Equals("screen_refresh_frequency")); |
| | | if (dict.Any()) |
| | |
| | | return 5000; |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | return 6000; |
| | |
| | | /// <returns></returns> |
| | | [HttpGet("GetProductionForTime")] |
| | | [AllowAnonymous] |
| | | public async Task<List<ProductionInfo>> GetProductionForTime(DateTime start,DateTime end) |
| | | public async Task<List<ProductionInfo>> GetProductionForTime(DateTime start, DateTime end) |
| | | { |
| | | //获取最近月下线工件的成品 |
| | | var Production = from info in _workPieceInfoRep.DetachedEntities.ProjectToType<WorkPieceInfoOutput>().ToList() |
| | | where info.WorkPieceLastOfflineTime>=start |
| | | where info.WorkPieceLastOfflineTime<=end |
| | | where info.WorkPieceState==(int)WorkPieceState.FinishedProducts |
| | | group info by info.WorkPieceLastOfflineTimeDayHand into grouplist |
| | | select new ProductionInfo() |
| | | { |
| | | Day=grouplist.Key, |
| | | ProductionNum=grouplist.Count(), |
| | | }; |
| | | return Production.OrderBy(o=>o.Day).ToList(); |
| | | where info.WorkPieceLastOfflineTime >= start |
| | | where info.WorkPieceLastOfflineTime <= end |
| | | where info.WorkPieceState == (int)WorkPieceState.FinishedProducts |
| | | group info by info.WorkPieceLastOfflineTimeDayHand into grouplist |
| | | select new ProductionInfo() |
| | | { |
| | | Day = grouplist.Key, |
| | | ProductionNum = grouplist.Count(), |
| | | }; |
| | | return Production.OrderBy(o => o.Day).ToList(); |
| | | |
| | | } |
| | | #endregion |