From 3b20c2396e271b0e2660df012273c0b5cfb7b3d7 Mon Sep 17 00:00:00 2001 From: yarnom Date: Thu, 13 Nov 2025 22:08:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=E5=9B=9E=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../imdroid/secapi/dto/GnssDeviceMapper.java | 3 ++ .../controller/RtkTransactionController.java | 16 ++++++++- .../templates/page/rtk_transactions.html | 33 +++++++++++++++++-- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDeviceMapper.java b/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDeviceMapper.java index 8fb70ea0..ef1cc0fe 100644 --- a/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDeviceMapper.java +++ b/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDeviceMapper.java @@ -16,4 +16,7 @@ public interface GnssDeviceMapper extends MPJBaseMapper { @Update({"update gnssdevices set iccid=#{iccid} where deviceid=#{deviceId}"}) int updateIccidByDeviceId(String deviceId, String iccid); + @Update({"update gnssdevices set ecefx=#{ecefx}, ecefy=#{ecefy}, ecefz=#{ecefz} where deviceid=#{deviceId}"}) + int updateEcefByDeviceId(String deviceId, Double ecefx, Double ecefy, Double ecefz); + } diff --git a/sec-beidou/src/main/java/com/imdroid/beidou/controller/RtkTransactionController.java b/sec-beidou/src/main/java/com/imdroid/beidou/controller/RtkTransactionController.java index 864a97da..929f0d45 100644 --- a/sec-beidou/src/main/java/com/imdroid/beidou/controller/RtkTransactionController.java +++ b/sec-beidou/src/main/java/com/imdroid/beidou/controller/RtkTransactionController.java @@ -18,6 +18,8 @@ import javax.servlet.http.HttpSession; public class RtkTransactionController extends BasicController { @Autowired RtkTransactionMapper mapper; + @Autowired + com.imdroid.secapi.dto.GnssDeviceMapper gnssDeviceMapper; @RequestMapping("/page/rtk_transactions") public String page(Model m, HttpSession session){ @@ -39,5 +41,17 @@ public class RtkTransactionController extends BasicController { json.put("data", cs.getRecords()); return json; } -} + @RequestMapping("/rtk/transaction/check") + @ResponseBody + public String check(Integer id, Boolean apply){ + RtkTransaction t = mapper.selectById(id); + if(t==null) return com.imdroid.beidou.common.HttpResult.failed(); + t.setChecked((short)1); + mapper.updateById(t); + if(Boolean.TRUE.equals(apply)){ + try{ gnssDeviceMapper.updateEcefByDeviceId(t.getDevice_id(), t.getEcef_x(), t.getEcef_y(), t.getEcef_z()); }catch(Exception ignored){} + } + return com.imdroid.beidou.common.HttpResult.ok(); + } +} diff --git a/sec-beidou/src/main/resources/templates/page/rtk_transactions.html b/sec-beidou/src/main/resources/templates/page/rtk_transactions.html index 50b1c48c..034a8dbd 100644 --- a/sec-beidou/src/main/resources/templates/page/rtk_transactions.html +++ b/sec-beidou/src/main/resources/templates/page/rtk_transactions.html @@ -31,12 +31,18 @@
+ -