main^2
黄海 12 months ago
parent 2d25e2703c
commit b77c3ca163

@ -2,6 +2,7 @@ package com.dsideal.ZhuQue.Ylt.Controller;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.dsideal.ZhuQue.Interceptor.EmptyInterface;
import com.dsideal.ZhuQue.Interceptor.IsLoginInterface;
import com.dsideal.ZhuQue.Util.CommonUtil;
import com.dsideal.ZhuQue.Util.SignUtils;
@ -14,6 +15,7 @@ import com.jfinal.plugin.activerecord.Record;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.UUID;
@ -21,33 +23,31 @@ public class YltController extends Controller {
Logger log = LoggerFactory.getLogger(YltController.class);
YltModel ym = new YltModel();
/**
* JWTTOKEN
*
*/
@Before({GET.class})
@IsLoginInterface({})
public void getListWithAuth() {
public void getCarList() {
//获取当前登录人员信息
Record user = ym.getUser(getRequest());
String userId = user.get("userId");
String phone = user.get("phone");
System.out.println(userId);
System.out.println(phone);
renderJson(CommonUtil.getRet(true, "获取成功!"));
int userId = Integer.parseInt(user.get("userId"));
List<Record> list = ym.getCarList(userId);
renderJson(CommonUtil.getRet(list, true, "获取成功!"));
}
/**
* :
*/
@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=2022012911045715187
public void SyncChargePilePay(String order_no) {
public void SyncChargePilePay(String order_no,String charge_plate_no) { //订单号,车牌号
//根据订单号获取到第三方方面提供的车场信息
Record thirdPartyStation = ym.getThirdPartyStation(order_no);
if (thirdPartyStation == null) {
@ -68,7 +68,6 @@ public class YltController extends Controller {
//订单信息
Record dingDanRecord = ym.getOrderByNo(order_no);
String charge_plate_no = dingDanRecord.getStr("charge_plate_no");//车牌号
String charge_begin_time = dingDanRecord.getStr("charge_begin_time");//充电开始时间
String charge_end_time = dingDanRecord.getStr("charge_end_time");//充电结束时间
int stationId = dingDanRecord.getInt("station_id");//电站ID

@ -8,6 +8,8 @@ import javax.servlet.http.HttpServletRequest;
import com.jfinal.plugin.activerecord.Record;
import java.util.List;
public class YltModel {
/**
* JWTtoken
@ -90,4 +92,14 @@ public class YltModel {
String sql = "select * from t_equipment where id =?";
return Db.findFirst(sql, equipment_id);
}
/**
*
* @param user_id
* @return
*/
public List<Record> getCarList(int user_id) {
String sql = "select * from t_user_car where user_id=?";
return Db.find(sql, user_id);
}
}

Loading…
Cancel
Save