| | |
| | | |
| | | @Override |
| | | public void autoPlatformCallCar(WmsService wmsService){ |
| | | log.error("定时自动分配月台 - 月台开始自动分配分配任务:{}"+DateUtil.getCurrDateTime()); |
| | | //查询当前开启的月台数据 |
| | | List<PlatformGroup> allPlatformGroup = platformGroupMapper.selectList(new QueryWrapper<PlatformGroup>().lambda().eq(PlatformGroup::getStatus,Constants.ZERO) |
| | | .eq(PlatformGroup::getIsdeleted,Constants.ZERO).eq(PlatformGroup::getAutoCall,Constants.ONE) |
| | |
| | | } |
| | | } |
| | | for (Platform platform:platforms) { |
| | | |
| | | log.error("定时自动分配月台 - 月台开始自动分配分配任务:{}"+JSONObject.toJSONString(platform)); |
| | | //月台 叫号入园数量 |
| | | Integer workingNum = platform.getWorkingNum(); |
| | | //查询当前月台是否存在月台叫号数据 如果大于等于可叫号数量 则跳过 |
| | |
| | | } |
| | | for (int i = 0; i < workingNum - workNum ; i++) { |
| | | PlatformJob platformJob = this.getAutoCallJob(platformJobList,platform,isDefaul,platformGroup); |
| | | log.error("定时自动分配月台 - 月台自动分配分配任务:{}"+JSONObject.toJSONString(platformJob)); |
| | | if(Objects.isNull(platformJob)){ |
| | | continue; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public PlatformJob getAutoCallJob(List<PlatformJob> platformJobList, Platform platform,Boolean isDefaul,PlatformGroup platformGroup){ |
| | | log.error("定时自动分配月台 - 月台自动分配任务:{}"+DateUtil.getCurrDateTime()); |
| | | if(isDefaul){ |
| | | //月台下只有一类月台 直接返回第一个任务 |
| | | return platformJobList.get(Constants.ZERO); |
| | |
| | | } |
| | | }else{ |
| | | //物流车预约的任务 直接分配 散托盘月台 |
| | | if(Constants.equalsInteger(platform.getType(),Constants.TWO)){ |
| | | if(Constants.equalsInteger(platform.getType(),Constants.ONE)){ |
| | | return platformJob; |
| | | } |
| | | } |
| | |
| | | if(Objects.isNull(platformWmsJob)){ |
| | | continue; |
| | | } |
| | | SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.IN_REPERTOTY_CODE); |
| | | SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.IN_REPERTOTY_CODE); |
| | | if(Objects.nonNull(systemDictData)){ |
| | | //判断放置位置 |
| | | if(platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda().eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO) |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void jobUrge(Integer jobId,LoginUserInfo loginUserInfo){ |
| | | if(Objects.isNull(jobId)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | PlatformJob platformJob = platformJobMapper.selectById(jobId); |
| | | if(Objects.isNull(platformJob)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey()) |
| | | || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.IN_WAIT.getKey()) |
| | | || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,状态已流转"); |
| | | } |
| | | |
| | | platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda() |
| | | .set(PlatformJob::getUrgeUser,loginUserInfo.getId()) |
| | | .set(PlatformJob::getUrgeTime,DateUtil.getCurrDateTime()) |
| | | .set(PlatformJob::getEditDate,DateUtil.getCurrDateTime()) |
| | | .eq(PlatformJob::getId,platformJob.getId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |