From c21fc355a6a8df90c8c6d970faa6f664ce0736ca Mon Sep 17 00:00:00 2001 From: gongjiale <942894820@qq.com> Date: Wed, 4 Dec 2024 10:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=81=E8=AE=BE=E5=A4=87=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/task/EquTask.java | 4 ++-- .../com/ruoyi/project/outside/mapper/OutSideMapper.java | 7 +++++++ .../project/outside/service/impl/OutSideServiceImpl.java | 1 + .../src/main/resources/mybatis/outside/OutSideMapper.xml | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java index 6f4d45b..89fd2cf 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java @@ -36,7 +36,7 @@ public class EquTask { /** * 港口原有设备对接 */ - @Scheduled(fixedRate = 3600) + @Scheduled(fixedRate = 3600000) public void equ(){ String hash = "16EA8A305FB58BE0730DD67F04F022F4"; @@ -56,7 +56,7 @@ public class EquTask { map.put("sensorUId",e.getSn()); map.put("label",e.getName()); HttpResult result = OkHttps.sync("http://10.201.35.30:8090/enviSensor/select?" + - "page=1&pageSize=20&valid=0&type=5&sensorUId={sensorUId}&label={label}") + "page=1&pageSize=40&valid=0&type=5&sensorUId={sensorUId}&label={label}") .addPathPara(map) .addHeader("token", token) .get(); diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/mapper/OutSideMapper.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/mapper/OutSideMapper.java index 966544d..1a3c18c 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/mapper/OutSideMapper.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/mapper/OutSideMapper.java @@ -26,4 +26,11 @@ public interface OutSideMapper { * @param list */ void insertMonth(@Param("sensorMonthList") List list); + + /** + * 删除相同数据 + * @param sn + * @param reportTime + */ + void deleteSampleDevice(@Param("sn")String sn,@Param("reportTime") String reportTime); } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/service/impl/OutSideServiceImpl.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/service/impl/OutSideServiceImpl.java index c628faf..dd38444 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/service/impl/OutSideServiceImpl.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/outside/service/impl/OutSideServiceImpl.java @@ -86,6 +86,7 @@ public class OutSideServiceImpl implements OutSideService { for (JsonNode node : rootNode) { if (node.get("type").asInt()==5) { SensorData sd = insertOldData(node); + outSideMapper.deleteSampleDevice(sd.getSn(),sd.getReportTime()); outSideMapper.insertDevice(sd); } } diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/outside/OutSideMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/outside/OutSideMapper.xml index c3c5ab4..ac7fe27 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/outside/OutSideMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/outside/OutSideMapper.xml @@ -64,4 +64,8 @@ SELECT * FROM dual + + + delete from th_device_report where sn=#{sn} and report_time= TO_DATE(#{reportTime}, 'yyyy-mm-dd hh24:mi:ss') + \ No newline at end of file