get native config rate model code back
This commit is contained in:
parent
982b5eb35e
commit
95291a76e7
@ -106,6 +106,33 @@ public class PileController {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("native/pile/{pileNo}/rateModel")
|
||||||
|
public Object configRateModel(@PathVariable("pileNo") String pileNo, @RequestBody String msg) {
|
||||||
|
|
||||||
|
ClientHandler handler = getHandler(pileNo);
|
||||||
|
R r;
|
||||||
|
if (handler != null && handler.isOpen()) {
|
||||||
|
if (!handler.isOpen()) {
|
||||||
|
log.error("send message failed. [{}]({}) connection lost", handler.getName(), pileNo);
|
||||||
|
removeHandler(pileNo);
|
||||||
|
r = R.fail("充电桩连接已断开,请稍后再试");
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
log.debug("[{}] - server send msg >>>> ({}) |{}|", handler.getName(), pileNo, msg);
|
||||||
|
handler.sendClientBinary(HexUtils.toBytes(msg));
|
||||||
|
r = R.ok(null, "网络延迟,请重试");
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("费率模型下发失败[{}]:".concat(e.getMessage()).concat(".无法启动充电"), pileNo);
|
||||||
|
removeHandler(pileNo);
|
||||||
|
r = R.fail("电桩网络通信失败,请重试");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("费率模型下发失败[{}].无法启动充电", pileNo);
|
||||||
|
r = R.fail("启动失败,请稍后重试");
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("native/pile/{pileNo}/timeNRateModel")
|
@PostMapping("native/pile/{pileNo}/timeNRateModel")
|
||||||
public R nativeConfigTimeNRateModel(@PathVariable("pileNo") String pileNo) {
|
public R nativeConfigTimeNRateModel(@PathVariable("pileNo") String pileNo) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user