icc修改bug

This commit is contained in:
guoshengxiong 2025-07-25 15:53:00 +08:00
parent 8926a006da
commit 0f21141944

View File

@ -39,6 +39,7 @@ import com.zhgd.xmgl.call.IccWorkerCall;
import com.zhgd.xmgl.modules.car.entity.CarInfo;
import com.zhgd.xmgl.modules.car.entity.ProjectCarCameraConfig;
import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig;
import com.zhgd.xmgl.modules.project.entity.vo.ProjectInfoExtVo;
import com.zhgd.xmgl.modules.project.service.impl.ProjectServiceImpl;
import com.zhgd.xmgl.util.Base64Util;
import com.zhgd.xmgl.util.PathUtil;
@ -324,11 +325,15 @@ public class IccHttpUtil {
.map(ja -> ja.stream().map(o -> ((JSONObject) o)).filter(jo -> jo.getString("parkingLot").equals(projectName))
.findFirst().orElse(null)).orElse(null);
if (jsonObject == null) {
throw new OpenAlertException("ICC没有找到对应项目的车场请在ICC加一个车场名称=项目名称)的车场");
ProjectServiceImpl projectService = SpringContextUtils.getBean(ProjectServiceImpl.class);
ProjectInfoExtVo project = projectService.getProjectInfoBySn(config.getProjectSn());
throw new OpenAlertException("在ICC没有找到对应项目的车场请在ICC把车场名称修改为\"" + project.getProjectName() + "\"");
}
return BeanUtil.toBean(jsonObject, IccHttpUtil.ParkingLot.class);
} catch (OpenAlertException e) {
throw new OpenAlertException("查询项目的车场异常," + e.getMessage(), e);
} catch (Exception e) {
throw new OpenAlertException("查询项目的车场(车场名称=项目名称)请求异常,请联系管理员", e);
throw new OpenAlertException("查询项目的车场异常,请联系管理员", e);
}
}
@ -387,6 +392,8 @@ public class IccHttpUtil {
GeneralResponse response = HttpUtils.executeJson("/evo-apigw/ipms/car/add", carBody, null, Method.POST, getOauthConfig(config), GeneralResponse.class);
printResp(response, "添加车辆");
return response;
} catch (OpenAlertException e) {
throw e;
} catch (Exception e) {
throw new OpenAlertException("添加车辆请求异常,请联系管理员", e);
}