QueryEquipBusinessPolicyController增加了空指针异常处理逻辑
This commit is contained in:
parent
861a22b4b1
commit
8d0f60bfbc
@ -33,8 +33,18 @@ public class QueryEquipBusinessPolicyController {
|
||||
//获取枪所对应的桩编码
|
||||
String bySerialNumber = xhpcTerminalRepository.selectBySql(connectorId);
|
||||
String pileSerialNumber = bySerialNumber;
|
||||
|
||||
//找不到对应的桩编码,说明充电设备接口编码有误
|
||||
if (pileSerialNumber == null) {
|
||||
CommonResponse commonResponse = new CommonResponse();
|
||||
commonResponse.setMsg("error connectorId");
|
||||
commonResponse.setRet("1");
|
||||
commonResponse.setData(null);
|
||||
return commonResponse;
|
||||
}
|
||||
//通过桩编码,进入redis,找到其所用的费率模型id
|
||||
Map<String, Object> cacheMap = REDIS.getCacheMap("pile:" + pileSerialNumber);
|
||||
|
||||
Long rateModelId = (Long) cacheMap.get("rateModelId");
|
||||
//通过指定费率模型id,找到其对应的费率模型
|
||||
CacheRateModel rateModel = REDIS.getCacheObject("rateModel:" + rateModelId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user