|
|
|
@ -55,13 +55,15 @@ public class YltController extends Controller {
|
|
|
|
|
/**
|
|
|
|
|
* 功能: 向第三方道闸同步充电桩支付信息
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
//@Before({POST.class})
|
|
|
|
|
//@IsLoginInterface({})
|
|
|
|
|
@EmptyInterface({"order_no", "charge_plate_no"})
|
|
|
|
|
// 非指定闸机场地
|
|
|
|
|
// http://10.10.21.20:8888/ZhuQue/Ylt/SyncChargePilePay?order_no=2020092315154430479
|
|
|
|
|
// http://10.10.21.20:8888/ZhuQue/Ylt/SyncChargePilePay?order_no=2020092315154430479&charge_plate_no=吉A88888
|
|
|
|
|
// 科拓闸机场地
|
|
|
|
|
// http://10.10.21.20:8888/ZhuQue/Ylt/SyncChargePilePay?order_no=2022012911045715187
|
|
|
|
|
// http://10.10.21.20:8888/ZhuQue/Ylt/SyncChargePilePay?order_no=2022012911045715187&charge_plate_no=吉A88888
|
|
|
|
|
// 智门科技
|
|
|
|
|
// http://10.10.21.20:8888/ZhuQue/Ylt/SyncChargePilePay?order_no=2021040710440684484&charge_plate_no=吉A88888
|
|
|
|
|
public void SyncChargePilePay(String order_no, String charge_plate_no) { //订单号,车牌号
|
|
|
|
|
//根据订单号获取到第三方方面提供的车场信息
|
|
|
|
|
Record thirdPartyStation = ym.getThirdPartyStation(order_no);
|
|
|
|
@ -148,15 +150,33 @@ public class YltController extends Controller {
|
|
|
|
|
.header("version", "1.0.0")
|
|
|
|
|
.header("Content-Type", "application/json") // 设置请求头,指明内容类型为 JSON
|
|
|
|
|
.execute().body(); // 发送请求并获取响应体
|
|
|
|
|
|
|
|
|
|
// 返回结果
|
|
|
|
|
JSONObject jj = JSONObject.parseObject(result);
|
|
|
|
|
String resCode = jj.getString("resCode");
|
|
|
|
|
String resMsg = jj.getString("resMsg");
|
|
|
|
|
String data = jj.getString("data");
|
|
|
|
|
//记录到数据库中闸机的流水记录
|
|
|
|
|
ym.recordDzLog(order_no, charge_plate_no, jo.toString(), resCode, resMsg, data);
|
|
|
|
|
renderJson(CommonUtil.getRet(true, "已经向科拓闸机平台发送了减免消息!"));
|
|
|
|
|
ym.recordDzLog(order_no, charge_plate_no, jo.toString(), result);
|
|
|
|
|
renderJson(CommonUtil.getRet(JSONObject.parseObject(result),true, "已经向科拓闸机平台发送了减免消息!" ));
|
|
|
|
|
return;
|
|
|
|
|
} else if ("智门科技".equals(name)) {
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
|
|
jo.put("Ver", 2);//协议版本
|
|
|
|
|
jo.put("Uid", UUID.randomUUID().toString().toUpperCase());//请求编号(协议唯一码,可使用uuid)
|
|
|
|
|
jo.put("Timestamp", System.currentTimeMillis());//时间戳(1970-01-01到现在的秒数)
|
|
|
|
|
jo.put("Op", "discount");//下发优惠券
|
|
|
|
|
String sign = "Op=discount&Timestamp=" + System.currentTimeMillis() + "&Uid=" + jo.getString("Uid") + "&key=";
|
|
|
|
|
jo.put("Sign", CommonUtil.md5(sign).toUpperCase());//签名
|
|
|
|
|
JSONObject dataJo = new JSONObject();
|
|
|
|
|
dataJo.put("Name", "驿来特停车优惠券");
|
|
|
|
|
dataJo.put("Serial", UUID.randomUUID().toString().toUpperCase());//优惠券派发流水
|
|
|
|
|
dataJo.put("License", charge_plate_no);//车牌
|
|
|
|
|
dataJo.put("DiscountType", 2);//优惠类型为时长
|
|
|
|
|
dataJo.put("DiscountFee", 0);//优惠金额0分
|
|
|
|
|
dataJo.put("DiscountMinute", 60 * 2);//优惠分钟
|
|
|
|
|
jo.put("Data", dataJo);//请求数据 json
|
|
|
|
|
String result = HttpUtil.createPost(url)
|
|
|
|
|
.body(jo.toString()) // 将 JSON 对象转换为字符串作为请求正文
|
|
|
|
|
.header("Content-Type", "application/json") // 设置请求头,指明内容类型为 JSON
|
|
|
|
|
.execute().body(); // 发送请求并获取响应体
|
|
|
|
|
//记录到数据库中闸机的流水记录
|
|
|
|
|
ym.recordDzLog(order_no, charge_plate_no, jo.toString(), result);
|
|
|
|
|
renderJson(CommonUtil.getRet(JSONObject.parseObject(result),true, "已经向智门科技闸机平台发送了减免消息!"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|