From f178ae90880c3ee639a384d3df9bfb70ff415aa4 Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期二, 25 二月 2025 17:31:11 +0800 Subject: [PATCH] 代码初始化 --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java | 57 ++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 34 insertions(+), 23 deletions(-) diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java index 3135e0c..f49d098 100644 --- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java +++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java @@ -297,8 +297,8 @@ .apply(pageWrap.getModel().getQueryStatus() != null, " find_in_set(t.`STATUS`,'"+pageWrap.getModel().getQueryStatus()+"')") .apply(pageWrap.getModel().getQueryStatusForPower() != null, " find_in_set(t.`STATUS`,'"+pageWrap.getModel().getQueryStatusForPower()+"')") .apply(pageWrap.getModel().getQueryType() != null, " find_in_set(t.TYPE,'"+pageWrap.getModel().getQueryType()+"')") - .ge(pageWrap.getModel().getCreateDateStart() != null, PlatformJob::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDateStart())) - .le(pageWrap.getModel().getCreateDateEnd() != null, PlatformJob::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDateEnd())) + .ge(pageWrap.getModel().getCreateDateStart() != null, PlatformJob::getCreateDate, pageWrap.getModel().getCreateDateStart()) + .le(pageWrap.getModel().getCreateDateEnd() != null, PlatformJob::getCreateDate, pageWrap.getModel().getCreateDateEnd()) .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().getBeginDoneDateStart() != null, PlatformJob::getDoneDate, Utils.Date.getStart(pageWrap.getModel().getBeginDoneDateStart())) @@ -471,7 +471,9 @@ platformJob.setWaitTime("棰勮绛夊緟锛�-灏忔椂-鍒嗛挓"); } }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey()) - || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.DONE.getKey())){ + || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.DONE.getKey()) + || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) + || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.LEAVED.getKey())){ //鏌ヨ鏈�鍚庡紑濮嬩换鍔$殑鏈堝彴璁板綍 鏃ュ織琛� 鍥犱负瀛樺湪寮傚父鎸傝捣 杞Щ 绛夐棶棰� PlatformLog platformLog = platformLogMapper.selectOne(new QueryWrapper<PlatformLog>().lambda() .eq(PlatformLog::getJobId,platformJob.getId()) @@ -494,6 +496,7 @@ } } + platformJob.setWorkTimeStr(DateUtil.getTimeStrBySecond(platformJob.getWorkTime())); } @@ -597,11 +600,17 @@ 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(),"涓氬姟鐘舵�佸凡娴佽浆锛岃鍒锋柊鏌ョ湅"); } @@ -649,7 +658,6 @@ || 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()); @@ -674,11 +682,9 @@ } } - @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()); @@ -688,14 +694,16 @@ 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涓偣鐨勮窛绂籜绫� - 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涓偣鐨勮窛绂籜绫� + 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()) @@ -883,7 +891,7 @@ ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())) { + if(Objects.nonNull(platformJob.getDrivierPhone())) { this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobCallIn,platformJob); } return platformJob; @@ -892,7 +900,7 @@ 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())) { @@ -1134,7 +1142,7 @@ ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())){ + if(Objects.nonNull(platformJob.getDrivierPhone())){ this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobSingIn,platformJob); } @@ -1270,7 +1278,7 @@ ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())) { + if(Objects.nonNull(platformJob.getDrivierPhone())) { this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobMove,platformJob); } @@ -1323,7 +1331,7 @@ ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())){ + if(Objects.nonNull(platformJob.getDrivierPhone())){ this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobOverNum,platformJob); } @@ -1375,7 +1383,7 @@ ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())) { + if(Objects.nonNull(platformJob.getDrivierPhone())) { this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobError,platformJob); } @@ -1429,7 +1437,7 @@ SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())) { + if(Objects.nonNull(platformJob.getDrivierPhone())) { this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobWorking,platformJob); } //骞挎挱 led閫氱煡 @@ -1530,7 +1538,7 @@ ); //鍏紬鍙锋ā鏉挎秷鎭� - if(Objects.nonNull(platformJob.getDriverId())) { + if(Objects.nonNull(platformJob.getDrivierPhone())) { this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobFinish,platformJob); } @@ -2191,8 +2199,11 @@ 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()); -- Gitblit v1.9.3