lmstack 3 years ago
parent
commit
dae28591fa
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/main/java/com/lm/lib/controller/ShowDataController.java

+ 5 - 3
src/main/java/com/lm/lib/controller/ShowDataController.java

@@ -59,19 +59,21 @@ public class ShowDataController {
 
     @ApiOperation(value = "获取美团sn")
     @RequestMapping(value = "/getSn", method = RequestMethod.GET)
-    public String getSn() throws IOException {
+    public Map<String, String> getSn() throws IOException {
         String sql = "select qrcode from py_battery where f_id=141";
         List<Map<String, Object>> snData = moyuJdbcTemplate.queryForList(sql);
         List<String> snList = new ArrayList();
         snData.forEach(p -> snList.add(p.get("qrcode").toString()));
         String snString = "\'" + String.join("\',\'", snList) + "\'";
-        return snString;
+        Map res = new HashMap<String, String>();
+        res.put("snString", snString);
+        return res;
     }
 
     @ApiOperation(value = "获取gps数据")
     @RequestMapping(value = "/allrealtimeInfo", method = RequestMethod.GET)
     public Map<String, Object> gpsInfo() throws IOException {
-        String snString = this.getSn();
+        String snString = this.getSn().get("snString");
         Map<String, Object> res = new HashMap<>();
         String sql = "select t2.latitude, t2.longitude, t1.charge_state, t1.devcode from ff_battery_status t1 left join ff_location t2 on t1.devcode = t2.devcode where t2.devcode in (%s)";
         List<Map<String, Object>> realtimeData;