| | |
| | | platformDevice.setType(Constants.ZERO); |
| | | platformDevice.setDeviceId(ledId.toString()); |
| | | platformDevice.setHkId(device.getHkId()); |
| | | platformDevice.setHkNo(device.getNo()); |
| | | platformDevice.setName(device.getName()); |
| | | platformDeviceList.add(platformDevice); |
| | | } |
| | |
| | | platformDevice.setType(Constants.TWO); |
| | | platformDevice.setDeviceId(broadcastId.toString()); |
| | | platformDevice.setHkId(device.getHkId()); |
| | | platformDevice.setHkNo(device.getNo()); |
| | | platformDevice.setName(device.getName()); |
| | | platformDeviceList.add(platformDevice); |
| | | } |
| | |
| | | platformDevice.setType(Constants.ZERO); |
| | | platformDevice.setDeviceId(ledId.toString()); |
| | | platformDevice.setHkId(device.getHkId()); |
| | | platformDevice.setHkNo(device.getNo()); |
| | | platformDevice.setName(device.getName()); |
| | | platformDeviceList.add(platformDevice); |
| | | } |
| | |
| | | platformDevice.setType(Constants.TWO); |
| | | platformDevice.setDeviceId(broadcastId.toString()); |
| | | platformDevice.setHkId(device.getHkId()); |
| | | platformDevice.setHkNo(device.getNo()); |
| | | platformDevice.setName(device.getName()); |
| | | platformDeviceList.add(platformDevice); |
| | | } |
| | |
| | | .selectAs(PlatformGroup::getName,Platform::getGroupName) |
| | | .select(" (select ifnull(TIMESTAMPDIFF(HOUR, '2023-01-01 '||pg.start_time||':00', '2023-01-01 '||pg.end_time||':00' ),0) from platform_group pg " + |
| | | " where t.group_id = pg.id ) as openTime ") |
| | | .select(" ( select ROUND( ifnull(SUM(pl.PARAM3),0) / 3600 , 2 ) from platform_log pl where pl.remark = t.id " + |
| | | " and pl.CREATE_DATE > '"+DateUtil.getFomartDate(platform.getQueryDateStart(),"yyyy-MM-dd")+" 00:00:00' " + |
| | | "and pl.CREATE_DATE <= '"+DateUtil.getFomartDate(platform.getQueryDateEnd(),"yyyy-MM-dd")+" 23:59:59' ) as workCountTime ") |
| | | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId); |
| | | queryWrapper |
| | | .eq(platform.getGroupId() != null, Platform::getGroupId, platform.getGroupId()) |
| | |
| | | List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAll(PlatformJob.class) |
| | | .select(" ( select ROUND( ifnull(SUM(pl.PARAM3),0) / 3600 , 2 ) from platform_log pl where pl.OBJ_ID = t.id " + |
| | | " ) as workTimes ") |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey(), |
| | | Constants.PlatformJobStatus.DONE.getKey(), |
| | | Constants.PlatformJobStatus.TRANSFERING.getKey(), |
| | |
| | | .le(platform.getQueryDateEnd() != null, PlatformJob::getStartDate, Utils.Date.getEnd(platform.getQueryDateEnd())) |
| | | ); |
| | | //查询2日期相差天数 |
| | | Integer sumDays = DateUtil.daysBetweenDates(platform.getQueryDateStart(),platform.getQueryDateEnd()); |
| | | Integer sumDays = DateUtil.daysBetweenDates(platform.getQueryDateEnd(),platform.getQueryDateStart())+1; |
| | | for (Platform bean:platformList) { |
| | | List<PlatformJob> beanJobList = platformJobList.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),bean.getId())).collect(Collectors.toList()); |
| | | bean.setStopCount(beanJobList.size()); |
| | | bean.setWorkCountTime( |
| | | beanJobList.stream().map(i->i.getWorkTimes()).reduce(BigDecimal.ZERO,BigDecimal::add) |
| | | ); |
| | | if(Objects.isNull(bean.getOpenTime())||bean.getOpenTime().compareTo(BigDecimal.ZERO)<=0){ |
| | | bean.setUseRata(BigDecimal.ZERO); |
| | | continue; |
| | | } |
| | | BigDecimal sumTime = BigDecimal.valueOf(sumDays).multiply(bean.getOpenTime()); |
| | | bean.setUseRata( |
| | | bean.getWorkCountTime().divide(sumTime,BigDecimal.ROUND_HALF_DOWN,2) |
| | | bean.getWorkCountTime().multiply(new BigDecimal(100)).divide(sumTime,BigDecimal.ROUND_HALF_DOWN,2) |
| | | ); |
| | | } |
| | | } |
| | |
| | | if(Constants.equalsInteger(platform.getPlatformStatus(),Constants.ONE)){ |
| | | response.setCarCode(platform.getWorkCarCode()); |
| | | } |
| | | platformStatusListResponses.add(response); |
| | | } |
| | | } |
| | | return platformStatusListResponses; |