jiangping
2024-09-30 0c3093f553437faf2bfd48ff23d753872f86c9d7
最新版本
已修改1个文件
60 ■■■■■ 文件已修改
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -1507,37 +1507,43 @@
    @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;
    }