| | |
| | | Constants.PlatformJobStatus.EXCEPTION.getKey(), |
| | | Constants.PlatformJobStatus.OVER_NUMBER.getKey(), |
| | | Constants.PlatformJobStatus.TRANSFERING.getKey() |
| | | |
| | | ) |
| | | // .like(PlatformJob::getArriveDate,DateUtil.getCurrDate()) |
| | | .orderByDesc(PlatformJob::getCreateDate) |
| | | ); |
| | | for (Platform platform:allPlatformList) { |
| | | PlatformWorkVO platformWorkVO = PlatformGroupServiceImpl.getPlatformWorkVO(platform.getId(),platformJobList); |
| | | PlatformWorkVO platformWorkVO = PlatformGroupServiceImpl.getPlatformWorkVO(platform,platformJobList); |
| | | platform.setPlatformWorkVO(platformWorkVO); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static PlatformWorkVO getPlatformWorkVO(Integer platformId,List<PlatformJob> platformJobList){ |
| | | public static PlatformWorkVO getPlatformWorkVO(Platform platform,List<PlatformJob> platformJobList){ |
| | | PlatformWorkVO platformWorkVO = new PlatformWorkVO(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){ |
| | | //获取月台下的所有作业数据 |
| | | List<PlatformJob> platformJobs = platformJobList.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platformId) |
| | | && !Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey())).collect(Collectors.toList()); |
| | | List<PlatformJob> platformJobs = platformJobList.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platform.getId()) || Constants.equalsInteger(i.getPlatformGroupId(),platform.getGroupId()) |
| | | ).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobs)){ |
| | | platformWorkVO.setWorkNum( |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())).collect(Collectors.toList()).size() |
| | |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | platformWorkVO.setWaitNum( |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()) |
| | | platformJobs.stream().filter(i-> |
| | | Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()) |
| | | || Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey()) |
| | | ).collect(Collectors.toList()).size() |
| | | + |
| | | platformJobList.stream().filter(i->Constants.equalsInteger(platformId,i.getPlatformId()) |
| | | && Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.IN_WAIT.getKey())).collect(Collectors.toList()).size() |
| | | platformJobList.stream().filter(i->Constants.equalsInteger(platform.getId(),i.getPlatformId()) |
| | | && (Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.IN_WAIT.getKey()) |
| | | ) |
| | | ).collect(Collectors.toList()).size() |
| | | ); |
| | | platformWorkVO.setExceptionNum( |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | platformWorkVO.setPlatformJobList(platformJobs); |
| | | platformWorkVO.setPlatformJobList(platformJobs.stream().filter( |
| | | i->Constants.equalsInteger(platform.getId(),i.getPlatformId()) && !Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey()) |
| | | ).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | return platformWorkVO; |
| | |
| | | Constants.PlatformJobStatus.WAIT_CALL.getKey(), |
| | | Constants.PlatformJobStatus.IN_WAIT.getKey(), |
| | | Constants.PlatformJobStatus.CALLED.getKey() |
| | | |
| | | ) |
| | | ) |
| | | ); |
| | |
| | | .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().getCreateDateStart() != null, PlatformJob::getStartDate, Utils.Date.getStart(pageWrap.getModel().getCreateDateStart())) |
| | | .le(pageWrap.getModel().getCreateDateEnd() != null, PlatformJob::getStartDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDateEnd())) |
| | | .ge(pageWrap.getModel().getCreateDateStart() != null, PlatformWmsJob::getIoCreatedate, Utils.Date.getStart(pageWrap.getModel().getCreateDateStart())) |
| | | .le(pageWrap.getModel().getCreateDateEnd() != null, PlatformWmsJob::getIoCreatedate, Utils.Date.getEnd(pageWrap.getModel().getCreateDateEnd())) |
| | | .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) |
| | | ; |
| | |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getPlatformGroupId,platformGroup.getId()) |
| | | .ge(Objects.nonNull(platformJob),PlatformJob::getSignDate,DateUtil.dateTypeToString(platformJob.getSignDate(),"yyyy-MM-dd HH:mm:ss")) |
| | | .le(Objects.nonNull(platformJob),PlatformJob::getSignDate,DateUtil.dateTypeToString(platformJob.getSignDate(),"yyyy-MM-dd HH:mm:ss")) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey(), |
| | | Constants.PlatformJobStatus.IN_WAIT.getKey(), |
| | | Constants.PlatformJobStatus.CALLED.getKey()) |
| | |
| | | .selectAll(PlatformJob.class) |
| | | .selectAs(Platform::getName,PlatformJob::getPlatformName) |
| | | .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) |
| | | .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getJobId,PlatformJob::getId) |
| | | .eq(PlatformJob::getPlatformId,platformId) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getStatus, |
| | |
| | | //查询前方排队数量 |
| | | this.queryWaitNum(platformJob); |
| | | } |
| | | PlatformWorkVO platformWorkVO = PlatformGroupServiceImpl.getPlatformWorkVO(platformId,platformJobList); |
| | | PlatformWorkVO platformWorkVO = PlatformGroupServiceImpl.getPlatformWorkVO(platformJoinMapper.selectById(platformId),platformJobList); |
| | | return platformWorkVO; |
| | | } |
| | | |
| | |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.PlatformWmsDetailMapper; |
| | | import com.doumee.dao.business.PlatformWmsJobMapper; |
| | |
| | | |
| | | @Override |
| | | public PlatformWmsJob findByDetailId(Integer id) { |
| | | PlatformWmsJob platformWmsJob = platformWmsJobMapper.selectOne(new QueryWrapper<PlatformWmsJob>().lambda().eq(PlatformWmsJob::getJobId,id).last(" limit 1 ")); |
| | | PlatformWmsJob platformWmsJob = platformWmsJobMapper.selectOne(new QueryWrapper<PlatformWmsJob>().lambda().eq(PlatformWmsJob::getIsdeleted, Constants.ZERO).eq(PlatformWmsJob::getJobId,id).last(" limit 1 ")); |
| | | if(Objects.isNull(platformWmsJob)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到运单信息"); |
| | | } |
| | | List<PlatformWmsDetail> platformWmsDetailList = platformWmsDetailMapper.selectList(new QueryWrapper<PlatformWmsDetail>() |
| | | .lambda().eq(PlatformWmsDetail::getJobId,id)); |
| | | .lambda().eq(PlatformWmsDetail::getJobId,id).eq(PlatformWmsDetail::getIsdeleted, Constants.ZERO)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformWmsDetailList)){ |
| | | platformWmsJob.setIoQty( |
| | | platformWmsDetailList.stream().map(m->m.getIoQty()).reduce(BigDecimal.ZERO,BigDecimal::add) |
| | |
| | | job.setRepertotyAddress(param.getRepertotyAddress()); |
| | | job.setContractNum(param.getContractNum()); |
| | | job.setDriverPhone(param.getDriverPhone()); |
| | | job.setDriverName(param.getDriverName()); |
| | | platformWmsJobMapper.insert(job); |
| | | jobList.add(model); |
| | | } |