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