| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.google.gson.Gson; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | * 跳转到修改出租车订单 |
| | | */ |
| | | @RequestMapping("/tOrderTaxi_update/{tOrderTaxiId}") |
| | | public String tOrderTaxiUpdate(@PathVariable Integer tOrderTaxiId, Model model) { |
| | | public String tOrderTaxiUpdate(@PathVariable Integer tOrderTaxiId, Model model) throws IOException { |
| | | Map<String, Object> tOrderTaxi = tOrderTaxiService.getTaxiOrderDetailById(tOrderTaxiId); |
| | | model.addAttribute("item",tOrderTaxi); |
| | | // 查询司机扣款 |
| | |
| | | model.addAttribute("driverMoney",""); |
| | | } |
| | | } |
| | | if(tOrderTaxi.get("payManner").equals("1")){ |
| | | if(tOrderTaxi.get("payManner")!=null && tOrderTaxi.get("payManner").equals("1")){ |
| | | model.addAttribute("payMannerStr","线上收款"); |
| | | }else { |
| | | model.addAttribute("payMannerStr","计费打表"); |
| | | } |
| | | LogObjectHolder.me().set(tOrderTaxi); |
| | | try{ |
| | | //将数据存储到文件中 |
| | | File file = new File(filePath + tOrderTaxiId + "_2.txt"); |
| | | |
| | | //读取文件(字符流) |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); |
| | | //循环取出数据 |
| | | String str = null; |
| | | StringBuffer sb = new StringBuffer(); |
| | | while ((str = in.readLine()) != null) { |
| | | sb.append(str); |
| | | } |
| | | List<TOrderPosition> list = JSONArray.parseArray(sb.toString(), TOrderPosition.class); |
| | | List<Map> maps = new ArrayList<>(); |
| | | for (TOrderPosition tOrderPosition : list) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("lon",tOrderPosition.getLon()); |
| | | map.put("lat",tOrderPosition.getLat()); |
| | | maps.add(map); |
| | | } |
| | | // resultUtil = ResultUtil.success(list); |
| | | // 将maps转化为jsonArray字符串 |
| | | // 使用 Gson 转换为 JSON 字符串 |
| | | // Gson gson = new Gson(); |
| | | // String jsonString = gson.toJson(maps); |
| | | // System.out.println(jsonString); |
| | | model.addAttribute("guiji",maps); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | resultUtil = ResultUtil.runErr(); |
| | | model.addAttribute("guiji",""); |
| | | } |
| | | |
| | | |
| | | return PREFIX + "tOrderTaxi_edit.html"; |
| | | } |
| | | |
| | |
| | | * 跳转到出租车订单轨迹页面 |
| | | */ |
| | | @RequestMapping("/tOrderTaxi_trajectory/{tOrderTaxiId}") |
| | | public String tOrderTaxi_trajectory(@PathVariable Integer tOrderTaxiId, Model model) { |
| | | public String tOrderTaxi_trajectory(@PathVariable Integer tOrderTaxiId, Model model) throws IOException { |
| | | model.addAttribute("tOrderTaxiId",tOrderTaxiId); |
| | | try{ |
| | | //将数据存储到文件中 |
| | | File file = new File(filePath + tOrderTaxiId + "_2.txt"); |
| | | |
| | | //读取文件(字符流) |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); |
| | | //循环取出数据 |
| | | String str = null; |
| | | StringBuffer sb = new StringBuffer(); |
| | | while ((str = in.readLine()) != null) { |
| | | sb.append(str); |
| | | } |
| | | List<TOrderPosition> list = JSONArray.parseArray(sb.toString(), TOrderPosition.class); |
| | | List<Map> maps = new ArrayList<>(); |
| | | for (TOrderPosition tOrderPosition : list) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("lon",tOrderPosition.getLon()); |
| | | map.put("lat",tOrderPosition.getLat()); |
| | | maps.add(map); |
| | | } |
| | | // resultUtil = ResultUtil.success(list); |
| | | // 将maps转化为jsonArray字符串 |
| | | // 使用 Gson 转换为 JSON 字符串 |
| | | // Gson gson = new Gson(); |
| | | // String jsonString = gson.toJson(maps); |
| | | // System.out.println(jsonString); |
| | | model.addAttribute("guiji",maps); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | resultUtil = ResultUtil.runErr(); |
| | | model.addAttribute("guiji",""); |
| | | } |
| | | return PREFIX + "tOrderTaxi_trajectory.html"; |
| | | } |
| | | |