From cd2f0a97ed34f4ccf3d2d4d72682285ec987e3d4 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 07 五月 2025 18:49:07 +0800
Subject: [PATCH] 代码初始化

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java |   42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
index 80e5ec4..b22d16d 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -656,6 +656,7 @@
         MinitorDataSearchRequest param = new MinitorDataSearchRequest();
         param.setResourceTypeCodes(new String[]{});
         param.setRegionIndexCode("root000000");
+        //60-娑蹭綅 61-姘村帇
         param.setResourceTypeCodes("60,61".split(","));
         param.setIncludeDown("1");
         param.setUserId("admin");
@@ -676,6 +677,8 @@
                     if(model.getValues()!=null){
                         List<MonitorDataInfoVO> dataList = new ArrayList<>();
                         for(MonitorDataValResponse v : model.getValues()){
+                            //娑插帇鍥哄畾鍊硷細254001
+                            //姘村帇鍥哄畾鍊硷細253958
                             if(Constants.equalsInteger(model.getType(),60)){
                                 if(v.getMonitorTypeCode().equals("254001")){
                                     MonitorDataInfoVO vm = new MonitorDataInfoVO();
@@ -978,10 +981,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(),
@@ -1177,15 +1181,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;
@@ -1197,7 +1205,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;
@@ -1943,11 +1951,11 @@
         );
         //鍦ㄥ洯闀挎湡鐩稿叧鏂逛汉鏁�
         data.setRelatedTotal(
-                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count()
+                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FOUR) ).count()
         );
         //鍦ㄥ洯鍐呴儴鍛樺伐浜烘暟
         data.setInternalTotal(
-                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) && Constants.equalsInteger(i.getCompanyType(),Constants.ONE)).count()
+                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) ).count()
         );
         //鍦ㄥ洯璁垮鏁伴噺
         data.setVisitTotal(
@@ -1957,6 +1965,10 @@
         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()
+        );
        /* //鍦ㄥ洯鐩稿叧鏂硅溅杈�
         data.setRelatedCarTotal(
                 (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)

--
Gitblit v1.9.3