| | |
| | | package com.qianwen.smartman.modules.mdc.service.impl; |
| | | |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDate; |
| | |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | | import com.qianwen.core.mp.base.BaseEntity; |
| | | import com.qianwen.core.oss.model.BladeFile; |
| | | import com.qianwen.core.tool.utils.DateUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.cache.cps.WorkstationCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.DateConstant; |
| | |
| | | import com.qianwen.smartman.common.utils.CommonUtil; |
| | | import com.qianwen.smartman.common.utils.ListUtils; |
| | | import com.qianwen.smartman.common.utils.LocalDateTimeUtils; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | | import com.qianwen.core.oss.model.BladeFile; |
| | | import com.qianwen.core.tool.utils.DateUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.modules.cps.entity.GlobalWcs; |
| | | import com.qianwen.smartman.modules.cps.entity.Workstation; |
| | | import com.qianwen.smartman.modules.cps.enums.WorkstationTypeEnum; |
| | |
| | | import com.qianwen.smartman.modules.mdc.vo.excel.StatusRecordExcelVO; |
| | | import com.qianwen.smartman.modules.mdc.wrapper.WorkstationFeedbackWrapper; |
| | | import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import cn.hutool.core.util.NumberUtil; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/mdc/service/impl/StatusRecordServiceImpl.class */ |
| | | public class StatusRecordServiceImpl implements IStatusRecordService { |
| | | private static final Logger log = LoggerFactory.getLogger(StatusRecordServiceImpl.class); |
| | | private final ISuperAggregateStateService superAggregateStateService; |
| | | private final ITimeUsedAnalysisService timeUsedAnalysisService; |
| | | private final IWorkstationService workstationService; |
| | | private final OssBuilder ossBuilder; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75106384: |
| | | if (implMethodName.equals("getType")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Workstation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Workstation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Workstation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getType(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public StatusRecordServiceImpl(final ISuperAggregateStateService superAggregateStateService, final ITimeUsedAnalysisService timeUsedAnalysisService, final IWorkstationService workstationService, final OssBuilder ossBuilder) { |
| | | this.superAggregateStateService = superAggregateStateService; |
| | |
| | | List<StatusRecordDateVO> result = new ArrayList<>(); |
| | | List<WorkstationInfoVO> workstationList = statusRecordDateSelectVO.getWorkstationInfoList(); |
| | | if (Func.isEmpty(workstationList)) { |
| | | workstationList = (List<WorkstationInfoVO>)this.workstationService.list(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()).eq(BaseEntity::getStatus, CommonConstant.ENABLE)).stream().map(s -> { |
| | | WorkstationInfoVO workstationInfoVO = new WorkstationInfoVO(); |
| | | workstationInfoVO.setId(s.getId()); |
| | | workstationInfoVO.setName(s.getName()); |
| | | workstationInfoVO.setCode(s.getCode()); |
| | | return workstationInfoVO; |
| | | }).collect(Collectors.toList()); |
| | | /* |
| | | workstationList = (List) this.workstationService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getType(); |
| | | }, WorkstationTypeEnum.MACHINE.getCode())).eq((v0) -> { |
| | |
| | | workstationInfoVO.setName(s.getName()); |
| | | workstationInfoVO.setCode(s.getCode()); |
| | | return workstationInfoVO; |
| | | }).collect(Collectors.toList()); |
| | | }).collect(Collectors.toList());*/ |
| | | } |
| | | page.setTotal(workstationList.size()); |
| | | List<WorkstationInfoVO> workstationList2 = (List) workstationList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList()); |
| | | List<Long> workstationIdList = (List) workstationList2.stream().map((v0) -> { |
| | | List<WorkstationInfoVO> workstationList2 = workstationList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList()); |
| | | List<Long> workstationIdList = workstationList2.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(workstationIdList, null, statusRecordDateSelectVO.getDate(), statusRecordDateSelectVO.getDate()); |
| | | Map<Long, List<SuperAggregateState>> workstationStatusMap = (Map) superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Long, List<SuperAggregateState>> workstationStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | })); |
| | | workstationList2.forEach(x -> { |
| | | StatusRecordDateVO statusRecord = new StatusRecordDateVO().setWorkstationInfo(x).setStatusRecordList(StatusRecordConvert.INSTANCE.convert((List) workstationStatusMap.get(x.getId()))); |
| | | StatusRecordDateVO statusRecord = new StatusRecordDateVO().setWorkstationInfo(x).setStatusRecordList(StatusRecordConvert.INSTANCE.convert(workstationStatusMap.get(x.getId()))); |
| | | result.add(statusRecord); |
| | | }); |
| | | return page.setRecords(result); |
| | |
| | | Long workstationId = statusRecordWorkstationSelectVO.getWorkstationId(); |
| | | List<LocalDate> dateList = LocalDateTimeUtils.getDateList(statusRecordWorkstationSelectVO.getStartDate(), statusRecordWorkstationSelectVO.getEndDate()); |
| | | page.setTotal(dateList.size()); |
| | | List<LocalDate> dateList2 = (List) dateList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList()); |
| | | List<LocalDate> dateList2 = dateList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList()); |
| | | statusRecordWorkstationSelectVO.setStartDate((LocalDate) ListUtils.getFirst(dateList2)); |
| | | statusRecordWorkstationSelectVO.setEndDate((LocalDate) ListUtils.getLast(dateList2)); |
| | | List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(Arrays.asList(workstationId), null, statusRecordWorkstationSelectVO.getStartDate(), statusRecordWorkstationSelectVO.getEndDate()); |
| | | Map<String, List<SuperAggregateState>> dateStatusMap = (Map) superAggregateStateList.stream().collect(Collectors.groupingBy(x -> { |
| | | Map<String, List<SuperAggregateState>> dateStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy(x -> { |
| | | return DateUtil.format(x.getStartTime(), DateConstant.PATTERN_DATE); |
| | | }, LinkedHashMap::new, Collectors.toList())); |
| | | long daysBetween = LocalDateTimeUtils.getDifference(statusRecordWorkstationSelectVO.getStartDate(), statusRecordWorkstationSelectVO.getEndDate()).intValue(); |
| | |
| | | public List<ChartDataVO> getTimeDistribution(StatusRecordDetailSelectVO statusRecordDetailSelectVO) { |
| | | List<ChartDataVO> result = new ArrayList<>(); |
| | | List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(Arrays.asList(statusRecordDetailSelectVO.getWorkstationId()), null, statusRecordDetailSelectVO.getDate(), statusRecordDetailSelectVO.getDate()); |
| | | Map<Integer, Long> wcsMap = (Map) superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Integer, Long> wcsMap = superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getWcs(); |
| | | }, HashMap::new, Collectors.summingLong((v0) -> { |
| | | return v0.getDurationCollect(); |
| | | }))); |
| | | for (Map.Entry<Integer, Long> entry : wcsMap.entrySet()) { |
| | | ChartDataVO chartData = new ChartDataVO().setName(entry.getKey() + "").setValue(Double.valueOf(BigDecimal.valueOf(entry.getValue().longValue()).divide(BigDecimal.valueOf(60000L), 2, 4).doubleValue())); |
| | | ChartDataVO<Object> chartData = new ChartDataVO<>().setName(entry.getKey() + "").setValue(Double.valueOf(BigDecimal.valueOf(entry.getValue().longValue()).divide(BigDecimal.valueOf(60000L), 2, 4).doubleValue())); |
| | | result.add(chartData); |
| | | } |
| | | return result; |
| | |
| | | List<SuperAggregateState> superAggregateStateList = statusData; |
| | | List<ShiftIndexNameDTO> shiftIndexList = getWorkstationShiftIndexList(workstationId, statusRecordDetailSelectVO.getDate()); |
| | | Optional.ofNullable(shiftIndexList).ifPresent(p -> { |
| | | Map<Integer, List<SuperAggregateState>> shiftIndexStatusMap = (Map) superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Integer, List<SuperAggregateState>> shiftIndexStatusMap =superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getShiftIndex(); |
| | | })); |
| | | p.forEach(x -> { |
| | | List<StatusRecordVO> listRecord = (List) Optional.ofNullable(StatusRecordConvert.INSTANCE.convert((List) shiftIndexStatusMap.get(x.getShiftIndex()))).map(list -> { |
| | | List<StatusRecordVO> listRecord = Optional.ofNullable(StatusRecordConvert.INSTANCE.convert( shiftIndexStatusMap.get(x.getShiftIndex()))).map(list -> { |
| | | return statusRecordDetailSelectVO.isHumanFeedback() ? WorkstationFeedbackWrapper.entityVO((List<StatusRecordVO>) list) : list; |
| | | }).orElse(null); |
| | | StatusRecordShiftIndexChartVO statusRecord = new StatusRecordShiftIndexChartVO().setShiftIndex(x.getShiftIndex()).setShiftIndexName(x.getShiftIndexName()).setStatusRecordList(listRecord); |
| | |
| | | List<SuperAggregateState> superAggregateStateList = statusData; |
| | | List<ShiftIndexNameDTO> shiftIndexList = getWorkstationShiftIndexList(workstationId, statusRecordDetailSelectVO.getDate()); |
| | | Optional.ofNullable(shiftIndexList).ifPresent(p -> { |
| | | Map<Integer, List<SuperAggregateState>> shiftIndexStatusMap = (Map) superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Integer, List<SuperAggregateState>> shiftIndexStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getShiftIndex(); |
| | | })); |
| | | p.forEach(x -> { |
| | | HashMap<String, String> hashMap = new HashMap<>(16); |
| | | hashMap.put("shiftIndex", x.getShiftIndex() + ""); |
| | | hashMap.put("shiftIndexName", x.getShiftIndexName()); |
| | | List<SuperAggregateState> shiftIndexStatusList = (List) shiftIndexStatusMap.get(x.getShiftIndex()); |
| | | List<SuperAggregateState> shiftIndexStatusList = shiftIndexStatusMap.get(x.getShiftIndex()); |
| | | if (Func.isNotEmpty(shiftIndexStatusList)) { |
| | | hashMap.put("oee", EifficiencyUtils.calculationResults(shiftIndexStatusList, ProductivityTypeEnum.OEE) + ""); |
| | | hashMap.put("fault", EifficiencyUtils.calculationResults(shiftIndexStatusList, ProductivityTypeEnum.ALARM) + ""); |
| | | HashMap<Integer, Long> wcsMap = (HashMap) shiftIndexStatusList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | HashMap<Integer, Long> wcsMap = shiftIndexStatusList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getWcs(); |
| | | }, HashMap::new, Collectors.summingLong((v0) -> { |
| | | return v0.getDurationCollect(); |
| | |
| | | List<Workstation> workstations; |
| | | List<WorkstationInfoVO> infoList = vo.getWorkstationInfoList(); |
| | | if (Func.isEmpty(infoList)) { |
| | | workstations = this.workstationService.list(Wrappers.<Workstation>lambdaQuery() |
| | | .eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()) |
| | | .eq(Workstation::getStatus, CommonConstant.ENABLE)); |
| | | /* |
| | | workstations = this.workstationService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getType(); |
| | | }, WorkstationTypeEnum.MACHINE.getCode())).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | ids = (List) workstations.stream().map((v0) -> { |
| | | }, CommonConstant.ENABLE));*/ |
| | | ids = workstations.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | } else { |
| | | ids = (List) infoList.stream().map((v0) -> { |
| | | ids = infoList.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | workstations = this.workstationService.listByIds(ids); |
| | |
| | | if (Func.isEmpty(workstations)) { |
| | | return exportEmpty(); |
| | | } |
| | | Map<Long, Workstation> workstationMap = (Map) workstations.stream().collect(Collectors.toMap((v0) -> { |
| | | Map<Long, Workstation> workstationMap = workstations.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getId(); |
| | | }, v -> { |
| | | return v; |
| | |
| | | for (LocalDate endTime = vo.getEndTime(); endTime.compareTo((ChronoLocalDate) startTime) >= 0; endTime = endTime.minusDays(1L)) { |
| | | List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(ids, null, endTime, endTime); |
| | | LocalDate finalEndTime = endTime; |
| | | List<StatusRecordExport> collect = (List) superAggregateStateList.stream().sorted(Comparator.comparing((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }).thenComparing((v0) -> { |
| | | return v0.getStartTime(); |
| | | })).map(state -> { |
| | | //SuperAggregateState state; |
| | | |
| | | List<StatusRecordExport> collect = superAggregateStateList.stream().sorted(Comparator.comparing(SuperAggregateState::getWorkstationId).thenComparing(SuperAggregateState::getStartTime)).map(state -> { |
| | | Long workstationId = state.getWorkstationId(); |
| | | GroupWorkDTO groupWorkDTO = (GroupWorkDTO) groupWorkMap.getOrDefault(workstationId, new GroupWorkDTO()); |
| | | Workstation infoVO = (Workstation) workstationMap.getOrDefault(workstationId, new Workstation()); |
| | |
| | | LocalDateTime end = LocalDateTime.of(date, LocalTime.MAX); |
| | | List<SuperAggregateState> res = this.superAggregateStateService.crossDay(start, end); |
| | | if (Func.isEmpty(res)) { |
| | | return new ArrayList(); |
| | | return new ArrayList<>(); |
| | | } |
| | | List<List<SuperAggregateStateVO>> list = Lists.newArrayList(); |
| | | List<SuperAggregateState> collect = (List) res.stream().flatMap(state -> { |
| | | List<SuperAggregateState> collect = res.stream().flatMap(state -> { |
| | | List<SuperAggregateState> states = crossState(state, date); |
| | | List<SuperAggregateStateVO> vos = StatusRecordConvert.INSTANCE.convertState(states); |
| | | list.add(vos); |
| | |
| | | List<StatusRecordDateVO> result = new ArrayList<>(); |
| | | List<WorkstationInfoVO> workstationList = statusRecordDateTimeSelectVO.getWorkstationInfoList(); |
| | | if (Func.isEmpty(workstationList)) { |
| | | workstationList = this.workstationService.list(Wrappers.<Workstation>lambdaQuery() |
| | | .eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()) |
| | | .eq(Workstation::getStatus, CommonConstant.ENABLE)).stream().map(s -> { |
| | | WorkstationInfoVO workstationInfoVO = new WorkstationInfoVO(); |
| | | workstationInfoVO.setId(s.getId()); |
| | | workstationInfoVO.setName(s.getName()); |
| | | workstationInfoVO.setCode(s.getCode()); |
| | | return workstationInfoVO; |
| | | }).collect(Collectors.toList()); |
| | | /* |
| | | workstationList = (List) this.workstationService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getType(); |
| | | }, WorkstationTypeEnum.MACHINE.getCode())).eq((v0) -> { |
| | |
| | | workstationInfoVO.setName(s.getName()); |
| | | workstationInfoVO.setCode(s.getCode()); |
| | | return workstationInfoVO; |
| | | }).collect(Collectors.toList()); |
| | | }).collect(Collectors.toList());*/ |
| | | } |
| | | page.setTotal(workstationList.size()); |
| | | List<WorkstationInfoVO> workstationList2 = (List) workstationList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList()); |
| | | List<Long> workstationIdList = (List) workstationList2.stream().map((v0) -> { |
| | | List<WorkstationInfoVO> workstationList2 = workstationList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList()); |
| | | List<Long> workstationIdList = workstationList2.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusDataByTime(workstationIdList, statusRecordDateTimeSelectVO.getStartTime(), statusRecordDateTimeSelectVO.getEndTime()); |
| | | Map<Long, List<SuperAggregateState>> workstationStatusMap = (Map) superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Long, List<SuperAggregateState>> workstationStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | })); |
| | | workstationList2.forEach(x -> { |
| | | StatusRecordDateVO statusRecord = new StatusRecordDateVO().setWorkstationInfo(x).setStatusRecordList(StatusRecordConvert.INSTANCE.convert((List) workstationStatusMap.get(x.getId()))); |
| | | StatusRecordDateVO statusRecord = new StatusRecordDateVO().setWorkstationInfo(x).setStatusRecordList(StatusRecordConvert.INSTANCE.convert(workstationStatusMap.get(x.getId()))); |
| | | result.add(statusRecord); |
| | | }); |
| | | return page.setRecords(result); |
| | |
| | | |
| | | private Map<String, String> getWcs() { |
| | | List<GlobalWcs> defaultWcs = WorkstationCache.getDefaultWcs(); |
| | | return (Map) defaultWcs.stream().collect(Collectors.toMap((v0) -> { |
| | | return defaultWcs.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getCode(); |
| | | }, (v0) -> { |
| | | return v0.getName(); |