From ebd3867b9b896afd5768f04afaf53b905d01f64b Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 19 十二月 2024 14:57:34 +0800
Subject: [PATCH] 代码初始化

---
 server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java         |   13 +-
 server/system_service/src/main/java/com/doumee/core/utils/Constants.java                                       |    2 
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java                     |    4 +
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java      |    4 +
 server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/VisitsCloudController.java                    |    1 
 server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java                                        |   32 ++++++--
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java                          |    5 +
 server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java                     |    3 
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformWorkDataVO.java |    4 
 server/system_service/src/main/java/com/doumee/dao/business/model/SmsEmail.java                                |    2 
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java       |  112 ++++++++++++++++++++++++---
 server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java                    |    1 
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java            |   13 +++
 server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java                  |    1 
 server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java                         |    2 
 15 files changed, 166 insertions(+), 33 deletions(-)

diff --git a/server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java b/server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java
index 4726292..4f08d14 100644
--- a/server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java
+++ b/server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java
@@ -153,9 +153,9 @@
         //鍙戦�佷細璁绾︽垚鍔熼�氱煡
         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){
             this.sendNotice(bookings, MeetConstants.TWO);
+            SystemUser systemUser = systemUserMapper.selectById(user.getId());
+            this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO);
         }
-        SystemUser systemUser = systemUserMapper.selectById(user.getId());
-        this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO);
 
         return bookings.getId();
     }
@@ -386,9 +386,9 @@
         //鍙戦�佷細璁�氱煡
         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){
             this.sendNotice(bookings, MeetConstants.TWO);
+            SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId());
+            this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO);
         }
-        SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId());
-        this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO);
     }
 
     @Override
@@ -458,9 +458,8 @@
         //鍙栨秷浼氳 鍙戦�佸彇娑堥�氱煡
         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){
             this.sendNotice(bookings, 3);
+            this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE);
         }
-        this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE);
-
     }
 
     @Override
@@ -1416,7 +1415,7 @@
                 if(Constants.equalsInteger(sendType,Constants.ZERO)){
                     wxPlatNotice.sendMeetingBookTemplateNotice(systemDictDataBiz,bookings,"CuoDoxOl6SFwi4NhNgOQgKSJVjDD4VCIaPYlnbv_zdY",
                             systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds);
-                }else{
+                }else if(Constants.equalsInteger(sendType,Constants.ONE)){
                     wxPlatNotice.sendMeetingBookCancelTemplateNotice(systemDictDataBiz,bookings,"CiB6vCT2InovAoQfudY-lvzLSV0-3lfz3a5GsSFCzd8",
                             systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds);
                 }
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
index 69ed8e8..2c10447 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -151,6 +151,8 @@
     public static final String HK_WXTOKEN_CONFIGID ="HK_WXTOKEN_CONFIGID" ;
     public static final String HK_WXTOKEN_TAGID ="HK_WXTOKEN_TAGID" ;
     public static final String WMS_TOTAL_STOCK_NUM ="WMS_TOTAL_STOCK_NUM" ;
+    public static final String WMS_LIQUID_LEVEL ="WMS_LIQUID_LEVEL" ;
+    public static final String WMS_PRESSURE_LEVEL ="WMS_PRESSURE_LEVEL" ;
     public static final String WX_REDIRECT_URL = "WX_REDIRECT_URL";
     public static final String HK_CHANGNEI_SCREEN_INDEXCODES = "HK_CHANGNEI_SCREEN_INDEXCODES";
     public static final String CITY_XH_REASON_ID ="CITY_XH_REASON_ID" ;
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
index e27187a..afb3039 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -2911,14 +2911,17 @@
 //            System.out.println(DateUtil.afterMinutesDate(-5));
 
 
-            List<Date> list =getThisMonthDateList();
-            for(Date d :list){
-                System.out.println(getPlusTime2(d));
-            }
-            List<Date> list1 =getThisYearMonthList();
-            for(Date d :list1){
-                System.out.println(getPlusTime2(d));
-            }
+            System.out.println(DateUtil.getBeforMonthStr(new Date(),1));
+            System.out.println(DateUtil.getBeforMonthStr(new Date(),12));
+
+//            List<Date> list =getThisMonthDateList();
+//            for(Date d :list){
+//                System.out.println(getPlusTime2(d));
+//            }
+//            List<Date> list1 =getThisYearMonthList();
+//            for(Date d :list1){
+//                System.out.println(getPlusTime2(d));
+//            }
 
 //            Date startTime = DateUtil.StringToDate("2024-05-01 08:00:00" ,"yyyy-MM-dd HH:mm:ss");
 //            Date endTime = DateUtil.StringToDate("2024-05-01 17:00:00" ,"yyyy-MM-dd HH:mm:ss");
@@ -3389,4 +3392,17 @@
     }
 
 
+    /**
+     * 鑾峰彇X澶╁悗鐨勬棩鏈�
+     * @param date
+     * @param beforMonths 涓嬫湀 -1  涓婃湀 1
+     * @return
+     */
+    public static String getBeforMonthStr(Date date,Integer beforMonths){
+        ZonedDateTime zonedDateTime = date.toInstant().atZone(ZoneId.systemDefault());
+        // 杞崲涓簀ava.time.LocalDate,璁$畻x澶╃殑鏃ユ湡
+        LocalDate dateBeforeDay = zonedDateTime.toLocalDate().minusMonths(beforMonths);
+        return dateBeforeDay.toString();
+    }
+
 }
\ No newline at end of file
diff --git a/server/system_service/src/main/java/com/doumee/dao/business/model/SmsEmail.java b/server/system_service/src/main/java/com/doumee/dao/business/model/SmsEmail.java
index 0d205a8..40ce406 100644
--- a/server/system_service/src/main/java/com/doumee/dao/business/model/SmsEmail.java
+++ b/server/system_service/src/main/java/com/doumee/dao/business/model/SmsEmail.java
@@ -78,7 +78,7 @@
     @ExcelColumn(name="鐘舵�� 0鏈娇鐢� 1宸蹭娇鐢� 2绛夊緟鍙戦��")
     private Integer status;
 
-    @ApiModelProperty(value = "绫诲瀷 0鐭俊 1閭欢")
+    @ApiModelProperty(value = "绫诲瀷 0鐭俊 1閭欢 ")
     @ExcelColumn(name="绫诲瀷 0鐭俊 1閭欢")
     private Integer type;
 
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/VisitsCloudController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/VisitsCloudController.java
index 3ed8c63..fbd5e45 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/VisitsCloudController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/VisitsCloudController.java
@@ -143,6 +143,7 @@
         visits.setMemberId(loginUserInfo.getMemberId());
         visits.setCreateMemberId(loginUserInfo.getMemberId());
         visits.setReceptMemberId(visits.getMemberId());
+        visits.setLoginUserInfo(loginUserInfo);
         return ApiResponse.success("鏌ヨ鎴愬姛", visitsService.visitReporting(visits));
     }
 
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java
index f3f15b5..2955bc4 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java
@@ -53,6 +53,7 @@
         List<AlarmEventDataVO> data  = boardService.fightingAdminAlertList();
         return ApiResponse.success(data);
     }
+
     @LoginNoRequired
     @ApiOperation("妫�娴嬫暟鎹泦鍚�")
     @GetMapping("/monitorDataList")
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
index 7782d65..9b41d15 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
@@ -240,4 +240,5 @@
     public ApiResponse<List<PlatformStatusListResponse>> getStatusList() {
         return ApiResponse.success(platformService.getPlatformStatusList());
     }
+
 }
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
index 161e8f3..5f01230 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
@@ -619,6 +619,9 @@
         String[] findHomeAlarmInfoPage= new String[]{"/api/v1/alarm/findHomeAlarmInfoPage","瀹夐槻鐪嬫澘-- 鍒嗛〉鏌ヨ鏈鐞嗘姤璀︿俊鎭�6"};//瀹夐槻鐪嬫澘-- 鍒嗛〉鏌ヨ鏈鐞嗘姤璀︿俊鎭�6
         String[] minitorDataSearchV1= new String[]{"/api/fem/v1/minitor/data/search","鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁"};//鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁
         String[] minitorDataSearch= new String[]{"/api/fpms/v2/minitor/data/search","鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁"};//鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁
+        String[] monitorDataSearch= new String[]{"/api/fpms/v2/monitor/data/search","鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁"};//鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁
+        String[] fireMonitorData= new String[]{"/api/v2/monitor/fireMonitorData","鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁"};//鍒嗛〉鏌ヨ璁惧鐩戞祴鍘嗗彶鏁版嵁
+
         String[] userOpenidSave= new String[]{"/api/v1/oa/userOpenId/saveV2","淇濆瓨鐢ㄦ埛鍙妎penId缁戝畾淇℃伅寰俊鍏紬鍙�"};//淇濆瓨鐢ㄦ埛鍙妎penId缁戝畾淇℃伅寰俊鍏紬鍙�
         String[] temperatureHumidityDataStatistic= new String[]{"/api/v2/public/monitor/sensor/list","娑堥槻鐪嬫澘-4娓╂箍搴︾粺璁�"};//娑堥槻鐪嬫澘-娓╂箍搴�
         String[] regionDataRanking= new String[]{"/api/ecm/v1/energy/regionDataRanking","娑堥槻鐪嬫澘-4鑾峰彇鍖哄煙鐢ㄩ噺鎺掑悕-鑳借�楃湅鏉�"};//娑堥槻鐪嬫澘-鑾峰彇鍖哄煙鐢ㄩ噺鎺掑悕 - 鑳借�楃湅鏉�
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
index f05520f..8b18aa6 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -896,7 +896,7 @@
 	 * @return
 	 */
 	public static String minitorDataSearch(String body) {
-		return startDoPostStringArtemis(HKConstants.InterfacePath.minitorDataSearch,body);
+		return startDoPostStringArtemis(HKConstants.InterfacePath.minitorDataSearchV1,body);
 	}
 	/**
 	 * 缁熻鍥尯鎬讳綋鐨勫畨闃茶澶囨暟閲忥紝鍦ㄧ嚎鏁般�佸湪绾跨巼銆佺绾挎暟銆佺绾跨巼
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
index 99e6b30..5c768fc 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
@@ -262,6 +262,10 @@
     @TableField(exist = false)
     private String finishTimeStr;
 
+    @ApiModelProperty(value = "浣滀笟鏈堝彴缂栫爜")
+    @TableField(exist = false)
+    private String platformCode;
+
     @ApiModelProperty(value = "浣滀笟鏈堝彴鍚嶇О")
     @TableField(exist = false)
     private String platformName ;
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
index 55bdfcb..bc3f6c0 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.core.model.LoginUserInfo;
 import com.doumee.core.model.LoginUserModel;
 import com.doumee.dao.business.vo.ApproveDataVO;
 import io.swagger.annotations.ApiModel;
@@ -315,6 +316,10 @@
     @TableField(exist = false)
     private String createMobile;
 
+    @ApiModelProperty(value = "鍚庣鍒涘缓浜�", example = "1",hidden = true)
+    @TableField(exist = false)
+    private LoginUserInfo loginUserInfo;
+
     @ApiModelProperty(value = "瀹℃壒淇℃伅鏁版嵁")
     @TableField(exist = false)
     private ApproveDataVO approveDateVO;
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java
index 5e0daa7..35e005d 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java
@@ -17,6 +17,10 @@
 
     @ApiModelProperty(value = "璁惧鎴栬�呬紶鎰熷櫒鍚嶇О")
     private String name;
+
+    @ApiModelProperty(value = "闃堝��")
+    private String level;
+    
     @ApiModelProperty(value = "鐩戞祴鏁版嵁闆嗗悎")
     private List<MonitorDataInfoVO> dataList;
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformWorkDataVO.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformWorkDataVO.java
index e03762f..7fbcb46 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformWorkDataVO.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformWorkDataVO.java
@@ -17,11 +17,13 @@
 
     @ApiModelProperty(value = "鏈堝彴鍚嶇О")
     private String platformName;
-    @ApiModelProperty(value = "鏈堝彴缂栫爜")
+    @ApiModelProperty(value = "鏈堝彴涓婚敭")
     private Integer platformId;
     @ApiModelProperty(value = "鏈堝彴鎺掑簭")
     private Integer platformSort;
 
+    @ApiModelProperty(value = "鏈堝彴缂栫爜")
+    private String platformCode;
     @ApiModelProperty(value = "杞︾墝鍙�")
     private String carNo;
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
index 2876618..d7cc716 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -331,6 +331,19 @@
         //鍒濆鍖栬瀹俊鎭�
 //        initVisitInfo(visits,date);
         visitsMapper.insert(visits);
+        if(Objects.nonNull(visits.getLoginUserInfo())){
+            SystemUser systemUser = systemUserMapper.selectById(visits.getLoginUserInfo().getId());
+            if(Objects.nonNull(systemUser)&&StringUtils.isNotBlank(systemUser.getOpenid())){
+                WxPlatNotice wxPlatNotice = new WxPlatNotice();
+                wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz,
+                        wxNoticeConfigMapper,visits,
+                        Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload,
+                        systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
+                        Arrays.asList(systemUser.getOpenid().split(","))
+                );
+            }
+        }
+
         approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId());
         return visits.getId();
     }
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 19ca4b2..95aaf3c 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
@@ -581,7 +581,7 @@
         param.setPage(1);
         param.setUserId("admin");
 //        param.setRegionIndexCodes("root000000");
-        param.setAlarmStartTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1)));
+        param.setAlarmStartTime(DateUtil.getFomartDate(new Date(),"yyyy-MM-dd") + " 00:00:00");
         param.setAlarmEndTime(DateUtil.getPlusTime2(new Date()));
         param.setPageSize(20);
         BaseResponse<BaseListPageResponse<FindHomeAlarmInfoPageResponse>> response = HKService.findHomeAlarmInfoPage(param);
@@ -608,9 +608,14 @@
         MinitorDataSearchRequest param = new MinitorDataSearchRequest();
         param.setResourceTypeCodes(new String[]{});
         param.setRegionIndexCode("root000000");
+        param.setResourceTypeCodes("60,61".split(","));
         param.setIncludeDown("1");
         param.setUserId("admin");
+        param.setPageNo(1);
+        param.setPageSize(100);
         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();
         if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
                 && response.getData()!=null ) {
             List<MonitorDataSearchResponse> r = response.getData().getList();
@@ -618,17 +623,37 @@
                 for(MonitorDataSearchResponse model : r){
                     MonitorDataVO m = new MonitorDataVO();
                     m.setName(model.getName());
+                    m.setLevel(Constants.equalsInteger(model.getType(),60)?liquid:pressure);
                     m.setDataList(new ArrayList<>());
                     if(model.getValues()!=null){
+                        List<MonitorDataInfoVO> dataList = new ArrayList<>();
                         for(MonitorDataValResponse v : model.getValues()){
-                            MonitorDataInfoVO vm = new MonitorDataInfoVO();
-                            vm.setValue(v.getMonitorValue());
-                            vm.setCateName(v.getMonitorSpecificName());
-                            vm.setCateCode(v.getMonitorTypeKey());
-                            vm.setTypeCode(v.getMonitorTypeCode());
-                            vm.setTypeName(v.getMonitorTypeName());
+                            if(Constants.equalsInteger(model.getType(),60)){
+                                if(v.getMonitorTypeCode().equals("254001")){
+                                    MonitorDataInfoVO vm = new MonitorDataInfoVO();
+                                    vm.setValue(v.getMonitorValue());
+                                    vm.setCateName(v.getMonitorSpecificName());
+                                    vm.setCateCode(v.getMonitorTypeKey());
+                                    vm.setTypeCode(v.getMonitorTypeCode());
+                                    vm.setTypeName(v.getMonitorTypeName());
+                                    dataList.add(vm);
+                                }
+                            }else{
+                                if(v.getMonitorTypeCode().equals("253958")){
+                                    MonitorDataInfoVO vm = new MonitorDataInfoVO();
+                                    vm.setValue(v.getMonitorValue());
+                                    vm.setCateName(v.getMonitorSpecificName());
+                                    vm.setCateCode(v.getMonitorTypeKey());
+                                    vm.setTypeCode(v.getMonitorTypeCode());
+                                    vm.setTypeName(v.getMonitorTypeName());
+                                    dataList.add(vm);
+                                }
+                            }
+
                         }
+                        m.setDataList(dataList);
                     }
+                    list.add(m);
                 }
             }
         }
@@ -1268,18 +1293,22 @@
         BigDecimal carbonWater = new BigDecimal(0);//鏈湀鐢ㄦ按
         BigDecimal carbonElec = new BigDecimal(0);//鐢ㄧ數
 
+        data.setYesterdayElectricity(getDefaultData());//鏄ㄦ棩鐢ㄧ數
         data.setTodayElectricity(getDefaultData());//浠婃棩鐢ㄧ數
         data.setElectricityQuantity(getDefaultData());//涓婃湀鐢ㄧ數
-        data.setWaterQuantity(getDefaultData());//涓婃湀鐢ㄦ按
-        data.setGasQuantity(getDefaultData());//涓婃湀鐢ㄦ皵
         data.setMonthElectricity(getDefaultData());//鏈湀鐢ㄧ數
-        data.setYesterdayElectricity(getDefaultData());//鏄ㄦ棩鐢ㄧ數
+
+
         getMonthElectricityData(data.getMonthElectricity());//閫氳繃瀹夐槻骞宠幏鍙栨湰鏈堢敤鐢甸噺鏁版嵁
         carbonElec = new BigDecimal(StringUtils.defaultString(data.getMonthElectricity().getTotal(), "0"));
 
         getLastMonthElectricityData(data.getElectricityQuantity());//閫氳繃瀹夐槻骞宠幏鍙栦笂鏈堢敤鐢甸噺鏁版嵁
-        getCurrentDateElectircityData(data.getTodayElectricity(),0);//閫氳繃瀹夐槻骞宠幏鍙栦粖鏃ョ敤鐢甸噺鏁版嵁
         getCurrentDateElectircityData(data.getYesterdayElectricity(),-1);//閫氳繃瀹夐槻骞宠幏鍙栨槰鏃ョ敤鐢甸噺鏁版嵁
+        getCurrentDateElectircityData(data.getTodayElectricity(),0);//閫氳繃瀹夐槻骞宠幏鍙栦粖鏃ョ敤鐢甸噺鏁版嵁
+
+        data.setWaterQuantity(getDefaultData());//涓婃湀鐢ㄦ按
+        data.setGasQuantity(getDefaultData());//涓婃湀鐢ㄦ皵
+        carbonElec = new BigDecimal(StringUtils.defaultString(data.getMonthElectricity().getTotal(), "0"));
         String firstDate = DateUtil.getFirstDayCurrentMonth() +" 00:00:00";
         Date month0 = DateUtil.getDateFromString(firstDate);
         Date month1 = DateUtil.increaseMonth(month0,-1);//涓婃湀
@@ -1369,12 +1398,62 @@
      */
     private void getLastMonthElectricityData(EnergyModelDataVO data) {
          BaseResponse<LastMonthFeeByMeterTypeResponse> response = HKService.lastMonthFeeByMeterType("1");
-        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){
-           data.setRingRate(StringUtils.defaultString(response.getData().getRingPercent(),"0"));
-           data.setSameRate(StringUtils.defaultString(response.getData().getSamePercent(),"0"));
-           data.setTotal(StringUtils.defaultString(response.getData().getValue(),"0"));
+//        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){
+//           data.setRingRate(StringUtils.defaultString(response.getData().getRingPercent(),"0"));
+//           data.setSameRate(StringUtils.defaultString(response.getData().getSamePercent(),"0"));
+//           data.setTotal(StringUtils.defaultString(response.getData().getValue(),"0"));
+//        }
+//        String nowMonth = DateUtil.getFomartDate(new Date(),"yyyy-MM-dd");
+//        //涓婃湀鏃ユ湡
+//        DateUtil.getBeforMonthStr(new Date(),1);
+//        //涓婁笂鏈堟棩鏈�
+//        DateUtil.getBeforMonthStr(new Date(),2);
+//        //涓婂勾鏃ユ湡
+//        DateUtil.getBeforMonthStr(new Date(),13);
+
+        EnergyTotalDataRequest param = new EnergyTotalDataRequest();
+        param.setPeriodType("month");
+        param.setDate(DateUtil.getBeforMonthStr(new Date(),1).substring(0,7));
+        BaseResponse<EnergyTotalDataResponse> beforMonthResponse = HKService.energyTotal(param);
+        if(beforMonthResponse != null && StringUtils.equals(beforMonthResponse.getCode(), HKConstants.RESPONSE_SUCCEE) && beforMonthResponse.getData()!=null ){
+            data.setTotal(beforMonthResponse.getData().getElectricity());
+            data.setTotalNum(new BigDecimal(beforMonthResponse.getData().getElectricity()));
+        }
+        param.setDate(DateUtil.getBeforMonthStr(new Date(),2).substring(0,7));
+        BaseResponse<EnergyTotalDataResponse> beforBeforMonthResponse = HKService.energyTotal(param);
+        if(beforBeforMonthResponse != null && StringUtils.equals(beforBeforMonthResponse.getCode(), HKConstants.RESPONSE_SUCCEE) && beforBeforMonthResponse.getData()!=null ){
+            if(Objects.nonNull(beforBeforMonthResponse.getData()) && StringUtils.isNotBlank(beforBeforMonthResponse.getData().getElectricity())){
+                data.setRingNum(new BigDecimal(beforBeforMonthResponse.getData().getElectricity()));
+            }else{
+                data.setRingNum(BigDecimal.ZERO);
+            }
+            if(Objects.isNull(data.getTotal()) || Objects.isNull(data.getRingNum())
+                    || data.getTotalNum().compareTo(BigDecimal.ZERO) ==0  || data.getRingNum().compareTo(BigDecimal.ZERO) ==0 ){
+               data.setRingRate("0");
+            }else{
+               data.setRingRate(new BigDecimal(data.getTotal()).divide(data.getRingNum(),2,BigDecimal.ROUND_HALF_UP).toString());
+            }
+        }
+        param.setDate(DateUtil.getBeforMonthStr(new Date(),13).substring(0,7));
+        BaseResponse<EnergyTotalDataResponse> beforYearMonthResponse = HKService.energyTotal(param);
+        if(beforYearMonthResponse != null && StringUtils.equals(beforYearMonthResponse.getCode(), HKConstants.RESPONSE_SUCCEE) && beforBeforMonthResponse.getData()!=null ){
+            if(Objects.nonNull(beforYearMonthResponse.getData()) && StringUtils.isNotBlank(beforYearMonthResponse.getData().getElectricity())){
+                data.setSameNum(new BigDecimal(beforYearMonthResponse.getData().getElectricity()));
+            }else{
+                data.setSameNum(BigDecimal.ZERO);
+            }
+            if(Objects.isNull(data.getTotal()) || Objects.isNull(data.getSameNum())
+                    || data.getTotalNum().compareTo(BigDecimal.ZERO) ==0  || data.getSameNum().compareTo(BigDecimal.ZERO) ==0 ){
+                data.setSameRate("0");
+            }else{
+                data.setSameRate(new BigDecimal(data.getTotal()).divide(data.getSameNum(),2,BigDecimal.ROUND_HALF_UP).toString());
+            }
         }
     }
+
+
+
+
 
     /**
      * 閫氳繃瀹夐槻骞宠幏鍙栦粖鏃ョ敤鐢甸噺
@@ -1668,18 +1747,21 @@
         if(platformList!=null && platformList.size()>0){
             List<PlatformJob> jobList = platformJobMapper.selectJoinList(PlatformJob.class, new MPJLambdaWrapper<PlatformJob>()
                     .selectAll( PlatformJob.class)
+//                    .selectAs(Platform::getCode,PlatformJob::getPlatformCode)
                     .select("( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = "+Constants.PlatformJobLogType.WORKING.getKey()+"  order by pl.CREATE_DATE desc  limit 1  ) as newStartDate")
                     //.select(" (  select sum(ifnull(pl.IO_QTY , 0 ))   from platform_wms_detail pl  where   pl.job_id = t.id and pl.isdeleted=0 )",PlatformJob::getWorkNum)
                     .select(" (  case when t.total_num is null  then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id  ) else t.total_num end )",PlatformJob::getWorkNum)
                     .apply("to_days(t.create_date) = to_days(now())")
                     .eq(Platform::getIsdeleted, Constants.ZERO)
                     .in(PlatformJob ::getStatus,new Integer[]{Constants.PlatformJobStatus.WORKING.getKey(),Constants.PlatformJobStatus.CALLED.getKey() })
+//                    .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                     .orderByDesc(PlatformJob::getStatus ));
             //鏈堝彴鐘舵�侊細0=浣滀笟涓紱1=绌洪棽涓紱2=浣滀笟瓒呮椂;3=鍙彿
             for(Platform model : platformList){
                 PlatformWorkDataVO platformDurationVO = new PlatformWorkDataVO();
                 platformDurationVO.setPlatformName(model.getName());
                 platformDurationVO.setPlatformId(model.getId());
+                platformDurationVO.setPlatformCode(model.getCode());
                 platformDurationVO.setPlatformSort(model.getSortnum());
                 PlatformJob job = getJobFromListById(model.getId(),jobList);
                 if(job != null){

--
Gitblit v1.9.3