Merge branch 'FSHJOB1.2' of 192.168.0.27:dev0/fangjia-job into FSHJOB1.2

This commit is contained in:
尹吉欢
2018-05-04 13:37:11 +08:00
2 changed files with 20 additions and 1 deletions
@@ -31,6 +31,12 @@ public class DistrictDetail {
*/
private String name;
/**
* 物业类型
*/
@Field("estate_type")
private String estateType;
/**
* 地址
*/
@@ -566,6 +572,14 @@ public class DistrictDetail {
this.rank = rank;
}
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
public double getLevelRate() {
return levelRate;
}
@@ -55,7 +55,7 @@ public class DistrictInfoJob implements SimpleJob{
final FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, openApiUrl);
DBCollection collection = seaweedMongoTemplate.getCollection("seaweed");
DBCursor cursor = collection.find(new BasicDBObject("cat", "district").append("status", 0),
new BasicDBObject("city", 1).append("region", 1).append("name", 1)).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
new BasicDBObject("city", 1).append("region", 1).append("name", 1).append("estate_type2", 1)).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
final Semaphore semaphore = new Semaphore(10);
while (cursor.hasNext()) {
final DBObject data = cursor.next();
@@ -90,10 +90,15 @@ public class DistrictInfoJob implements SimpleJob{
if (id != null) {
districtDetail.setId(id);
}
String estateType = "";
if(data.containsKey("estate_type2")){
estateType = (String) data.get("estate_type2");
}
districtDetail.setDistrictKey(city + "_" + region + "_" + name);
districtDetail.setCity(city);
districtDetail.setRegion(region);
districtDetail.setName(name);
districtDetail.setEstateType(estateType);
districtDetail.setModifyTime(new Date());
mongoTemplate.save(districtDetail);
}catch(Exception e) {