添加AI支持
This commit is contained in:
+13
-9
@@ -1127,15 +1127,19 @@ public class AddrSvcController {
|
||||
} else {
|
||||
Integer radius = model.getRadius();
|
||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||
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");
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-9
@@ -95,19 +95,24 @@ public class GdBankController {
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
|
||||
params.put("address", model.getAddress());
|
||||
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");
|
||||
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/cebEnterpriseVillageIdentify", params, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -6,6 +6,7 @@ public class AddressModel extends FangjiaApiModel {
|
||||
|
||||
private String city;
|
||||
private String address;
|
||||
private Integer ai;
|
||||
private String suggestDistrict;
|
||||
private Integer businessMatch;
|
||||
private Double area;
|
||||
@@ -334,4 +335,12 @@ public class AddressModel extends FangjiaApiModel {
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getAi() {
|
||||
return ai;
|
||||
}
|
||||
|
||||
public void setAi(Integer ai) {
|
||||
this.ai = ai;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user