k94314517
2025-07-02 095d19dff25e37c8abf3cf197a4bdac6a2b3ecd5
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -93,7 +93,8 @@
    private TmsService tmsService;
    @Autowired
    private PlatformDeviceMapper platformDeviceMapper;
    @Autowired
    private CategoryMapper categoryMapper;
    @Value("${debug_model}")
    private Boolean isDebug;
    /**
@@ -620,6 +621,9 @@
            if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
                throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~");
            }
            if(Objects.nonNull(response.getData().getList())){
                return data;
            }
            for(FindHomeAlarmInfoPageResponse r : response.getData().getList()){
                AlarmEventDataVO t = new AlarmEventDataVO();
                BeanUtils.copyProperties(r,t);
@@ -1000,13 +1004,21 @@
    /**
     * 【消防管控】看板-告警信息集合
     *
     * @param type 0/null  = 当天;1=当月;2=当年
     * @return
     *
     */
    @Override
    public   AlarmDataVO alarmDataSumByCate(){
        AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(Utils.Date.getStart(new Date()))
    public   AlarmDataVO alarmDataSumByCate(Integer type){
        Date startDate = Utils.Date.getStart(new Date());
        if(Objects.nonNull(type)){
            if(Constants.equalsInteger(type,Constants.TWO)){
                startDate = Utils.Date.getStart(DateUtil.getFirstThisYearDate());
            }else if(Constants.equalsInteger(type,Constants.ONE)){
                startDate = Utils.Date.getStart(DateUtil.getFirstThisMonthDate());
            }
        }
        AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(startDate)
                ,(DateUtil.getPlusTime2(new Date())));
        return  alarmDataVO;
    }
@@ -1319,12 +1331,12 @@
        }
        //获取开始时间
        List<Long> startTimeList = platformLogList.stream().filter(i->Objects.nonNull(i.getParam1()))
                .filter(i->DateUtil.formatDate(null,i.getParam1()).equals(today))
                .filter(i->Objects.nonNull(i.getParam1())&&i.getParam1().indexOf(today)>=0)
                .map(i->DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",i.getParam1()).getTime()).collect(Collectors.toList());
        Long startTime  = Collections.min(startTimeList);
        //获取结束时间
        List<Long> endTimeList = platformLogList.stream()
                .filter(i->Objects.nonNull(i.getParam2())&&DateUtil.formatDate(null,i.getParam2()).equals(today))
                .filter(i->Objects.nonNull(i.getParam2())&&i.getParam2().indexOf(today)>=0)
                .map(i->DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",i.getParam2()).getTime()).collect(Collectors.toList());
        Long endTime = Collections.max(endTimeList);
        if(Objects.isNull(startTime)
@@ -1333,14 +1345,6 @@
        }
        return   totalAmount.divide(new BigDecimal(( endTime - startTime )+"").divide(new BigDecimal("3600000"),2,BigDecimal.ROUND_HALF_UP),2,BigDecimal.ROUND_HALF_UP) ;
    }
    private BigDecimal  getSumTotalByList(List<PlatformJob> list,Integer type,Integer status) {
@@ -2060,7 +2064,7 @@
        data.setInParkCarTotal(
                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count()
        );
        //在园车辆
        //当前在园货车司机总数
        data.setInParkCarUserTotal(
                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FIVE)).count()
        );
@@ -2095,8 +2099,44 @@
                        &&Constants.equalsInteger(i.getCarType(),Constants.RetentionCarType.wxysCar)).count()
        );
        data.setVideoPluginUrl(getVideoUrl());
        data.setOutHyLotTotal(Integer.valueOf(systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.OUT_HY_LOT_TOTAL).getCode()));
        data.setInParkCarList(this.getInParkCars(data));
        return data;
    }
    public List<Map<String,Object>> getInParkCars(SecurityBoardVO securityBoardVO){
        List<Map<String,Object>> mapList = categoryMapper.selectJoinMaps(new MPJLambdaWrapper<Category>()
                .select(Category::getName)
                .select(" ( select count(1) from retention r where r.isdeleted = 0 and  r.CATEGORY_PARENT_ID = t.id and r.TYPE = 3   ) as total ")
                .eq(Category::getType,Constants.ONE)
                .eq(Category::getIsdeleted,Constants.ZERO)
                .isNull(Category::getParentId)
                .groupBy(Category::getName)
        );
        if(CollectionUtils.isEmpty(mapList)){
            mapList = new ArrayList<>();
        }
        Map<String,Object> map = new HashMap<>();
        map.put("name","未知车辆");
        map.put("total", retentionMapper.selectCount(
                new MPJLambdaWrapper<Retention>()
                        .eq(Retention::getIsdeleted,Constants.ZERO)
                        .isNull(Retention::getCategoryId)
                        .eq(Retention::getCarType,Constants.SIX)
                    )
        );
        mapList.add(map);
        return mapList;
    }
    private String getVideoUrl() {
        return  systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()+"plugin/VideoWebPlugin.exe";
@@ -3110,7 +3150,6 @@
            }
        }
        return r ;
    }