main^2^2
黄海 11 months ago
parent 9a55620f18
commit 906538e89c

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

@ -2,6 +2,7 @@ package com.charge.task.controller;
import com.jfinal.plugin.activerecord.Db; import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record; import com.jfinal.plugin.activerecord.Record;
import java.util.List; import java.util.List;
public class YltModel { public class YltModel {
@ -27,7 +28,11 @@ public class YltModel {
* @return * @return
*/ */
public Record getThirdPartyStation(String order_no) { public Record getThirdPartyStation(String order_no) {
Record record = getOrderByNo(order_no); //因为测试库与生产库是两个库,在生产库中产生的订单号,在测试库中是无法获取到的,所以先写死,再考虑与吴缤研究是否可以将
String sql = "select * from t_ext_dz_station where station_id=161";
Record record = Db.findFirst(sql);
//Record record = getOrderByNo(order_no);
if (record == null) { if (record == null) {
return null; return null;
} }
@ -114,6 +119,7 @@ public class YltModel {
/** /**
* 退 * 退
*
* @param userId * @param userId
* @return * @return
*/ */

@ -0,0 +1,11 @@
#### 东师理想上网$IP$
```
36.48.59.112
```
#### 公网访问阿里云$RDS$云数据库
https://blog.csdn.net/javad0g/article/details/107436829
Loading…
Cancel
Save