Merge remote-tracking branch 'origin/master'
This commit is contained in:
+2
-1
@@ -623,7 +623,8 @@ public class ApiUserController {
|
|||||||
* @param AuthorityBo
|
* @param AuthorityBo
|
||||||
* :用户的appKey username、等资料
|
* :用户的appKey username、等资料
|
||||||
*/
|
*/
|
||||||
List<OpenResource> openResourceList = openResourceService.findAll();
|
List<QueryParam> queryParams = Arrays.asList(new QueryParam("pubStatus", 1));
|
||||||
|
List<OpenResource> openResourceList = openResourceService.findOpenResource(queryParams);
|
||||||
List<AuthorityBo> authorityBoList = new ArrayList<AuthorityBo>();
|
List<AuthorityBo> authorityBoList = new ArrayList<AuthorityBo>();
|
||||||
ApiUserAuthority authority = apiUserAuthorityService.findByUserId(model.getUserId());
|
ApiUserAuthority authority = apiUserAuthorityService.findByUserId(model.getUserId());
|
||||||
if (authority == null) {
|
if (authority == null) {
|
||||||
|
|||||||
+16
-4
@@ -2,10 +2,7 @@ package com.fangjia.bkoff.controllers;
|
|||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.fangjia.bkoff.model.JsonModel;
|
import com.fangjia.bkoff.model.JsonModel;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -42,6 +39,15 @@ public class OpenResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Object doAddAction(OpenResourceModel model) {
|
public Object doAddAction(OpenResourceModel model) {
|
||||||
|
List<OpenResource> openResource = this.openResourceService.findOpenResource(null);
|
||||||
|
HashSet<Integer> apiCodeSet = new HashSet<Integer>();
|
||||||
|
for (OpenResource resource : openResource) {
|
||||||
|
apiCodeSet.add(resource.getApiCode());
|
||||||
|
}
|
||||||
|
if (model.getApiCode() != 0 && apiCodeSet.contains(model.getApiCode())){
|
||||||
|
model.setMsg("APICode已存在");
|
||||||
|
return model;
|
||||||
|
}
|
||||||
if (!"doAdd".equals(model.getMethod())) {
|
if (!"doAdd".equals(model.getMethod())) {
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
@@ -70,7 +76,9 @@ public class OpenResourceController {
|
|||||||
OpenResource r = new OpenResource();
|
OpenResource r = new OpenResource();
|
||||||
r.setUri(uri);
|
r.setUri(uri);
|
||||||
r.setName(name);
|
r.setName(name);
|
||||||
|
r.setApiCode(model.getApiCode());
|
||||||
r.setSaveResult(model.getSave_result());
|
r.setSaveResult(model.getSave_result());
|
||||||
|
r.setPubStatus(model.getPubStatus() ? 1 : 0);
|
||||||
r.setDescription(model.getDescription());
|
r.setDescription(model.getDescription());
|
||||||
this.openResourceService.save(r);
|
this.openResourceService.save(r);
|
||||||
model.setMsg("添加成功!");
|
model.setMsg("添加成功!");
|
||||||
@@ -80,6 +88,7 @@ public class OpenResourceController {
|
|||||||
public Object doChangeAction(OpenResourceModel model){
|
public Object doChangeAction(OpenResourceModel model){
|
||||||
Map<String, Object> data = new HashMap<String, Object>();
|
Map<String, Object> data = new HashMap<String, Object>();
|
||||||
data.put("saveResult",model.getSave_result());
|
data.put("saveResult",model.getSave_result());
|
||||||
|
data.put("pubStatus",model.getPubStatus() ? 1 : 0);
|
||||||
this.openResourceService.update(data,model.getId());
|
this.openResourceService.update(data,model.getId());
|
||||||
model.setMsg("保存成功");
|
model.setMsg("保存成功");
|
||||||
JsonModel model1 = new JsonModel();
|
JsonModel model1 = new JsonModel();
|
||||||
@@ -105,6 +114,9 @@ public class OpenResourceController {
|
|||||||
if (StringUtils.isNotBlank(model.getDescription())) {
|
if (StringUtils.isNotBlank(model.getDescription())) {
|
||||||
data.put("description", model.getDescription());
|
data.put("description", model.getDescription());
|
||||||
}
|
}
|
||||||
|
if (0 != model.getApiCode()){
|
||||||
|
data.put("apiCode",model.getApiCode());
|
||||||
|
}
|
||||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||||
params.add(new QueryParam("uri", uri));
|
params.add(new QueryParam("uri", uri));
|
||||||
params.add(new QueryParam("name", name));
|
params.add(new QueryParam("name", name));
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ public class OpenResourceModel extends BaseModel {
|
|||||||
private Boolean save_result;
|
private Boolean save_result;
|
||||||
|
|
||||||
private OpenResource or;
|
private OpenResource or;
|
||||||
|
private Boolean pubStatus;
|
||||||
|
|
||||||
|
private int apiCode;
|
||||||
|
|
||||||
public String getExceptId() {
|
public String getExceptId() {
|
||||||
return exceptId;
|
return exceptId;
|
||||||
@@ -116,4 +119,20 @@ public class OpenResourceModel extends BaseModel {
|
|||||||
public void setSave_result(Boolean save_result) {
|
public void setSave_result(Boolean save_result) {
|
||||||
this.save_result = save_result;
|
this.save_result = save_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getPubStatus() {
|
||||||
|
return pubStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPubStatus(Boolean pubStatus) {
|
||||||
|
this.pubStatus = pubStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getApiCode() {
|
||||||
|
return apiCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiCode(int apiCode) {
|
||||||
|
this.apiCode = apiCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,11 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
.resizable-td {
|
||||||
|
resize: horizontal; /* 允许水平调整大小 */
|
||||||
|
overflow: auto; /* 显示滚动条以便查看超出部分 */
|
||||||
|
min-width: 50px; /* 设置最小宽度,防止过于缩小 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -58,28 +63,33 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
API数量: <b>${authorityBoList?size}</b>个
|
API数量: <b>${authorityBoList?size}</b>个
|
||||||
<th align="center" width="15%">
|
<th align="center" width="50px">
|
||||||
|
APICode
|
||||||
|
</th>
|
||||||
|
<th align="center" width="100px">
|
||||||
uri
|
uri
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="15%">
|
<th align="center" width="100px">
|
||||||
API名称
|
API名称
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="10%">
|
<th align="center" width="60px">
|
||||||
是否有权限<input type="checkbox" id="auth" >全选</input>
|
是否有权限</br>
|
||||||
|
<input type="checkbox" id="auth" >全选</input>
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="30%">
|
<th align="center" width="100px">
|
||||||
访问最大次数(每天)/(总数)
|
访问最大次数(每天)/(总数)
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="15%">
|
<th align="center" width="60px">
|
||||||
访问次数修改
|
访问次数修改
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="10%">
|
<th align="center" width="70px">
|
||||||
是否按查得计费<input type="checkbox" id="isCheckCount" >全选</input>
|
是否按查得计费</br>
|
||||||
|
<input type="checkbox" id="isCheckCount" >全选</input>
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="10%">
|
<th align="center" width="70px">
|
||||||
计费次数(当天)/(历史)
|
计费次数(当天)/(历史)
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="15%">
|
<th align="center" width="150px">
|
||||||
操作
|
操作
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -88,10 +98,13 @@
|
|||||||
<#list authorityBoList as bo>
|
<#list authorityBoList as bo>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
${bo.apiCode!}
|
||||||
|
</td>
|
||||||
|
<td align="center" class="resizable-td">
|
||||||
<input type="hidden" id="uri_${bo_index + 1}" value="${bo.uri!}"></input>
|
<input type="hidden" id="uri_${bo_index + 1}" value="${bo.uri!}"></input>
|
||||||
${bo.uri!}
|
${bo.uri!}
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center" class="resizable-td">
|
||||||
${bo.name!}
|
${bo.name!}
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
@@ -99,16 +112,15 @@
|
|||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<#if bo.limitCountMap?? && bo.limitCountMap[bo.uri!]??>
|
<#if bo.limitCountMap?? && bo.limitCountMap[bo.uri!]??>
|
||||||
<input type="text" value="${bo.limitCountMap[bo.uri!]}" name="limit" id="limit_${bo_index + 1}" style="width:80px;" ></input>
|
<input type="text" value="${bo.limitCountMap[bo.uri!]}" name="limit" id="limit_${bo_index + 1}" style="width:40px;" readonly></input>
|
||||||
<#else>
|
<#else>
|
||||||
<input type="text" value="" name="limit" id="limit_${bo_index + 1}" style="width:80px;" ></input>
|
<input type="text" value="" name="limit" id="limit_${bo_index + 1}" style="width:60px;" readonly></input>
|
||||||
</#if>
|
</#if>
|
||||||
|
/
|
||||||
/
|
|
||||||
<#if bo.totalCountMap?? && bo.totalCountMap[bo.uri!]??>
|
<#if bo.totalCountMap?? && bo.totalCountMap[bo.uri!]??>
|
||||||
<input type="text" value="${bo.totalCountMap[bo.uri!]}" name="sum" id="sum_${bo_index + 1}" style="width:80px;" readonly ></input>
|
<input type="text" value="${bo.totalCountMap[bo.uri!]}" name="sum" id="sum_${bo_index + 1}" style="width:40px;" readonly ></input>
|
||||||
<#else>
|
<#else>
|
||||||
<input type="text" value="" name="sum" id="sum_${bo_index + 1}" style="width:80px;" readonly></input>
|
<input type="text" value="" name="sum" id="sum_${bo_index + 1}" style="width:60px;" readonly></input>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ table{text-align: left;}
|
|||||||
<form id="_form" action="doAdd" method="post">
|
<form id="_form" action="doAdd" method="post">
|
||||||
<input name="method" value="doAdd" type="hidden"/>
|
<input name="method" value="doAdd" type="hidden"/>
|
||||||
<table style = "border:0px;">
|
<table style = "border:0px;">
|
||||||
|
<tr><td width="20%"><strong>APICode</strong></td><td width="30%"><input size="35" id="apiCode" name="apiCode" value="${apiCode!}"/></td><td width="50%"><font color="red" id="_apiCode_error"></font></td></tr>
|
||||||
<tr><td width="20%"><strong>名称</strong></td><td width="30%"><input size="35" id="name" name="name" value="${name!}"/></td><td width="50%"><font color="red" id="_name_error"></font></td></tr>
|
<tr><td width="20%"><strong>名称</strong></td><td width="30%"><input size="35" id="name" name="name" value="${name!}"/></td><td width="50%"><font color="red" id="_name_error"></font></td></tr>
|
||||||
<tr><td><strong>URI</strong></td><td><input size="35" id="uri" name="uri" value="${uri!}"/></td><td><font color="red" id="_uri_error"></font></td></tr>
|
<tr><td><strong>URI</strong></td><td><input size="35" id="uri" name="uri" value="${uri!}"/></td><td><font color="red" id="_uri_error"></font></td></tr>
|
||||||
<tr><td><strong>说明</strong></td><td colspan="2"><input size="40" id="description" name="description" value="${description!}"/></td></tr>
|
<tr><td><strong>说明</strong></td><td colspan="2"><input size="40" id="description" name="description" value="${description!}"/></td></tr>
|
||||||
@@ -32,6 +33,12 @@ table{text-align: left;}
|
|||||||
<label><input name="save_result" type="radio" value="true" checked/>监控 </label>
|
<label><input name="save_result" type="radio" value="true" checked/>监控 </label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr><td><strong>是否对外</strong></td>
|
||||||
|
<td colspan="2">
|
||||||
|
<label><input name="pubStatus" type="radio" value="true" />不对外 </label>
|
||||||
|
<label><input name="pubStatus" type="radio" value="true" checked/>对外 </label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr><td clospan="2"><input type="button" id="_sub" value="创建"/></td></tr>
|
<tr><td clospan="2"><input type="button" id="_sub" value="创建"/></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ table{text-align: left;}
|
|||||||
<input type="hidden" name="id" value="${or.id}"/>
|
<input type="hidden" name="id" value="${or.id}"/>
|
||||||
<input name="method" value="doUpdate" type="hidden"/>
|
<input name="method" value="doUpdate" type="hidden"/>
|
||||||
<table style = "border:0px;">
|
<table style = "border:0px;">
|
||||||
|
<tr><td width="20%"><strong>APICode</strong></td><td width="30%"><#if apiCode != 0>
|
||||||
|
<input size="35" id="apiCode" name="apiCode" value="${apiCode}"/>
|
||||||
|
<#else>
|
||||||
|
<input size="35" id="apiCode" name="apiCode" value="${or.apiCode}"/>
|
||||||
|
</#if></td><td width="50%"><font color="red" id="_apiCode_error"></font></td></tr>
|
||||||
<tr><td width="20%"><strong>名称</strong></td><td width="30%"><input size="35" id="name" name="name" value="${name!or.name}"/></td><td width="50%"><font color="red" id="_name_error"></font></td></tr>
|
<tr><td width="20%"><strong>名称</strong></td><td width="30%"><input size="35" id="name" name="name" value="${name!or.name}"/></td><td width="50%"><font color="red" id="_name_error"></font></td></tr>
|
||||||
<tr><td><strong>URI</strong></td><td><input size="35" id="uri" name="uri" value="${uri!or.uri}"/></td><td><font color="red" id="_uri_error"></font></td></tr>
|
<tr><td><strong>URI</strong></td><td><input size="35" id="uri" name="uri" value="${uri!or.uri}"/></td><td><font color="red" id="_uri_error"></font></td></tr>
|
||||||
<tr><td><strong>说明</strong></td><td colspan="2"><input size="40" id="description" name="description" value="${description!or.description}"/></td></tr>
|
<tr><td><strong>说明</strong></td><td colspan="2"><input size="40" id="description" name="description" value="${description!or.description}"/></td></tr>
|
||||||
|
|||||||
@@ -47,8 +47,8 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="center" width="15%">
|
<th align="center" width="50px">
|
||||||
ID
|
APICode
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="15%">
|
<th align="center" width="15%">
|
||||||
名称
|
名称
|
||||||
@@ -56,15 +56,18 @@
|
|||||||
<th align="center" width="15%">
|
<th align="center" width="15%">
|
||||||
URI
|
URI
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="10%">
|
<th align="center" width="100px">
|
||||||
监控返回结果
|
监控返回结果
|
||||||
</th>
|
</th>
|
||||||
|
<th align="center" width="100px">
|
||||||
|
是否对外
|
||||||
|
</th>
|
||||||
<th align="center" width="20%">
|
<th align="center" width="20%">
|
||||||
说明
|
说明
|
||||||
</th>
|
</th>
|
||||||
<th align="center" width="10%">
|
<#-- <th align="center" width="10%">-->
|
||||||
是否有字权限
|
<#-- 是否有字权限-->
|
||||||
</th>
|
<#-- </th>-->
|
||||||
<th>
|
<th>
|
||||||
操作
|
操作
|
||||||
</th>
|
</th>
|
||||||
@@ -74,7 +77,7 @@
|
|||||||
<#list ors as or>
|
<#list ors as or>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
${or.id}
|
${or.apiCode!}
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
${or.name!}
|
${or.name!}
|
||||||
@@ -86,17 +89,20 @@
|
|||||||
<input type="checkbox" value="false" <#if or.saveResult??&&or.saveResult==true>checked </#if> id="jk_${or.id}"
|
<input type="checkbox" value="false" <#if or.saveResult??&&or.saveResult==true>checked </#if> id="jk_${or.id}"
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
${or.description!}
|
<input type="checkbox" value="false" <#if or.pubStatus??&&or.pubStatus==1>checked </#if> id="pub_${or.id}"
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<#if or.hasSubResource>
|
${or.description!}
|
||||||
有
|
|
||||||
<#else>
|
|
||||||
无
|
|
||||||
</#if>
|
|
||||||
</td>
|
</td>
|
||||||
|
<#-- <td align="center">-->
|
||||||
|
<#-- <#if or.hasSubResource>-->
|
||||||
|
<#-- 有-->
|
||||||
|
<#-- <#else>-->
|
||||||
|
<#-- 无-->
|
||||||
|
<#-- </#if>-->
|
||||||
|
<#-- </td>-->
|
||||||
<td>
|
<td>
|
||||||
<a onclick="return confirm('您确定要删除这条信息吗?');" href="../openResource/doDelete?id=${or.id}">删除</a>
|
<a onclick="return confirm('您确定要删除这条信息吗?');" href="../openResource/doDelete?id=${or.id}">删除</a>
|
||||||
<a href="../openResource/doUpdate?id=${or.id}">编辑</a>
|
<a href="../openResource/doUpdate?id=${or.id}">编辑</a>
|
||||||
<a href="#" onclick="saveSingle(this)" value="${or.id}">保存</a>
|
<a href="#" onclick="saveSingle(this)" value="${or.id}">保存</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -118,18 +124,27 @@
|
|||||||
var a = $(e);
|
var a = $(e);
|
||||||
var id = a.attr("value");
|
var id = a.attr("value");
|
||||||
var eck = $('#jk_'+id).attr("checked");
|
var eck = $('#jk_'+id).attr("checked");
|
||||||
|
var eck2 = $('#pub_'+id).attr("checked");
|
||||||
var flag = false;
|
var flag = false;
|
||||||
|
var flag2 = false;
|
||||||
if (eck == "checked") {
|
if (eck == "checked") {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
flag= false;
|
flag= false;
|
||||||
}
|
}
|
||||||
|
if (eck2 == "checked") {
|
||||||
|
flag2 = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
flag2 = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
url: "../openResource/doChange",
|
url: "../openResource/doChange",
|
||||||
data: "id="+id+"&save_result="+flag,
|
data: "id="+id+"&save_result="+flag+"&pubStatus="+flag2,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public class OpenResource implements MongoEntity {
|
|||||||
|
|
||||||
private Boolean saveResult;
|
private Boolean saveResult;
|
||||||
|
|
||||||
|
private int pubStatus;
|
||||||
|
|
||||||
|
private int apiCode;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@Column(name = "_id")
|
@Column(name = "_id")
|
||||||
@@ -115,4 +119,22 @@ public class OpenResource implements MongoEntity {
|
|||||||
public void setSaveResult(Boolean saveResult) {
|
public void setSaveResult(Boolean saveResult) {
|
||||||
this.saveResult = saveResult;
|
this.saveResult = saveResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Column(name = "pub_status")
|
||||||
|
public int getPubStatus() {
|
||||||
|
return pubStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPubStatus(int pubStatus) {
|
||||||
|
this.pubStatus = pubStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "api_code")
|
||||||
|
public int getApiCode() {
|
||||||
|
return apiCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiCode(int apiCode) {
|
||||||
|
this.apiCode = apiCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
package com.fangjia.script.gj.data_handle
|
||||||
|
|
||||||
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
|
import com.fangjia.script.util.CosineSimilarAlgorithm
|
||||||
|
import com.fangjia.script.util.ExcelUtils
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找重复小区
|
||||||
|
*/
|
||||||
|
class DistrictRepeatBatch {
|
||||||
|
|
||||||
|
static main(args) {
|
||||||
|
def task = new DistrictRepeatBatch()
|
||||||
|
task.run()
|
||||||
|
}
|
||||||
|
|
||||||
|
def run(){
|
||||||
|
def rets = []
|
||||||
|
rets << ["id","城市","区域", "名称", "物业类型", "地址", "备注", "id(重复)","城市(重复)","区域(重复)", "名称(重复)", "物业类型(重复)", "地址(重复)", "相似度"]
|
||||||
|
def citys = CommonDatautils.findAllCity()
|
||||||
|
def index = 0
|
||||||
|
for(def city : citys){
|
||||||
|
index++
|
||||||
|
def districts = CommonDatautils.findAllDistricts(city, "district", ["city", "region", "name", "address","estate_type2","lat", "lng"])
|
||||||
|
def rows = findRepeatByEstateType(districts)
|
||||||
|
rets.addAll(rows)
|
||||||
|
println "【${index}】 "+city +" 完成比对"
|
||||||
|
}
|
||||||
|
|
||||||
|
ExcelUtils.write("D:\\数据\\小区重复数据处理.xlsx", rets, "小区")
|
||||||
|
}
|
||||||
|
|
||||||
|
def findRepeatByEstateType(districts){
|
||||||
|
def rows = []
|
||||||
|
def ids = []
|
||||||
|
for(def d1 : districts){
|
||||||
|
if(ids.contains(d1._id.toString())){
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for(def d2 : districts){
|
||||||
|
if(d1._id.toString() == d2._id.toString()){
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if(d1.estate_type2!=d2.estate_type2){
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
def d1_name = d1.name.replace("别墅", "").replace("商住楼", "").replace("商住", "").replace("小区", "")
|
||||||
|
def d2_name = d2.name.replace("别墅", "").replace("商住楼", "").replace("商住", "").replace("小区", "")
|
||||||
|
if(d1_name != d2_name){
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def key1 = d1.region+"-"+d1_name+"-"+d1.address
|
||||||
|
def key2 = d2.region+"-"+d2_name+"-"+d2.address
|
||||||
|
def score = CosineSimilarAlgorithm.getSimilarityRatio(key1, key2);
|
||||||
|
if(score>0.9){
|
||||||
|
ids << d1._id.toString()
|
||||||
|
ids << d2._id.toString()
|
||||||
|
rows << [d1._id.toString(), d1.city, d1.region, d1.name, d1.estate_type2, d1.address, "物业类型", d2._id.toString(), d2.city, d2.region, d2.name, d2.estate_type2, d2.address, score]
|
||||||
|
println d1.region +" "+d1.name +" "+d1.address +" 重复数据("+d2.region+" "+d2.name+" "+d2.address+") score:"+score
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,6 +33,10 @@ public class AuthorityBo implements Serializable {
|
|||||||
private long totalVisitedCount;
|
private long totalVisitedCount;
|
||||||
private Integer isCheckCount;//是否按查得计费 1:是 ,0:否
|
private Integer isCheckCount;//是否按查得计费 1:是 ,0:否
|
||||||
|
|
||||||
|
private int pubStatus;
|
||||||
|
|
||||||
|
private int apiCode;
|
||||||
|
|
||||||
public Map<String, BasicDBObject> getResourceAuthorityMap() {
|
public Map<String, BasicDBObject> getResourceAuthorityMap() {
|
||||||
return resourceAuthorityMap;
|
return resourceAuthorityMap;
|
||||||
}
|
}
|
||||||
@@ -158,7 +162,19 @@ public class AuthorityBo implements Serializable {
|
|||||||
this.totalVisitedCount = totalVisitedCount;
|
this.totalVisitedCount = totalVisitedCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPubStatus() {
|
||||||
|
return pubStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPubStatus(int pubStatus) {
|
||||||
|
this.pubStatus = pubStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getApiCode() {
|
||||||
|
return apiCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiCode(int apiCode) {
|
||||||
|
this.apiCode = apiCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user