| | |
| | | .selectAs(PlatformGroup::getName,PlatformJob::getPlatformGroupName) |
| | | .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) |
| | | .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) |
| | | .selectAs(SystemUser::getUsername,PlatformJob::getOutUserName) |
| | | .selectAs(PlatformWmsJob::getIoCreatedate,PlatformJob::getIoCreatedate) |
| | | .selectAs(SystemUser::getRealname,PlatformJob::getOutUserName) |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId) |
| | | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode) |
| | |
| | | .eq(pageWrap.getModel().getSingType() != null, PlatformJob::getSingType, pageWrap.getModel().getSingType()) |
| | | .eq(pageWrap.getModel().getSignDistance() != null, PlatformJob::getSignDistance, pageWrap.getModel().getSignDistance()) |
| | | .eq(pageWrap.getModel().getPlatformNames() != null, PlatformJob::getPlatformNames, pageWrap.getModel().getPlatformNames()) |
| | | .like(pageWrap.getModel().getPlatformName() != null, Platform::getName, pageWrap.getModel().getPlatformName()) |
| | | .eq(pageWrap.getModel().getPlatforms() != null, PlatformJob::getPlatforms, pageWrap.getModel().getPlatforms()) |
| | | .eq(pageWrap.getModel().getPlatformId() != null, PlatformJob::getPlatformId, pageWrap.getModel().getPlatformId()) |
| | | .ge(pageWrap.getModel().getInwaitDate() != null, PlatformJob::getInwaitDate, Utils.Date.getStart(pageWrap.getModel().getInwaitDate())) |
| | |
| | | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode) |
| | | .eq(pageWrap.getModel().getPlatformGroupId() != null, PlatformJob::getPlatformGroupId, pageWrap.getModel().getPlatformGroupId()) |
| | | .like(pageWrap.getModel().getCarCodeFront() != null, PlatformJob::getCarCodeFront, pageWrap.getModel().getCarCodeFront()) |
| | | // .eq(Objects.nonNull(pageWrap.getModel().getCallType()) |
| | | // &&Constants.equalsInteger(pageWrap.getModel().getCallType(),Constants.ONE), |
| | | // PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey() |
| | | // ) |
| | | |
| | | .apply(Objects.nonNull(pageWrap.getModel().getCallType()) |
| | | &&Constants.equalsInteger(pageWrap.getModel().getCallType(),Constants.ONE), |
| | |
| | | &&Constants.equalsInteger(pageWrap.getModel().getCallType(),Constants.THREE), |
| | | i->i.eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey()).or() |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.IN_WAIT.getKey()).or() |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()).or() |
| | | // .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()).or() |
| | | .apply(" ( t.status = "+Constants.PlatformJobStatus.TRANSFERING.getKey()+" and t.PLATFORM_GROUP_ID = "+pageWrap.getModel().getPlatformGroupId()+" ) ") |
| | | ) |
| | | // .like(PlatformJob::getArriveDate,DateUtil.dateTypeToString(new Date(),"yyyy-MM-dd")) |
| | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"签到类型错误"); |
| | | } |
| | | //查询月台组数据 |
| | | PlatformGroup platformGroup = platformGroupMapper.selectById(platformJob.getPlatformGroupId()); |
| | | if(Objects.isNull(platformGroup)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到月台组信息"); |
| | | } |
| | | if(System.currentTimeMillis() > DateUtil.getDateByString(DateUtil.getCurrDate() + " " + platformGroup.getEndTime() + ":59" ).getTime() |
| | | || System.currentTimeMillis() < DateUtil.getDateByString(DateUtil.getCurrDate() + " " + platformGroup.getStartTime() + ":00" ).getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未在工作时间["+platformGroup.getStartTime() + "-" + platformGroup.getEndTime() +"],无法进行签到"); |
| | | } |
| | | |
| | | platformJob.setSignDate(new Date()); |
| | | platformJob.setSingType(signInDTO.getSignType()); |
| | | platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey()); |
| | |
| | | ){ |
| | | //查询前方排队数量 |
| | | this.queryWaitNum(platformJob); |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.nonNull(platform)){ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | } |
| | | }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){ |
| | | //作业月台信息 |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.nonNull(platform)){ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | } |
| | | |
| | | } |
| | | platformJob.dealTime(); |
| | | this.getWorkTime(platformJob); |
| | |
| | | if(platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getPlatformId,platform.getId()) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey(),Constants.PlatformJobStatus.WORKING.getKey()) |
| | | )>platform.getWorkingNum()){ |
| | | )>=platform.getWorkingNum()){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"超出月台可同时作业数量["+platform.getWorkingNum()+"辆]"); |
| | | }; |
| | | |
| | |
| | | if(Objects.isNull(platformJob)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){ |
| | | if(! (Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey()) |
| | | ||Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey()) )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转!"); |
| | | } |
| | | PlatformJob oldPlatformJob = new PlatformJob(); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void powerLevel(JobOperateDTO jobOperateDTO){ |
| | | public PlatformJob powerLevel(JobOperateDTO jobOperateDTO){ |
| | | if(Objects.isNull(jobOperateDTO) |
| | | || Objects.isNull(jobOperateDTO.getJobId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | platformJob.setOutHkdate(new Date()); |
| | | platformJob.setStatus(Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()); |
| | | platformJob.setEditDate(new Date()); |
| | | platformJob.setRemark(jobOperateDTO.getRemark()); |
| | | platformJobMapper.updateById(platformJob); |
| | | //存储操作日志 |
| | | savePlatformLog(Constants.PlatformJobLogType.AUTHED_LEAVE.getKey(),oldPlatformJob,platformJob , |
| | | Constants.PlatformJobLogType.AUTHED_LEAVE.getInfo()); |
| | | //TODO 授权车辆离场权限 |
| | | return platformJob; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | platformLog.setParam2(DateUtil.dateTypeToString(platformLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | | String v = Long.toString((platformLog.getCreateDate().getTime() - DateUtil.StringToDate(lastBeginPlatform.getParam1(),"yyyy-MM-dd HH:mm:ss").getTime() )/ 1000) ; |
| | | platformLog.setParam3(v); |
| | | platformLog.setRemark(platformJobBefor.getPlatformId().toString()); |
| | | }else{ |
| | | platformLog.setParam3("0"); |
| | | } |
| | |
| | | platformLog.setParam2(DateUtil.dateTypeToString(platformLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | | String v = Long.toString((platformJobAfter.getDoneDate().getTime() - DateUtil.StringToDate(lastBeginPlatform.getParam1(),"yyyy-MM-dd HH:mm:ss").getTime()) / 1000) ; |
| | | platformLog.setParam3(v); |
| | | platformLog.setRemark(platformJobBefor.getPlatformId().toString()); |
| | | } |
| | | }else if(Constants.equalsInteger(objType,Constants.PlatformJobLogType.WORKING.getKey())){ |
| | | platformLog.setParam1(DateUtil.dateTypeToString(platformLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |