From bf0eb543e2deab8a1629dd2a46f8e1cd191531e1 Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期四, 17 七月 2025 15:22:01 +0800
Subject: [PATCH] Merge branch 'master' of http://103.135.160.14:9034/r/NslWeb

---
 src/api/hpApi.js |  245 +++++++++++++++++++++++++++++-------------------
 1 files changed, 148 insertions(+), 97 deletions(-)

diff --git a/src/api/hpApi.js b/src/api/hpApi.js
index 23e827e..9c220ff 100644
--- a/src/api/hpApi.js
+++ b/src/api/hpApi.js
@@ -39,6 +39,7 @@
   console.log("getSafeLocation:", response);
   return response.data;
 }
+
 // 鑾峰彇閬块櫓绾胯矾
 export async function getEscapeRoute(data) {
   const response = await axios.post("/hp/escapeRoute/getData", {
@@ -49,6 +50,7 @@
   console.log("getEscapeRoute:", response);
   return response.data;
 }
+
 // 鑾峰彇浼犳劅鍣ㄥ垪琛�
 export async function getSensor(data) {
   const response = await axios.post("/hp/sensor/getData", {
@@ -59,6 +61,7 @@
   console.log("getSensor:", response);
   return response.data;
 }
+
 // 鑾峰彇闆ㄩ噺鏁版嵁
 export async function getRainfallData() {
   const response = await axios.post("/hp/rainfallCountyCity/getData", {
@@ -69,62 +72,36 @@
   return response.data;
 }
 
-// 鑾峰彇鐞夌拑搴欓晣鐩戞祴璁惧淇℃伅
-export async function getDeviceInfoShg(data) {
-  const response = await axios.post("/hp/deviceInfo/getData", {
-    filterObject: {
-      "dictDeviceType": data,
-      "townCode": "110116110000"
-    },
-    "pageSize": 10000
+// 鎸夌収鍖椾含甯俢ode鏌ヨ琛屾斂鍖篶ode
+export async function getAeraCode() {
+  const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerCountByDistrict", {
+    "dictDisasterGrade": "",
+    "dictDisasterType": "",
+    "dictRiskLevel": "",
+    "districtCode": "110000000000",
+    "dictThreatObj": "",
+    "year": "2025"
   });
   return response.data;
 }
 
-// 鑾峰彇鍖椾含甯傜洃娴嬭澶囦俊鎭�
-export async function getDeviceInfo(data) {
-  const response = await axios.post("/hp/deviceInfo/getData", {
-
-    "currentPage": 1,
-    "pageSize": 10000,
-    "filterObject": {
-      "belongObjList": [
-        "1797461961110261762"
-      ],
-      "townCode": data
-      // "id": "",
-      // "deviceName": "",
-      // "deviceCode": "",
-      // "deviceClientId": "",
-      // "dictDeviceType": "",
-      // "hdName": "",
-      // "installUnit": "",
-      // "rtuUnit": "",
-      // "dictDisasterType": "",
-      // "dictCommunicationType": "",
-      // "dictDeviceStatus": "",
-      // "divisionDistrict": "",
-    },
-    "sortedList": [
-      {
-        "sorted": "createTime",
-        "type": "desc"
-      }
-    ]
-  })
-
+// 鎸夌収琛屾斂鍖篶ode鏌ヨ涔¢晣code(姝ゆ帴鍙e寘鍚殣鎮g偣鏁伴噺鏌ヨ)
+export async function getAeraTownCode(data) {
+  const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerTownCount", {
+    "dictDisasterGrade": "",
+    "dictDisasterType": "",
+    "dictRiskLevel": "",
+    "districtCode": data,
+    "dictThreatObj": "",
+    "year": "2025"
+  });
   return response.data;
 }
 
-
-// 鑾峰彇闅愭偅鐐逛俊鎭�
+// 鏍规嵁涔¢晣Code鑾峰彇闅愭偅鐐�(姝ゆ帴鍙e寘鍚殣鎮g偣鏁伴噺鏌ヨ)
 export async function getDangerPoint(data) {
-
   const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", {
-
     filterObject: {
-      // divisionCounty鍏跺疄鍙互涓嶄紶
-      // "divisionCounty": divisionCounty,
       "divisionTown": data,
       "year": 2025
     },
@@ -133,44 +110,86 @@
   return response.data;
 }
 
-// export async function fetchAndLoadDangerPoints(loadCallback) {
-//   let currentPage = 1;
-//   const pageSize = 100; // 姣忔璇锋眰鐨勬暟鎹噺
 
-//   while (true) {
-//     try {
-//       const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", {
-//         filterObject: {
-//           divisionCounty: "110111000000",
-//           divisionTown: null,
-//           year: 2025
-//         },
-//         pageSize: pageSize,
-//         currentPage: currentPage // 娣诲姞褰撳墠椤电爜鍙傛暟
-//       });
+// 鍒嗛〉鑾峰彇琛屾斂鍖哄垝闅愭偅鐐逛俊鎭�
+export async function getDangerPointByPage(data, pageNum) {
+  const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", {
+    filterObject: {
+      "divisionCounty": data,
+      "year": 2025
+    },
+    "pageSize": 50,
+    "pageNum": pageNum,
+  });
+  return response.data;
+}
 
-//       const pageData = response.data?.data?.pageData;
 
-//       if (!Array.isArray(pageData)) {
-//         console.error("Expected an array in 'pageData', but got:", typeof pageData, pageData);
-//         break;
-//       }
+// 鐩戞祴璁惧鎺ュ彛
+/**
+ * @param {string} data - 闆ㄩ噺璁¤澶囩被鍨媔d
+ * @param {string} townCode - 涔¢晣code,鍙互鏌ヨ涔¢晣鐩戞祴璁惧淇℃伅
+ */
+export async function getDeviceInfo(data, townCode) {
+  const response = await axios.post("/hp/deviceInfo/getData", {
+    filterObject: {
+      "dictCommunicationType": data,
+      "townCodeList": [townCode],
+      "year": 2025,
+      // 鎵�灞為」鐩�
+      "belongObjList": [
+        "1797461961110261762"
+      ],
+    },
+    "pageSize": 10000
+  });
+  return response.data;
+}
 
-//       if (pageData.length === 0) break; // 娌℃湁鏇村鏁版嵁浜�
+// 鎺ュ彛澶氬啓鍑犱釜搴旇鏃犲Θ鍚�
+export async function getDeviceNWJ(data, townCode) {
+  const response = await axios.post("/hp/deviceInfo/getData", {
+    filterObject: {
+      "dictDeviceTypeList": [data],
+      "townCodeList": [townCode],
+      "year": 2025,
+    },
+    "pageSize": 10000
+  });
+  return response.data;
+}
 
-//       // 璋冪敤浼犲叆鐨勫洖璋冨嚱鏁帮紝鐢ㄤ簬鏇存柊椤甸潰鍐呭
-//       loadCallback(pageData);
+// 鏌ヨ瀛欒儭娌熺洃娴嬭澶囷紝dictCommunicationType涓烘煡璇㈠瓩鑳℃矡鐨勯洦閲忚
+export async function getDeviceInfoSHG(data) {
+  const response = await axios.post("/hp/deviceInfo/getData", {
+    filterObject: {
+      "dictCommunicationType": data,
+      "townCodeList": ["110116110000"],
+      "year": 2025,
+    },
+    "pageSize": 10000
 
-//       if (pageData.length < pageSize) break; // 濡傛灉鏈杩斿洖鐨勬暟鎹皯浜巔ageSize锛岃鏄庡凡鑾峰彇瀹屾墍鏈夋暟鎹�
+  });
+  return response.data;
+}
 
-//       currentPage++; // 鏇存柊涓嬩竴椤电殑椤电爜
-//     } catch (error) {
-//       console.error("Error fetching danger points:", error);
-//       break;
-//     }
-//   }
-// }
 
+// 鍒嗛〉鏌ヨ琛屾斂鍖哄垝鐩戞祴璁惧淇℃伅
+export async function getDeviceInfoByPage(data, pageNum) {
+  const response = await axios.post("/hp/deviceInfo/getData", {
+    filterObject: {
+      "divisionDistrictList": [data],
+      // 鎵�灞為」鐩�
+      // 濡傛灉涓嶅姞杩欎釜锛屽垯杩斿洖鐨勫叏鏄己闇囦华锛�1933099069385355265锛�
+      "belongObjList": [
+        "1797461961110261762"
+      ],
+    },
+    "pageSize": 50,
+    "pageNum": pageNum
+  });
+  return response.data;
+}
 
 
 // 鏍规嵁骞翠唤鑾峰彇闆ㄩ噺鏁版嵁
@@ -181,7 +200,6 @@
     },
     "pageSize": 1000
   });
-  console.log("getRainfallData:", response);
   return response.data;
 }
 
@@ -219,30 +237,63 @@
   return response.data;
 }
 
-// 鎸夌収鍖椾含甯俢ode鏌ヨ琛屾斂鍖篶ode
-export async function getAeraCode() {
-  const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerCountByDistrict", {
-    "dictDisasterGrade": "",
-    "dictDisasterType": "",
-    "dictRiskLevel": "",
-    "districtCode": "110000000000",
-    "dictThreatObj": "",
-    "year": "2025"
+
+
+// 鏌ヨ鍖椾含甯傜洃娴嬭澶囩殑鏁伴噺
+export async function getDeviceCount(params = {}) {
+  const response = await axios.get("/hp/device/statisticsCountyByDeviceType", {
+    params
   });
-  console.log("getAeraCode:", response);
   return response.data;
 }
 
-// 鎸夌収琛屾斂鍖篶ode鏌ヨ涔¢晣code
-export async function getAeraTownCode(data) {
-  const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerTownCount", {
-    "dictDisasterGrade": "",
-    "dictDisasterType": "",
-    "dictRiskLevel": "",
-    "districtCode": data,
-    "dictThreatObj": "",
-    "year": "2025"
+// 鏌ヨ鍖椾含甯傞伩闄╁満鎵�
+export async function getSafePoint(data) {
+  const response = await axios.get("/hp/safeHavenLocation/getDataSelect", {
+    params: {
+      divisionId: data
+    }
   });
-  console.log("getAeraCode:", response);
+  return response.data;
+}
+// 110116110218
+
+
+
+// 鏌ヨ鍖椾含甯�
+export async function getAllCode() {
+  const response = await axios.get("/hp/district/getAll");
+  return response.data;
+}
+
+// 鑾峰彇澶╂皵棰勬姤
+export async function getWeather() {
+  // 鑾峰彇褰撳墠鏃堕棿鎴�
+  const currentTimestamp = Date.now();
+
+  // 鍒涘缓Date瀵硅薄
+  const currentDate = new Date(currentTimestamp);
+
+  // 鏍煎紡鍖栦负骞�-鏈�-鏃ワ紙YYYY-MM-DD锛�
+  const year = currentDate.getFullYear();
+  const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮嬶紝鎵�浠ヨ+1
+  const day = String(currentDate.getDate()).padStart(2, '0');
+  const formattedDate = `${year}-${month}-${day}`;
+
+  const response = await axios.get("/hp/weatherForecast/getSevenDaysWeather", {
+    params: {
+      inputDate: formattedDate
+    }
+  });
+  return response.data;
+}
+
+// 鐩戞祴璁惧涓叧鑱旂殑闅愭偅鐐圭殑鍏蜂綋淇℃伅
+export async function hdByDevice(data) {
+  const response = await axios.get("/hp/sinoDzHiddenDangerPoint/getDetail", {
+    params: {
+      unifiedCode: data
+    }
+  });
   return response.data;
 }
\ No newline at end of file

--
Gitblit v1.9.3