From b33f2e78ffd4fd401698b84a33dc3c293793c62f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 18 二月 2025 16:22:33 +0800
Subject: [PATCH] 最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java |   48 ++++++++++++++++++++++++++++--------------------
 1 files changed, 28 insertions(+), 20 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 ff3aea9..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
@@ -600,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(),"涓氬姟鐘舵�佸凡娴佽浆锛岃鍒锋柊鏌ョ湅");
             }
@@ -652,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());
@@ -677,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());
@@ -691,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())
@@ -886,7 +891,7 @@
         );
         
         //鍏紬鍙锋ā鏉挎秷鎭�
-        if(Objects.nonNull(platformJob.getDriverId())) {
+        if(Objects.nonNull(platformJob.getDrivierPhone())) {
           this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobCallIn,platformJob);
         }
         return platformJob;
@@ -895,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())) {
@@ -1137,7 +1142,7 @@
         );
 
         //鍏紬鍙锋ā鏉挎秷鎭�
-        if(Objects.nonNull(platformJob.getDriverId())){ 
+        if(Objects.nonNull(platformJob.getDrivierPhone())){
             this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobSingIn,platformJob);
         }
 
@@ -1273,7 +1278,7 @@
         );
 
         //鍏紬鍙锋ā鏉挎秷鎭�
-        if(Objects.nonNull(platformJob.getDriverId())) { 
+        if(Objects.nonNull(platformJob.getDrivierPhone())) {
             this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobMove,platformJob);
         }
 
@@ -1326,7 +1331,7 @@
         );
 
         //鍏紬鍙锋ā鏉挎秷鎭�
-        if(Objects.nonNull(platformJob.getDriverId())){
+        if(Objects.nonNull(platformJob.getDrivierPhone())){
             this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobOverNum,platformJob);
         }
 
@@ -1378,7 +1383,7 @@
         );
 
         //鍏紬鍙锋ā鏉挎秷鎭�
-        if(Objects.nonNull(platformJob.getDriverId())) {
+        if(Objects.nonNull(platformJob.getDrivierPhone())) {
             this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobError,platformJob);
         }
 
@@ -1432,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閫氱煡
@@ -1533,7 +1538,7 @@
         );
 
         //鍏紬鍙锋ā鏉挎秷鎭�
-        if(Objects.nonNull(platformJob.getDriverId())) {
+        if(Objects.nonNull(platformJob.getDrivierPhone())) {
             this.sendWxNotice(WxPlatConstants.platformJobContent.platformJobFinish,platformJob);
         }
 
@@ -2194,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