From 5a810cba2f81ae3c69ad70214aaba3e94b2f1bf0 Mon Sep 17 00:00:00 2001 From: guoyuepeng <770272267@qq.com> Date: Sun, 4 Feb 2024 17:44:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=87=95=E5=A4=A7AI=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=9B=BE=E7=89=87=E5=AD=98=E5=82=A8=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zcloud/controller/keyProjects/AIWarningController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/zcloud/controller/keyProjects/AIWarningController.java b/src/main/java/com/zcloud/controller/keyProjects/AIWarningController.java index d92f570c..51b9fbbf 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/AIWarningController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/AIWarningController.java @@ -370,7 +370,7 @@ public class AIWarningController extends BaseController { if (Tools.notEmpty(jsonObject.get("IMG_PATH").toString())) { String imgName = this.get32UUID() + ".jpg"; String filePath = Const.FILEPATHAITP + "/" + DateUtil.getDays(); - Base64Utils.decodeToFile(Const.basePath + filePath + "/" + imgName, jsonObject.get("IMG_PATH").toString().replace("data:image/jpeg;base64,", "")); + Base64Utils.decodeToFile(Smb.basePath + filePath + "/" + imgName, jsonObject.get("IMG_PATH").toString().replace("data:image/jpeg;base64,", "")); pd.put("IMG_PATH", filePath + "/" + imgName); //报警图片(路径) } else { map.put("returnCode", "1001"); //缺少同步信息 From cd03aabe3016a19a44c0b6a4b953a3fd8795c20b Mon Sep 17 00:00:00 2001 From: guoyuepeng <770272267@qq.com> Date: Tue, 27 Feb 2024 16:34:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=80=E5=85=AC=E5=8F=B8=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E9=A3=8E=E5=90=91=E7=9B=91=E6=B5=8B=E7=AB=99?= =?UTF-8?q?sql=E4=B8=9A=E5=8A=A1=E9=80=9F=E5=BA=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/controller/map/MapController.java | 24 ++++++++++++++- .../dsno2/map/MeteorologicalinfoMapper.java | 3 ++ .../map/MeteorologicalinfoService.java | 5 +++- .../impl/MeteorologicalinfoServiceImpl.java | 30 ++++++++++++++++++- .../dsno2/map/MeteorologicalinfoMapper.xml | 21 ++++++++++++- 5 files changed, 79 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zcloud/controller/map/MapController.java b/src/main/java/com/zcloud/controller/map/MapController.java index 99296de5..24459ab8 100644 --- a/src/main/java/com/zcloud/controller/map/MapController.java +++ b/src/main/java/com/zcloud/controller/map/MapController.java @@ -983,5 +983,27 @@ public class MapController extends BaseController { r.put("pd", pd); return r; } - + /** + * 企业端地图优化 + * 原有的地图查询速度太慢,达到5s以上,通过索引的方式暂时无法解决,所有使用业务优化sql,提升速度 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/listbymeteorologicalByCorpinfo") + @ResponseBody + public Object listbymeteorologicalByCorpinfo() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = this.getPageData(); + //根据条件增加参数或减少参数 都没有 直接返回空 + if (StringUtils.isBlank(pd.getString("CORPINFO_ID"))) { + map.put("result", errInfo); + return map; + } + pd = meteorologicalinfoService.listbymeteorologicalByCorpinfoId(pd); //列出meteorological列表 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } } diff --git a/src/main/java/com/zcloud/mapper/dsno2/map/MeteorologicalinfoMapper.java b/src/main/java/com/zcloud/mapper/dsno2/map/MeteorologicalinfoMapper.java index c51056b7..c85402d0 100644 --- a/src/main/java/com/zcloud/mapper/dsno2/map/MeteorologicalinfoMapper.java +++ b/src/main/java/com/zcloud/mapper/dsno2/map/MeteorologicalinfoMapper.java @@ -100,5 +100,8 @@ public interface MeteorologicalinfoMapper { * @return */ List tensList(PageData pd); + + PageData listbymeteorologicalByCodes(PageData pd); + } diff --git a/src/main/java/com/zcloud/service/map/MeteorologicalinfoService.java b/src/main/java/com/zcloud/service/map/MeteorologicalinfoService.java index 8b80b9d2..35f71254 100644 --- a/src/main/java/com/zcloud/service/map/MeteorologicalinfoService.java +++ b/src/main/java/com/zcloud/service/map/MeteorologicalinfoService.java @@ -98,6 +98,9 @@ public interface MeteorologicalinfoService { * @throws Exception */ Integer updateMeteorologicalinfo(PageData pageData); - + /**列表 + * @throws Exception + */ + public PageData listbymeteorologicalByCorpinfoId(PageData pd)throws Exception; } diff --git a/src/main/java/com/zcloud/service/map/impl/MeteorologicalinfoServiceImpl.java b/src/main/java/com/zcloud/service/map/impl/MeteorologicalinfoServiceImpl.java index 42c149a5..df1a3c83 100644 --- a/src/main/java/com/zcloud/service/map/impl/MeteorologicalinfoServiceImpl.java +++ b/src/main/java/com/zcloud/service/map/impl/MeteorologicalinfoServiceImpl.java @@ -2,6 +2,7 @@ package com.zcloud.service.map.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.mapper.dsno2.map.MeteorologicalMapper; import com.zcloud.mapper.dsno2.map.MeteorologicalinfoMapper; import com.zcloud.service.map.DataDockingLogService; import com.zcloud.service.map.MeteorologicalinfoService; @@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -27,7 +29,8 @@ public class MeteorologicalinfoServiceImpl implements MeteorologicalinfoService @Autowired private MeteorologicalinfoMapper meteorologicalinfoMapper; - + @Autowired + private MeteorologicalMapper meteorologicalMapper; @Autowired private DataDockingLogService dataDockingLogService; @@ -218,5 +221,30 @@ public class MeteorologicalinfoServiceImpl implements MeteorologicalinfoService public Integer updateMeteorologicalinfo(PageData pageData) { return meteorologicalinfoMapper.updateMeteorologicalinfo(pageData); } + + /**列表 + * @throws Exception + */ + public PageData listbymeteorologicalByCorpinfoId(PageData pd)throws Exception{ + /** + * 暂时使用in优化速度 + * 1.获取这个企业下的所有天气站信息 + * 2.根据这些天气站的信息,获取最新的数据 + */ + pd.put("OUTSOURCED_ID",pd.getString("CORPINFO_ID")); + List getListByCorpinfoId = meteorologicalMapper.listAll(pd); + if(getListByCorpinfoId.size() > 0){ + String codes = ""; + for (PageData met : getListByCorpinfoId){ + codes += "'" + met.getString("CODE")+"',"; + } + System.out.println(); + codes = codes.substring(0,codes.length()-1); + pd.put("codes",codes); + return meteorologicalinfoMapper.listbymeteorologicalByCodes(pd); + } + + return null; + } } diff --git a/src/main/resources/mybatis/dsno2/map/MeteorologicalinfoMapper.xml b/src/main/resources/mybatis/dsno2/map/MeteorologicalinfoMapper.xml index 3a2e2c88..a2b3204c 100644 --- a/src/main/resources/mybatis/dsno2/map/MeteorologicalinfoMapper.xml +++ b/src/main/resources/mybatis/dsno2/map/MeteorologicalinfoMapper.xml @@ -510,5 +510,24 @@ where f.CODE = #{CODE} and ABS(TIMESTAMPDIFF(SECOND, f.OPERATTIME, #{OPERATTIME})) < 10; - +