| | |
| | | @Override |
| | | public List<PlatformDataListResponse> platformWorkingDataList(PlatformDataListRequest param){ |
| | | List<PlatformDataListResponse> platformDataListResponseList = new ArrayList<>(); |
| | | List<Platform> platformList = platformJoinMapper.selectList( |
| | | new MPJLambdaWrapper<Platform>().eq(Platform::getIsdeleted,Constants.ZERO) |
| | | .eq(Platform::getStatus,Constants.ZERO) |
| | | ); |
| | | for (Platform platform:platformList) { |
| | | PlatformDataListResponse platformDataListResponse = new PlatformDataListResponse(); |
| | | platformDataListResponse.setId(platform.getId()); |
| | | platformDataListResponse.setHkId(platform.getHkId()); |
| | | platformDataListResponse.setName(platform.getName()); |
| | | platformDataListResponse.setWorkStatus(Constants.ZERO); |
| | | //查询当前作业车辆 |
| | | PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey()) |
| | | .orderByDesc(PlatformJob::getWorkTime) |
| | | .last(" limit 1") |
| | | try { |
| | | List<Platform> platformList = platformJoinMapper.selectList( |
| | | new MPJLambdaWrapper<Platform>().eq(Platform::getIsdeleted,Constants.ZERO) |
| | | .eq(Platform::getStatus,Constants.ZERO) |
| | | ); |
| | | if(Objects.nonNull(platformJob)){ |
| | | platformDataListResponse.setCarCode(platformJob.getCarCodeFront()); |
| | | platformDataListResponse.setWorkType( |
| | | Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.zycxh) |
| | | ||Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.wxcxh) |
| | | ||Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.sgscxh)?Constants.ZERO:Constants.ONE |
| | | for (Platform platform:platformList) { |
| | | PlatformDataListResponse platformDataListResponse = new PlatformDataListResponse(); |
| | | platformDataListResponse.setId(platform.getId()); |
| | | platformDataListResponse.setHkId(platform.getHkId()); |
| | | platformDataListResponse.setName(platform.getName()); |
| | | platformDataListResponse.setWorkStatus(Constants.ZERO); |
| | | //查询当前作业车辆 |
| | | PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey()) |
| | | .orderByDesc(PlatformJob::getWorkTime) |
| | | .last(" limit 1") |
| | | ); |
| | | platformDataListResponse.setWorkStatus(Constants.ONE); |
| | | //查询作业时长 |
| | | platformDataListResponse.setWorkTime( |
| | | this.getWorkTime(platformJob) |
| | | ); |
| | | if(Objects.nonNull(platformJob)){ |
| | | platformDataListResponse.setCarCode(platformJob.getCarCodeFront()); |
| | | platformDataListResponse.setWorkType( |
| | | Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.zycxh) |
| | | ||Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.wxcxh) |
| | | ||Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.sgscxh)?Constants.ZERO:Constants.ONE |
| | | ); |
| | | platformDataListResponse.setWorkStatus(Constants.ONE); |
| | | //查询作业时长 |
| | | platformDataListResponse.setWorkTime( |
| | | this.getWorkTime(platformJob) |
| | | ); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | System.out.println("===============================报错啦:\n"); |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return platformDataListResponseList; |
| | | } |
| | | |