| | |
| | | import com.doumee.core.tms.model.response.TmsBaseResponse; |
| | | import com.doumee.core.tms.model.response.TmsLockStatusQueryResponse; |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | | import com.doumee.dao.business.join.PlatformJobJoinMapper; |
| | | import com.doumee.dao.business.join.PlatformJoinMapper; |
| | |
| | | import com.doumee.dao.openapi.request.*; |
| | | import com.doumee.dao.openapi.response.*; |
| | | |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.web.reqeust.*; |
| | | import com.doumee.dao.web.response.DriverHomeVO; |
| | | import com.doumee.dao.web.response.LineUpVO; |
| | | import com.doumee.dao.web.response.PlatformWorkVO; |
| | | import com.doumee.dao.web.response.platformReport.WholeProvinceBoardVO; |
| | | import com.doumee.service.business.PlatformJobService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private EmayService emayService; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | @Autowired |
| | | private PlatformBroadcastLogMapper platformBroadcastLogMapper; |
| | | @Autowired |
| | | private PlatformWarnEventServiceImpl platformWarnEventService; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | |
| | | @Override |
| | | public Integer create(PlatformJob platformJob) { |
| | |
| | | } |
| | | |
| | | public void sceneSignIn(SignInDTO signInDTO){ |
| | | |
| | | if( StringUtils.isNotBlank(signInDTO.getQrCodeKey())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(!signInDTO.getQrCodeKey().equals(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode())){ |
| | | if(!signInDTO.getQrCodeKey().equals( |
| | | systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode() + systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"二维码已过期,请刷新重试"); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | platformJob.dealTime(); |
| | | this.getWorkTime(platformJob); |
| | | this.getWorkTime(platformJob,platformLogMapper); |
| | | this.getWmsJobData(platformJob); |
| | | return platformJob; |
| | | } |
| | |
| | | * 获取已作业时间 |
| | | * @param platformJob |
| | | */ |
| | | public Long getWorkTime(PlatformJob platformJob){ |
| | | public static Long getWorkTime(PlatformJob platformJob,PlatformLogMapper platformLogMapper){ |
| | | List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>() |
| | | .lambda().eq(PlatformLog::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformLog::getJobId,platformJob.getId()) |
| | |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(Objects.nonNull(lastBeginPlatform)){ |
| | | String v = Long.toString(System.currentTimeMillis() - lastBeginPlatform.getCreateDate().getTime() / 1000) ; |
| | | String v = Long.toString((System.currentTimeMillis() - lastBeginPlatform.getCreateDate().getTime() )/ 1000) ; |
| | | optTime = optTime + Long.valueOf(v); |
| | | } |
| | | } |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobCallIn,null,null |
| | | ); |
| | | |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobCallIn,platformJob); |
| | | } |
| | | return platformJob; |
| | | } |
| | | |
| | | public void sendWxNotice(String objCode,PlatformJob platformJob){ |
| | | SystemUser driver = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDeleted, Constants.ZERO) |
| | | .eq(SystemUser::getType, Constants.ZERO) |
| | | .eq(SystemUser::getMobile,platformJob.getDrivierPhone()) |
| | | .last(" limit 1 ")); |
| | | if (Objects.nonNull(driver) && StringUtils.isNotBlank(driver.getOpenid())) { |
| | | PlatformJob p = platformJobJoinMapper.selectJoinOne(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAll(PlatformJob.class) |
| | | .selectAs(Platform::getName,PlatformJob::getPlatformName) |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .eq(PlatformJob::getId,platformJob.getId()) |
| | | .last(" limit 1") |
| | | ); |
| | | |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper, p, |
| | | objCode, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(driver.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(PlatformJobServiceImpl.class); |
| | |
| | | public void cancelInPark(PlatformJob platformJob){ |
| | | if(Constants.equalsInteger(platformJob.getType(),Constants.TWO) |
| | | || Constants.equalsInteger(platformJob.getType(),Constants.THREE) |
| | | || StringUtils.isBlank(platformJob.getCarCodeFront()) |
| | | || Constants.equalsInteger(platformJob.getType(),Constants.FOUR)){ |
| | | |
| | | List<VisitPark> visitParkList = visitParkMapper.selectList(new QueryWrapper<VisitPark>().lambda() |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobSingIn,platform.getName(),null |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())){ |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobSingIn,platformJob); |
| | | } |
| | | |
| | | |
| | | //广播 led通知 |
| | | platformJob.setPlatformName(platform.getName()); |
| | |
| | | SmsConstants.platformJobContent.platformJobMove,oldPlatform.getName(),platform.getName() |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobMove,platformJob); |
| | | } |
| | | |
| | | platformJob.setPlatformName(oldPlatform.getName()); |
| | | platformJob.setPlatformId(oldPlatform.getId()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(oldPlatform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getLedContent(), |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转!"); |
| | | } |
| | | |
| | | Platform platform = platformJoinMapper.selectById(jobOperateDTO.getPlatformId()); |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.isNull(platform)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到月台信息"); |
| | | } |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobOverNum,null,null |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())){ |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobOverNum,platformJob); |
| | | } |
| | | |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), |
| | | null |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobError,platform.getName(),null |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobError,platformJob); |
| | | } |
| | | |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobWorking,platformJob); |
| | | } |
| | | //广播 led通知 |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.WORKING.getInfo(), |
| | |
| | | |
| | | return platformJob; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 完成作业 |
| | | */ |
| | | |
| | | @Override |
| | | public PlatformJob getLastWaitJob(String uuid, LoginUserInfo loginUser){ |
| | | String u = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.BIGSCREEN_UUID); |
| | | if(!StringUtils.equals(u,uuid)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,二维码已失效!"); |
| | | } |
| | | PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getDrivierPhone,loginUser.getMobile()) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()) |
| | | .orderByDesc(PlatformJob::getCreateDate) |
| | | .last(" limit 1 ") ); |
| | | return platformJob; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public PlatformJob finishWork(JobOperateDTO jobOperateDTO){ |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobFinish,platform.getName(),null |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobFinish,platformJob); |
| | | } |
| | | |
| | | //广播 led通知 |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.DONE.getInfo(), |
| | |
| | | List<PlatformJob> calledList = platformJobList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())).collect(Collectors.toList()); |
| | | largeScreenDataVO.setWaitWorkList(calledList); |
| | | } |
| | | largeScreenDataVO.setQrCode(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode()); |
| | | String u = UUID.randomUUID().toString(); |
| | | redisTemplate.opsForValue().set(Constants.RedisKeys.BIGSCREEN_UUID,u,3, TimeUnit.MINUTES); |
| | | String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),Constants.WxUrlParams.BISCREEN_CODE,u); |
| | | largeScreenDataVO.setQrCode(url); |
| | | largeScreenDataVO.setAttention(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_ATTENTION).getCode()); |
| | | return largeScreenDataVO; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 累计出库量统计 - 大屏 |
| | | * @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)); |
| | | // } |
| | | |
| | | |
| | | } |
| | | |
| | | } |