| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 聚合表的基类 |
| | | */ |
| | | public class SuperAggregate implements Serializable { |
| | | private static final long serialVersionUID = 1074211007569731042L; |
| | | private String calendarCode; |
| | |
| | | private Integer factoryMonth; |
| | | private Integer factoryWeek; |
| | | private Integer factoryDate; |
| | | /** |
| | | * 班次 |
| | | */ |
| | | private Integer shiftIndex; |
| | | private Integer shiftTimeType; |
| | | /** |
| | | * 工作台 |
| | | */ |
| | | private Long workstationId; |
| | | |
| | | |
| | |
| | | private String productName; |
| | | private Long employeeId; |
| | | |
| | | @Override // org.springblade.modules.mdc.entity.SuperAggregate |
| | | @Override |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | |
| | | public class SuperAggregateState extends SuperAggregate { |
| | | private Timestamp startTime; |
| | | private Timestamp endTime; |
| | | /** |
| | | * 采集的期间/时长。单位秒? |
| | | */ |
| | | private Long durationCollect; |
| | | private Integer valueCollect; |
| | | /** |
| | | * 工况 |
| | | */ |
| | | private Integer wcs; |
| | | /** |
| | | * 效率? |
| | | */ |
| | | private Integer rps; |
| | | private Boolean isDeleted; |
| | | private Integer isPlan; |
| | | private Long employeeId; |
| | | private Long feedbackId; |
| | | |
| | | @Override // org.springblade.modules.mdc.entity.SuperAggregate |
| | | @Override |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 设备报警 |
| | | */ |
| | | public class SuperAlarm extends SuperAggregate implements Serializable { |
| | | private static final long serialVersionUID = 1123326427413588953L; |
| | | private Timestamp ts; |
| | |
| | | |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * 反馈状态 |
| | | */ |
| | | public enum FeedbackStatus { |
| | | WAIT_SYNC("待执行", 1), |
| | | SYNCING("执行中", 2), |
| | |
| | | package com.qianwen.smartman.modules.mdc.enums; |
| | | |
| | | /** |
| | | * 反馈类型 |
| | | */ |
| | | public enum FeedbackType { |
| | | TIME_RANGE("时间段反馈", 0), |
| | | IMMEDIATE("即时反馈", 1); |
| | |
| | | package com.qianwen.smartman.modules.mdc.enums; |
| | | |
| | | public enum RpsTypeEnum { |
| | | /** |
| | | * T1运行 |
| | | */ |
| | | T1(1, "T1"), |
| | | T2(2, "T2"), |
| | | T3(3, "T3"), |
| | | /** |
| | | * T4报警 |
| | | */ |
| | | T4(4, "T4"), |
| | | T5(5, "T5"), |
| | | T6(6, "T6"); |
| | |
| | | import com.qianwen.smartman.modules.mdc.enums.ProductivityTypeEnum; |
| | | import com.qianwen.smartman.modules.mdc.enums.RpsTypeEnum; |
| | | |
| | | /** |
| | | * 效率计算 |
| | | */ |
| | | public class EifficiencyUtils { |
| | | public static Double openShiftTypeCalculationResults(List<SuperAggregateState> superAggregateStates, ProductivityTypeEnum productivityType) { |
| | | Double v; |
| | |
| | | return v; |
| | | } |
| | | |
| | | /** |
| | | * 计算运行率? |
| | | * @param originalData |
| | | * @return |
| | | */ |
| | | public static Double calculationRunning(List<SuperAggregateState> originalData) { |
| | | List<SuperAggregateState> originalData2 = FilterOffUtils.filterOffDay(originalData, OpenTypeEnums.RUNNING); |
| | | double result = 0.0d; |
| | |
| | | return Double.valueOf(result); |
| | | } |
| | | |
| | | /** |
| | | * 计算报警率 |
| | | * @param originalData |
| | | * @return |
| | | */ |
| | | public static Double calculationAlarm(List<SuperAggregateState> originalData) { |
| | | List<SuperAggregateState> originalData2 = FilterOffUtils.filterOffDay(originalData, OpenTypeEnums.ALARM); |
| | | double result = 0.0d; |
| | | if (Func.isNotEmpty(originalData2)) { |
| | | //总时间 |
| | | double sum = originalData2.stream().mapToDouble((v0) -> { |
| | | return v0.getDurationCollect(); |
| | | }).sum(); |
| | |
| | | return Double.valueOf(result); |
| | | } |
| | | |
| | | /** |
| | | * 计算OEE稼动率 |
| | | * @param originalData |
| | | * @return |
| | | */ |
| | | public static Double calculationOee(List<SuperAggregateState> originalData) { |
| | | List<SuperAggregateState> originalData2 = FilterOffUtils.filterOffDay(originalData, OpenTypeEnums.OEE); |
| | | double result = 0.0d; |