feat: 对公涉农接口支持AI配置与透传,API后台支持配置对公涉农启用AI
This commit is contained in:
+6
@@ -285,6 +285,11 @@ public class ApiUserController {
|
|||||||
bo.setPriceType(apiUserCfg_pt.getCfgValue().toString());
|
bo.setPriceType(apiUserCfg_pt.getCfgValue().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApiUserCfg apiUserCfg_ai = apiUserCfgService.findByUserId(apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
|
if (apiUserCfg_ai != null && apiUserCfg_ai.getCfgValue() != null) {
|
||||||
|
bo.setEnterpriseVillageAi(apiUserCfg_ai.getCfgValue().toString());
|
||||||
|
}
|
||||||
|
|
||||||
model.setApiUserBo(bo);
|
model.setApiUserBo(bo);
|
||||||
if (StringUtils.isNotBlank(model.getMsg()) && model.getMsg().equals("success")) {
|
if (StringUtils.isNotBlank(model.getMsg()) && model.getMsg().equals("success")) {
|
||||||
model.setMsg("更新成功!");
|
model.setMsg("更新成功!");
|
||||||
@@ -343,6 +348,7 @@ public class ApiUserController {
|
|||||||
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
||||||
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE, model.getEvaluateRate());
|
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE, model.getEvaluateRate());
|
||||||
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.PRICE_TYPE, model.getPriceType());
|
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.PRICE_TYPE, model.getPriceType());
|
||||||
|
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI, model.getEnterpriseVillageAi());
|
||||||
|
|
||||||
model.setViewType("redirect");
|
model.setViewType("redirect");
|
||||||
//model.setViewParam("location", "/apiUser/edit?msg=sucess&userId=" + model.getUserId());
|
//model.setViewParam("location", "/apiUser/edit?msg=sucess&userId=" + model.getUserId());
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class ApiUserModel extends BaseModel {
|
|||||||
private String totalCountMap;
|
private String totalCountMap;
|
||||||
private Integer creditLevelStatus;
|
private Integer creditLevelStatus;
|
||||||
private String priceType;
|
private String priceType;
|
||||||
|
private String enterpriseVillageAi;
|
||||||
private Map<String,Double> priceRatingMap;
|
private Map<String,Double> priceRatingMap;
|
||||||
private Integer isMonitor;
|
private Integer isMonitor;
|
||||||
|
|
||||||
@@ -50,6 +51,14 @@ public class ApiUserModel extends BaseModel {
|
|||||||
|
|
||||||
private Integer isWarnExpired;
|
private Integer isWarnExpired;
|
||||||
|
|
||||||
|
public String getEnterpriseVillageAi() {
|
||||||
|
return enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseVillageAi(String enterpriseVillageAi) {
|
||||||
|
this.enterpriseVillageAi = enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPriceType() {
|
public String getPriceType() {
|
||||||
return priceType;
|
return priceType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,6 +155,15 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>对公涉农是否启用AI</td>
|
||||||
|
<td>
|
||||||
|
<select id="slt_enterpriseVillageAi" name="enterpriseVillageAi" style="width: 100px">
|
||||||
|
<option value="0" <#if !(apiUserBo.enterpriseVillageAi??) || apiUserBo.enterpriseVillageAi == "0">selected</#if>>否</option>
|
||||||
|
<option value="1" <#if apiUserBo.enterpriseVillageAi?? && apiUserBo.enterpriseVillageAi == "1">selected</#if>>是</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>siteName</td>
|
<td>siteName</td>
|
||||||
<td><input name="siteName" value="${apiUserBo.siteName!}"/></td>
|
<td><input name="siteName" value="${apiUserBo.siteName!}"/></td>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class ApiUserCfg implements MongoEntity {
|
|||||||
|
|
||||||
public enum ApiUserCfgKey{
|
public enum ApiUserCfgKey{
|
||||||
EVALUATE_RATE,
|
EVALUATE_RATE,
|
||||||
PRICE_TYPE;
|
PRICE_TYPE,
|
||||||
|
ENTERPRISE_VILLAGE_AI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
@@ -1,6 +1,7 @@
|
|||||||
package com.fangjia.open.controllers;
|
package com.fangjia.open.controllers;
|
||||||
|
|
||||||
import com.fangjia.core.util.HttpRequest;
|
import com.fangjia.core.util.HttpRequest;
|
||||||
|
import com.fangjia.dal.mongo.model.ApiUserCfg;
|
||||||
import com.fangjia.dal.mongo.model.Township;
|
import com.fangjia.dal.mongo.model.Township;
|
||||||
import com.fangjia.dal.mongo.model.VillageIdentify;
|
import com.fangjia.dal.mongo.model.VillageIdentify;
|
||||||
import com.fangjia.dal.seaweed.model.District;
|
import com.fangjia.dal.seaweed.model.District;
|
||||||
@@ -10,6 +11,7 @@ import com.fangjia.open.dto.addressGovernance.DistrictDto;
|
|||||||
import com.fangjia.open.dto.addressGovernance.DistrictIdentifyDto;
|
import com.fangjia.open.dto.addressGovernance.DistrictIdentifyDto;
|
||||||
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
||||||
import com.fangjia.open.dto.addressGovernance.StructureAndCompleteDto;
|
import com.fangjia.open.dto.addressGovernance.StructureAndCompleteDto;
|
||||||
|
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||||
import com.fangjia.open.interceptors.Authority;
|
import com.fangjia.open.interceptors.Authority;
|
||||||
import com.fangjia.open.interceptors.Role;
|
import com.fangjia.open.interceptors.Role;
|
||||||
import com.fangjia.open.model.AddesssMatchModel;
|
import com.fangjia.open.model.AddesssMatchModel;
|
||||||
@@ -22,6 +24,7 @@ import com.fangjia.service.datastore.DistrictService;
|
|||||||
import com.fangjia.service.district.DistrictStatService;
|
import com.fangjia.service.district.DistrictStatService;
|
||||||
import com.fangjia.service.mongo.fangjia.TownshipService;
|
import com.fangjia.service.mongo.fangjia.TownshipService;
|
||||||
import com.fangjia.service.mongo.fangjia.VillageIdentifyService;
|
import com.fangjia.service.mongo.fangjia.VillageIdentifyService;
|
||||||
|
import com.fangjia.service.api.ApiUserCfgService;
|
||||||
import com.fangjia.service.open.DistrictAnalyDataService;
|
import com.fangjia.service.open.DistrictAnalyDataService;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
@@ -42,8 +45,10 @@ import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
|
|||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.sothis.core.util.CollectionUtils;
|
import org.sothis.core.util.CollectionUtils;
|
||||||
import org.sothis.core.util.Pager;
|
import org.sothis.core.util.Pager;
|
||||||
|
import org.sothis.web.mvc.ActionContext;
|
||||||
import sun.misc.BASE64Encoder;
|
import sun.misc.BASE64Encoder;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Authenticator;
|
import java.net.Authenticator;
|
||||||
import java.net.PasswordAuthentication;
|
import java.net.PasswordAuthentication;
|
||||||
@@ -64,6 +69,7 @@ public class AddrSvcController {
|
|||||||
private VillageIdentifyService villageIdentifyService;
|
private VillageIdentifyService villageIdentifyService;
|
||||||
private DistrictAnalyDataService districtAnalyDataService;
|
private DistrictAnalyDataService districtAnalyDataService;
|
||||||
private TownshipService townshipService;
|
private TownshipService townshipService;
|
||||||
|
private ApiUserCfgService apiUserCfgService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址结构化
|
* 地址结构化
|
||||||
@@ -1121,6 +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 (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/enterpriseVillageIdentify", params, "UTF-8");
|
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/enterpriseVillageIdentify", params, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1745,4 +1764,8 @@ public class AddrSvcController {
|
|||||||
public void setTownshipService(TownshipService townshipService) {
|
public void setTownshipService(TownshipService townshipService) {
|
||||||
this.townshipService = townshipService;
|
this.townshipService = townshipService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setApiUserCfgService(ApiUserCfgService apiUserCfgService) {
|
||||||
|
this.apiUserCfgService = apiUserCfgService;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+24
@@ -1,14 +1,19 @@
|
|||||||
package com.fangjia.open.controllers;
|
package com.fangjia.open.controllers;
|
||||||
|
|
||||||
import com.fangjia.core.util.HttpRequest;
|
import com.fangjia.core.util.HttpRequest;
|
||||||
|
import com.fangjia.dal.mongo.model.ApiUserCfg;
|
||||||
|
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||||
import com.fangjia.open.interceptors.Authority;
|
import com.fangjia.open.interceptors.Authority;
|
||||||
import com.fangjia.open.interceptors.Role;
|
import com.fangjia.open.interceptors.Role;
|
||||||
import com.fangjia.open.model.AddressModel;
|
import com.fangjia.open.model.AddressModel;
|
||||||
import com.fangjia.open.model.BasicModel;
|
import com.fangjia.open.model.BasicModel;
|
||||||
import com.fangjia.open.model.RestfulModelAndView;
|
import com.fangjia.open.model.RestfulModelAndView;
|
||||||
|
import com.fangjia.service.api.ApiUserCfgService;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.sothis.web.mvc.ActionContext;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -18,6 +23,8 @@ import java.util.Map;
|
|||||||
@Authority(role = Role.USER)
|
@Authority(role = Role.USER)
|
||||||
public class GdBankController {
|
public class GdBankController {
|
||||||
|
|
||||||
|
private ApiUserCfgService apiUserCfgService;
|
||||||
|
|
||||||
private static final Map<String, String> areaMap = new HashMap<String, String>() {
|
private static final Map<String, String> areaMap = new HashMap<String, String>() {
|
||||||
{
|
{
|
||||||
// 添加键值对到 Map 中
|
// 添加键值对到 Map 中
|
||||||
@@ -88,6 +95,19 @@ 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 (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/cebEnterpriseVillageIdentify", params, "UTF-8");
|
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cebEnterpriseVillageIdentify", params, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -115,4 +135,8 @@ public class GdBankController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setApiUserCfgService(ApiUserCfgService apiUserCfgService) {
|
||||||
|
this.apiUserCfgService = apiUserCfgService;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,12 @@ public class ApiUserBo implements Serializable {
|
|||||||
private Date deadTime;
|
private Date deadTime;
|
||||||
private String manager;
|
private String manager;
|
||||||
private String priceType;
|
private String priceType;
|
||||||
|
private String enterpriseVillageAi;
|
||||||
private Integer isMonitor;
|
private Integer isMonitor;
|
||||||
|
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
|
||||||
private String contact; //联系人
|
private String contact; //联系人
|
||||||
|
|
||||||
private String phone; //联系人手机号
|
private String phone; //联系人手机号
|
||||||
@@ -38,6 +42,14 @@ public class ApiUserBo implements Serializable {
|
|||||||
|
|
||||||
private Integer isWarnExpired;
|
private Integer isWarnExpired;
|
||||||
|
|
||||||
|
public String getEnterpriseVillageAi() {
|
||||||
|
return enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseVillageAi(String enterpriseVillageAi) {
|
||||||
|
this.enterpriseVillageAi = enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPriceType() {
|
public String getPriceType() {
|
||||||
return priceType;
|
return priceType;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user