| | |
| | | BeanUtils.copyProperties(platformJob,oldPlatformJob); |
| | | |
| | | if(Constants.equalsInteger(signInDTO.getSignType(),Constants.ZERO)){ |
| | | if(!StringUtils.equals(platformJob.getDrivierPhone(),signInDTO.getLoginUserInfo().getMobile())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看"); |
| | | } |
| | | this.distanceSignIn(signInDTO,platformJob); |
| | | }else if(Constants.equalsInteger(signInDTO.getSignType(),Constants.ONE)){ |
| | | if(!StringUtils.equals(platformJob.getDrivierPhone(),signInDTO.getLoginUserInfo().getMobile())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看"); |
| | | } |
| | |
| | | || Objects.isNull(signInDTO.getLnt())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"经纬度信息异常"); |
| | | } |
| | | |
| | | //获取签到点的经纬度 |
| | | Double lat = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LAT).getCode()); |
| | | Double lnt = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LNT).getCode()); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PlatformJob getDetail(JobDetailDTO jobDetailDTO){ |
| | | if(Objects.isNull(jobDetailDTO) |
| | | || Objects.isNull(jobDetailDTO.getJobId())){ |
| | | if(Objects.isNull(jobDetailDTO) || Objects.isNull(jobDetailDTO.getJobId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | PlatformJob platformJob = platformJobMapper.selectById(jobDetailDTO.getJobId()); |
| | |
| | | if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){ |
| | | //待签到 计算距离 |
| | | if(Objects.nonNull(jobDetailDTO.getLnt())&&Objects.nonNull(jobDetailDTO.getLat())){ |
| | | //获取签到点的经纬度 |
| | | Double lat = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LAT).getCode()); |
| | | Double lnt = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LNT).getCode()); |
| | | //获取2个点的距离X米 |
| | | Double getDistanceDouble = PositionUtil.getDistance(jobDetailDTO.getLnt(),jobDetailDTO.getLat(),lnt,lat); |
| | | //转换km |
| | | BigDecimal getDistance = BigDecimal.valueOf(getDistanceDouble).divide(new BigDecimal(1000),2,BigDecimal.ROUND_HALF_UP); |
| | | platformJob.setGetDistance(getDistance); |
| | | if(jobDetailDTO.getLat()!=null && jobDetailDTO.getLnt()!=null){ |
| | | //获取签到点的经纬度 |
| | | Double lat = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LAT).getCode()); |
| | | Double lnt = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LNT).getCode()); |
| | | //获取2个点的距离X米 |
| | | Double getDistanceDouble = PositionUtil.getDistance(jobDetailDTO.getLnt(),jobDetailDTO.getLat(),lnt,lat); |
| | | //转换km |
| | | BigDecimal getDistance = BigDecimal.valueOf(getDistanceDouble).divide(new BigDecimal(1000),2,BigDecimal.ROUND_HALF_UP); |
| | | platformJob.setGetDistance(getDistance); |
| | | } |
| | | } |
| | | }else if( Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey()) |
| | | || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.IN_WAIT.getKey()) |
| | |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())) { |
| | | 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) |
| | | .in(SystemUser::getType, Constants.ZERO,Constants.TWO) |
| | | .eq(SystemUser::getMobile,platformJob.getDrivierPhone()) |
| | | .last(" limit 1 ")); |
| | | if (Objects.nonNull(driver) && StringUtils.isNotBlank(driver.getOpenid())) { |
| | |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())){ |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())){ |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobSingIn,platformJob); |
| | | } |
| | | |
| | |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobMove,platformJob); |
| | | } |
| | | |
| | |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())){ |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())){ |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobOverNum,platformJob); |
| | | } |
| | | |
| | |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobError,platformJob); |
| | | } |
| | | |
| | |
| | | SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null |
| | | ); |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobWorking,platformJob); |
| | | } |
| | | //广播 led通知 |
| | |
| | | ); |
| | | |
| | | //公众号模板消息 |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | if(Objects.nonNull(platformJob.getDrivierPhone())) { |
| | | this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobFinish,platformJob); |
| | | } |
| | | |
| | |
| | | List<PlatformJob> calledList = platformJobList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())).collect(Collectors.toList()); |
| | | largeScreenDataVO.setWaitWorkList(calledList); |
| | | } |
| | | // String u = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.BIGSCREEN_UUID); |
| | | // if(StringUtils.isBlank(u)){ |
| | | 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()); |