无关风月
2025-03-19 12293a8893a129357fa0603550604df225bc2784
UserZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
@@ -66,7 +66,7 @@
    @Autowired
    private IOrderEvaluateService orderEvaluateService;
    private String path = "http://120.77.11.218:8868/";
    private String path = "http://127.0.0.1:8868/";
    /**
@@ -85,8 +85,19 @@
        jsonObject.put("UpdateTime", new Date());
        Map<String, Object> map = new HashMap<>();
        map.put("baseInfoPassenger", jsonObject.toJSONString());
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoPassenger", map,null,"form");
        System.out.println("乘客基本信息:" + result);
        Map<String, String> header = new HashMap<>();
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoPassenger", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("---------------------------乘客基本信息--------------------------:" + result);
    }
@@ -120,8 +131,19 @@
        jsonObject.put("CancelReason", query.getReason());//撤销或违约原因
        Map<String, Object> map = new HashMap<>();
        map.put("orderCancel", jsonObject.toJSONString());
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCancel", map,null,"form");
        System.out.println("订单撤销接口:" + result);
        Map<String, String> header = new HashMap<>();
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCancel", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("----------------------------订单撤销接口------------------:" + result);
    }
@@ -135,10 +157,26 @@
        Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
        Car car = carMapper.selectById(orderPrivateCar.getCarId());
        ServerCarModel serverCarModel = serverCarModelMapper.selectById(orderPrivateCar.getServerCarModelId());
        TransactionDetails transactionDetails = transactionDetailsService.selectById(new EntityWrapper<TransactionDetails>().eq("orderType", 1).eq("orderId", orderId));
        TransactionDetails transactionDetails = transactionDetailsService.selectOne(new EntityWrapper<TransactionDetails>().eq("orderType", 1).eq("orderId", orderId));
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单号
        jsonObject.put("OnArea", 450204);//上车位置行政区划代码
        if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
            Map<String, String> geocode = null;
            try {
                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (geocode!=null){
                System.err.println("数据上传--经纬度转行政区划代码");
                jsonObject.put("OnArea", geocode.get("provinceCode"));//发起第行政区划代码
            }else{
                jsonObject.put("OnArea", 530602);//发起第行政区划代码
            }
        }else{
            jsonObject.put("OnArea", 530602);//发起第行政区划代码
        }
//        jsonObject.put("OnArea", 530602);//上车位置行政区划代码
        jsonObject.put("DriverName", driver.getName());//机动车驾驶员
        jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号
        jsonObject.put("FareType", query.get("id").toString());//运价类型编码(由网约车公司定义,与运价信息接口保持一街)
@@ -199,8 +237,19 @@
        jsonObject.put("InvoiceStatus", "0");//发票状态(0:未开票,1:已开票,2:未知)
        Map<String, Object> map = new HashMap<>();
        map.put("operatePay", jsonObject.toJSONString());
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map,null,"form");
        System.out.println("经营支付接口:" + result);
        Map<String, String> header = new HashMap<>();
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("------------------------经营支付接口----------------------:" + result);
    }
@@ -219,8 +268,21 @@
        jsonObject.put("Detail", orderEvaluate.getContent());//评价内容
        Map<String, Object> map = new HashMap<>();
        map.put("ratedPassenger", jsonObject.toJSONString());
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedPassenger", map,null,"form");
        System.out.println("乘客评价信息:" + result);
        Map<String, String> header = new HashMap<>();
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedPassenger", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("-----------------------------乘客评价信息----------------------:" + result);
    }
@@ -243,8 +305,19 @@
        jsonObject.put("TestDepartment", "广西云森科技有限公司");//服务质量信誉考核机构
        Map<String, Object> map = new HashMap<>();
        map.put("ratedDriver", jsonObject.toJSONString());
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedDriver", map,null,"form");
        System.out.println("驾驶员信誉信息:" + result);
        Map<String, String> header = new HashMap<>();
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedDriver", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("---------------------------驾驶员信誉信息-----------------------:" + result);
    }