This commit is contained in:
2018-04-23 17:00:42 +08:00
parent d5ed649437
commit ed982e8124
3 changed files with 20 additions and 2 deletions
@@ -30,6 +30,11 @@ public class DistrictDetail {
*/ */
private String name; private String name;
/**
* 物业类型
*/
private String estateType;
/** /**
* 地址 * 地址
*/ */
@@ -517,6 +522,14 @@ public class DistrictDetail {
this.rank = rank; this.rank = rank;
} }
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
} }
@@ -55,7 +55,7 @@ public class DistrictInfoJob implements SimpleJob{
final FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, openApiUrl); final FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, openApiUrl);
DBCollection collection = seaweedMongoTemplate.getCollection("seaweed"); DBCollection collection = seaweedMongoTemplate.getCollection("seaweed");
DBCursor cursor = collection.find(new BasicDBObject("cat", "district").append("status", 0), 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); final Semaphore semaphore = new Semaphore(10);
while (cursor.hasNext()) { while (cursor.hasNext()) {
final DBObject data = cursor.next(); final DBObject data = cursor.next();
@@ -90,9 +90,14 @@ public class DistrictInfoJob implements SimpleJob{
if (id != null) { if (id != null) {
districtDetail.setId(id); districtDetail.setId(id);
} }
String estateType = "";
if(data.containsKey("estate_type2")){
estateType = (String) data.get("estate_type2");
}
districtDetail.setCity(city); districtDetail.setCity(city);
districtDetail.setRegion(region); districtDetail.setRegion(region);
districtDetail.setName(name); districtDetail.setName(name);
districtDetail.setEstateType(estateType);
districtDetail.setModifyTime(new Date()); districtDetail.setModifyTime(new Date());
mongoTemplate.save(districtDetail); mongoTemplate.save(districtDetail);
}catch(Exception e) { }catch(Exception e) {
@@ -95,7 +95,7 @@
<!-- 有房小区详情信息汇总 每周一0点10分执行--> <!-- 有房小区详情信息汇总 每周一0点10分执行-->
<job:simple id="districtInfoJob" class="com.fangjia.job.youfang.job.DistrictInfoJob" registry-center-ref="regCenter" <job:simple id="districtInfoJob" class="com.fangjia.job.youfang.job.DistrictInfoJob" registry-center-ref="regCenter"
sharding-total-count="1" cron="0 10 0 ? * 2" sharding-item-parameters="" sharding-total-count="1" cron="0 46 16 ? * 2" sharding-item-parameters=""
failover="true" description="【有房】 有房小区详情信息汇总" failover="true" description="【有房】 有房小区详情信息汇总"
overwrite="true" event-trace-rdb-data-source="elasticJobLog" job-exception-handler="com.fangjia.job.youfang.handler.CustomJobExceptionHandler"> overwrite="true" event-trace-rdb-data-source="elasticJobLog" job-exception-handler="com.fangjia.job.youfang.handler.CustomJobExceptionHandler">