yangbq hace 1 mes
padre
commit
9761fd7ed8

+ 3 - 3
pom.xml

@@ -227,12 +227,12 @@
                 <version>${change.version}</version>
             </dependency>
 
-            <!-- 扩展功能 -->
+            <!-- 扩展功能
             <dependency>
                 <groupId>com.project</groupId>
                 <artifactId>project-extend</artifactId>
                 <version>${change.version}</version>
-            </dependency>
+            </dependency>-->
             <!--<dependency>
                 <groupId>com.google.zxing</groupId>
                 <artifactId>core</artifactId>
@@ -263,7 +263,7 @@
         <module>project-quartz</module>
         <module>project-generator</module>
         <module>project-common</module>
-        <module>project-extend</module>
+        <!--<module>project-extend</module>-->
         <module>project-zcustom</module>
         <module>project-xxl-job</module>
     </modules>

+ 2 - 2
project-admin/pom.xml

@@ -75,11 +75,11 @@
             <groupId>com.project</groupId>
             <artifactId>project-zcustom</artifactId>
         </dependency>
-        <!-- 扩展功能 -->
+        <!-- 扩展功能
         <dependency>
             <groupId>com.project</groupId>
             <artifactId>project-extend</artifactId>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>com.xxl.job</groupId>
             <artifactId>project-xxl-job</artifactId>

+ 39 - 1
project-admin/src/main/resources/application-prod.yml

@@ -17,6 +17,9 @@ change:
   # 当前项目 redis cookie等 变量后缀
   projectSuffix: _sxgw24
 
+upload:
+  directory: "/home/path/to/upload/directory"
+
 # 接口地址配置
 apiurl:
   # 服务保障中心接口地址
@@ -26,7 +29,7 @@ apiurl:
   logisticsUrl: http://25.39.64.51:18080/unified-access/sgcc/shanxi/monitoring/assetMetrics
 
   # 楼宇运行监控左半部 接口前缀
-  controlApiUrl: http://113.44.175.227
+  controlApiUrl: http://25.39.79.244:18080/webapi
   # 楼宇中控 楼宇本周用电量
   controlElectricity: /electricity/init
   # 楼宇中控 楼宇本周用电量机房总用电量
@@ -52,6 +55,8 @@ apiurl:
   buildPrefix: http://25.39.64.37:10611/psbims
   # 楼宇运行监控 巡更次数统计(近6月)
   jsonFrequency: /screen/patrol/frequency/statistics
+  # 办公能耗情况接口 近一周电梯能量回收的总值
+  controlElevator: /office/energy/getTotalEnergyRecoveryLastWeek
   # 办公能耗情况接口 巡更及时率
   jsonPatrol: /screen/patrol/timeliness
   # 办公能耗情况接口 巡更点统计
@@ -75,6 +80,39 @@ apiurl:
   # 办公能耗情况接口 年度累计水耗
   jsonWaterYear: /office/energy/integrationWaterForYear
 
+  # 公务用车监控 接口前缀
+  carPrefix: http://ip:port/
+  # 公务用车接口 车辆编制情况接口
+  jsonEstablishment:
+  # 公务用车接口 车辆年度变化情况接口
+  jsonCarChange:
+  # 公务用车接口 车辆年度增加情况明细接口
+  jsonCarIncrease:
+  # 公务用车接口 车辆减少增加情况明细接口
+  jsonCarReduce:
+  # 公务用车接口 车辆类型接口
+  jsonCarType:
+  # 公务用车接口 企业车辆情况接口
+  jsonEnterpriseCar:
+  # 公务用车接口 车辆能源类型接口
+  jsonCarPowerType:
+  # 公务用车接口 车辆派单及里程接口
+  jsonCarOrderAndMileage:
+  # 公务用车接口 车辆活跃度排名接口
+  jsonCarRank:
+  # 公务用车接口 车辆终端情况接口
+  jsonCarTerminal:
+  # 公务用车接口 车辆未归档接口
+  jsonCarNotArchived:
+  # 公务用车接口 车辆预警接口
+  jsonCarWarning:
+  # 公务用车接口 车辆未带工单预警明细接口
+  jsonCarWarningTickets:
+  # 公务用车接口 车辆超速预警明细接口
+  jsonCarWarningOverSpeed:
+  # 公务用车接口 车辆节假日预警明细接口
+  jsonCarWarningHoliday:
+
 znhqcamera:
   path: /usr/local/ffmpeg/bin/ffmpeg # ffmpeg安装的位置
   rtmp: rtmp://25.39.67.168:10612/myapp/ # rtmp 链接前缀

+ 50 - 8
project-zcustom/src/main/java/com/project/zcustom/service/service/smart/impl/PlatBuildingServiceImpl.java

@@ -13,10 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class PlatBuildingServiceImpl implements IPlatBuildingService {
@@ -303,10 +300,16 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
     }
 
     public Map<String, Object> getThisWeekElectricity(){
+        Map<String, Object> map = new HashMap<>();
         LargeBuildingControl largeBuildingControl = platBuildingMapper.getThisWeekElectricity();
+        if (Objects.isNull(largeBuildingControl)) {
+            JSONArray array = new JSONArray();
+            map.put("total", array);
+            map.put("room", array);
+            return map;
+        }
         JSONArray weekElectricity = JSONArray.parseArray(largeBuildingControl.getWeekElectricity());
         JSONArray roomElectricity = JSONArray.parseArray(largeBuildingControl.getRoomElectricity());
-        Map<String, Object> map = new HashMap<>();
         map.put("total", weekElectricity);
         map.put("room", roomElectricity);
         return map;
@@ -327,19 +330,30 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
 
     public List<Map<String, Object>> getTodayElectricity(){
         String json = platBuildingMapper.getTodayElectricity();
+        if (StringUtils.isBlank(json)) {
+            return new ArrayList<>();
+        }
         JSONArray jsonArray = JSONArray.parseArray(json);
         return repeatElectricity(jsonArray);
     }
 
     public Map<String, Object> getMonthElectricity(){
         LargeBuildingControl largeBuildingControl = platBuildingMapper.getMonthElectricity();
+        Map<String, Object> map = new HashMap<>();
+        if (Objects.isNull(largeBuildingControl)) {
+            List<Map<String, Object>> list = new ArrayList<>();
+            map.put("first", list);
+            map.put("second", list);
+            map.put("third", list);
+            return map;
+        }
         JSONArray x = JSONArray.parseArray(largeBuildingControl.getMonthElectricityOne());
         JSONArray y = JSONArray.parseArray(largeBuildingControl.getMonthElectricityTwo());
         JSONArray z = JSONArray.parseArray(largeBuildingControl.getMonthElectricityThree());
         List<Map<String, Object>> a = repeatElectricity(x);
         List<Map<String, Object>> b = repeatElectricity(y);
         List<Map<String, Object>> c = repeatElectricity(z);
-        Map<String, Object> map = new HashMap<>();
+
         map.put("first", a);
         map.put("second", b);
         map.put("third", c);
@@ -348,6 +362,14 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
 
     public Map<String, Object> getRoomLoad(){
         LargeBuildingControl largeBuildingControl = platBuildingMapper.getRoomLoad();
+        Map<String, Object> map = new HashMap<>();
+        if (Objects.isNull(largeBuildingControl)) {
+            List<Integer> list = new ArrayList<>();
+            map.put("first", list);
+            map.put("second", list);
+            map.put("third", list);
+            return map;
+        }
         JSONArray x = JSONArray.parseArray(largeBuildingControl.getRoomLoadOne());
         JSONArray y = JSONArray.parseArray(largeBuildingControl.getRoomLoadTwo());
         JSONArray z = JSONArray.parseArray(largeBuildingControl.getRoomLoadThree());
@@ -369,7 +391,6 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
             Integer value = (Integer) jsonObject.values().iterator().next(); // 获取第一个值(每个 JSON 对象只有一个键值对)
             c.add(value);
         }
-        Map<String, Object> map = new HashMap<>();
         map.put("first", a);
         map.put("second", b);
         map.put("third", c);
@@ -378,8 +399,17 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
 
     public Map<String, Object> getWarnDevice(){
         LargeBuildingControl largeBuildingControl = platBuildingMapper.getWarnDevice();
-        JSONObject jsonObject = JSONObject.parseObject(largeBuildingControl.getWarnDevice());
+
         Map<String, Object> map = new HashMap<>();
+        if (Objects.isNull(largeBuildingControl)) {
+            JSONObject db = new JSONObject();
+            map.put("db", db);
+            map.put("ywj", db);
+            map.put("sj", db);
+            map.put("yw", db);
+            return map;
+        }
+        JSONObject jsonObject = JSONObject.parseObject(largeBuildingControl.getWarnDevice());
         JSONObject water = jsonObject.getJSONObject("sj");
         water.put("zcdw", largeBuildingControl.getWaterControlNormalNum() + largeBuildingControl.getWaterDeviceAirNum());
         water.put("air", largeBuildingControl.getWaterDeviceAirNum());
@@ -393,6 +423,9 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
 
     public JSONArray getAbnormalPoint(String type){
         LargeBuildingControl largeBuildingControl = platBuildingMapper.getAbnormalPoint();
+        if (Objects.isNull(largeBuildingControl)) {
+            return new JSONArray();
+        }
         switch (type){
             case "1":
                 return JSONArray.parseArray(largeBuildingControl.getAbnormalPointOne());
@@ -415,6 +448,12 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
     public Map<String, Object> getWarnState(){
         LargeBuildingControl largeBuildingControl = platBuildingMapper.getWarnState();
         Map<String, Object> map = new HashMap<>();
+        if (Objects.isNull(largeBuildingControl)) {
+            List<Map<String, Object>> list = new ArrayList<>();
+            map.put("twentyThree", list);
+            map.put("minusTwo", list);
+            return map;
+        }
         map.put("twentyThree", JSONObject.parseObject(largeBuildingControl.getWaterStateOne()));
         map.put("minusTwo", JSONObject.parseObject(largeBuildingControl.getWaterStateTwo()));
         return map;
@@ -422,6 +461,9 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
 
 
     private JSONObject repeatWarnDevice(JSONObject jsonObject){
+        if (Objects.isNull(jsonObject)) {
+            return new JSONObject();
+        }
         Long x = Long.parseLong(jsonObject.getString("zcdw")) + Long.parseLong(jsonObject.getString("ycdw"));
         jsonObject.put("total", x);
         return jsonObject;

+ 1 - 1
project-zcustom/src/main/java/com/project/zcustom/tools/BuildingService.java

@@ -164,7 +164,7 @@ public class BuildingService {
             // 添加接口请求记录
             PlatApiRecord platApiRecord = new PlatApiRecord();
             platApiRecord.setApiUrl(url);
-            platApiRecord.setApiResult(result);
+            platApiRecord.setApiResult(e.getMessage());
             iPlatApiRecordService.save(platApiRecord);
             return result;
         }

+ 1 - 2
project-zcustom/src/main/resources/mapper/zcustom/unit/LargeIssueMapper.xml

@@ -144,8 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND b.del_flag = 0
           AND c.del_flag = '0'
           AND (
-            DATE( a.create_time ) BETWEEN DATE( CURDATE() - 7 )
-            AND CURDATE()
+            DATE( a.create_time ) BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE()
             )
         <if test="appOrg != '10001'">AND ( c.app_parent_org = #{appOrg} OR c.app_org = #{appOrg} )</if>
         order by a.create_time desc