opt:优化空指针异常提示

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-02-17 13:28:08 +08:00
parent 8c47b97707
commit 6d5b6ead05

View File

@@ -518,11 +518,13 @@ public class BakingServiceImpl implements BakingService {
hotParam.put("task_id", task_id);
hotParam.put("start_point_code", point_code1);
hotParam.put("end_point_code", point_code2);
Object pt = redisUtils.hget(point_code1, "temperature");
if (ObjectUtil.isEmpty(pt)) {
boolean exists = redisUtils.hHasKey(point_code1, "temperature");
String point_temperature = "";
if(exists){
point_temperature = (String) redisUtils.hget(point_code1, "temperature");
}else{
throw new BadRequestException("当前操作点位设备:"+point_code1+",无法获取温度,请稍后再试!");
}
String point_temperature = String.valueOf(pt);
hotParam.put("temperature", point_temperature);
if (ObjectUtil.isEmpty(last_hot_mst)) {
hotParam.put("oven_time", "480");