|  |  |  | 
|---|
|  |  |  | //获取月台下的所有作业数据 | 
|---|
|  |  |  | List<PlatformJob> platformJobList =  platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() | 
|---|
|  |  |  | .selectAll(PlatformJob.class) | 
|---|
|  |  |  | .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 5 order by pl.CREATE_DATE desc  limit 1  ) as newStartDate  ") | 
|---|
|  |  |  | .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 order by pl.CREATE_DATE desc  limit 1  ) as newCallDate  ") | 
|---|
|  |  |  | .selectAs(Platform::getName,PlatformJob::getPlatformName) | 
|---|
|  |  |  | .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) | 
|---|
|  |  |  | .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) | 
|---|
|  |  |  | .selectAs(PlatformBooks::getId,PlatformJob::getBookId) | 
|---|
|  |  |  | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) | 
|---|
|  |  |  | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getJobId,PlatformJob::getId) | 
|---|
|  |  |  | .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId) | 
|---|
|  |  |  | .eq(PlatformJob::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .in(PlatformJob::getStatus, | 
|---|
|  |  |  | Constants.PlatformJobStatus.WAIT_CALL.getKey(), | 
|---|
|  |  |  | 
|---|
|  |  |  | List<PlatformJob> platformJobList =  platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() | 
|---|
|  |  |  | .selectAll(PlatformJob.class) | 
|---|
|  |  |  | .selectAs(Platform::getName,PlatformJob::getPlatformName) | 
|---|
|  |  |  | .select(" ( now() > DATE_ADD( ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 order by pl.CREATE_DATE desc  limit 1  )  ,INTERVAL t2.WAIT_CALL_TIME MINUTE) ) as isTimeOut   ") | 
|---|
|  |  |  | .select(" ( now() >= DATE_ADD( ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 " + | 
|---|
|  |  |  | "order by pl.CREATE_DATE desc  limit 1  )  ,INTERVAL t2.WAIT_CALL_TIME MINUTE) ) as isTimeOut   ") | 
|---|
|  |  |  | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) | 
|---|
|  |  |  | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId) | 
|---|
|  |  |  | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()) | 
|---|
|  |  |  | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | //如果超时 处理数据 并发送led与广播 | 
|---|
|  |  |  | for (PlatformJob platformJob:platformJobList) { | 
|---|
|  |  |  | JobOperateDTO jobOperateDTO = new JobOperateDTO(); | 
|---|
|  |  |  | jobOperateDTO.setJobId(platformJob.getId()); | 
|---|
|  |  |  | this.platformOverNumber(jobOperateDTO); | 
|---|
|  |  |  | this.cancelInPark(platformJob); | 
|---|
|  |  |  | if(Constants.equalsInteger(platformJob.getIsTimeOut(),Constants.ONE)){ | 
|---|
|  |  |  | JobOperateDTO jobOperateDTO = new JobOperateDTO(); | 
|---|
|  |  |  | jobOperateDTO.setJobId(platformJob.getId()); | 
|---|
|  |  |  | this.platformOverNumber(jobOperateDTO); | 
|---|
|  |  |  | this.cancelInPark(platformJob); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|