From 52b45f15586b58eb7bb8137f3ad65ae5a443bc5d Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Wed, 30 Oct 2024 10:39:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E4=B8=8D=E4=B8=8A=20=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zcloud/util/SaveAnemometerInfoScheduled.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java b/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java index 0c3af353..8a1dff83 100644 --- a/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java +++ b/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java @@ -42,12 +42,13 @@ public class SaveAnemometerInfoScheduled { }); anemometerList.forEach(anemometer -> { anemometer.put("FLID",UuidUtil.get32UUID()); - String ftime = anemometer.getString("FTIME"); + // String ftime = anemometer.getString("FTIME"); + Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - Date date = simpleDateFormat.parse(ftime); + // Date date = simpleDateFormat.parse(ftime); anemometer.put("FTIME",simpleDateFormat.format(date)); - } catch (ParseException e) { + } catch (Exception e) { throw new RuntimeException(e); } //判断获取的风速仪在本地是否存在 From 5a81340b6bc846310ac1e9ba58c2d6a7f893a2f6 Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Wed, 30 Oct 2024 10:43:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=9B=9E=E9=80=80=E6=9B=B4=E6=94=B9=20?= =?UTF-8?q?=E5=B9=B6=E6=94=B9=E4=B8=BALIMIT=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zcloud/util/SaveAnemometerInfoScheduled.java | 6 +++--- .../datasource/anemometer/AnemometerMachineMapper.xml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java b/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java index 8a1dff83..f78c18da 100644 --- a/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java +++ b/src/main/java/com/zcloud/util/SaveAnemometerInfoScheduled.java @@ -42,11 +42,11 @@ public class SaveAnemometerInfoScheduled { }); anemometerList.forEach(anemometer -> { anemometer.put("FLID",UuidUtil.get32UUID()); - // String ftime = anemometer.getString("FTIME"); - Date date = new Date(); + String ftime = anemometer.getString("FTIME"); + // Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - // Date date = simpleDateFormat.parse(ftime); + Date date = simpleDateFormat.parse(ftime); anemometer.put("FTIME",simpleDateFormat.format(date)); } catch (Exception e) { throw new RuntimeException(e); diff --git a/src/main/resources/mybatis/datasource/anemometer/AnemometerMachineMapper.xml b/src/main/resources/mybatis/datasource/anemometer/AnemometerMachineMapper.xml index 44a21c71..0576a96b 100644 --- a/src/main/resources/mybatis/datasource/anemometer/AnemometerMachineMapper.xml +++ b/src/main/resources/mybatis/datasource/anemometer/AnemometerMachineMapper.xml @@ -114,6 +114,7 @@ LEFT JOIN bus_anemometer_local al ON f.FNAME = al.FNAME and al.FTIME = ba.FTIME WHERE f.FNAME = #{FNAME} + LIMIT 1