代码优化

This commit is contained in:
bayi
2018-05-22 11:48:28 +08:00
parent 6a36c4659d
commit 10fb91163a
4 changed files with 40 additions and 9 deletions
@@ -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);
}
}
@@ -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());
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);
}
@@ -82,8 +82,12 @@ public class HousingEstateNewsSendJob implements SimpleJob {
param.setContent(pushMsg);
param.setOperation(FangjiaConstant.URL_SEND_TYPE);
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
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);
@@ -83,8 +83,12 @@ public class TopNewsSendJob implements SimpleJob {
param.setContent(pushMsg);
param.setOperation(FangjiaConstant.URL_SEND_TYPE);
param.setOperationPage("/views/news/newsDetail.html?newsId=" + n.getId());
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.NEWS_SEND_TYPE);
}