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 @@
+ -