liukangdong
2024-09-24 a1647a5152e3d368ec2fb738ca7cc858e220d06c
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -239,8 +239,8 @@
                .eq(pageWrap.getModel().getPlatformGroupId() != null, PlatformJob::getPlatformGroupId, pageWrap.getModel().getPlatformGroupId())
                .apply(pageWrap.getModel().getQueryStatus() != null, " find_in_set(t.`STATUS`,'"+pageWrap.getModel().getQueryStatus()+"')")
                .ge(pageWrap.getModel().getBeginWorkDateStart() != null, PlatformJob::getStartDate, Utils.Date.getStart(pageWrap.getModel().getBeginWorkDateStart()))
                .le(pageWrap.getModel().getBeginWorkDateEnd() != null, PlatformJob::getStartDate, Utils.Date.getEnd(pageWrap.getModel().getBeginWorkDateEnd()))
                .ge(pageWrap.getModel().getBeginWorkDateStart() != null, PlatformJob::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getBeginWorkDateStart()))
                .le(pageWrap.getModel().getBeginWorkDateEnd() != null, PlatformJob::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getBeginWorkDateEnd()))
                .eq(pageWrap.getModel().getJobType() != null && Constants.equalsInteger(Constants.ONE,pageWrap.getModel().getJobType()), PlatformJob::getType, Constants.platformJobType.sgscxh)
                .ne(pageWrap.getModel().getJobType() != null && Constants.equalsInteger(Constants.ZERO,pageWrap.getModel().getJobType()), PlatformJob::getType, Constants.platformJobType.sgscxh)
        ;
@@ -373,7 +373,8 @@
            }else{
                platformJob.setWaitTime("等待叫号");
            }
        }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){
        }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())
        || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.DONE.getKey())){
            //查询最后开始任务的月台记录  日志表  因为存在异常挂起 转移 等问题
            PlatformLog platformLog = platformLogMapper.selectOne(new QueryWrapper<PlatformLog>().lambda()
                    .eq(PlatformLog::getJobId,platformJob.getId())
@@ -416,7 +417,7 @@
                .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                .eq(PlatformJob::getDrivierPhone,loginUserInfo.getMobile())
                .like(PlatformJob::getArriveDate,DateUtil.getCurrDate())
//                .like(PlatformJob::getArriveDate,DateUtil.getCurrDate())
                .orderByDesc(PlatformJob::getId)
        );
        for (PlatformJob platformJob:platformJobList) {
@@ -462,8 +463,9 @@
        PlatformJob oldPlatformJob = new PlatformJob();
        BeanUtils.copyProperties(platformJob,oldPlatformJob);
        platformJob.setConfirmTaskDate(new Date());
        platformJob.setArriveDate(confirmTaskDTO.getArriveDate());
        platformJob.setCarCodeBack(confirmTaskDTO.getCarCodeBack());
        platformJob.setStatus(Constants.PlatformJobStatus.WART_SIGN_IN.getKey());
        platformJob.setEditDate(new Date());
        platformJobMapper.updateById(platformJob);
@@ -488,19 +490,31 @@
        if(Objects.isNull(platformJob)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
        }
        PlatformJob oldPlatformJob = new PlatformJob();
        BeanUtils.copyProperties(platformJob,oldPlatformJob);
        if(Constants.equalsInteger(signInDTO.getSignType(),Constants.ZERO)){
            if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
            }
            this.distanceSignIn(signInDTO,platformJob);
        }else if(Constants.equalsInteger(signInDTO.getSignType(),Constants.ONE)){
            if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
            }
            this.sceneSignIn(signInDTO);
        }else if(Constants.equalsInteger(signInDTO.getSignType(),Constants.TWO)){
            if(!(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CONFIRM.getKey())||
                    Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey()))
            ){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
            }
        }else{
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"签到类型错误");
        }
        platformJob.setSignDate(new Date());
        platformJob.setSingType(Constants.ZERO);
        platformJob.setSingType(signInDTO.getSignType());
        platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey());
        platformJobMapper.updateById(platformJob);
        //存储操作日志
@@ -508,12 +522,12 @@
                Constants.PlatformJobLogType.SIGN.getInfo());
    }
    public void distanceSignIn(SignInDTO signInDTO , PlatformJob platformJob){
        if(Objects.isNull(signInDTO.getLat())
                || Objects.isNull(signInDTO.getLnt())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"经纬度信息异常");
        }
        //获取签到点的经纬度
        Double lat = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LAT).getCode());
        Double lnt = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LNT).getCode());
@@ -529,6 +543,7 @@
    }
    public void sceneSignIn(SignInDTO signInDTO){
        if( StringUtils.isNotBlank(signInDTO.getQrCodeKey())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
@@ -716,6 +731,7 @@
        || Constants.equalsInteger(platformJob.getType(),Constants.FOUR)){
            //TODO 下发入园权限
        }
        //存储操作日志
        savePlatformLog(Constants.PlatformJobLogType.IN_WAIT.getKey(),oldPlatformJob,platformJob,