添加AI支持
This commit is contained in:
+13
-9
@@ -1127,15 +1127,19 @@ public class AddrSvcController {
|
|||||||
} else {
|
} else {
|
||||||
Integer radius = model.getRadius();
|
Integer radius = model.getRadius();
|
||||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||||
HttpServletRequest req = ActionContext.getContext().getRequest();
|
if(model.getAi() != null && model.getAi() == 1){
|
||||||
if (req != null && apiUserCfgService != null) {
|
params.put("ai", "1");
|
||||||
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
}else{
|
||||||
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
HttpServletRequest req = ActionContext.getContext().getRequest();
|
||||||
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
if (req != null && apiUserCfgService != null) {
|
||||||
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
|
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||||
String aiVal = apiUserCfg.getCfgValue().toString();
|
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
||||||
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
|
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
params.put("ai", "1");
|
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
|
||||||
|
String aiVal = apiUserCfg.getCfgValue().toString();
|
||||||
|
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
|
||||||
|
params.put("ai", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-9
@@ -95,19 +95,24 @@ public class GdBankController {
|
|||||||
Map<String, String> params = new HashMap<String, String>();
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
|
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
|
||||||
params.put("address", model.getAddress());
|
params.put("address", model.getAddress());
|
||||||
HttpServletRequest req = ActionContext.getContext().getRequest();
|
if(model.getAi() != null && model.getAi() == 1){
|
||||||
if (req != null && apiUserCfgService != null) {
|
params.put("ai", "1");
|
||||||
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
}else{
|
||||||
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
HttpServletRequest req = ActionContext.getContext().getRequest();
|
||||||
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
if (req != null && apiUserCfgService != null) {
|
||||||
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
|
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||||
String aiVal = apiUserCfg.getCfgValue().toString();
|
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
||||||
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
|
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
params.put("ai", "1");
|
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/cebEnterpriseVillageIdentify", params, "UTF-8");
|
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cebEnterpriseVillageIdentify", params, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
|
|
||||||
private String city;
|
private String city;
|
||||||
private String address;
|
private String address;
|
||||||
|
private Integer ai;
|
||||||
private String suggestDistrict;
|
private String suggestDistrict;
|
||||||
private Integer businessMatch;
|
private Integer businessMatch;
|
||||||
private Double area;
|
private Double area;
|
||||||
@@ -334,4 +335,12 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
public void setPage(Integer page) {
|
public void setPage(Integer page) {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getAi() {
|
||||||
|
return ai;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAi(Integer ai) {
|
||||||
|
this.ai = ai;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user