| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 累计出库量统计 - 大屏 |
| | | * @param data |
| | | */ |
| | | @Override |
| | | public void wholeProvinceCenterData(WholeProvinceBoardVO data){ |
| | | // //累计本年度出库量 |
| | | // List<PlatformJob> platformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>() |
| | | // .lambda() |
| | | // .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED) |
| | | // .isNotNull(PlatformJob::getDoneDate) |
| | | // .in(PlatformJob::getType,Constants.platformJobType.wxczh,Constants.platformJobType.zyczh) |
| | | // .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy")) |
| | | // ); |
| | | // data.setYearOutTotal(platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | // data.setYearOutTimes(platformJobList.size()); |
| | | // |
| | | // |
| | | // List<PlatformJob> platformJobsMonthList = platformJobList.stream().filter(i->DateUtil.getFomartDate(i.getDoneDate(),"yyyy-MM").equals(DateUtil.getFomartDate(new Date(),"yyyy-MM"))).collect(Collectors.toList()); |
| | | // data.setMonthOutTotal(platformJobsMonthList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | // data.setMonthOutTimes(platformJobsMonthList.size()); |
| | | // String beforYear = DateUtil.getBeforYear(new Date(),1); |
| | | // |
| | | // //累计本年度出库量 |
| | | // List<PlatformJob> beforYearPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>() |
| | | // .lambda() |
| | | // .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED) |
| | | // .isNotNull(PlatformJob::getDoneDate) |
| | | // .in(PlatformJob::getType,Constants.platformJobType.wxczh,Constants.platformJobType.zyczh) |
| | | // .like( PlatformJob::getDoneDate, beforYear.substring(0,4)) |
| | | // ); |
| | | // |
| | | // List<PlatformJob> beforPlatformJobsMonthList = platformJobList.stream().filter(i->DateUtil.getFomartDate(i.getDoneDate(),"yyyy-MM").equals(beforYear.substring(0,7))).collect(Collectors.toList()); |
| | | // //同比数据 |
| | | // data.setYearOutTotalOnYear(beforYearPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | // data.setMonthOutTotalOnYear(beforPlatformJobsMonthList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | // |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void centerDataForInOut(WholeProvinceBoardVO data){ |
| | | // //今日完成的出入库所有数据 |
| | | // List<PlatformJob> platformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>() |
| | | // .lambda() |
| | | // .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED) |
| | | // .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd")) |
| | | // ); |
| | | // //今日之前 所有未完成的出入库数据 - WMS推送 |
| | | // List<PlatformJob> wmsPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>() |
| | | // .lambda() |
| | | // .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED |
| | | // ,Constants.PlatformJobStatus.CANCEL) |
| | | // .eq(PlatformJob::getOrigin ,Constants.ONE) |
| | | // .le(PlatformJob::getCreateDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd") +" 23:59:59") |
| | | // ); |
| | | // //今日之前 所有未完成的出入库数据 - 预约数据 |
| | | // List<PlatformJob> bookPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>() |
| | | // .lambda() |
| | | // .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED |
| | | // ,Constants.PlatformJobStatus.CANCEL) |
| | | // .eq(PlatformJob::getOrigin ,Constants.ONE) |
| | | // .le(PlatformJob::getArriveDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd") +" 23:59:59") |
| | | // ); |
| | | // |
| | | // BigDecimal finishOutTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // BigDecimal unFinishWmsOutTotal = wmsPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // BigDecimal unFinishBookOutTotal = bookPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // |
| | | // BigDecimal finishInTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // BigDecimal unFinishWmsInTotal = wmsPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // BigDecimal unFinishBookInTotal = bookPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // |
| | | // data.setOutTotal(finishOutTotal); |
| | | // data.setOutPlanTotal(finishOutTotal.add(unFinishWmsOutTotal).add(unFinishBookOutTotal)); |
| | | // |
| | | // data.setInTotal(finishInTotal); |
| | | // data.setInPlanTotal(finishInTotal.add(unFinishWmsInTotal).add(unFinishBookInTotal)); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void centerDataOutInRata(WholeProvinceBoardVO data){ |
| | | // //累计本月度所有操作量 |
| | | // List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() |
| | | // .selectAll(PlatformJob.class) |
| | | // .select(" ( select ifnull(sum(p.param3),0) from platform_log p where p.obj_id = platform_job.id ) ",PlatformJob::getWorkTime) |
| | | // .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED) |
| | | // .isNotNull(PlatformJob::getDoneDate) |
| | | // .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy-MM")) |
| | | // ); |
| | | // |
| | | // //获取本月所有出库量 |
| | | // BigDecimal monthOutTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // Long monthOutWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum); |
| | | // BigDecimal monthInTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // Long monthInWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum); |
| | | // |
| | | // data.setMonthOutRata(BigDecimal.ZERO); |
| | | // //月度出库效率 |
| | | // if(Objects.nonNull(monthOutTotal) && Objects.nonNull(monthOutWorkTotal) && monthOutWorkTotal>0L && monthOutTotal.compareTo(BigDecimal.ZERO) > 0){ |
| | | // BigDecimal workTotal = new BigDecimal(monthOutWorkTotal); |
| | | // data.setMonthOutRata(monthOutTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP)); |
| | | // } |
| | | // |
| | | // //月度入库效率 |
| | | // |
| | | // data.setMonthInRata(BigDecimal.ZERO); |
| | | // if(Objects.nonNull(monthInTotal) && Objects.nonNull(monthInWorkTotal) && monthInWorkTotal>0L && monthInTotal.compareTo(BigDecimal.ZERO) > 0){ |
| | | // BigDecimal workTotal = new BigDecimal(monthInWorkTotal); |
| | | // data.setMonthInRata(monthInTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP)); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // List<PlatformJob> dayPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>() |
| | | // .lambda() |
| | | // .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE |
| | | // ,Constants.PlatformJobStatus.AUTHED_LEAVE |
| | | // ,Constants.PlatformJobStatus.LEAVED) |
| | | // .isNotNull(PlatformJob::getDoneDate) |
| | | // .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd")) |
| | | // ); |
| | | // |
| | | // BigDecimal dayOutTotal = dayPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // Long dayOutWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum); |
| | | // BigDecimal dayInTotal = dayPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // Long dayInWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum); |
| | | // |
| | | // data.setDayOutRata(BigDecimal.ZERO); |
| | | // //日出库效率 |
| | | // if(Objects.nonNull(dayOutTotal) && Objects.nonNull(dayOutWorkTotal) && dayOutWorkTotal>0L && dayOutTotal.compareTo(BigDecimal.ZERO) > 0){ |
| | | // BigDecimal workTotal = new BigDecimal(dayOutWorkTotal); |
| | | // data.setDayOutRata(dayOutTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP)); |
| | | // } |
| | | // //日入库效率 |
| | | // data.setDayInRata(BigDecimal.ZERO); |
| | | // if(Objects.nonNull(dayInTotal) && Objects.nonNull(dayInWorkTotal) && dayInWorkTotal>0L && dayInTotal.compareTo(BigDecimal.ZERO) > 0){ |
| | | // BigDecimal workTotal = new BigDecimal(dayInWorkTotal); |
| | | // data.setMonthInRata(dayInTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP)); |
| | | // } |
| | | |
| | | |
| | | } |
| | | |
| | | } |