|
|
|
@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
@ -42,7 +41,7 @@ public class YltControllerForWx {
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取当前订单是不是在有合作的道闸车场内,这样的车场停车有减免
|
|
|
|
|
*
|
|
|
|
|
* @param order_no
|
|
|
|
|
* @param order_no 订单号
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/station/isThirdPartyStation")
|
|
|
|
|
public ResultVO isThirdPartyStation(String order_no) {
|
|
|
|
@ -59,7 +58,7 @@ public class YltControllerForWx {
|
|
|
|
|
@PostMapping("/station/getCarList")
|
|
|
|
|
public ResultVO getCarList(HttpServletRequest request) {
|
|
|
|
|
//获取当前登录人员信息
|
|
|
|
|
int userId = Integer.parseInt(request.getHeader("userId").toString());
|
|
|
|
|
int userId = Integer.parseInt(request.getHeader("userId"));
|
|
|
|
|
List<Record> list = ym.getCarList(userId);
|
|
|
|
|
return ResultVO.success(list);
|
|
|
|
|
}
|
|
|
|
@ -69,6 +68,9 @@ public class YltControllerForWx {
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/station/SyncChargePilePay")
|
|
|
|
|
public ResultVO SyncChargePilePay(String order_no, String charge_plate_no) {
|
|
|
|
|
//模拟一下假的订单
|
|
|
|
|
order_no="2023010415453464446";
|
|
|
|
|
|
|
|
|
|
//根据订单号获取到第三方方面提供的车场信息
|
|
|
|
|
Record thirdPartyStation = ym.getThirdPartyStation(order_no);
|
|
|
|
|
if (thirdPartyStation == null) {
|
|
|
|
@ -83,7 +85,7 @@ public class YltControllerForWx {
|
|
|
|
|
//闸机提供商
|
|
|
|
|
String name = thirdPartyStation.getStr("third_party_name");
|
|
|
|
|
//闸机所在车场ID
|
|
|
|
|
int parkId = thirdPartyStation.getInt("third_party_station_id");
|
|
|
|
|
String parkId = thirdPartyStation.getStr("third_party_station_id");
|
|
|
|
|
//最小充电费用
|
|
|
|
|
int mini_receivable_total_fee = thirdPartyStation.getInt("mini_receivable_total_fee");
|
|
|
|
|
//最小充电度数
|
|
|
|
@ -96,8 +98,7 @@ public class YltControllerForWx {
|
|
|
|
|
|
|
|
|
|
//订单信息
|
|
|
|
|
Record ddRecord = ym.getOrderByNo(order_no);
|
|
|
|
|
String charge_begin_time = ddRecord.getStr("charge_begin_time");//充电开始时间
|
|
|
|
|
String charge_end_time = ddRecord.getStr("charge_end_time");//充电结束时间
|
|
|
|
|
|
|
|
|
|
int stationId = ddRecord.getInt("station_id");//电站ID
|
|
|
|
|
//获取车场名称
|
|
|
|
|
String stationName = ym.getStationById(stationId).getStr("station_name");
|
|
|
|
@ -127,6 +128,8 @@ public class YltControllerForWx {
|
|
|
|
|
jo.put("parkId", parkId);
|
|
|
|
|
jo.put("serviceCode", "syncChargePilePay");
|
|
|
|
|
// 获取当前时间戳
|
|
|
|
|
String charge_begin_time = ddRecord.getStr("charge_begin_time");//充电开始时间
|
|
|
|
|
String charge_end_time = ddRecord.getStr("charge_end_time");//充电结束时间
|
|
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
|
|
jo.put("ts", timestamp);//每次请求附带当前时间戳(格林威治时间1970年01月01日00时00分00秒起至现在的总毫秒数)超过10S请求失效
|
|
|
|
|
jo.put("reqId", UUID.randomUUID().toString().toUpperCase());//每次请求的唯一标识,如果是异步接口,异步响应消息的reqId会与原请求的reqId一致。每次请求必须唯一!!!
|
|
|
|
|