| | |
| | | @Autowired |
| | | private PlatformJobMapper platformJobMapper; |
| | | @Autowired |
| | | private PlatformBooksMapper platformBooksMapper; |
| | | @Autowired |
| | | private PlatformWmsDetailMapper platformWmsDetailMapper; |
| | | @Autowired |
| | | private PlatformWmsJobMapper platformWmsJobMapper; |
| | |
| | | private RetentionMapper retentionMapper; |
| | | @Autowired |
| | | private PlatformGroupMapper platformGroupMapper; |
| | | /** |
| | | * 获取区域树形结构数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GeneralVO> todayTotalInList(){ |
| | | /** |
| | | * 1市公司:根据预约的入园原因为市公司卸货的任务为市公司入库的统计; |
| | | * 2集散中心:WMS推送的入库单据; |
| | | * 3加工入库:预约入园为重庆加工入库的(作业月台为安泰物流卸货月台); |
| | | */ |
| | | String[] names = new String[]{"市公司","集散中心","加工入库"}; |
| | | String reason =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CITY_XH_REASON_ID).getCode(); |
| | | String platformGroupId =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ATWL_XH_PLATFORM_ID).getCode();; |
| | | List<GeneralVO> list = new ArrayList<>(); |
| | | for (int i = 0; i < 3; i++) { |
| | | Random random = new Random(); |
| | | GeneralVO data = new GeneralVO(); |
| | | data.setName(names[i]); |
| | | BigDecimal num =new BigDecimal(0); |
| | | if(i == 0){ |
| | | List<PlatformBooks> jobs = platformBooksMapper.selectJoinList(PlatformBooks.class, new MPJLambdaWrapper<PlatformBooks>() |
| | | .select(PlatformJob::getTotalNum) |
| | | .leftJoin(PlatformJob.class,PlatformJob::getId,PlatformBooks::getJobId) |
| | | .eq(PlatformBooks::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformBooks::getReasonId,reason) |
| | | .apply("to_days(t1.done_date) = to_days(now())") |
| | | .eq(PlatformBooks::getStatus,Constants.TWO)); |
| | | if(jobs!=null){ |
| | | for(PlatformBooks j :jobs){ |
| | | num =num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | } |
| | | }else if(i ==1){ |
| | | List<PlatformJob> jobs = platformJobMapper.selectList (new MPJLambdaWrapper<PlatformJob>() |
| | | .select(PlatformJob::getTotalNum) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getOrigin,Constants.ONE) |
| | | .in(PlatformJob::getStatus, Constants.PlatformJobStatus.DONE.getKey() |
| | | , Constants.PlatformJobStatus.AUTHED_LEAVE.getKey() |
| | | , Constants.PlatformJobStatus.LEAVED.getKey()) |
| | | .apply("to_days(done_date) = to_days(now())") ); |
| | | if(jobs!=null){ |
| | | for(PlatformJob j :jobs){ |
| | | num =num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | } |
| | | }else{ |
| | | List<PlatformJob> jobs = platformJobMapper.selectList (new MPJLambdaWrapper<PlatformJob>() |
| | | .select(PlatformJob::getTotalNum) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getPlatformGroupId,platformGroupId) |
| | | .apply("to_days(done_date) = to_days(now())") |
| | | .in(PlatformJob::getStatus, Constants.PlatformJobStatus.DONE.getKey() |
| | | , Constants.PlatformJobStatus.AUTHED_LEAVE.getKey() |
| | | , Constants.PlatformJobStatus.LEAVED.getKey()) ); |
| | | if(jobs!=null){ |
| | | for(PlatformJob j :jobs){ |
| | | num = num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | } |
| | | } |
| | | data.setNum(num); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | |
| | | } |
| | | /** |
| | | * 获取区域树形结构数据 |
| | | * @return |
| | |
| | | public BoardCarsListVO platformJobCarsList(){ |
| | | BoardCarsListVO data = new BoardCarsListVO(); |
| | | List<CarsDeviceDetaisResponse> detaisResponses = HKCarOpenService.getAllCarsDetais(); |
| | | List<CarsAlarmResultListResponse> eventList = HKCarOpenService.getAlarmEvemtList(detaisResponses,new Date()); |
| | | data.setCarsList(detaisResponses); |
| | | data.setCarsList(detaisResponses); |
| | | if(data.getCarsList()!=null && data.getCarsList().size()>0){ |
| | | List<String> codes = new ArrayList<>(); |
| | | //设备状态 0:离线;1:在线;2:休眠 |
| | | int online = 0; |
| | | for(CarsDeviceDetaisResponse model:detaisResponses){ |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ONE) ||Constants.equalsInteger(model.getStatus(),Constants.TWO)){ |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ONE) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.TWO)){ |
| | | //如果是在线或者休眠,查询在途还是空闲ty |
| | | codes.add(model.getPlateNum()); |
| | | model.setJobStatus(Constants.ZERO); |
| | | }else |
| | | model.setJobStatus(Constants.TWO); |
| | | data.setOfflineNum(data.getOfflineNum()+1); |
| | | } |
| | | if(codes.size()>0){ |
| | | //状态 0待确认 1待签到 2等待叫号 3入园等待 4已叫号 5作业中 6作业完成 7转移中 8异常挂起 9已授权离园 10已离园 11 已过号 12取消(WMS) |
| | | long busyNum = platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda() |
| | | List<PlatformJob> busyNum = platformJobMapper.selectList(new QueryWrapper<PlatformJob>() .lambda() |
| | | .select(PlatformJob::getCarCodeFront) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getCarCodeFront,codes) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey() |
| | |
| | | ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey() |
| | | ,Constants.PlatformJobStatus.EXCEPTION.getKey()) |
| | | .groupBy(PlatformJob::getCarCodeFront)); |
| | | data.setBusyNum((int)busyNum);//在途有任务数量 |
| | | data.setBusyNum( busyNum!=null ?busyNum.size():0);//在途有任务数量 |
| | | data.setIdleNum(codes.size() -data.getBusyNum());//无任务空闲数量 |
| | | data.setEventList(HKCarOpenService.getAlarmEvemtList(detaisResponses,new Date())); |
| | | if(busyNum != null){ |
| | | FLAG: for(CarsDeviceDetaisResponse model:detaisResponses){ |
| | | for(PlatformJob job : busyNum){ |
| | | if(StringUtils.equals(job.getCarCodeFront(),model.getPlateNum())){ |
| | | model.setJobStatus(Constants.ONE); |
| | | continue FLAG; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |