修改第三方启动SOC的值

This commit is contained in:
yuyang 2021-12-13 10:04:40 +08:00
parent 6422d21a40
commit 40201906ed

View File

@ -463,11 +463,32 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
}
//平台最小的
int number =0;
//平台
String soc = redisService.getCacheObject("global:SOC");
if(!"".equals(soc) && soc!=null){
if(number!=0){
if(Integer.parseInt(soc)-number<0){
number=Integer.parseInt(soc);
}
}else{
number=Integer.parseInt(soc);
}
}
Map<String, Object> operatorMessage = xhpcChargeOrderMapper.getOperatorMessage(xhpcTerminal.getChargingStationId());
if(operatorMessage !=null && operatorMessage.get("soc") !=null && !"".equals(operatorMessage.get("soc"))){
if(number!=0){
if(Integer.parseInt(operatorMessage.get("soc").toString())-number<0){
number=Integer.parseInt(operatorMessage.get("soc").toString());
}
}else{
number=Integer.parseInt(operatorMessage.get("soc").toString());
}
startChargingData.setSoc(Integer.parseInt(soc));
}
startChargingData.setSoc(number);
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<number>>>>>>>>>>>>>>>>>:" + soc);
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<Soc>>>>>>>>>>>>>>>>>:" + startChargingData.getSoc());