启动响应费率模型id

This commit is contained in:
ZZ 2021-11-17 09:53:54 +08:00
parent a30e3cdb44
commit ad0f0833ed

View File

@ -90,7 +90,6 @@ public class ChargingController {
@PostMapping("charging/start")
public R startCharging(@Validated @RequestBody StartChargingData startChargingData) {
//todo protocol versioning
String pileNo = startChargingData.getPileNo();
String pkey = "pile:".concat(pileNo);
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
@ -113,11 +112,14 @@ public class ChargingController {
r = R.fail(code, responseJson.getString("msg"));
} else {
r = R.fail(responseJson.getString("msg"));
cachePile.put("rateModelId", stationRateModelId);
REDIS.setCacheMap(pkey, cachePile);
}
} else {
JSONObject json = (JSONObject) JSON.toJSON(startChargingData);
String response = HttpUtils.post(fmt(svcSrv).concat("/native/charging/start"), json);
r = getRR(response);
r.setData(pileRateModelId);
}
}
return r;