添加AI支持

This commit is contained in:
王文艳
2026-09-20 13:56:27 +08:00
parent c3d0a39eff
commit 77d2ec0527
@@ -572,6 +572,23 @@ public class AddrSvcController {
params.put("address", address); params.put("address", address);
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null; String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
params.put("type", type); params.put("type", type);
if (model.getAi() != null && model.getAi() == 1) {
params.put("ai", "1");
} else {
HttpServletRequest req = ActionContext.getContext().getRequest();
if (req != null && apiUserCfgService != null) {
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
if (authenticationBean != null && authenticationBean.apiUser != null) {
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
String aiVal = apiUserCfg.getCfgValue().toString();
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
params.put("ai", "1");
}
}
}
}
}
try { try {
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {