| | |
| | | import com.hxzk.pojo.TbSystem; |
| | | import com.hxzk.pojo.tb_jingwei; |
| | | import com.hxzk.service.SystemService; |
| | | import com.sun.org.apache.xpath.internal.operations.Mod; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.print.DocFlavor; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static cn.hx.tools.*; |
| | | |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class SystemController { |
| | |
| | | @PostMapping("updaping") |
| | | public void updaping(String baoliu28){ |
| | | systemService.updaping(baoliu28); |
| | | } |
| | | // @CrossOrigin |
| | | @GetMapping({"ddmm2d"}) |
| | | public String dfConversion(String df) { |
| | | return ddmm2d(df); |
| | | } |
| | | // @CrossOrigin |
| | | @GetMapping({"dd2ddmm"}) |
| | | public String dudegreeConversion(String du) { |
| | | return dd2ddmm(du); |
| | | } |
| | | |
| | | // @CrossOrigin |
| | | @GetMapping({"gnssToxy"}) |
| | | public String[] coordinate(String gnssa,String gnssb,String gnsslat,String gnsslog) { |
| | | return gnssToxy(gnssa,gnssb,gnsslat,gnsslog); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = {"jisuanjingwei.do"}, method = {RequestMethod.POST, RequestMethod.GET}) |
| | | public JSONObject jisuanjingwei(String str) { |
| | | public static JSONObject jisuanjingwei(String str) { |
| | | JSONObject json = new JSONObject(); |
| | | String disab = disab(str); |
| | | String[] split = str.split(";"); |
| | | String[] split = str.split(""); |
| | | String qishi = split[1] + "/" + split[0]; |
| | | String zhongzhi = split[3] + "/" + split[2]; |
| | | tb_jingwei jingwei = new tb_jingwei(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String format = simpleDateFormat.format(new Date()); |
| | | jingwei.setQishi(qishi); |
| | | jingwei.setZhongzhi(zhongzhi); |
| | | jingwei.setJieguo(disab); |
| | | jingwei.setAddtime(format); |
| | | json.put("jieguo", disab); |
| | | return json; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = {"jisuanbaowen.do"}, method = {RequestMethod.POST, RequestMethod.GET}) |
| | | public static JSONObject jisuanbaowen(String gnggA ,String gnggB) { |
| | | String weiduA = gnggA.split(",")[2]; |
| | | String jingduA = gnggA.split(",")[4]; |
| | | String weiduB = gnggB.split(",")[2]; |
| | | String jingduB = gnggB.split(",")[4]; |
| | | String str = weiduA + ";" + jingduA + ";" + weiduB + ";" + jingduB; |
| | | JSONObject json = new JSONObject(); |
| | | String disab = disab(str); |
| | | String[] split = str.split(""); |
| | | String qishi = split[1] + "/" + split[0]; |
| | | String zhongzhi = split[3] + "/" + split[2]; |
| | | tb_jingwei jingwei = new tb_jingwei(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String format = simpleDateFormat.format(new Date()); |
| | | jingwei.setQishi(qishi); |
| | | jingwei.setZhongzhi(zhongzhi); |
| | | jingwei.setJieguo(disab); |
| | | jingwei.setAddtime(format); |
| | | json.put("jieguo", disab); |
| | | return json; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = {"jisuandubaowen.do"}, method = {RequestMethod.POST, RequestMethod.GET}) |
| | | public static JSONObject jisuandubaowen(String dugnggA ,String dugnggB) { |
| | | String weiduA = dd2ddmm(dugnggA.split(";")[0]); |
| | | String jingduA = dd2ddmm(dugnggA.split(";")[1]); |
| | | String weiduB = dd2ddmm(dugnggB.split(";")[0]); |
| | | String jingduB = dd2ddmm(dugnggB.split(";")[1]); |
| | | |
| | | // String weiduA = gnggA.split(",")[2]; |
| | | // String jingduA = gnggA.split(",")[4]; |
| | | // String weiduB = gnggB.split(",")[2]; |
| | | // String jingduB = gnggB.split(",")[4]; |
| | | String str = weiduA + ";" + jingduA + ";" + weiduB + ";" + jingduB; |
| | | JSONObject json = new JSONObject(); |
| | | String disab = disab(str); |
| | | String[] split = str.split(""); |
| | | String qishi = split[1] + "/" + split[0]; |
| | | String zhongzhi = split[3] + "/" + split[2]; |
| | | tb_jingwei jingwei = new tb_jingwei(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | //后台访问 |
| | | @PostMapping("HouTai") |
| | | public ModelAndView HouTai(String username){ |
| | | ModelAndView modelAndView = new ModelAndView(); |
| | | if (username!=null){ |
| | | modelAndView.setViewName("/HouTai/HouTai.jsp"); |
| | | }else{ |
| | | modelAndView.setViewName("/index.jsp"); |
| | | } |
| | | return modelAndView; |
| | | } |
| | | public static String todufen(String Du, String Fen, String Miao) { |
| | | Float strDu = Float.valueOf(Du); |
| | | Float strFen = Float.valueOf(Fen) / 60.0F; |