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

This commit is contained in:
尹吉欢
2018-05-22 16:34:19 +08:00
6 changed files with 75 additions and 18 deletions
@@ -19,6 +19,8 @@ public class FangjiaConstant {
public static final int SEND_THREAD_NUM = 100;
public static final int OPEN_APP_TYPE = 0;
public static final int URL_SEND_TYPE = 2;
}
@@ -17,6 +17,26 @@ public class CityStatInfoDto {
// 是否关注该城市(定位城市数据页面使用)
private boolean follow;
public CityStatInfoDto() {
}
public CityStatInfoDto(String id, String city, Integer statDate, Integer avgPrice, Integer index, Double markup,
Double rentRate, Double yoyMarkup, int rangeLevel, Integer downChance, boolean follow) {
super();
this.id = id;
this.city = city;
this.statDate = statDate;
this.avgPrice = avgPrice;
this.index = index;
this.markup = markup;
this.rentRate = rentRate;
this.yoyMarkup = yoyMarkup;
this.rangeLevel = rangeLevel;
this.downChance = downChance;
this.follow = follow;
}
public boolean isFollow() {
return follow;
}
@@ -125,9 +145,8 @@ public class CityStatInfoDto {
// 为实现深copy
@Override
public CityStatInfoDto clone() throws CloneNotSupportedException {
CityStatInfoDto dto = null;
dto = (CityStatInfoDto) super.clone();
return dto;
return new CityStatInfoDto(this.id, this.city, this.statDate, this.avgPrice, this.index, this.markup,
this.rentRate, this.yoyMarkup, this.rangeLevel, this.downChance, this.follow);
}
}
@@ -145,7 +145,7 @@ public class CityRankingSendJob implements SimpleJob {
List<CitySendLog> sendList = citySendLogService.find(city.getUid(), null, sendType);
if ((null == sendList || sendList.isEmpty()) && !list.isEmpty()) {
//取排名并发送
for (int i = 0; i <= list.size(); i++) {
for (int i = 0; i < list.size(); i++) {
if (city.getCity().equals(list.get(i).getCity())) {
int rankings = i + 1;// 排名
baseSend(city, rankings, sendType);
@@ -197,8 +197,12 @@ public class CityRankingSendJob implements SimpleJob {
param.setContent(title);
param.setOperation(FangjiaConstant.URL_SEND_TYPE);
param.setOperationPage("/views/house/cityDetail.html?city="+city.getCity());
param.setPushClientId(user.getPushClientId());
pushMessageService.push(param);
if (null != user) {
param.setPushClientId(user.getPushClientId());
pushMessageService.push(param);
} else {
LOG.info("PushClientId查询不到,uid:" + city.getUid());
}
// 记录
citySendLogService.save(city.getCity(), city.getUid(), 0L, sendType);
}
@@ -81,9 +81,14 @@ public class HousingEstateNewsSendJob implements SimpleJob {
param.setTitle(n.getTitle());
param.setContent(pushMsg);
param.setOperation(FangjiaConstant.URL_SEND_TYPE);
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
param.setPushClientId(user.getPushClientId());
pushMessageService.push(param);
param.setOperationPage("/views/district/detail.html?city=" + n.getRecommendDistrictCity() + "&region="
+ n.getRecommendDistrictRegion() + "&name=" + n.getRecommendDistrictName());
if (null != user) {
param.setPushClientId(user.getPushClientId());
pushMessageService.push(param);
} else {
LOG.info("PushClientId查询不到,uid:" + city.getUid());
}
// 4.记录
citySendLogService.save(city.getCity(), city.getUid(), n.getId(),
FangjiaConstant.HOUSING_ESTATE_SEND_TYPE);
@@ -82,9 +82,38 @@ public class TopNewsSendJob implements SimpleJob {
param.setTitle(n.getTitle());
param.setContent(pushMsg);
param.setOperation(FangjiaConstant.URL_SEND_TYPE);
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
param.setPushClientId(user.getPushClientId());
pushMessageService.push(param);
switch (n.getType()) {
case "专题":
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
break;
case "新闻":
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
param.setUserId(city.getUid());
break;
case "推荐城市":
param.setOperationPage("/views/house/cityDetail.html?city=" + n.getCity());
break;
case "投票":
param.setOperation(FangjiaConstant.OPEN_APP_TYPE);
break;
case "活动":
param.setOperation(FangjiaConstant.OPEN_APP_TYPE);
break;
case "推荐小区":
param.setOperationPage(
"/views/district/detail.html?city=" + n.getRecommendDistrictCity() + "&region="
+ n.getRecommendDistrictRegion() + "&name=" + n.getRecommendDistrictName());
break;
default:
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
}
if (null != user) {
param.setPushClientId(user.getPushClientId());
//LOG.info("param:" + JsonUtils.toJson(param));
pushMessageService.push(param);
} else {
LOG.info("PushClientId查询不到,uid:" + city.getUid());
}
// 4.记录
citySendLogService.save(city.getCity(), city.getUid(), n.getId(), FangjiaConstant.NEWS_SEND_TYPE);
}
@@ -14,8 +14,6 @@ public class NewsServiceImpl extends EntityService<News> implements NewsService
private static final int ON_LINE_STATUS = 1;
private static final String NEWS_TYPE = "新闻";
private static final String HOUSING_ESTATE_TYPE = "推荐小区";
@Override
@@ -32,8 +30,8 @@ public class NewsServiceImpl extends EntityService<News> implements NewsService
@Override
public List<News> findTopNews(String city) {
return super.list(new String[] { "status", "top_status", "type", "city" },
new Object[] { ON_LINE_STATUS, TOP_STATUS, NEWS_TYPE, city });
return super.list(new String[] { "status", "top_status", "city" },
new Object[] { ON_LINE_STATUS, TOP_STATUS, city });
}
@Override