启动响应费率模型id
This commit is contained in:
parent
a30e3cdb44
commit
ad0f0833ed
@ -90,7 +90,6 @@ public class ChargingController {
|
|||||||
@PostMapping("charging/start")
|
@PostMapping("charging/start")
|
||||||
public R startCharging(@Validated @RequestBody StartChargingData startChargingData) {
|
public R startCharging(@Validated @RequestBody StartChargingData startChargingData) {
|
||||||
|
|
||||||
//todo protocol versioning
|
|
||||||
String pileNo = startChargingData.getPileNo();
|
String pileNo = startChargingData.getPileNo();
|
||||||
String pkey = "pile:".concat(pileNo);
|
String pkey = "pile:".concat(pileNo);
|
||||||
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
||||||
@ -113,11 +112,14 @@ public class ChargingController {
|
|||||||
r = R.fail(code, responseJson.getString("msg"));
|
r = R.fail(code, responseJson.getString("msg"));
|
||||||
} else {
|
} else {
|
||||||
r = R.fail(responseJson.getString("msg"));
|
r = R.fail(responseJson.getString("msg"));
|
||||||
|
cachePile.put("rateModelId", stationRateModelId);
|
||||||
|
REDIS.setCacheMap(pkey, cachePile);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
JSONObject json = (JSONObject) JSON.toJSON(startChargingData);
|
JSONObject json = (JSONObject) JSON.toJSON(startChargingData);
|
||||||
String response = HttpUtils.post(fmt(svcSrv).concat("/native/charging/start"), json);
|
String response = HttpUtils.post(fmt(svcSrv).concat("/native/charging/start"), json);
|
||||||
r = getRR(response);
|
r = getRR(response);
|
||||||
|
r.setData(pileRateModelId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user