From ea0698e0384aa60d3e2bad7da5efd7ea4fb8cf71 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 08 五月 2025 15:39:42 +0800
Subject: [PATCH] 最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java |  104 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 81 insertions(+), 23 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..126b630 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
@@ -647,6 +647,8 @@
     }
     /**
      * 銆愭秷闃茬鎺с�戠湅鏉�-瀹炴椂鐩戞祴鏁版嵁
+     * 娑插帇鍥哄畾鍊硷細254001
+     * 姘村帇鍥哄畾鍊硷細253958
      * @return
      *
      */
@@ -656,6 +658,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");
@@ -664,6 +667,8 @@
         BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>> response = HKService.minitorDataSearch(param);
         String pressure = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_PRESSURE_LEVEL).getCode();
         String liquid = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_LIQUID_LEVEL).getCode();
+        String pressureUnit = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.PRESSURE_LEVEL_UNIT).getCode();
+        String liquidUnit = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LIQUID_LEVEL_UNIT).getCode();
         if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
                 && response.getData()!=null ) {
             List<MonitorDataSearchResponse> r = response.getData().getList();
@@ -671,11 +676,15 @@
                 for(MonitorDataSearchResponse model : r){
                     MonitorDataVO m = new MonitorDataVO();
                     m.setName(model.getName());
-                    m.setLevel(Constants.equalsInteger(model.getType(),60)?liquid:pressure);
+                    m.setType(model.getType());
+//                    m.setLevel(Constants.equalsInteger(model.getType(),60)?liquid:pressure);
+                    m.setLevel(getLevelDataByDeviceName(m,model.getName(),Constants.equalsInteger(model.getType(),60)?liquidUnit:pressureUnit));
                     m.setDataList(new ArrayList<>());
                     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();
@@ -683,7 +692,6 @@
                                     vm.setCateName(v.getMonitorSpecificName());
                                     vm.setCateCode(v.getMonitorTypeKey());
                                     vm.setTypeCode(v.getMonitorTypeCode());
-                                    vm.setTypeName(v.getMonitorTypeName());
                                     dataList.add(vm);
                                 }
                             }else{
@@ -706,6 +714,46 @@
             }
         }
         return  list;
+    }
+
+    private String getLevelDataByDeviceName(MonitorDataVO m,String name,String unit) {
+
+        /**
+         *   {
+         *     "name":"娑�",
+         *     "regionIndexCodes": [
+         *         "root000000"
+         *     ],
+         *     "isSubRegion": true,
+         *     "resourceType": "fireSensor",
+         *     "pageNo": 1,
+         *     "pageSize": 20,
+         *     "orderBy": "name",
+         *     "orderType": "desc"
+         *     }
+         */
+        String r = "";
+
+        ResourcesByParamsRequest param = new ResourcesByParamsRequest();
+        param.setName(name);
+        param.setIsSubRegion(Boolean.TRUE);
+        param.setRegionIndexCodes(new String[]{"root000000"});
+        param.setResourceType("fireSensor");
+        param.setOrderType("desc");
+        param.setOrderBy("name");
+        param.setPageNo(1);
+        param.setPageSize(20);
+        BaseResponse<BaseListPageResponse<ResourcesByParamsResponse>> response = HKService.resourcesByParams(param);
+        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
+                && response.getData()!=null ) {
+            String min  = response.getData().getList().get(0).getFireproChannelMinValue();
+            String max  = response.getData().getList().get(0).getFireproChannelMaxvalue();
+            m.setMax(max);
+            m.setMin(min);
+            r  =StringUtils.defaultString(min,"-")+"锝�"+StringUtils.defaultString(max,"-") +unit;
+        }
+        return  r;
+
     }
 
 
@@ -978,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(),
@@ -1177,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;
@@ -1197,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;
@@ -1943,11 +1996,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(
@@ -1956,6 +2009,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(
@@ -2727,17 +2784,18 @@
                     t =new WholeProvinceMapVO();
                     t.setMonthNum( Constants.formatBigdecimal0Float(model.getMonthOutboundQuantity()));
                     t.setYearNum( Constants.formatBigdecimal0Float(model.getYearOutboundQuantity()));
-
-                    if(Constants.UNIT_TYPE == 1) {
-                        //澶勭悊鍗曚綅鎴愨�滅鈥濓紝涓�绠�=5涓囨敮
-                        t.setMonthNum(Constants.formatBigdecimal(t.getMonthNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
-                        t.setYearNum(Constants.formatBigdecimal(t.getYearNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
-                    }
                     t.setProvinceCode(model.getToProvinceCode());
                     t.setProvinceName(model.getToProvinceName());
                     result.add(t);
                 }
             }
+            if(Constants.UNIT_TYPE == 1) {
+             for(WholeProvinceMapVO t : result){
+                    //澶勭悊鍗曚綅鎴愨�滅鈥濓紝涓�绠�=5涓囨敮
+                    t.setMonthNum(Constants.formatBigdecimal(t.getMonthNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
+                    t.setYearNum(Constants.formatBigdecimal(t.getYearNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
+                }
+            }
         }
         return result;
     }

--
Gitblit v1.9.3