jiangping
2025-05-07 c98f5eee8777711610dfeaf85ad4b7a92d476e6a
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -1026,10 +1026,11 @@
        Date lastYear = DateUtil.addYearToDate(year,-1);//去年
        List<PlatformJob>  monthNum = platformJobMapper.selectJoinList(PlatformJob.class,
                    new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .select(PlatformJob::getType,PlatformJob::getType)
                        .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select(PlatformJob::getStatus,PlatformJob::getStatus)
                            .selectAs(PlatformJob::getId,PlatformJob::getId)
                            .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                            .selectAs(PlatformJob::getDoneDate,PlatformJob::getDoneDate)
                            .select(PlatformJob::getStatus,PlatformJob::getStatus)
                            .select(PlatformJob::getType,PlatformJob::getType)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),
@@ -1225,15 +1226,19 @@
        }
        if(CollectionUtils.isNotEmpty(jobList)){
            //获取任务数据
            List<String> jobDataList = list.stream().filter(i->Objects.nonNull(i.getDoneDate())).map(i->DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd")).collect(Collectors.toList());
            for (String jobDate:jobDataList) {
                //过滤当天的数据
                List<PlatformJob> platformJobList = list.stream().
                        filter(i->jobDate.equals(DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd"))).collect(Collectors.toList());
                if(CollectionUtils.isNotEmpty(platformJobList)){
                    //获取今天的
                    r = r.add(this.getDayTotalRata(getSumTotalByList(platformJobList,type,null),jobDate));
            List<String> jobDataList = jobList.stream().filter(i->Objects.nonNull(i.getDoneDate()))
                    .map(i->DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd")).collect(Collectors.toList());
            if(CollectionUtils.isNotEmpty(jobDataList)){
                for (String jobDate:jobDataList) {
                    //过滤当天的数据
                    List<PlatformJob> platformJobList = list.stream().
                            filter(i->jobDate.equals(DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd"))).collect(Collectors.toList());
                    if(CollectionUtils.isNotEmpty(platformJobList)){
                        //获取今天的
                        r = r.add(this.getDayTotalRata(getSumTotalByList(platformJobList,type,null),jobDate));
                    }
                }
                r = r.divide(new BigDecimal(Integer.toString(jobList.size())),2,BigDecimal.ROUND_HALF_UP);
            }
        }
        return r;
@@ -1245,7 +1250,7 @@
        //查询今日最早/最晚的作业数据
        List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>()
                .lambda()
                .apply(" ( to_days(param1) =  '"+today+"' or to_days(param2) =  '"+today+"' ) ")
                .apply(" (  DATE_FORMAT( param1 ,'%Y-%m-%d' ) =  '"+today+"' or DATE_FORMAT( param2 ,'%Y-%m-%d' )  =  '"+today+"' ) ")
        );
        if(totalAmount.compareTo(BigDecimal.ZERO)==0||CollectionUtils.isEmpty(platformLogList)){
            return BigDecimal.ZERO;