| | |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hxzk.deo.GpsGuiJi; |
| | | import com.hxzk.pojo.PdfRequest; |
| | | import com.hxzk.pojo.TbGpsTrack; |
| | | import com.hxzk.pojo.TbGuiJiTrack; |
| | | import com.hxzk.pojo.TbSetting; |
| | | import com.hxzk.service.GpsGuiJiService; |
| | | import com.hxzk.service.SettingService; |
| | | import com.hxzk.util.result; |
| | | import com.hxzk.util.resultutil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class GpsGuiJiController { |
| | | |
| | | private Integer tps = 0; |
| | | |
| | | @Autowired |
| | | GpsGuiJiService gpsGuiJiService; |
| | | |
| | | @Autowired |
| | | SettingService settingService; |
| | | |
| | | @GetMapping("findGuiJiTrack") |
| | | result<List<TbGuiJiTrack>> findshishigaojing(Integer page, Integer limit){ |
| | |
| | | |
| | | |
| | | @GetMapping("findBaiDuGuiJi") |
| | | List<GpsGuiJi> findBaiDuGuiJi(String tagid,String time) throws ParseException { |
| | | LocalDate currentDate = LocalDate.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | String formattedDate = currentDate.format(formatter); |
| | | String[] times = time.split("到"); |
| | | String time1 = times[0].trim(); |
| | | String time2 = times[1].trim(); |
| | | List<GpsGuiJi> gui = gpsGuiJiService.findGuiJi(tagid,time1,time2); |
| | | for (int i = 0; i < gui.size();i++){ |
| | | if (gui.get(i).getGpsWeidu().equals("0.0")){ |
| | | |
| | | }else{ |
| | | double[] gpstodu = gpstodu(gui.get(i).getGpsWeidu(),gui.get(i).getGspJingdu()); |
| | | gui.get(i).setGspJingdu(String.valueOf(gpstodu[1])); |
| | | gui.get(i).setGpsWeidu(String.valueOf(gpstodu[0])); |
| | | } |
| | | |
| | | List<GpsGuiJi> findBaiDuGuiJi(String tagid,String start,String end,String layer) throws ParseException { |
| | | String time1 = start; |
| | | String time2 = end; |
| | | List<GpsGuiJi> gui = new ArrayList<>(); |
| | | if (layer.equals("默认地图")){ |
| | | gui = gpsGuiJiService.findGuiJi(tagid,time1,time2); |
| | | }else{ |
| | | gui=gpsGuiJiService.findGuiJiFloor(tagid,time1,time2,layer); |
| | | } |
| | | return gui; |
| | | } |
| | | |
| | | |
| | | public String gettime(){ |
| | | Date now = new Date(); |
| | | // 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm" |
| | |
| | | String format = String.format("%.6f", dufenmiao); |
| | | return format; |
| | | } |
| | | public void Languages(){ |
| | | List<TbSetting> setting = settingService.FindSetting(); |
| | | if (setting.get(0).getLanguages().equals("0")){ |
| | | tps = 0; |
| | | } |
| | | if (setting.get(0).getLanguages().equals("2")){ |
| | | tps = 2; |
| | | } |
| | | } |
| | | } |