liukangdong
2025-02-24 9a66d3a382406eda71b09ed06ddb5d4a0dc95989
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,6 +694,7 @@
        if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
            //待签到 计算距离
            if(Objects.nonNull(jobDetailDTO.getLnt())&&Objects.nonNull(jobDetailDTO.getLat())){
                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());
@@ -699,6 +703,7 @@
                //转换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());