diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java index dbdfb3852..f328b4172 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java @@ -572,6 +572,23 @@ public class AddrSvcController { params.put("address", address); String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null; 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 { json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8"); } catch (Exception e) {