修改代码字符编码

This commit is contained in:
2026-02-24 17:53:50 +08:00
parent 2495fe5f6d
commit c8418c7d4b
5195 changed files with 121754 additions and 121754 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
<version>0.0.1-SNAPSHOT</version>
<name>script</name>
<properties>
<project.build.sourceEncoding>GBK</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>script</finalName>
@@ -24,18 +24,18 @@ public class FetchPageToDB {
private StringBuffer verificationErrors = new StringBuffer();
private Set<String> URLset = new HashSet<String>();
private String baseUrl = "http://bol.szhome.com/";//基础url
private String firstEndUrl = "/search.aspx";//用基础url拼接成进入页面第一个URl
private String detailStartUrl = "";//把它作为前置Url拼接A标记的href,
static final String CITY = "深圳";//城市
static final String SITE_NAME = "深圳房地产信息网";//网站名称
static final String PAGE_NAME = "详细信息";//页面类型
private String baseUrl = "http://bol.szhome.com/";//基础url
private String firstEndUrl = "/search.aspx";//用基础url拼接成进入页面第一个URl
private String detailStartUrl = "";//把它作为前置Url拼接A标记的href,
static final String CITY = "深圳";//城市
static final String SITE_NAME = "深圳房地产信息网";//网站名称
static final String PAGE_NAME = "详细信息";//页面类型
static final String CATEGORY = "district";
static final String charset = "utf-8";//编码格式utf-8
static final String nextPageStr = ">";//下一页按钮的文本内容一般为:“下一页”or">"
static final int BreakPointpageCount = 1; //断点位置页数(即为开始页)
static final int pageCount = 200; //分页总数
static final String selectAeleStr = ".imgdiv a";//每页内容中选择到详细页面url标记
static final String charset = "utf-8";//编码格式utf-8
static final String nextPageStr = ">";//下一页按钮的文本内容一般为:“下一页”or">"
static final int BreakPointpageCount = 1; //断点位置页数(即为开始页)
static final int pageCount = 200; //分页总数
static final String selectAeleStr = ".imgdiv a";//每页内容中选择到详细页面url标记
@Before
public void setUp() throws Exception {
@@ -50,25 +50,25 @@ public class FetchPageToDB {
driver.get(baseUrl + firstEndUrl);
dryRun(driver,BreakPointpageCount);//空跑到断点页面
fetchDetail(driver);//获取第一个页面的内容
dryRun(driver,BreakPointpageCount);//空跑到断点页面
fetchDetail(driver);//获取第一个页面的内容
System.out.printf("处理完成第%d页\r\n",BreakPointpageCount);
System.out.printf("处理完成第%d页\r\n",BreakPointpageCount);
for(int i=BreakPointpageCount+1;i<=pageCount;i++) { //循环分页处理页面内容
for(int i=BreakPointpageCount+1;i<=pageCount;i++) { //循环分页处理页面内容
Thread.sleep(500);
WebDriverWait webDriverWait = new WebDriverWait(driver, 10);
webDriverWait.until(ExpectedConditions.presenceOfElementLocated(By.linkText(nextPageStr))).click();
fetchDetail(driver);
System.out.printf("处理完成第%d页\r\n",i);
System.out.printf("处理完成第%d页\r\n",i);
}
}
/**
* 空跑到上一个发生错误的页面
* 空跑到上一个发生错误的页面
* @param driver
* @param BreakPointpageCount
* @throws InterruptedException
@@ -87,7 +87,7 @@ public class FetchPageToDB {
}
/**
* 获取页面详细内容保存到数据库
* 获取页面详细内容保存到数据库
* @param driver
*/
public void fetchDetail(WebDriver driver){
@@ -101,7 +101,7 @@ public class FetchPageToDB {
}
String detailContent = InvokeHttpRequest.get(detailUrl, charset,null);
URLset.add(detailUrl);
SaveToWebpage.DataSaveToWebpage(CITY, SITE_NAME, PAGE_NAME, CATEGORY, detailUrl, detailContent);//保存数据
SaveToWebpage.DataSaveToWebpage(CITY, SITE_NAME, PAGE_NAME, CATEGORY, detailUrl, detailContent);//保存数据
}
}
@After
@@ -22,7 +22,7 @@ public class FetchPageUtil {
/**
* 打印传入页面渲染后的源码
* 打印传入页面渲染后的源码
* @param url
* @throws InterruptedException
*/
@@ -33,7 +33,7 @@ public class FetchPageUtil {
driver.quit();
}
/**
* 打印页面源码和选择器匹配后的结果
* 打印页面源码和选择器匹配后的结果
* @param url
* @param selectStr
* @throws InterruptedException
@@ -46,7 +46,7 @@ public class FetchPageUtil {
driver.quit();
}
/**
* 测试分页是否正常运行
* 测试分页是否正常运行
* @param url
* @param nextStr
* @throws InterruptedException
@@ -75,8 +75,8 @@ public class FetchPageUtil {
}
@Test
public void runMain() throws InterruptedException{
//printPageSource("http://bol.szhome.com/search.aspx");//第一步,查看分页的渲染后源码
printselects("http://bol.szhome.com/search.aspx",".imgdiv a");//根据源码写出选择器String
//TestNext("http://bol.szhome.com/search.aspx",">");//测试分页
//printPageSource("http://bol.szhome.com/search.aspx");//第一步,查看分页的渲染后源码
printselects("http://bol.szhome.com/search.aspx",".imgdiv a");//根据源码写出选择器String
//TestNext("http://bol.szhome.com/search.aspx",">");//测试分页
}
}
@@ -46,7 +46,7 @@ public class JQueryUtils {
try{
if(repeatTimes>0){
Thread.sleep(1000);
System.out.println( "准备尝试第"+(repeatTimes+1)+"次请求:$url");
System.out.println( "准备尝试第"+(repeatTimes+1)+"次请求:$url");
}
doc = Jsoup.parse(new URL(url), 5*1000);
if(doc != null){
@@ -58,7 +58,7 @@ public class JQueryUtils {
}
if(doc==null){
System.out.println("检测到不可访问链接:$url");
System.out.println("检测到不可访问链接:$url");
}
return doc;
}
@@ -69,7 +69,7 @@ public class JQueryUtils {
try{
if(repeatTimes>0){
Thread.sleep(1000);
System.out.println("准备尝试第"+(repeatTimes+1)+"次请求:$url");
System.out.println("准备尝试第"+(repeatTimes+1)+"次请求:$url");
}
URL _url = new URL(url);
input = _url.openStream();
@@ -92,7 +92,7 @@ public class JQueryUtils {
}
if(doc==null){
System.out.println("检测到不可访问链接:$url");
System.out.println("检测到不可访问链接:$url");
}
return doc;
}
@@ -70,7 +70,7 @@ public class SaveToWebpage {
}
/**
* ѹËõ
* 压缩
*
* @param content
* @return
+2 -2
View File
@@ -7,7 +7,7 @@
<version>0.0.1-SNAPSHOT</version>
<name>chafangtong-dal</name>
<properties>
<project.build.sourceEncoding>GBK</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>chafangtong-dal</finalName>
@@ -19,7 +19,7 @@
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>GBK</encoding>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
@@ -10,7 +10,7 @@ import javax.persistence.Table;
import com.fangjia.dal.MongoEntity;
/**
* ·¿ÆÀ¿¨Óû§·´À¡±í
* 房评卡用户反馈表
*
*/
@Entity
@@ -11,7 +11,7 @@ import javax.persistence.Table;
import com.fangjia.dal.MongoEntity;
/**
* 房评卡报告下载记录表
* 房评卡报告下载记录表
*
*/
@Entity
@@ -25,9 +25,9 @@ public class FpkDownload implements MongoEntity {
private String city;
private String region;
private String districtName;
private int actionType;//1:住宅 2:商铺
private int valid; //0:有效 1:无效
// TODO 按需求加字段 如:报告的一些信息
private int actionType;//1:住宅 2:商铺
private int valid; //0:有效 1:无效
// TODO 按需求加字段 如:报告的一些信息
private Date downloadDate;
private String userName;
private String roleName;
@@ -11,7 +11,7 @@ import javax.persistence.Table;
import com.fangjia.dal.MongoEntity;
/**
* ·¿ÆÀ¿¨Óû§·´À¡±í
* 房评卡用户反馈表
*
*/
@Entity
@@ -11,7 +11,7 @@ import javax.persistence.Table;
import com.fangjia.dal.MongoEntity;
/**
* 房评卡菜单表
* 房评卡菜单表
*
*/
@Entity
@@ -20,10 +20,10 @@ public class FpkMenu implements MongoEntity {
private static final long serialVersionUID = -6309545731097038246L;
private String id;
private String name; // 名称
private String type; // 类型 目前分住宅、商铺
private String uri; // 访问地址 如:/local/shop
private int sn; // 序号 从小到大排序
private String name; // 名称
private String type; // 类型 目前分住宅、商铺
private String uri; // 访问地址 如:/local/shop
private int sn; // 序号 从小到大排序
private Date creationDate;
private Date modificationDate;
@@ -12,7 +12,7 @@ import javax.persistence.Table;
import com.fangjia.dal.MongoEntity;
/**
* 角色
* 角色
*
*/
@Entity
@@ -21,9 +21,9 @@ public class FpkRole implements MongoEntity {
private static final long serialVersionUID = 6346725824282407782L;
private String id;
private String name; // 名称
private String desc; // 描述
private List<String> menuStrs; // 权限菜单 有序
private String name; // 名称
private String desc; // 描述
private List<String> menuStrs; // 权限菜单 有序
private Date creationDate;
private Date modificationDate;
@@ -12,7 +12,7 @@ import javax.persistence.Table;
import com.fangjia.dal.MongoEntity;
/**
* 房评卡用户表
* 房评卡用户表
*
*/
@Entity
@@ -26,10 +26,10 @@ public class FpkUsers implements MongoEntity {
private String name;
private String password;
private boolean enabled;
private String role; // 用户类型
private Date creationDate; // 创建日期
private Date modificationDate; // 修改日期
private Date expiryDate; // 有效期(截至日期)
private String role; // 用户类型
private Date creationDate; // 创建日期
private Date modificationDate; // 修改日期
private Date expiryDate; // 有效期(截至日期)
private int fangpingApplyAdd;
private int fangpingApplyCount;
private int fangpingDownloadCount;
@@ -37,8 +37,8 @@ public class FpkUsers implements MongoEntity {
private int shopApplyCount;
private int shopDownloadCount;
private String company;
private List<String> propertySupportCitys; // 住宅开通城市
private List<String> shopSupportCitys; //商铺开通城市
private List<String> propertySupportCitys; // 住宅开通城市
private List<String> shopSupportCitys; //商铺开通城市
private String email;
private String defaultCity;
@@ -32,7 +32,7 @@ public class ChafangtongContextLoaderListener extends ContextLoaderListener {
}
super.contextInitialized(event);
// Ô¤ÈÈ
// 预热
if (LOGGER.isInfoEnabled()) {
LOGGER.info("warm up keyword links...");
}
@@ -30,7 +30,7 @@ import com.fangjia.dal.seaweed.model.District;
import com.fangjia.service.mongo.fangjia.BusStationService;
/**
* 环境指数
* 环境指数
* @author yk
*
*/
@@ -54,13 +54,13 @@ public class AroundController extends BaseController {
double lng = district.getLng2()/10000000000d;
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
String[] ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "机场", "网吧" };
String[] ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "机场", "网吧" };
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
@@ -71,24 +71,24 @@ public class AroundController extends BaseController {
JSONObject json = baiduApiService.searchNearby(keys[i], lat, lng, 1000, model.getBaiduMapKey());
countMap.put(keys[i], getTotal(json));
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
model.setAirPort("虹桥机场");
model.setAirPort("虹桥机场");
model.setAirPortLat(31.200062);
model.setAirPortLng(121.352578);
countMap.put("机场", 1);
countMap.put("机场", 1);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
model.setAirPort("浦东机场");
model.setAirPort("浦东机场");
model.setAirPortLat(31.160702);
model.setAirPortLng(121.807085);
countMap.put("机场", 1);
countMap.put("机场", 1);
}
}
@@ -120,22 +120,22 @@ public class AroundController extends BaseController {
double lng = mall.getLng2()/10000000000d;
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
String[] ks = new String[] { "医院", "公园", "学校", "体育馆" };
String[] ks = new String[] { "医院", "公园", "学校", "体育馆" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
JSONObject json = baiduApiService.searchNearby(ks[i], lat, lng, radius, model.getBaiduMapKey());
countMap.put(ks[i], getTotal(json));
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
double score1 = ShopScoreUtil.aroundScore1(countMap);
model.setScore1(score1);
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
JSONObject json = baiduApiService.searchNearby(ks[i], lat, lng, radius, model.getBaiduMapKey());
@@ -123,7 +123,7 @@ public class AutocompleteController {
//nameQuery.add(new TermQuery(new Term("address", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("addr_alias_std", keyword)), Occur.SHOULD);
nameQuery.add(new TermQuery(new Term("keyword", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
srQuery1.add(nameQuery, Occur.SHOULD);
params.add(new QueryParam("$sr", new SrQuery(srQuery1)));
List<District> districts = districtService.findAllByParams(params, 0, limit, new String[] { "region", "name","address", "addrAlias" });
@@ -138,7 +138,7 @@ public class AutocompleteController {
bo.setRegion(district.getRegion());
ret.add(bo);
}
//对自动完成出来的结果按长短排序
//对自动完成出来的结果按长短排序
if(ret.size() > 0){
Collections.sort(ret, new Comparator<AutoCompleteBo>() {
public int compare(AutoCompleteBo o1, AutoCompleteBo o2) {
@@ -104,16 +104,16 @@ public abstract class BaseController {
}
/**
* 根据cookie或者用户输入关键字,填充经纬度、mall信息到cookie和model
* 根据cookie或者用户输入关键字,填充经纬度、mall信息到cookie和model
*/
protected void fillShop2CookieModel(ChafangtongModel model) {
// TODO 不用每次都去seaweed查询mall,可根据是否是新提交表单、存下的mallid来查,优化性能
// TODO 不用每次都去seaweed查询mall,可根据是否是新提交表单、存下的mallid来查,优化性能
HttpServletResponse response = ActionContext.getContext().getResponse();
String keyword = model.getQ();
if (StringUtils.isNotBlank(keyword)) {
Shop mall = null;
// open地址匹配
// open地址匹配
Map<String, Object> resMap = addressService.parse(model.getCityName(), keyword, "shop", false);
if (MapUtils.isNotEmpty(resMap)) {
if (resMap.containsKey("status") && (Integer) resMap.get("status") == 0 && resMap.containsKey("precise")
@@ -124,14 +124,14 @@ public abstract class BaseController {
}
if ("general".equals(model.getControllerName())) {
// 记录用户搜索词open匹配结果
// 记录用户搜索词open匹配结果
HttpServletRequest request = ActionContext.getContext().getRequest();
AddressMatchLog addressMatchLog = new AddressMatchLog();
addressMatchLog.setCity(model.getCityName());
addressMatchLog.setInput(model.getQ());
addressMatchLog.setIp(AnalyticsUtil.getIpAddress(request));
addressMatchLog.setUid(cookieContext.getCookieValue(request, "fpk_uid"));
addressMatchLog.setSource("房评卡");
addressMatchLog.setSource("房评卡");
addressMatchLog.setUserName(cookieContext.getCookieValue(request, "fpk_name"));
addressMatchLog.setCreationDate(new Date());
addressMatchLog.setModificationDate(new Date());
@@ -203,7 +203,7 @@ public abstract class BaseController {
}
protected void fillDistrict2CookieModel(ChafangtongModel model) {
// TODO 不用每次都去seaweed查询district,可根据是否是新提交表单、存下的districtid来查,优化性能
// TODO 不用每次都去seaweed查询district,可根据是否是新提交表单、存下的districtid来查,优化性能
HttpServletResponse response = ActionContext.getContext().getResponse();
String keyword = model.getQ();
if (StringUtils.isNotBlank(keyword)) {
@@ -31,7 +31,7 @@ import com.fangjia.dal.seaweed.model.District;
import com.fangjia.service.mongo.fangjia.BizShopService;
/**
* 消费指数
* 消费指数
* @author yk
*
*/
@@ -54,7 +54,7 @@ public class ConsumController extends BaseController {
double lat = district.getLat2()/10000000000d;
double lng = district.getLng2()/10000000000d;
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "美食"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "美食"));
double cityConsumMin = model.getCityConsumMin()!=null?model.getCityConsumMin():15;
double cityConsumMax = model.getCityConsumMax()!=null?model.getCityConsumMax():150;
@@ -62,7 +62,7 @@ public class ConsumController extends BaseController {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, JSONObject> result = baiduApiService.searchNearBy(Arrays.asList(ks), lat, lng, 1000, model.getBaiduMapKey());
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks) {
@@ -87,13 +87,13 @@ public class ConsumController extends BaseController {
// model.setAroundSell(aroundMarkers);
// }
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
if (null != model.getAvgConsumption()) {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, JSONObject> result = baiduApiService.searchNearBy(Arrays.asList(ks), lat, lng, 1000, model.getBaiduMapKey());
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks) {
@@ -13,7 +13,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* Òâ¼û·´À¡
* 意见反馈
* Created by wenyan on 2015/11/24.
*/
public class FeedbackController {
@@ -54,7 +54,7 @@ import com.fangjia.service.mongo.fangjia.DistrictHotService;
import com.fangjia.service.mongo.fangjia.PricePredictService;
/**
* 首页
* 首页
*
* @author yk
*
@@ -92,7 +92,7 @@ public class GeneralController extends BaseController {
}
model.setDistrict(district);
/* 坐标 */
/* 坐标 */
double lat = district.getLat2()/10000000000d;
double lng = district.getLng2()/10000000000d;
double radius = getRadius();
@@ -100,16 +100,16 @@ public class GeneralController extends BaseController {
String city = district.getCity();
String region = district.getRegion();
// 房价指数
// 房价指数
RegionStat cityStat = regionStatService.findByCity(model.getCityName());
DistrictStatBo statBo = districtStatService.findYearPeriodStatBo(districtKey);
model.setStatBo(statBo);
DistrictStat stat = statBo.getDefaultDistrictStat();
String estateType = district.getEstateType2();
if(!estateType.contains("别墅")){
estateType = "小区";
if(!estateType.contains("别墅")){
estateType = "小区";
}else{
estateType = "别墅";
estateType = "别墅";
}
List<Integer> rentList = new ArrayList<Integer>();
Map<Integer,Integer> districtStatRents = districtStatRentService.findByDistrictStatRent(districtKey, estateType);
@@ -134,13 +134,13 @@ public class GeneralController extends BaseController {
model.setPriceScore(DistrictScoreUtil.priceScore2(null == stat ? null: stat.getAvgPrice(), pricelist.get(0), pricelist.get(1), rentList));
// 潜力指数
// 潜力指数
int avgPrice = 0;
String buildType = "小区";
String buildType = "小区";
if (null == statBo.getDistrictStat()
&& null != statBo.getVillaDistrictStat()) {
avgPrice = statBo.getVillaDistrictStat().getAvgPrice();
buildType = "别墅";
buildType = "别墅";
} else if (null != statBo.getDistrictStat()) {
avgPrice = statBo.getDistrictStat().getAvgPrice();
}
@@ -166,54 +166,54 @@ public class GeneralController extends BaseController {
}
model.setRankScore(DistrictScoreUtil.rankScore2(houseCountRatio, dealPriceCountRatio));
// 消费指数
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, 1000, "美食");
String[] allKw = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院",
"学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧", "发电厂", "变电站", "垃圾焚烧厂", "化工厂"};
// 消费指数
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, 1000, "美食");
String[] allKw = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院",
"学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧", "发电厂", "变电站", "垃圾焚烧厂", "化工厂"};
Map<String,JSONObject> searchResult = baiduApiService.searchNearBy(Arrays.asList(allKw), lat, lng, 1000, model.getBaiduMapKey());
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(searchResult.get(ks[i])));
}
model.setConsumScore(DistrictScoreUtil.consumScore(avgConsumption,countMap));
// 环境指数
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧" };
// 厌恶设施
String[] keys = new String[] { "发电厂", "变电站", "垃圾焚烧厂", "化工厂" };
// 环境指数
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧" };
// 厌恶设施
String[] keys = new String[] { "发电厂", "变电站", "垃圾焚烧厂", "化工厂" };
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(searchResult.get(ks[i])));
}
// 添加厌恶设施
// 添加厌恶设施
for (int i = 0; i < keys.length; i++) {
countMap.put(keys[i], getTotal(searchResult.get(ks[i])));
}
Map<String, List<BusStation>> stationMap = busStationService
.getNearByStations(city, lat, lng, 1000);
countMap.put("地铁站", null == stationMap.get("地铁") ? null : stationMap
.get("地铁").size());
countMap.put("公交点", null == stationMap.get("公交") ? null : stationMap
.get("公交").size());
countMap.put("地铁站", null == stationMap.get("地铁") ? null : stationMap
.get("地铁").size());
countMap.put("公交点", null == stationMap.get("公交") ? null : stationMap
.get("公交").size());
model.setAroundScore(DistrictScoreUtil.aroundScore(countMap));
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils
.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
}
}
// 楼盘指数
// 楼盘指数
model.setDetailScore(DistrictScoreUtil.detailScore(district,seaweedNumbericDao.findDistrict(city, region,district.getName())));
double totalScore = 0d;
@@ -509,12 +509,12 @@ public class GeneralController extends BaseController {
double radius = getRadius();
List<BusStation> metros = null;
List<BusStation> buses = null;
// 综合得分
// 综合得分
SeaweedNumberic numberic = seaweedNumbericDao.findShop(mall.getCity(),
mall.getRegion(), mall.getName());
model.setDetailScore(ShopScoreUtil.detailScore(mall, numberic));
// 房价
// 房价
BizRegionStat cityStat = bizRegionStatService.findCitySellPrice(mall.getCity(),
weekend);
DistrictStatBo statBo = shopStatService.findAllShopStat(
@@ -524,22 +524,22 @@ public class GeneralController extends BaseController {
null == cityStat ? null : cityStat.getAvgPrice()));
model.setStatBo(statBo);
// 租金
// 租金
BizRegionStat cityStatRent = bizRegionStatService.findCityRentPrice(mall.getCity(), weekend);
DistrictBusinessStatRentBo statRentBo = districtBusinessStatRentService
.findMallStatBo(new DistrictKey(mall.getCity(), mall.getRegion(), mall.getName()), weekend);
model.setRentScore(ShopScoreUtil.rentScore(statRentBo,null == cityStatRent ? null : cityStatRent.getAvgPrice(), mall.getPaymentPattern()));
// 地段
// 地段
Map<String, List<BusStation>> stationMap = busStationService
.getNearByStations(mall.getCity(), lat, lng, radius);
metros = stationMap.get("地铁");
buses = stationMap.get("公交");
metros = stationMap.get("地铁");
buses = stationMap.get("公交");
model.setLocalScore(ShopScoreUtil.localScore(mall.getLoopLineInfo(),
null == metros ? 0 : metros.size(),
null == buses ? 0 : buses.size()));
// 人口
// 人口
int cityAvgPrice = cityPriceLevelService.findCityPriceLevel(city);
cityAvgPrice = cityAvgPrice == 0 ? 7000 : cityAvgPrice;
@@ -547,7 +547,7 @@ public class GeneralController extends BaseController {
lng, radius);
int totalHouseCount = getTotalHouseCount(districts, cityAvgPrice);
// 居民人口密度
// 居民人口密度
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
double density = totalHouseCount * 2.49 / circleArea;
double peopleScore1 = ShopScoreUtil.peopleScore1(density);
@@ -556,38 +556,38 @@ public class GeneralController extends BaseController {
radius);
int totalOfficeCount = getTotalOfficeCount(offices);
// 办公人口
// 办公人口
density = totalOfficeCount / circleArea;
double peopleScore2 = ShopScoreUtil.peopleScore2(density);
model.setPeopleScore(peopleScore1 > peopleScore2 ? peopleScore1
: peopleScore2);
String[] allKs = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"
String[] allKs = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"
};
Map<String,JSONObject> searchResult = baiduApiService.searchNearBy(Arrays.asList(allKs), lat, lng, radius, model.getBaiduMapKey());
// 消费
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
// 消费
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks){
countMap.put(k, getTotal(searchResult.get(k)));
}
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, radius, "餐厅");
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, radius, "餐厅");
model.setConsumScore(ShopScoreUtil.consumScore(avgConsumption, countMap));
// 环境
ks = new String[] { "医院", "公园", "学校", "体育馆" };
// 环境
ks = new String[] { "医院", "公园", "学校", "体育馆" };
countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks){
countMap.put(k, getTotal(searchResult.get(k)));
}
countMap.put("地铁站", null == metros ? null : metros.size());
countMap.put("公交点", null == buses ? null : buses.size());
countMap.put("地铁站", null == metros ? null : metros.size());
countMap.put("公交点", null == buses ? null : buses.size());
double aroundScore1 = ShopScoreUtil.aroundScore1(countMap);
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks){
countMap.put(k, getTotal(searchResult.get(k)));
@@ -750,7 +750,7 @@ public class GeneralController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
} else {
@@ -769,7 +769,7 @@ public class GeneralController extends BaseController {
}
return oldHouseCount + hightLevelDistrictHouseCount
+ commonDistrictHouseCount;// 总户数
+ commonDistrictHouseCount;// 总户数
}
return 0;
}
@@ -846,13 +846,13 @@ public class GeneralController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount
+ office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount
+ office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount
+ office.getHouseholdCount();
} else {
@@ -41,12 +41,12 @@ public class LocalController extends BaseController {
double lng = mall.getLng2()/10000000000.0;
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(model.getCityName(), lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
if("上海".equals(model.getCityName())){
// 虹桥机场 121.352578,31.200062
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
if("上海".equals(model.getCityName())){
// 虹桥机场 121.352578,31.200062
model.setDisHongqiaoAirport(GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062));
// 虹桥火车站 121.32795,31.1991
// 虹桥火车站 121.32795,31.1991
model.setDisHongqiaoStation(GeoUtils.calculateDistance(lng, lat, 121.32795, 31.1991));
}
model.setTabScore(ShopScoreUtil.localScore(mall.getLoopLineInfo(), null == model.getMetroStations() ? 0 : model
@@ -42,7 +42,7 @@ public class NodistrictController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没小区,直接返回
// 周边没小区,直接返回
List<District> districts = districtService.findDistrict(lat, lng, radius, model.getCityName());
if (CollectionUtils.isEmpty(districts)) {
return model;
@@ -54,7 +54,7 @@ public class NodistrictController extends BaseController {
model.setCityPrice(cityStat.getAvgPrice());
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(districts, new Comparator<District>() {
public int compare(District o1, District o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -102,11 +102,11 @@ public class NodistrictController extends BaseController {
model.setPriceNearest(priceNearest);
// 范围内均价
// 范围内均价
if (priceCount > 0 && stats.size() > 0) {
model.setAreaPrice(priceCount / stats.size());
Map<String, Integer> priceMap = districtStatService.getCityDistriceMinAndMaxPrice(model.getCityName());
//设置价格
//设置价格
model.setCityDistrictMinSellPrice(priceMap.get("cityDistrictMinSellPrice"));
model.setCityDistrictMaxSellPrice(priceMap.get("cityDistrictMaxSellPrice"));
@@ -124,7 +124,7 @@ public class NodistrictController extends BaseController {
}
}
// 由低到高排序
// 由低到高排序
Collections.sort(stats, new Comparator<DistrictStat>() {
public int compare(DistrictStat o1, DistrictStat o2) {
return o1.getAvgPrice() - o2.getAvgPrice();
@@ -139,7 +139,7 @@ public class NodistrictController extends BaseController {
}
model.setPriceBtm5(priceBtm5);
// 由高到低排序
// 由高到低排序
Collections.reverse(stats);
List<DistrictStat> priceTop5 = new ArrayList<DistrictStat>(5);
for (DistrictStat s : stats) {
@@ -158,13 +158,13 @@ public class NodistrictController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没小区,直接返回
// 周边没小区,直接返回
List<District> districts = districtService.findDistrict(lat, lng, radius, model.getCityName());
if (CollectionUtils.isEmpty(districts)) {
return model;
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(districts, new Comparator<District>() {
public int compare(District o1, District o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -325,7 +325,7 @@ public class NodistrictController extends BaseController {
double lng = model.getLng();
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
@@ -342,20 +342,20 @@ public class NodistrictController extends BaseController {
double lng = model.getLng();
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
model.setAirPort("虹桥机场");
model.setAirPort("虹桥机场");
model.setAirPortLat(31.200062);
model.setAirPortLng(121.352578);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
model.setAirPort("浦东机场");
model.setAirPort("浦东机场");
model.setAirPortLat(31.160702);
model.setAirPortLng(121.807085);
}
@@ -32,7 +32,7 @@ public class NofoundController extends BaseController {
return model.redirect("/general/district?q=" + URLEncoder.encode(model.getQ(), "UTF-8")+"&cityName="+URLEncoder.encode(model.getCityName(), "UTF-8"));
}
// 查询半径内小区
// 查询半径内小区
final double lat = model.getLat();
final double lng = model.getLng();
final double radius = getRadius();
@@ -50,7 +50,7 @@ public class NofoundController extends BaseController {
return model;
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(tmpDistricts, new Comparator<District>() {
public int compare(District o1, District o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -106,7 +106,7 @@ public class NofoundController extends BaseController {
final double lat = model.getLat();
final double lng = model.getLng();
List<Shop> shops = shopService.searchNearby(lat, lng, getRadius());
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(shops, new Comparator<Shop>() {
public int compare(Shop o1, Shop o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -49,7 +49,7 @@ public class NoshopController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没商铺,直接返回
// 周边没商铺,直接返回
List<Shop> shops = shopService.searchNearby(lat, lng, radius);
if (CollectionUtils.isEmpty(shops)) {
return model;
@@ -61,7 +61,7 @@ public class NoshopController extends BaseController {
model.setCityPrice(cityStat.getAvgPrice());
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(shops, new Comparator<Shop>() {
public int compare(Shop o1, Shop o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -102,7 +102,7 @@ public class NoshopController extends BaseController {
model.setPriceNearest(priceNearest);
// 范围内均价
// 范围内均价
if (priceCount > 0 && stats.size() > 0) {
model.setAreaPrice(priceCount / stats.size());
@@ -120,7 +120,7 @@ public class NoshopController extends BaseController {
}
}
// 由低到高排序
// 由低到高排序
Collections.sort(stats, new Comparator<DistrictStat>() {
public int compare(DistrictStat o1, DistrictStat o2) {
return o1.getAvgPrice() - o2.getAvgPrice();
@@ -135,7 +135,7 @@ public class NoshopController extends BaseController {
}
model.setPriceBtm5(priceBtm5);
// 由高到低排序
// 由高到低排序
Collections.reverse(stats);
List<DistrictStat> priceTop5 = new ArrayList<DistrictStat>(5);
for (DistrictStat s : stats) {
@@ -154,7 +154,7 @@ public class NoshopController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没商铺,直接返回
// 周边没商铺,直接返回
List<Shop> shops = shopService.searchNearby(lat, lng, radius);
if (CollectionUtils.isEmpty(shops)) {
return model;
@@ -166,7 +166,7 @@ public class NoshopController extends BaseController {
model.setCityRentPrice(cityStat.getAvgPrice());
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(shops, new Comparator<Shop>() {
public int compare(Shop o1, Shop o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -201,7 +201,7 @@ public class NoshopController extends BaseController {
model.setRentNearest(priceNearest);
// 范围内均价
// 范围内均价
if (priceCount > 0 && stats.size() > 0) {
model.setAreaRentPrice(priceCount / stats.size());
@@ -219,7 +219,7 @@ public class NoshopController extends BaseController {
}
}
// 由低到高排序
// 由低到高排序
Collections.sort(stats, new Comparator<DistrictBusinessStatRent>() {
public int compare(DistrictBusinessStatRent o1, DistrictBusinessStatRent o2) {
return o1.getAvgPrice() - o2.getAvgPrice();
@@ -234,7 +234,7 @@ public class NoshopController extends BaseController {
}
model.setRentBtm5(priceBtm5);
// 由高到低排序
// 由高到低排序
Collections.reverse(stats);
List<DistrictBusinessStatRent> priceTop5 = new ArrayList<DistrictBusinessStatRent>(5);
for (DistrictBusinessStatRent s : stats) {
@@ -254,16 +254,16 @@ public class NoshopController extends BaseController {
final double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(model.getCityName(), lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
// 虹桥机场 121.352578,31.200062
// 虹桥机场 121.352578,31.200062
model.setDisHongqiaoAirport(GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062));
// 虹桥火车站 121.32795,31.1991
// 虹桥火车站 121.32795,31.1991
model.setDisHongqiaoStation(GeoUtils.calculateDistance(lng, lat, 121.32795, 31.1991));
// 周边没商铺,直接返回
// 周边没商铺,直接返回
List<Shop> shops = shopService.searchNearby(lat, lng, radius);
if (CollectionUtils.isNotEmpty(shops)) {
int priceCount = 0;
@@ -278,7 +278,7 @@ public class NoshopController extends BaseController {
}
}
// 范围内均价
// 范围内均价
if (priceCount > 0 && count > 0) {
model.setAreaPrice(priceCount / count);
}
@@ -380,7 +380,7 @@ public class NoshopController extends BaseController {
double lat = model.getLat();
double lng = model.getLng();
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
@@ -397,8 +397,8 @@ public class NoshopController extends BaseController {
double lng = model.getLng();
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
return model;
}
@@ -617,7 +617,7 @@ public class NoshopController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
oldDistrictCount++;
@@ -636,15 +636,15 @@ public class NoshopController extends BaseController {
}
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
}
return model;
@@ -691,11 +691,11 @@ public class NoshopController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount + office.getHouseholdCount();
} else {
otherLevelCount = otherLevelCount + office.getHouseholdCount();
@@ -78,13 +78,13 @@ public class PeopleController extends BaseController {
JSONArray officesObj = JSONArray.fromObject(offices);
model.setOffices(officesObj.toString());
// 居民人口密度
// 居民人口密度
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
int totalHouseCount = model.getTotalHouseCount();
double density = totalHouseCount * 2.49 / circleArea;
double score1 = ShopScoreUtil.populationScore(density);
data.put("populationScore",score1);
// 办公人口
// 办公人口
int totalCountOffice = model.getTotalCountOffice();
density = totalCountOffice / circleArea;
double score2 = ShopScoreUtil.officePopulationScore(density);
@@ -124,26 +124,26 @@ public class PeopleController extends BaseController {
JSONArray officesObj = JSONArray.fromObject(offices);
model.setOffices(officesObj.toString());
// 居民人口密度
// 居民人口密度
/*double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
int totalHouseCount = model.getTotalHouseCount();
double density = totalHouseCount * 2.49 / circleArea;
double score1 = ShopScoreUtil.peopleScore1(density);
model.setScore1(score1);
// 办公人口
// 办公人口
int totalCountOffice = model.getTotalCountOffice();
density = totalCountOffice / circleArea;
double score2 = ShopScoreUtil.peopleScore2(density);
model.setScore2(score2);*/
//圆形面积
//圆形面积
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
//设置居民人口密度得分
//设置居民人口密度得分
double peopleDensityScore = setPeopleDensityScore(model, radius, circleArea);
//设置办公人口得分
//设置办公人口得分
double officeDensityScore = setOfficeDensityScore(model, circleArea);
model.setTabScore(peopleDensityScore > officeDensityScore ? peopleDensityScore : officeDensityScore);
@@ -182,7 +182,7 @@ public class PeopleController extends BaseController {
}
/**
* 设置办公人口得分
* 设置办公人口得分
* @author yinjihuan
* @date 2016-03-04
* @param model
@@ -190,18 +190,18 @@ public class PeopleController extends BaseController {
* @return
*/
private double setOfficeDensityScore(PeopleModel model, double circleArea) {
//办公人数总数
//办公人数总数
int totalCountOffice = model.getTotalCountOffice();
//办公人口密度=(圆形区域内办公人数总数/圆形面积)
//办公人口密度=(圆形区域内办公人数总数/圆形面积)
double density = totalCountOffice / circleArea;
//办公人口密度得分
//办公人口密度得分
double officeDensityScore = ShopScoreUtil.calcOfficeDensityScore(density);
model.setScore2(officeDensityScore);
return officeDensityScore;
}
/**
* 设置居民人口密度得分
* 设置居民人口密度得分
* @author yinjihuan
* @date 2016-03-04
* @param model
@@ -209,11 +209,11 @@ public class PeopleController extends BaseController {
* @return
*/
private double setPeopleDensityScore(PeopleModel model, double radius, double circleArea) {
// 圆形区域内总户数
// 圆形区域内总户数
int totalHouseCount = model.getTotalHouseCount();
//居民人口密度(居民人口密度 = 圆形区域内总户数*2.49/圆形面积)
//居民人口密度(居民人口密度 = 圆形区域内总户数*2.49/圆形面积)
double density = totalHouseCount * 2.49 / circleArea;
//人口密度得分
//人口密度得分
double peopleDensityScore = ShopScoreUtil.calcPeopleDensityScore(density);
model.setScore1(peopleDensityScore);
return peopleDensityScore;
@@ -319,7 +319,7 @@ public class PeopleController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
oldDistrictCount++;
@@ -338,15 +338,15 @@ public class PeopleController extends BaseController {
}
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
}
return model;
@@ -393,11 +393,11 @@ public class PeopleController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount + office.getHouseholdCount();
} else {
otherLevelCount = otherLevelCount + office.getHouseholdCount();
@@ -43,10 +43,10 @@ public class PredictController extends BaseController{
model.setStatBo(statBo);
int avgPrice = 0;
String buildType = "小区";
String buildType = "小区";
if (null == statBo.getDistrictStat() && null != statBo.getVillaDistrictStat()) {
avgPrice = statBo.getVillaDistrictStat().getAvgPrice();
buildType = "别墅";
buildType = "别墅";
} else if (null != statBo.getDistrictStat()) {
avgPrice = statBo.getDistrictStat().getAvgPrice();
}
@@ -81,7 +81,7 @@ public class PredictController extends BaseController{
}
private void addDistrictStat(List<JSONObject> seriesOptions, DistrictKey districtKey, int weeks) {
List<String> list = Arrays.asList(StringUtils.split(districtService.findDistrictKind(districtKey), ",,"));
List<String> list = Arrays.asList(StringUtils.split(districtService.findDistrictKind(districtKey), ",,"));
List<DistrictStatBo> districtStatBoList = districtStatService.findAllDistrictStatByKind(districtKey, new Date(), weeks,
list);
JSONArray districtJa = new JSONArray();
@@ -130,7 +130,7 @@ public class PredictController extends BaseController{
if (villaJa.length() > 0) {
JSONObject jo2 = new JSONObject();
jo2.put("name", districtKey.getName() + "(别墅)");
jo2.put("name", districtKey.getName() + "(别墅)");
jo2.put("data", villaJa.toString());
jo2.put("yAxis", 0);
seriesOptions.add(jo2);
@@ -35,7 +35,7 @@ import java.net.URLEncoder;
import java.util.*;
/**
* 价格指数
* 价格指数
* @author yk
*
*/
@@ -51,15 +51,15 @@ public class PriceController extends BaseController {
final static ChafangtongCookieContext cookieContext = ChafangtongCookieContext.getInstance();
public Object districtAction(PriceModel model) throws UnsupportedEncodingException {
/**
* 将"全市相对最低"指标数字变更成上海小区均价升序,前0到3%的均价的中位数。
* "全市相对最高"指标数字变更成上海小区均价升序,前97%到100%的均价的中位数
* 2016-07-05 yinjihuan修改
* 将"全市相对最低"指标数字变更成上海小区均价升序,前0到3%的均价的中位数。
* "全市相对最高"指标数字变更成上海小区均价升序,前97%到100%的均价的中位数
* 2016-07-05 yinjihuan修改
*/
Map<String, Integer> priceMap = districtStatService.getCityDistriceMinAndMaxPrice(model.getCityName());
if (null == priceMap) {
return model.redirect("/noResult/district?q=" + URLEncoder.encode(model.getDistrictName(), "UTF-8") + "&cityName=" +URLEncoder.encode(model.getCityName(), "UTF-8"));
}
//设置价格
//设置价格
model.setCityDistrictMinSellPrice(priceMap.get("cityDistrictMinSellPrice"));
model.setCityDistrictMaxSellPrice(priceMap.get("cityDistrictMaxSellPrice"));
@@ -108,17 +108,17 @@ public class PriceController extends BaseController {
if(StringUtils.isNotBlank(district.getRegion())){
params.add(new QueryParam("region", district.getRegion()));
}
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
params.add(new QueryParam("endMonthDate", lastMonthEndDate));
List<RegionStatRent> regionStatRentList=regionStatRentDao.findAllByParams(params);
model.setRegionStatRents(regionStatRentList);
model.setRentStatBos(rentBos);
String estateType = district.getEstateType2();
if(!estateType.contains("别墅")){
estateType = "小区";
if(!estateType.contains("别墅")){
estateType = "小区";
}else{
estateType = "别墅";
estateType = "别墅";
}
List<Integer> rentList = new ArrayList<Integer>();
Map<Integer,Integer> districtStatRents = districtStatRentService.findByDistrictStatRent(districtKey, estateType);
@@ -211,7 +211,7 @@ public class PriceController extends BaseController {
}
List<JSONObject> seriesOptions = new ArrayList<JSONObject>();
String title = name + "均价走势";
String title = name + "均价走势";
DistrictKey districtKey = new DistrictKey(city, region, name);
addDistrictStat(seriesOptions, districtKey, weeks);
@@ -114,7 +114,7 @@ public class RentController extends BaseController {
}
List<JSONObject> seriesOptions = new ArrayList<JSONObject>();
String title = name + "×â½ð×ßÊÆ";
String title = name + "租金走势";
DistrictKey districtKey = new DistrictKey(city, region, name);
addDistrictStat(seriesOptions, districtKey, weeks);
@@ -124,7 +124,7 @@ public class ReportController extends BaseController {
model.setShowPdfLink(true);
}
// 综合指数
// 综合指数
SeaweedNumberic numberic = seaweedNumbericDao.findShop(shop.getCity(), shop.getRegion(), shop.getName());
model.setDetailScore(ShopScoreUtil.detailScore(shop, numberic));
model.setDetailScore1(ShopScoreUtil.detailScore1(shop.getEstateType(), null == numberic ? null : numberic.getBuildArea()));
@@ -132,7 +132,7 @@ public class ReportController extends BaseController {
model.setDetailScore3(ShopScoreUtil.detailScore3(shop.getCarSiteCount()));
model.setDetailScore4(ShopScoreUtil.detailScore4(null == numberic ? null : numberic.getFinishBuildYear()));
// 房价指数
// 房价指数
Date weekend = DateUtil.getFirstDayOfWeek(new Date());
BizRegionStat cityStat = bizRegionStatService.findCitySellPrice(city, weekend);
if (null != cityStat) {
@@ -170,7 +170,7 @@ public class ReportController extends BaseController {
model.setSellTradeUrl(model.getCityUrl() + "/cImg/" + SecurityUtil.encode(urlBuilder.toString())
+ (isRefreshCache ? "?__refresh_cache=1" : ""));
// 租金指数
// 租金指数
DistrictBusinessStatRentBo retnStatBo = districtBusinessStatRentService.findMallStatBo(new DistrictKey(shop.getCity(),
shop.getRegion(), shop.getName()), weekend);
model.setRentStatBo(retnStatBo);
@@ -203,15 +203,15 @@ public class ReportController extends BaseController {
model.setRentTradeUrl(model.getCityUrl() + "/cImg/" + SecurityUtil.encode(urlBuilder.toString())
+ (isRefreshCache ? "?__refresh_cache=1" : ""));
// 地段指数
// 地段指数
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
// 虹桥机场 121.352578,31.200062
// 虹桥机场 121.352578,31.200062
model.setDisHongqiaoAirport(GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062));
// 虹桥火车站 121.32795,31.1991
// 虹桥火车站 121.32795,31.1991
model.setDisHongqiaoStation(GeoUtils.calculateDistance(lng, lat, 121.32795, 31.1991));
model.setLocalScore(ShopScoreUtil.localScore(shop.getLoopLineInfo(), null == model.getMetroStations() ? 0 : model
@@ -263,7 +263,7 @@ public class ReportController extends BaseController {
model.setPieColors(Arrays.asList(new String[]{"#5491c7" ,"#f0776e" ,"#66bd7d" ,"#f5a549" ,"#c075eb"}));
model.setPieMarkers(jFreeChartImageService.getAroundBizTypePieMarkers(lat, lng, radius));
// 人口指数
// 人口指数
int cityAvgPrice = cityPriceLevelService.findCityPriceLevel(city);
cityAvgPrice = cityAvgPrice == 0 ? 7000 : cityAvgPrice;
model.setCityAvgPrice(cityAvgPrice);
@@ -274,14 +274,14 @@ public class ReportController extends BaseController {
List<DistrictInfoBo> offices = findDistricts(city, "office", lat, lng, radius);
offices = getOfficeCommDataInfo(offices, model);
// 居民人口密度
// 居民人口密度
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
int totalHouseCount = model.getTotalHouseCount();
double density = totalHouseCount * 2.49 / circleArea;
double peopleScore1 = ShopScoreUtil.peopleScore1(density);
model.setPeopleScore1(peopleScore1);
// 办公人口
// 办公人口
int totalCountOffice = model.getTotalCountOffice();
density = totalCountOffice / circleArea;
double peopleScore2 = ShopScoreUtil.peopleScore2(density);
@@ -289,17 +289,17 @@ public class ReportController extends BaseController {
model.setPeopleScore(peopleScore1 > peopleScore2 ? peopleScore1 : peopleScore2);
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
if (null != model.getAvgConsumption()) {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
List<String> allKw = Arrays.asList(new String[]{ "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市",
"高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"});
List<String> allKw = Arrays.asList(new String[]{ "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市",
"高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"});
Map<String,JSONObject> baiduKwResult = baiduApiService.searchNearBy(allKw, lat, lng, radius, model.getBaiduMapKey());
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
Integer c = getTotal(baiduKwResult.get(ks[i]));
@@ -310,8 +310,8 @@ public class ReportController extends BaseController {
model.setConsumCountMap(countMap);
model.setConsumScore(ShopScoreUtil.consumScore(model.getAvgConsumption(), countMap));
// 环境指数
ks = new String[] { "医院", "公园", "学校", "体育馆" };
// 环境指数
ks = new String[] { "医院", "公园", "学校", "体育馆" };
Map<String, Integer> aroundCountMap = new HashMap<String, Integer>();
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
@@ -320,14 +320,14 @@ public class ReportController extends BaseController {
countMap.put(ks[i], c);
}
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
aroundCountMap.putAll(countMap);
double aroundScore1 = ShopScoreUtil.aroundScore1(countMap);
model.setAroundScore1(aroundScore1);
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
Integer c = getTotal(baiduKwResult.get(ks[i]));
@@ -438,7 +438,7 @@ public class ReportController extends BaseController {
model.setShowPdfLink(true);
}
// 楼盘指数
// 楼盘指数
SeaweedNumberic numberic = seaweedNumbericDao.findDistrict(city, region, district.getName());
model.setDetailScore(DistrictScoreUtil.detailScore(district, numberic));
@@ -451,9 +451,9 @@ public class ReportController extends BaseController {
model.setDetailScore4(DistrictScoreUtil.detailScore4(nullNumberic ? null : numberic.getCubagePercent()));
model.setDetailScore5(DistrictScoreUtil.detailScore5(district.getBuildType(), nullNumberic ? null : numberic.getCarSiteCount()));
// 房价指数
// 房价指数
RegionStat cityStat = regionStatService.findByCity(city);
// Integer cityLeave = 0;//最高房价和最低房价的差值
// Integer cityLeave = 0;//最高房价和最低房价的差值
if (null != cityStat) {
model.setCityPrice(cityStat.getAvgPrice());
// Integer citySellMin = model.getCityDistrictMinSellPrice();
@@ -478,7 +478,7 @@ public class ReportController extends BaseController {
if(StringUtils.isNotBlank(district.getRegion())){
params.add(new QueryParam("region", district.getRegion()));
}
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
params.add(new QueryParam("endMonthDate", lastMonthEndDate));
List<RegionStatRent> regionStatRentList=regionStatRentDao.findAllByParams(params);
model.setRegionStatRents(regionStatRentList);
@@ -487,10 +487,10 @@ public class ReportController extends BaseController {
rentBo = districtStatRentService.findByDistrictStatRent(districtKey,2);
List<Integer> rentList = new ArrayList<Integer>();
String estateType = district.getEstateType2();
if(!estateType.contains("别墅")){
estateType = "小区";
if(!estateType.contains("别墅")){
estateType = "小区";
}else{
estateType = "别墅";
estateType = "别墅";
}
Map<Integer,Integer> districtStatRents = districtStatRentService.findByDistrictStatRent(districtKey, estateType);
@@ -520,7 +520,7 @@ public class ReportController extends BaseController {
if (null != stat) {
Map<String, Integer> priceMap = districtStatService.getCityDistriceMinAndMaxPrice(model.getCityName());
//设置价格
//设置价格
model.setCityDistrictMinSellPrice(priceMap.get("cityDistrictMinSellPrice"));
model.setCityDistrictMaxSellPrice(priceMap.get("cityDistrictMaxSellPrice"));
@@ -538,11 +538,11 @@ public class ReportController extends BaseController {
}
}
// 潜力指数
String buildType = "小区";
// 潜力指数
String buildType = "小区";
if (null == statBo.getDistrictStat() && null != statBo.getVillaDistrictStat()) {
avgPrice = statBo.getVillaDistrictStat().getAvgPrice();
buildType = "别墅";
buildType = "别墅";
} else if (null != statBo.getDistrictStat()) {
avgPrice = statBo.getDistrictStat().getAvgPrice();
}
@@ -569,9 +569,9 @@ public class ReportController extends BaseController {
model.setSellTradeUrl(model.getCityUrl() + "/cImg/" + SecurityUtil.encode(urlBuilder.toString())
+ (isRefreshCache ? "?__refresh_cache=1" : ""));
// 稀缺指数
// 稀缺指数
model.setRegionOrg(regionBlockService.getOrgName(city, region, "region"));
model.setBlockOrg(block + "板块");
model.setBlockOrg(block + "板块");
model.setRegionDistrictCount(districtService.findRegionDistrictCount(city, region));
//model.setBlockDistrictCount(districtService.findBlockDistrictCount(city, region, block));
model.setCityDistrictCount(districtService.findCityDistrictCount(city));
@@ -612,8 +612,8 @@ public class ReportController extends BaseController {
model.setMaxDealPriceCount(districtAnalyDataService.findMaxDealCountByCity(city));
model.setMaxSellCount(districtAnalyDataService.findMaxSellCountByCity(city));
model.setDistrictAnalyData(districtAnalyData);
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
@@ -621,11 +621,11 @@ public class ReportController extends BaseController {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
List<String> allKs = Arrays.asList(new String[]{
"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧", "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧"
"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧", "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧"
});
Map<String,JSONObject> kwResult = baiduApiService.searchNearBy(allKs, lat, lng, radius, model.getBaiduMapKey());
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" , "银行"};
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" , "银行"};
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(kwResult.get(ks[i])));
@@ -633,34 +633,34 @@ public class ReportController extends BaseController {
model.setConsumCountMap(countMap);
model.setConsumScore(DistrictScoreUtil.consumScore(model.getAvgConsumption(), countMap));
// 环境指数
// 环境指数
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧"};
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧"};
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(kwResult.get(ks[i])));
}
//添加厌恶设施
//添加厌恶设施
for (int i = 0; i < keys.length; i++) {
countMap.put(ks[i], getTotal(kwResult.get(ks[i])));
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
}
}
@@ -760,7 +760,7 @@ public class ReportController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
} else {
if (avgPrice >= model.getCityAvgPrice()) {
@@ -772,10 +772,10 @@ public class ReportController extends BaseController {
}
}
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
}
return model;
}
@@ -820,11 +820,11 @@ public class ReportController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount + office.getHouseholdCount();
} else {
otherLevelCount = otherLevelCount + office.getHouseholdCount();
@@ -872,7 +872,7 @@ public class ReportController extends BaseController {
return model;
}
//获取报告编号
//获取报告编号
public String getNumber(){
String number = "";
while(StringUtil.isBlank(number)){
@@ -914,7 +914,7 @@ public class ReportController extends BaseController {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district.getCity(), district
.getRegion(), district.getName()));
DistrictStat districtStat = null;
if (StringUtils.contains(evaluation.getBuildType(), "别墅")) {
if (StringUtils.contains(evaluation.getBuildType(), "别墅")) {
districtStat = districtStatBo.getVillaDistrictStat();
} else {
districtStat = districtStatBo.getDistrictStat();
@@ -959,7 +959,7 @@ public class ReportController extends BaseController {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district.getCity(), district
.getRegion(), district.getName()));
DistrictStat districtStat = null;
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
districtStat = districtStatBo.getVillaDistrictStat();
} else {
districtStat = districtStatBo.getDistrictStat();
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.Random;
/**
*估价报告查看
*估价报告查看
*@author wenyan
*/
public class ReportViewController extends BaseController {
@@ -47,7 +47,7 @@ public class ReportViewController extends BaseController {
String serialNumber;
// 根据id查找商铺
// 根据id查找商铺
Shop shop = null;
if (StringUtils.isNotBlank(model.getId()) && ObjectId.isValid(model.getId())) {
shop = shopService.findById(model.getId());
@@ -240,7 +240,7 @@ public class ReportViewController extends BaseController {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district.getCity(), district
.getRegion(), district.getName()));
DistrictStat districtStat = null;
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
districtStat = districtStatBo.getVillaDistrictStat();
} else {
districtStat = districtStatBo.getDistrictStat();
@@ -258,7 +258,7 @@ public class ReportViewController extends BaseController {
return avgPrice;
}
//获取报告编号
//获取报告编号
public String getNumber(){
String number = "";
while(StringUtil.isBlank(number)){
@@ -27,7 +27,7 @@ import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.district.ShopStatService;
/**
* 报告样例
* 报告样例
* Created by wenyan on 2015/11/27.
*/
public class SampleController extends BaseController{
@@ -41,7 +41,7 @@ public class SampleController extends BaseController{
DistrictKey districtKey = new DistrictKey(model.getCityName(), model.getRegion(), model.getDistrictName());
District district = districtService.findDistrict(districtKey,"district");
model.setDistrict(district);
/* 获取下载份数,菜单控制by tom */
/* 获取下载份数,菜单控制by tom */
String uid = cookieContext.getCookieValue(request, "fpk_uid");
if (StringUtils.isNotBlank(uid)) {
FpkUsers fpkUser = fpkUsersService.findById(SecurityUtil
@@ -61,7 +61,7 @@ public class SampleController extends BaseController{
DistrictKey districtKey = new DistrictKey(model.getCityName(), model.getRegion(), model.getDistrictName());
District district = districtService.findDistrict(districtKey,"shop");
model.setDistrict(district);
/* 获取下载份数,菜单控制by tom */
/* 获取下载份数,菜单控制by tom */
String uid = cookieContext.getCookieValue(request, "fpk_uid");
if (StringUtils.isNotBlank(uid)) {
FpkUsers fpkUser = fpkUsersService.findById(SecurityUtil
@@ -136,7 +136,7 @@ public class SearchController {
//nameQuery.add(new TermQuery(new Term("address", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("addr_alias_std", keyword)), Occur.SHOULD);
nameQuery.add(new TermQuery(new Term("keyword", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
srQuery1.add(nameQuery, Occur.SHOULD);
params.add(new QueryParam("$sr", new SrQuery(srQuery1)));
List<District> districts = districtService.findAllByParams(params, 0, limit, new String[] { "region", "name","address", "addrAlias" });
@@ -151,7 +151,7 @@ public class SearchController {
bo.setRegion(district.getRegion());
ret.add(bo);
}
//对自动完成出来的结果按长短排序
//对自动完成出来的结果按长短排序
if(ret.size() > 0){
Collections.sort(ret, new Comparator<AutoCompleteBo>() {
public int compare(AutoCompleteBo o1, AutoCompleteBo o2) {
@@ -35,11 +35,11 @@ public class ShapeController {
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,360);
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,rim);
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.fillArc(50,50,300,300,90,360);
g2d.setColor(new Color(0,115,230));
Map<TextAttribute, Object> attributes = new HashMap<TextAttribute, Object>();
@@ -61,7 +61,7 @@ public class ShapeController {
unitStart = 200 + 25;
}else if("0".equals(scoreStr)){
scoreStr ="-";
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString(scoreStr, 200 - w + 10, 230);
unitStart = 175;
}else{
@@ -70,11 +70,11 @@ public class ShapeController {
}
if("0".equals(scoreStr)){
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 200);
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 200);
}else{
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 252);
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 252);
}
g2d.dispose();
cache.put(model.getScore(), image);
@@ -37,33 +37,33 @@ public class UserController {
mav.setModel(data);
String password = model.getPassword();
if (StringUtils.isBlank(model.getUserName())) {
data.put("userNameMsg","用户名不能为空");
data.put("userNameMsg","用户名不能为空");
return mav;
}
if (StringUtils.isBlank(model.getPassword())) {
data.put("passwordMsg","密码不能为空");
data.put("passwordMsg","密码不能为空");
return mav;
}
FpkUsers user = fpkUsersDao.findByName(model.getUserName());
if (null == user) {
data.put("userNameMsg","用户名不存在");
data.put("userNameMsg","用户名不存在");
return mav;
}
if (!user.getPassword().equals(DigestUtils.md5Hex(password))) {
data.put("passwordMsg","密码错误");
data.put("passwordMsg","密码错误");
return mav;
}
if(!user.isEnabled()){
data.put("userNameMsg","账户被禁用,请联系我们!");
data.put("userNameMsg","账户被禁用,请联系我们!");
return mav;
}
if(user.getExpiryDate() != null && user.getExpiryDate().before(new Date())){
data.put("userNameMsg","您的账户已过期!");
data.put("userNameMsg","您的账户已过期!");
return mav;
}
@@ -86,7 +86,7 @@ public class UserController {
}
}
if(city == null || location == null){
data.put("userNameMsg","权限不足!");
data.put("userNameMsg","权限不足!");
}else{
if(StringUtils.isNotBlank(model.getForm())){
location = URLDecoder.decode(model.getForm(),"UTF-8");
@@ -122,7 +122,7 @@ public class UserController {
mav.setModel(data);
FpkUsers users = model.getUser();
if(!users.getPassword().equals(DigestUtils.md5Hex(model.getPasswordOld()))){
data.put("passwordOldMsg","原密码错误");
data.put("passwordOldMsg","原密码错误");
return mav;
}
Map<String,Object> map = new HashMap<String, Object>();
@@ -151,7 +151,7 @@ public class UserController {
}
/**
* 链接请求直接登录(新需求)
* 链接请求直接登录(新需求)
* @param model
* @param req
* @param response
@@ -191,7 +191,7 @@ public class UserController {
}
try {
return model.redirect("/noResult/district?cityName="+URLEncoder.encode("上海", "utf-8"));
return model.redirect("/noResult/district?cityName="+URLEncoder.encode("上海", "utf-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
@@ -73,7 +73,7 @@ public class AccessLogFilter implements Filter {
LOGGER.error("error process request: request_url=" + analyticsBean.requestUrl + ", referer="
+ analyticsBean.refererUrl, rootCause);
}
// 记录运行超过1秒的请求到日志中
// 记录运行超过1秒的请求到日志中
final long time = System.currentTimeMillis() - start;
final String actionUri = (String) request.getAttribute(ActionContext.ACTION_URI);
if (time > 1000 || (!ChafangtongConfig.getConfig().isProductionEnvironment() && executeCounter.getTotalCount() > 0)) {
@@ -94,7 +94,7 @@ public class AccessLogFilter implements Filter {
private void writeAccessLog(AnalyticsBean analyticsBean, long duration, String actionUri, int statusCode, String method) {
StringBuilder logStr = new StringBuilder();
// 不要改变顺序
// 不要改变顺序
logStr.append(DATE_FORMAT.format(analyticsBean.startTime));// 1
logStr.append(SPLIT).append(StringUtils.defaultString(analyticsBean.connectionIp));// 2
logStr.append(SPLIT).append(StringUtils.defaultString(analyticsBean.ip));// 3
@@ -105,7 +105,7 @@ public class AnalyticsBean {
}
/**
* 获得连接客户端的IP(部署环境下一般都设有nginx等http服务器)
* 获得连接客户端的IP(部署环境下一般都设有nginx等http服务器)
*
* @param request
* @return
@@ -123,7 +123,7 @@ public class AnalyticsBean {
String citySpell = getCitySpell(request.getRequestURL().toString());
ServerArea city = ServerAreaData.getServerAreaByNameOrSpellDefaultNull(citySpell);
if (null != city) {
// 保存至cookie
// 保存至cookie
Cookie cityCookie = cookieContext.createCookie(CookieName.COOKIE_CITY, citySpell);
cityCookie.setMaxAge(Integer.MAX_VALUE);
response.addCookie(cityCookie);
@@ -137,7 +137,7 @@ public class AnalyticsBean {
}
private String createUID(HttpServletRequest request, HttpServletResponse response) {
// 设置UUID
// 设置UUID
String uuid = new ObjectId().toString();
Cookie uuidCookie = cookieContext.createCookie(CookieName.UID, uuid);
uuidCookie.setMaxAge(Integer.MAX_VALUE);
@@ -152,7 +152,7 @@ public class AnalyticsBean {
}
private String createSID(HttpServletRequest request, HttpServletResponse response) {
// 设置session id
// 设置session id
String sid = new ObjectId().toString();
Cookie uuidCookie = cookieContext.createCookie(CookieName.SID, sid);
uuidCookie.setMaxAge(-1);
@@ -165,7 +165,7 @@ public class AnalyticsBean {
}
/**
* 请求url,不包括query string
* 请求url,不包括query string
*
* @return
*/
@@ -174,7 +174,7 @@ public class AnalyticsBean {
}
/**
* 请求url后的请求参数,如果参数不为空则包括问号在内
* 请求url后的请求参数,如果参数不为空则包括问号在内
*
* @return
*/
@@ -183,7 +183,7 @@ public class AnalyticsBean {
}
/**
* 请求uri
* 请求uri
*
* @return
*/
@@ -192,7 +192,7 @@ public class AnalyticsBean {
}
/**
* 来源url
* 来源url
*
* @return
*/
@@ -201,7 +201,7 @@ public class AnalyticsBean {
}
/**
* 完整的请求url,包括query string
* 完整的请求url,包括query string
*
* @return
*/
@@ -210,7 +210,7 @@ public class AnalyticsBean {
}
/**
* 是否刷新缓存
* 是否刷新缓存
*
* @return
*/
@@ -219,7 +219,7 @@ public class AnalyticsBean {
}
/**
* 当前城市,可能为null
* 当前城市,可能为null
*
* @return
*/
@@ -228,7 +228,7 @@ public class AnalyticsBean {
}
/**
* 当前城市,不会为null
* 当前城市,不会为null
*
* @return
*/
@@ -237,7 +237,7 @@ public class AnalyticsBean {
}
/**
* cookie中的uid,如果没有则生成新的uid
* cookie中的uid,如果没有则生成新的uid
*
* @return
*/
@@ -246,7 +246,7 @@ public class AnalyticsBean {
}
/**
* 全局的请求id
* 全局的请求id
*
* @return
*/
@@ -255,7 +255,7 @@ public class AnalyticsBean {
}
/**
* cookie中的会话id,如果没有则生成新的sid
* cookie中的会话id,如果没有则生成新的sid
*
* @return
*/
@@ -264,7 +264,7 @@ public class AnalyticsBean {
}
/**
* 是否为ajax请求
* 是否为ajax请求
*
* @return
*/
@@ -273,7 +273,7 @@ public class AnalyticsBean {
}
/**
* 访问者的真实ip
* 访问者的真实ip
*
* @return
*/
@@ -282,7 +282,7 @@ public class AnalyticsBean {
}
/**
* 访问者标识,可能为null
* 访问者标识,可能为null
*
* @return
*/
@@ -291,7 +291,7 @@ public class AnalyticsBean {
}
/**
* 连接ip
* 连接ip
*
* @return
*/
@@ -300,7 +300,7 @@ public class AnalyticsBean {
}
/**
* cookie中的uid,如果没有则为空字符串
* cookie中的uid,如果没有则为空字符串
*
* @return
*/
@@ -309,7 +309,7 @@ public class AnalyticsBean {
}
/**
* cookie中的会话id,如果没有则为空字符串
* cookie中的会话id,如果没有则为空字符串
*
* @return
*/
@@ -318,7 +318,7 @@ public class AnalyticsBean {
}
/**
* 请求开始时间
* 请求开始时间
*
* @return
*/
@@ -59,12 +59,12 @@ public class AnalyticsFilter implements Filter {
ServletException {
final AnalyticsBean analyticsBean = AnalyticsBean.get(request, response);
// 点击日志
// 点击日志
if (analyticsBean.requestUrl.indexOf("/__utm.gif") > -1) {
processUtmGifLog(request, response, analyticsBean);
return;
}
// 判断URL是否合法,不合法则重定向
// 判断URL是否合法,不合法则重定向
String redirectUrl = checkUrlFormat(analyticsBean);
if (null != redirectUrl) {
if (analyticsBean.isSpider()) {
@@ -84,7 +84,7 @@ public class AnalyticsFilter implements Filter {
threadLocalData.put(ThreadLocalKey.DisableCache, "1");
}
// 切换城市
// 切换城市
FangjiaServerAreaContextHolder.setServerArea(analyticsBean.city);
threadLocalData.put(ThreadLocalKey.FromSpider, analyticsBean.isSpider());
chain.doFilter(request, response);
@@ -105,7 +105,7 @@ public class AnalyticsFilter implements Filter {
responseOutputStream.close();
String userAgent = analyticsBean.userAgent;
if (userAgent != null && (userAgent.indexOf("Googlebot-Image") >= 0 || userAgent.indexOf("Baidu") >= 0)) {
// 过滤爬虫的访问
// 过滤爬虫的访问
return;
}
jmsTemplate.send(utmgifDestination, new MessageCreator() {
@@ -138,7 +138,7 @@ public class AnalyticsFilter implements Filter {
}
/**
* 判断URL是否合法,合法则返回null,否则返回重定向URL
* 判断URL是否合法,合法则返回null,否则返回重定向URL
*
* @param requestUrl
* @param requestUri
@@ -148,7 +148,7 @@ public class AnalyticsFilter implements Filter {
private String checkUrlFormat(AnalyticsBean analyticsBean) {
ChafangtongConfig fangjiaConfig = ChafangtongConfig.getConfig();
String hostName = StringUtils.substringBetween(analyticsBean.requestUrl, "http://", "/");
// 如果hostName中有端口号,则把端口号去掉
// 如果hostName中有端口号,则把端口号去掉
int index = hostName.indexOf(":");
if (index > 0) {
hostName = hostName.substring(0, index);
@@ -168,7 +168,7 @@ public class AnalyticsFilter implements Filter {
return fangjiaConfig.getCityDomainName(city) + analyticsBean.requestUri + analyticsBean.queryString;
}
if (city != null) {
// 找到对应的城市,或者是一个有效的二级域名
// 找到对应的城市,或者是一个有效的二级域名
return null;
}
if (prefixSplit[0].equalsIgnoreCase("www")) {
@@ -53,7 +53,7 @@ public class SpiderValidateFilter implements Filter {
private void checkReload() {
if (this.reloading.compareAndSet(false, true)) {
try {
// 5分钟reload一次
// 5分钟reload一次
if (System.currentTimeMillis() - lastReloadTimestamp < 300000) {
return;
}
@@ -87,13 +87,13 @@ public class SpiderValidateFilter implements Filter {
if (isValidUserAgent(ua)) {
for (String spiderName : spiderDomains.keySet()) {
if (!ua.contains(spiderName)) {
// 未声明自己为spider则跳过
// 未声明自己为spider则跳过
continue;
}
if (null == ip) {
spider = new Spider(spiderName, ip, ua);
spider.setFake(true);
// 对ip为null的蜘蛛暂时不入数据库
// 对ip为null的蜘蛛暂时不入数据库
} else {
spider = spiders.get(ip);
if (null == spider) {
@@ -106,7 +106,7 @@ public class SpiderValidateFilter implements Filter {
} else {
spider = new Spider("unkown", ip, ua);
spider.setFake(true);
// 对userAgent为null的蜘蛛暂时不入数据库
// 对userAgent为null的蜘蛛暂时不入数据库
}
}
if (spider != null && spider.isFake()) {
@@ -145,7 +145,7 @@ public class SpiderValidateFilter implements Filter {
private void validateSpider(Spider spider) {
if (null == spider.getId()) {
// 新发现的蜘蛛
// 新发现的蜘蛛
checkSpider(spider);
spiderService.upsertByIp(spider);
spiders.put(spider.getIp(), spider);
@@ -153,23 +153,23 @@ public class SpiderValidateFilter implements Filter {
LOGGER.info("find new spider: " + spider);
}
} else if (spider.isVerified()) {
// 已人工验证的蜘蛛
// 已人工验证的蜘蛛
spiders.put(spider.getIp(), spider);
} else if (spider.isFake()) {
// 已发现的假蜘蛛
// 已发现的假蜘蛛
Date yestoday = DateUtils.addDays(new Date(), -1);
if (spider.getModificationDate().before(yestoday)) {
// 删除超过1天的假蜘蛛信息
// 删除超过1天的假蜘蛛信息
spiderService.deleteByIp(spider.getIp());
spiders.remove(spider.getIp());
} else {
spiders.put(spider.getIp(), spider);
}
} else {
// 已发现的真蜘蛛
// 已发现的真蜘蛛
Date lastWeek = DateUtils.addDays(new Date(), -7);
if (spider.getModificationDate().before(lastWeek)) {
// 重新验证超过7天的真蜘蛛
// 重新验证超过7天的真蜘蛛
checkSpider(spider);
if (spider.isFake()) {
spiderService.deleteByIp(spider.getIp());
@@ -191,10 +191,10 @@ public class SpiderValidateFilter implements Filter {
String host = nslookup(spider.getIp());
if (null != host) {
spider.setHost(host);
// 不是相同域的为假蜘蛛
// 不是相同域的为假蜘蛛
spider.setFake(!isSameDomain(host, spiderDomains.get(spider.getName())));
} else {
// 反向解析失败,则默认为真蜘蛛
// 反向解析失败,则默认为真蜘蛛
spider.setHost(spider.getIp());
spider.setFake(false);
}
@@ -31,7 +31,7 @@ import java.net.URLEncoder;
import java.util.*;
/**
* 查房通权限拦截器
* 查房通权限拦截器
* Created by wenyan on 2015/11/12.
*/
public class AuthenticationInterceptor implements Interceptor {
@@ -75,11 +75,11 @@ public class AuthenticationInterceptor implements Interceptor {
isPassed = false;
}
if(isPassed && city == null){
LOGGER.info("无法访问" + request.getRequestURI() + "请用cityName 指定访问资源所在的城市");
LOGGER.info("无法访问" + request.getRequestURI() + "请用cityName 指定访问资源所在的城市");
error = "noAuth";
}
if(isPassed && !isAccessible(user, city, request)){
LOGGER.info("无法访问" + request.getRequestURI() + "!!!请到菜单管理添加菜单");
LOGGER.info("无法访问" + request.getRequestURI() + "!!!请到菜单管理添加菜单");
isPassed = false;
error = "noAuth";
}
@@ -235,7 +235,7 @@ public class BaseModel extends ModelAndViewSupport {
}
/**
* 如果queryString不为空则在前面加上问号"?",否则不加
* 如果queryString不为空则在前面加上问号"?",否则不加
*
* @return
*/
@@ -5,7 +5,7 @@ import com.fangjia.service.bo.DistrictStatBo;
public class ConsumModel extends ChafangtongModel {
private static final long serialVersionUID = 6142958920656840695L;
private Double avgConsumption; // 周边餐饮人均消费
private Double avgConsumption; // 周边餐饮人均消费
private DistrictStatBo statBo;
private Double higher;
@@ -3,17 +3,17 @@ package com.fangjia.chafangtong.model;
public final class Models {
/**
* 404错误面页的model
* 404错误面页的model
*/
public static final BaseModel NOT_FOUNT = createModel(404, "/error");
/**
* 一般错误面页的model
* 一般错误面页的model
*/
public static final BaseModel ERROR = createModel(500, "/error");
/**
* 500错误面页的model
* 500错误面页的model
*/
public static final BaseModel FORBIDDEN = createModel(400, "/forbidden");
@@ -13,7 +13,7 @@ public class NoResultModel extends ChafangtongModel {
private double maxLng;
double centerLat;
double centerLng;
String type; // r: 矩形搜索(最大最小经纬度),c:圆形搜索(中心点、半径)
String type; // r: 矩形搜索(最大最小经纬度),c:圆形搜索(中心点、半径)
List<Map<String, String>> result;
public List<AroundMarker> getInsideShops() {
@@ -11,15 +11,15 @@ import com.fangjia.service.bo.DistrictStatRentBo;
public class NodistrictModel extends ChafangtongModel {
private static final long serialVersionUID = -2866501361955105846L;
// 房价
// 房价
Integer areaPrice;
Integer cityPrice;
Double priceLeft;
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
// 租金
// 租金
Integer areaRent1;
Integer areaRent2;
Integer areaRent3;
@@ -30,7 +30,7 @@ public class NodistrictModel extends ChafangtongModel {
DistrictStatRent[] rentRank3;
DistrictStatRent[] rentRank4;
Double avgConsumption; // 周边餐饮人均消费
Double avgConsumption; // 周边餐饮人均消费
Double higher;
List<BusStation> metroStations;
@@ -11,30 +11,30 @@ import com.fangjia.service.bo.DistrictStatBo;
public class NoshopModel extends ChafangtongModel {
private static final long serialVersionUID = -170439161907268598L;
// 房价
// 房价
Integer areaPrice;
Integer cityPrice;
Double priceLeft;
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
// 租金
// 租金
Integer areaRentPrice;
Integer cityRentPrice;
Double rentLeft;
List<DistrictBusinessStatRent> rentNearest; // 最近的3个商铺价格
List<DistrictBusinessStatRent> rentTop5; // 最高的5个
List<DistrictBusinessStatRent> rentBtm5; // 最低的5个
List<DistrictBusinessStatRent> rentNearest; // 最近的3个商铺价格
List<DistrictBusinessStatRent> rentTop5; // 最高的5个
List<DistrictBusinessStatRent> rentBtm5; // 最低的5个
// 地段
// 地段
List<BusStation> metroStations;
List<BusStation> busStations;
double disHongqiaoAirport;
double disHongqiaoStation;
Map<String, Double> typePercentMap;
// 人口
// 人口
int cityAvgPrice;
String districts;
String offices;
@@ -55,8 +55,8 @@ public class NoshopModel extends ChafangtongModel {
Double left1;
Double left2;
// 消费
Double avgConsumption; // 周边餐饮人均消费
// 消费
Double avgConsumption; // 周边餐饮人均消费
Double higher;
private final String[] PIE_COLOR_RGBS = new String[] { "#C6DBF7", "#F5EEBD", "#DEE7C6", "#FFD7BD", "#D6C3E7", "#C3E1E7",
@@ -29,7 +29,7 @@ public class ReportModel extends ChafangtongModel {
List<String> pieColors;
List<String> pieMarkers;
// 综合指数
// 综合指数
double detailScore;
double detailScore1;
double detailScore2;
@@ -39,7 +39,7 @@ public class ReportModel extends ChafangtongModel {
double shopArea;
List<Object[]> aroundTypes;
// 房价指数
// 房价指数
double priceScore;
Integer cityPrice;
DistrictStatBo statBo;
@@ -48,21 +48,21 @@ public class ReportModel extends ChafangtongModel {
List<RegionStatRent> regionStatRents;
List<DistrictStatRentBo> rentStatBos;
// 租金指数
// 租金指数
double rentScore;
DistrictBusinessStatRentBo rentStatBo;
String regionPayment;
Double rentLeft;
String rentTradeUrl;
// 地段指数
// 地段指数
double localScore;
double localScore1;
double localScore2;
Integer regionPrice;
String aroundPieUrl;
// 人口指数
// 人口指数
double peopleScore;
double peopleScore1;
double peopleScore2;
@@ -79,26 +79,26 @@ public class ReportModel extends ChafangtongModel {
Double left1;
Double left2;
// 消费指数
// 消费指数
double consumScore;
Double avgConsumption; // 周边餐饮人均消费
Double avgConsumption; // 周边餐饮人均消费
Double higher;
Map<String, Integer> consumCountMap;
// 环境指数
// 环境指数
double aroundScore;
double aroundScore1;
double aroundScore2;
Map<String, Integer> aroundCountMap;
// 潜力指数
// 潜力指数
double predictScore;
Integer predictPrice;
Double predictMarkup;
Integer districtMinPrice;
Integer districtMaxPrice;
// 稀缺指数
// 稀缺指数
double rankScore;
DistrictHot districtHot;
DistrictAttentionRank districtAttention;
@@ -113,7 +113,7 @@ public class ReportModel extends ChafangtongModel {
double totalScore;
private FpkDownload fpkDownload;
//报告编号
//报告编号
private String serialNum;
private Integer totalPrice;
@@ -3,7 +3,7 @@ package com.fangjia.chafangtong.model;
import org.sothis.web.mvc.ModelAndViewSupport;
/**
* 用于restAPI的ModelAndView
* 用于restAPI的ModelAndView
*
* @author velna
*
@@ -49,7 +49,7 @@ public class ChartImgServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");// 注意编码
request.setCharacterEncoding("UTF-8");// 注意编码
String reqUrl = request.getRequestURI();
String i = reqUrl.substring(reqUrl.indexOf("/cImg/") + 6, reqUrl.length());
@@ -107,7 +107,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 处理均价类走势图
* 处理均价类走势图
*
* @throws IOException
*/
@@ -170,7 +170,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 处理租金类走势图
* 处理租金类走势图
*
* @throws IOException
*/
@@ -233,7 +233,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 周边行业饼图
* 周边行业饼图
*
* @throws IOException
*/
@@ -305,7 +305,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 卖家关注度排行柱状图
* 卖家关注度排行柱状图
*
* @throws IOException
*/
@@ -56,7 +56,7 @@ public class ReportServlet extends HttpServlet {
System.setProperty("javax.xml.transform.TransformerFactory",
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
// 字体文件
// 字体文件
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
FONT_PATHS.add(classLoader.getResource("districtreport/SIMSUN.TTC").toString());
FONT_PATHS.add(classLoader.getResource("districtreport/SIMHEI.TTF").toString());
@@ -106,11 +106,11 @@ public class ReportServlet extends HttpServlet {
PdfCopy copy = new PdfCopy(document, resp.getOutputStream());
document.open();
document.newPage();
// // 封面
// // 封面
// PdfReader reader = new PdfReader(FRONTCOVER_DATA);
// PdfImportedPage coverPage = copy.getImportedPage(reader, 1);
// copy.addPage(coverPage);
// // 目录
// // 目录
// reader = new PdfReader(DIRECTORY_DATA);
// PdfImportedPage directoryPage = copy.getImportedPage(reader, 1);
// copy.addPage(directoryPage);
@@ -129,7 +129,7 @@ public class ReportServlet extends HttpServlet {
}
/**
* 根据页面URL获取内容
* 根据页面URL获取内容
*/
private byte[] getPageData(String pagePath,HttpServletRequest request) {
long start = System.currentTimeMillis();
@@ -151,7 +151,7 @@ public class ReportServlet extends HttpServlet {
html = html.replaceAll("&ensp;", "&#8194;");
renderer.setDocumentFromString(html);
// 解决中文支持问题
// 解决中文支持问题
ITextFontResolver fontResolver = renderer.getFontResolver();
for (String path : FONT_PATHS) {
fontResolver.addFont(path, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
@@ -19,9 +19,9 @@ public class DesUtils {
private final static String DES = "DES";
/**
* Description 根据键值进行加密
* Description 根据键值进行加密
* @param data
* @param key 加密键byte数组
* @param key 加密键byte数组
* @return
* @throws Exception
*/
@@ -32,9 +32,9 @@ public class DesUtils {
}
/**
* Description 根据键值进行解密
* Description 根据键值进行解密
* @param data
* @param key 加密键byte数组
* @param key 加密键byte数组
* @return
* @throws IOException
* @throws Exception
@@ -50,27 +50,27 @@ public class DesUtils {
}
/**
* Description 根据键值进行加密
* Description 根据键值进行加密
* @param data
* @param key 加密键byte数组
* @param key 加密键byte数组
* @return
* @throws Exception
*/
private static byte[] encrypt(byte[] data, byte[] key) throws Exception {
// 生成一个可信任的随机数源
// 生成一个可信任的随机数源
SecureRandom sr = new SecureRandom();
// 从原始密钥数据创建DESKeySpec对象
// 从原始密钥数据创建DESKeySpec对象
DESKeySpec dks = new DESKeySpec(key);
// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
SecretKey securekey = keyFactory.generateSecret(dks);
// Cipher对象实际完成加密操作
// Cipher对象实际完成加密操作
Cipher cipher = Cipher.getInstance(DES);
// 用密钥初始化Cipher对象
// 用密钥初始化Cipher对象
cipher.init(Cipher.ENCRYPT_MODE, securekey, sr);
return cipher.doFinal(data);
@@ -78,27 +78,27 @@ public class DesUtils {
/**
* Description 根据键值进行解密
* Description 根据键值进行解密
* @param data
* @param key 加密键byte数组
* @param key 加密键byte数组
* @return
* @throws Exception
*/
private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
// 生成一个可信任的随机数源
// 生成一个可信任的随机数源
SecureRandom sr = new SecureRandom();
// 从原始密钥数据创建DESKeySpec对象
// 从原始密钥数据创建DESKeySpec对象
DESKeySpec dks = new DESKeySpec(key);
// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
SecretKey securekey = keyFactory.generateSecret(dks);
// Cipher对象实际完成解密操作
// Cipher对象实际完成解密操作
Cipher cipher = Cipher.getInstance(DES);
// 用密钥初始化Cipher对象
// 用密钥初始化Cipher对象
cipher.init(Cipher.DECRYPT_MODE, securekey, sr);
return cipher.doFinal(data);
@@ -106,7 +106,7 @@ public class DesUtils {
/**
* Description 获取字符串MD5值
* Description 获取字符串MD5值
* @param sourceStr
*/
private static String MD5(String sourceStr) {
@@ -137,12 +137,12 @@ public class DesUtils {
public static void main(String[] args) throws Exception {
String data = "18616348076_1234561";
String key = "fangjia_pds_goojia"; //秘钥
String key = "fangjia_pds_goojia"; //秘钥
String encode = encrypt(data, key);
System.err.println("加密:"+encode);
System.err.println("加密encode:"+URLEncoder.encode(encode, "utf-8"));
System.err.println("加密decode:"+URLDecoder.decode(URLEncoder.encode(encode, "utf-8"), "utf-8"));
System.err.println("加密:"+encode);
System.err.println("加密encode:"+URLEncoder.encode(encode, "utf-8"));
System.err.println("加密decode:"+URLDecoder.decode(URLEncoder.encode(encode, "utf-8"), "utf-8"));
String dcode = decrypt(encode, key);
System.err.println("解密:"+dcode);
System.err.println("解密:"+dcode);
}
}
@@ -14,68 +14,68 @@ import com.fangjia.service.bo.DistrictStatRentBo;
public class DistrictScoreUtil {
/**
* 城市平均租金(确认)
* 城市平均租金(确认)
*/
private final static int CITY_AVG_RENT_PRICE = 5847;
/**
* 市均餐饮人均消费(确认)
* 市均餐饮人均消费(确认)
*/
private final static int CITY_AVG_CONSUMPTION = 50;
/**
* 上月房源平均发布量(确认)
* 上月房源平均发布量(确认)
* modify by shibb 2015-6-18
*/
// private final static int LAST_MONTH_HOUSES_AVG = 200;
private final static int LAST_MONTH_HOUSES_AVG = 65;
/**
* 半年房源平均发布量(确认)
* 半年房源平均发布量(确认)
*/
private final static int HALF_YEAR_HOUSES_AVG = 1000;
/**
* 市均容积率(确认)
* 市均容积率(确认)
*/
private final static double CITY_AVG_CUBAGE_PERCENT = 2.0;
/**
* 市均绿化率(确认)
* 市均绿化率(确认)
*/
private final static double CITY_AVG_VIRESCENCE_PERCENT = 40;
/**
* 城市户均占地面积(确认)
* 城市户均占地面积(确认)
*/
private final static double CITY_AVG_HOUSEHOLD_ALLAREA = 50;
/**
* 城市户均建筑面积(确认)
* 城市户均建筑面积(确认)
*/
private final static double CITY_AVG_HOUSEHOLD_BUILDAREA = 100;
/**
* 市均停车位(确认)
* 市均停车位(确认)
*/
private final static double CITY_AVG_CAR_SITE = 300;
/**
* 市均物业费(确认)
* 市均物业费(确认)
*/
private final static double CITY_AVG_ESTATE_CHARGE = 1.59;
/**
* 稀缺度指数中关注度所占比重
* 稀缺度指数中关注度所占比重
*/
private final static int ATTENTION_RATIO = 7;
/**
* 稀缺度指数中挂牌量所占比重
* 稀缺度指数中挂牌量所占比重
*/
private final static int HOT_RATIO = 3;
/**
* 房价指数
* 房价指数
* modify by shibb 2015-6-19
*/
public static double priceScore(Integer districtPrice, Integer cityPrice, Integer leave, List<DistrictStatRentBo> rentBos) {
@@ -184,11 +184,11 @@ public class DistrictScoreUtil {
}
/**
* 新的计算房价指数的方法
* 新的计算房价指数的方法
*
* @param districtAvgPrice 小区均价
* @param districtAvgPrice 小区均价
* @param cityAvgPrice
* @param mPrice 方差
* @param mPrice 方差
* @param rentBos
* @return
*/
@@ -254,32 +254,32 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市中房价较低的住宅";
return "属于城市中房价较低的住宅";
case 2:
return "属于城市中房价较低的住宅";
return "属于城市中房价较低的住宅";
case 3:
return "属于城市中房价较低的住宅";
return "属于城市中房价较低的住宅";
case 4:
return "属于接近城市均价的住宅";
return "属于接近城市均价的住宅";
case 5:
return "属于接近城市均价的住宅";
return "属于接近城市均价的住宅";
case 6:
return "属于略高于城市均价的住宅";
return "属于略高于城市均价的住宅";
case 7:
return "属于城市中房价较高的住宅";
return "属于城市中房价较高的住宅";
case 8:
return "属于城市中房价较高的住宅";
return "属于城市中房价较高的住宅";
case 9:
return "属于城市中房价非常高的住宅";
return "属于城市中房价非常高的住宅";
case 10:
return "属于城市中房价非常高的住宅";
return "属于城市中房价非常高的住宅";
default:
return "";
}
}
/**
* 消费指数
* 消费指数
* modify by shibb 2015-6-18
*/
public static double consumScore(Double avgConsumption, Map<String, Integer> countMap) {
@@ -317,12 +317,12 @@ public class DistrictScoreUtil {
}
}
if (null != countMap.get("商场")) {
if (null != countMap.get("商场")) {
ret += 0.2;
// if (countMap.get("商场") >= 5) {
// if (countMap.get("商场") >= 5) {
// ret += 0.3;
// }
if (countMap.get("商场") >= 8) {
if (countMap.get("商场") >= 8) {
ret += 0.3;
}
}
@@ -335,48 +335,48 @@ public class DistrictScoreUtil {
ret += 0.1;
}
}
if (null != countMap.get("电影院")) {
if (null != countMap.get("电影院")) {
ret += 0.1;
}
if (null != countMap.get("健身中心")) {
if (null != countMap.get("健身中心")) {
ret += 0.2;
}
if (null != countMap.get("美容院")) {
if (null != countMap.get("美容院")) {
ret += 0.1;
// if (countMap.get("美容院") >= 5) {
// if (countMap.get("美容院") >= 5) {
// ret += 0.2;
// }
if (countMap.get("美容院") >= 20) {
if (countMap.get("美容院") >= 20) {
ret += 0.1;
}
}
if (null != countMap.get("大型超市")) {
if (null != countMap.get("大型超市")) {
ret += 0.2;
}
if (null != countMap.get("高尔夫球场")) {
if (null != countMap.get("高尔夫球场")) {
ret += 0.5;
}
if (null != countMap.get("私立学校")) {
if (null != countMap.get("私立学校")) {
ret += 0.2;
if (countMap.get("私立学校") >= 5) {
if (countMap.get("私立学校") >= 5) {
ret += 0.3;
}
}
if (null != countMap.get("整形")) {
if (null != countMap.get("整形")) {
ret += 0.2;
if (countMap.get("整形") >= 3) {
if (countMap.get("整形") >= 3) {
ret += 0.3;
}
}
if (null != countMap.get("洗浴")) {
if (null != countMap.get("洗浴")) {
ret += 0.1;
}
if (null != countMap.get("私立医院")) {
if (null != countMap.get("私立医院")) {
ret += 0.2;
}
if (null != countMap.get("星级酒店")) {
if (null != countMap.get("星级酒店")) {
ret += 0.2;
// if (countMap.get("星级酒店") >= 5) {
// if (countMap.get("星级酒店") >= 5) {
// ret += 0.2;
// }
}
@@ -388,44 +388,44 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边消费水平非常低,生活成<br>本低廉";
return "周边消费水平非常低,生活成<br>本低廉";
case 2:
return "周边消费水平非常低,生活成<br>本低廉";
return "周边消费水平非常低,生活成<br>本低廉";
case 3:
return "周边消费水平较低,生活成<br>本较低";
return "周边消费水平较低,生活成<br>本较低";
case 4:
return "周边消费水平较低,生活成<br>本较低";
return "周边消费水平较低,生活成<br>本较低";
case 5:
return "周边消费水平一般";
return "周边消费水平一般";
case 6:
return "周边消费水平一般";
return "周边消费水平一般";
case 7:
return "周边消费水平较高,生活成<br>本较高";
return "周边消费水平较高,生活成<br>本较高";
case 8:
return "周边消费水平较高,生活成<br>本较高";
return "周边消费水平较高,生活成<br>本较高";
case 9:
return "周边消费水平非常高,生活成<br>本昂贵";
return "周边消费水平非常高,生活成<br>本昂贵";
case 10:
return "周边消费水平非常高,生活成<br>本昂贵";
return "周边消费水平非常高,生活成<br>本昂贵";
default:
return "";
}
}
/**
* 环境指数计算
* 环境指数计算
* modify by shibb 2015-6-18
*/
public static double aroundScore(Map<String, Integer> countMap) {
double ret = 0d;
int schoolCount = null == countMap.get("学校") ? 0 : countMap.get("学校");
int hospitalCount = null == countMap.get("医院") ? 0 : countMap.get("医院");
int bankCount = null == countMap.get("银行") ? 0 : countMap.get("银行");
int schoolCount = null == countMap.get("学校") ? 0 : countMap.get("学校");
int hospitalCount = null == countMap.get("医院") ? 0 : countMap.get("医院");
int bankCount = null == countMap.get("银行") ? 0 : countMap.get("银行");
if (null != countMap.get("公交点")) {
int busCount = countMap.get("公交点");
if (null == countMap.get("地铁站") || countMap.get("地铁站") == 0) {
if (null != countMap.get("公交点")) {
int busCount = countMap.get("公交点");
if (null == countMap.get("地铁站") || countMap.get("地铁站") == 0) {
if (busCount <= 3) {
ret += 1;
} else if (busCount <= 8) {
@@ -438,7 +438,7 @@ public class DistrictScoreUtil {
ret += 5;
}
} else {
int metroCount = countMap.get("地铁站");
int metroCount = countMap.get("地铁站");
if (metroCount < 1) {
if (busCount <= 3) {
ret += 1;
@@ -490,27 +490,27 @@ public class DistrictScoreUtil {
}
}
if (null != countMap.get("写字楼") && countMap.get("写字楼") >= 5) {
if (null != countMap.get("写字楼") && countMap.get("写字楼") >= 5) {
ret += 0.5;
}
if (null != countMap.get("停车场")) {
if (null != countMap.get("停车场")) {
ret += 0.5;
}
// if (null != countMap.get("超市") && countMap.get("超市") >= 5) {
// if (null != countMap.get("超市") && countMap.get("超市") >= 5) {
// ret += 0.5;
// }
if (null != countMap.get("超市") && countMap.get("超市") >= 15) {
if (null != countMap.get("超市") && countMap.get("超市") >= 15) {
ret += 0.5;
}
// if (null != countMap.get("公园") && countMap.get("公园") >= 5) {
// if (null != countMap.get("公园") && countMap.get("公园") >= 5) {
// ret += 0.5;
// }
if (null != countMap.get("公园")) {
if (null != countMap.get("公园")) {
ret += 0.5;
}
//add by shibb
if (null != countMap.get("发电站") || null != countMap.get("变电站") || null != countMap.get("垃圾焚烧厂") || null != countMap.get("化工厂")) {
if (null != countMap.get("发电站") || null != countMap.get("变电站") || null != countMap.get("垃圾焚烧厂") || null != countMap.get("化工厂")) {
ret -= 1;
}
@@ -521,32 +521,32 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边公共配套非常差,生活很不便";
return "周边公共配套非常差,生活很不便";
case 2:
return "周边公共配套非常差,生活很不便";
return "周边公共配套非常差,生活很不便";
case 3:
return "周边公共配套较差,生活较为不便";
return "周边公共配套较差,生活较为不便";
case 4:
return "周边公共配套较差,生活较为不便";
return "周边公共配套较差,生活较为不便";
case 5:
return "周边公共配套一般,生活便利<br>指数一般";
return "周边公共配套一般,生活便利<br>指数一般";
case 6:
return "周边公共配套一般,生活便利<br>指数一般";
return "周边公共配套一般,生活便利<br>指数一般";
case 7:
return "周边公共配套较成熟,生活便利";
return "周边公共配套较成熟,生活便利";
case 8:
return "周边公共配套较成熟,生活便利";
return "周边公共配套较成熟,生活便利";
case 9:
return "周边公共配套非常成熟,生活<br>很便利";
return "周边公共配套非常成熟,生活<br>很便利";
case 10:
return "周边公共配套非常成熟,生活<br>很便利";
return "周边公共配套非常成熟,生活<br>很便利";
default:
return "";
}
}
/**
* 小区综合指数
* 小区综合指数
*/
public static double detailScore(District district, SeaweedNumberic numberic) {
double ret = 0d;
@@ -556,11 +556,11 @@ public class DistrictScoreUtil {
year = numberic.getFinishBuildYear();
}
// 类型
if (StringUtils.endsWith(district.getName(), "洋房")) {
// 类型
if (StringUtils.endsWith(district.getName(), "洋房")) {
ret += 9;
} else {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (year >= 1920 && year <= 1949) {
ret += 9;
} else {
@@ -577,7 +577,7 @@ public class DistrictScoreUtil {
}
}
// 户均占地面积
// 户均占地面积
if (null != numberic && null != numberic.getHouseholdCount() && null != numberic.getAllArea()
&& numberic.getHouseholdCount() > 0 && numberic.getAllArea() > 0) {
double d = numberic.getAllArea() * 1.0 / numberic.getHouseholdCount();
@@ -589,7 +589,7 @@ public class DistrictScoreUtil {
}
}
// 户均建筑面积
// 户均建筑面积
if (null != numberic && null != numberic.getHouseholdCount() && null != numberic.getBuildArea()
&& numberic.getHouseholdCount() > 0 && numberic.getBuildArea() > 0) {
double d = numberic.getBuildArea() * 1.0 / numberic.getHouseholdCount();
@@ -602,7 +602,7 @@ public class DistrictScoreUtil {
}
}
// 绿化率
// 绿化率
if (null != numberic && null != numberic.getVirescencePercent()) {
double d = numberic.getVirescencePercent();
if (d > CITY_AVG_VIRESCENCE_PERCENT && ((d - CITY_AVG_VIRESCENCE_PERCENT) / CITY_AVG_VIRESCENCE_PERCENT > 0.2)) {
@@ -612,7 +612,7 @@ public class DistrictScoreUtil {
}
}
// 容积率
// 容积率
if (null != numberic && null != numberic.getCubagePercent()) {
double d = numberic.getCubagePercent();
if (d > CITY_AVG_CUBAGE_PERCENT && ((d - CITY_AVG_CUBAGE_PERCENT) / CITY_AVG_CUBAGE_PERCENT > 0.2)) {
@@ -622,7 +622,7 @@ public class DistrictScoreUtil {
}
}
// 停车位
// 停车位
if (null != numberic && null != numberic.getCarSiteCount()) {
double d = numberic.getCarSiteCount();
if (d > CITY_AVG_CAR_SITE && ((d - CITY_AVG_CAR_SITE) / CITY_AVG_CAR_SITE > 0.2)) {
@@ -639,7 +639,7 @@ public class DistrictScoreUtil {
ret += 0.5;
}
// 物业费
// 物业费
if (null != numberic && null != numberic.getEstateCharge()) {
double d = numberic.getEstateCharge();
if (d > CITY_AVG_ESTATE_CHARGE && ((d - CITY_AVG_ESTATE_CHARGE) * 1.0 / CITY_AVG_ESTATE_CHARGE > 0.2)) {
@@ -656,32 +656,32 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 2:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 3:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 4:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 5:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 6:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 7:
return "属于城市的优质住宅";
return "属于城市的优质住宅";
case 8:
return "属于城市的优质住宅";
return "属于城市的优质住宅";
case 9:
return "属于城市的高端住宅";
return "属于城市的高端住宅";
case 10:
return "属于城市的高端住宅";
return "属于城市的高端住宅";
default:
return "";
}
}
/**
* 户均占地面积
* 户均占地面积
*/
public static double detailScore1(Integer householdCount, Integer allArea) {
if (null == householdCount || null == allArea || householdCount <= 0 || allArea <= 0) {
@@ -705,7 +705,7 @@ public class DistrictScoreUtil {
}
/**
* 户均建筑面积
* 户均建筑面积
*/
public static double detailScore2(Integer householdCount, Integer buildArea) {
if (null == householdCount || null == buildArea || householdCount <= 0 || buildArea <= 0) {
@@ -729,7 +729,7 @@ public class DistrictScoreUtil {
}
/**
* 绿化率
* 绿化率
*/
public static double detailScore3(Double virescencePercent) {
if (null == virescencePercent) {
@@ -752,7 +752,7 @@ public class DistrictScoreUtil {
}
/**
* 容积率
* 容积率
*/
public static double detailScore4(Double cubagePercent) {
if (null == cubagePercent) {
@@ -777,13 +777,13 @@ public class DistrictScoreUtil {
}
/**
* 停车位
* 停车位
*/
public static double detailScore5(String buildType, Integer carSiteCount) {
if (StringUtils.isNotBlank(buildType)) {
buildType = buildType.replaceAll(",", "");
if ("独栋".equals(buildType) || "双拼".equals(buildType) || "联排".equals(buildType) || "叠加".equals(buildType)
|| "花园洋房".equals(buildType) || "老洋房".equals(buildType) || "四合院".equals(buildType)) {
if ("独栋".equals(buildType) || "双拼".equals(buildType) || "联排".equals(buildType) || "叠加".equals(buildType)
|| "花园洋房".equals(buildType) || "老洋房".equals(buildType) || "四合院".equals(buildType)) {
return 9d;
}
}
@@ -810,8 +810,8 @@ public class DistrictScoreUtil {
}
/**
* 潜力指数
* 稀缺指数
* 潜力指数
* 稀缺指数
* modify by shibb
*/
public static double rankScore(int regionClickRank, int regionDistrictCount, int lastMonthHouses, int halfYearHouse) {
@@ -897,7 +897,7 @@ public class DistrictScoreUtil {
// ret -= 1;
// }
//regionDistrictCount小区平均关注度
//regionDistrictCount小区平均关注度
if (regionClickRank > regionDistrictCount) {
double d = (regionClickRank - regionDistrictCount) * 1.0 / regionDistrictCount;
if (d > 0.3) {
@@ -914,8 +914,8 @@ public class DistrictScoreUtil {
}
/**
* 潜力指数
* 稀缺指数
* 潜力指数
* 稀缺指数
* add by shibb
*/
public static double rankScore2(double hotRatio, double attentionRatio) {
@@ -927,27 +927,27 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 0:
return "市场上有大量挂牌房源";
return "市场上有大量挂牌房源";
case 1:
return "市场上有大量挂牌房源";
return "市场上有大量挂牌房源";
case 2:
return "市场上有大量挂牌房源";
return "市场上有大量挂牌房源";
case 3:
return "挂牌房源量较充足";
return "挂牌房源量较充足";
case 4:
return "挂牌房源量较充足";
return "挂牌房源量较充足";
case 5:
return "挂牌房源量一般";
return "挂牌房源量一般";
case 6:
return "挂牌房源量一般";
return "挂牌房源量一般";
case 7:
return "市场上房源较稀缺";
return "市场上房源较稀缺";
case 8:
return "市场上房源较稀缺";
return "市场上房源较稀缺";
case 9:
return "市场上房源非常稀缺";
return "市场上房源非常稀缺";
case 10:
return "市场上房源非常稀缺";
return "市场上房源非常稀缺";
default:
return "";
}
@@ -997,23 +997,23 @@ public class DistrictScoreUtil {
case 1:
return "";
case 2:
return "房价跌幅明显,预计升值能力较弱";
return "房价跌幅明显,预计升值能力较弱";
case 3:
return "房价跌幅较明显,预计升值能力较弱";
return "房价跌幅较明显,预计升值能力较弱";
case 4:
return "房价走势较为平稳,预计未来<br>波动不大";
return "房价走势较为平稳,预计未来<br>波动不大";
case 5:
return "房价走势平稳,预计未来波动不大";
return "房价走势平稳,预计未来波动不大";
case 6:
return "房价走势较为平稳,预计未来<br>波动不大";
return "房价走势较为平稳,预计未来<br>波动不大";
case 7:
return "房价涨幅明显,未来走势理想";
return "房价涨幅明显,未来走势理想";
case 8:
return "房价涨幅明显,未来走势理想";
return "房价涨幅明显,未来走势理想";
case 9:
return "房价涨幅较高,未来走势乐观";
return "房价涨幅较高,未来走势乐观";
case 10:
return "房价涨幅较高,未来走势乐观";
return "房价涨幅较高,未来走势乐观";
default:
return "";
}
@@ -1024,7 +1024,7 @@ public class DistrictScoreUtil {
if (StringUtils.isBlank(date)) {
return 0;
}
Pattern p = Pattern.compile("(\\d{4})[-|年|.]?(\\d{1,2})?[-|月|.]?(\\d{1,2})?日?");
Pattern p = Pattern.compile("(\\d{4})[-|年|.]?(\\d{1,2})?[-|月|.]?(\\d{1,2})?日?");
Matcher m = p.matcher(date);
Integer year = 0;
if (m.find()) {
@@ -12,52 +12,52 @@ import com.fangjia.service.bo.DistrictStatBo;
public class ShopScoreUtil {
/**
* 市均停车位(确认)
* 市均停车位(确认)
*/
private final static int CITY_AVG_CAR_SITE_COUNT = 683;
/**
* 市均餐饮人均消费(确认)
* 市均餐饮人均消费(确认)
*/
private final static int CITY_AVG_CONSUMPTION = 50;
/**
* 市均商场建筑规模(面积)(确认)
* 市均商场建筑规模(面积)(确认)
*/
private final static int CITY_AVG_MALL_AREA = 119250;
/**
* 市均居民人口密度(确认)
* 市均居民人口密度(确认)
*/
//private final static double CITY_AVG_HOUSE_DENSITY = 3030;
private final static double CITY_AVG_HOUSE_DENSITY = 3631;
/**
* 市均办公人口密度(确认)
* 市均办公人口密度(确认)
*/
//private final static double CITY_AVG_OFFICE_DENSITY = 3030;
private final static double CITY_AVG_OFFICE_DENSITY = 3631;
/**
* 市均商场竣工年份(确认)
* 市均商场竣工年份(确认)
*/
private final static int CITY_AVG_FINISH_YAER = 2007;
/**
* 市均商场物业费(确认)
* 市均商场物业费(确认)
*/
private final static double CITY_AVG_ESTATE_CHARGE = 3.57;
/**
* 地段指数
* 地段指数
*/
public static double localScore(String loopLineInfo, int metros, int buses) {
double ret = 0d;
if ("内环以内".equals(loopLineInfo)) {
if ("内环以内".equals(loopLineInfo)) {
ret += 8;
} else if ("中内之间".equals(loopLineInfo) || "中内环间".equals(loopLineInfo)) {
} else if ("中内之间".equals(loopLineInfo) || "中内环间".equals(loopLineInfo)) {
ret += 6;
} else if ("中外之间".equals(loopLineInfo) || "中外环间".equals(loopLineInfo)) {
} else if ("中外之间".equals(loopLineInfo) || "中外环间".equals(loopLineInfo)) {
ret += 5;
} else if ("外环以外".equals(loopLineInfo)) {
} else if ("外环以外".equals(loopLineInfo)) {
ret += 4;
} else {
ret += 3;
@@ -69,8 +69,8 @@ public class ShopScoreUtil {
ret += 0.5;
}
// TODO 板块
// TODO A类+1,B类+0.5
// TODO 板块
// TODO A类+1,B类+0.5
return ret > 10 ? 10 : ret;
}
@@ -79,32 +79,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "位于城市中偏远的地段";
return "位于城市中偏远的地段";
case 2:
return "位于城市中偏远的地段";
return "位于城市中偏远的地段";
case 3:
return "位于城市中较偏远的地段";
return "位于城市中较偏远的地段";
case 4:
return "位于城市中较偏远的地段";
return "位于城市中较偏远的地段";
case 5:
return "位于城市中普通地段";
return "位于城市中普通地段";
case 6:
return "位于城市中普通地段";
return "位于城市中普通地段";
case 7:
return "位于城市中较好的地段";
return "位于城市中较好的地段";
case 8:
return "位于城市中较好的地段";
return "位于城市中较好的地段";
case 9:
return "位于城市中黄金地段";
return "位于城市中黄金地段";
case 10:
return "位于城市中黄金地段";
return "位于城市中黄金地段";
default:
return "";
}
}
/**
* 地段指数--公共交通
* 地段指数--公共交通
*/
public static double localScore1(int metroCount, int busCount) {
if (metroCount > 2) {
@@ -137,7 +137,7 @@ public class ShopScoreUtil {
}
/**
* 地段指数--周边业态
* 地段指数--周边业态
*/
public static double localScore2(Map<String, Integer> typeCountMap) {
double ret = 0d;
@@ -160,7 +160,7 @@ public class ShopScoreUtil {
}
/**
* 消费指数
* 消费指数
*/
public static double consumScore(Double avgConsumption, Map<String, Integer> countMap) {
double ret = 0d;
@@ -197,9 +197,9 @@ public class ShopScoreUtil {
}
}
if (null != countMap.get("商场")) {
if (null != countMap.get("商场")) {
ret += 0.2;
if (countMap.get("商场") >= 5) {
if (countMap.get("商场") >= 5) {
ret += 0.3;
}
}
@@ -209,45 +209,45 @@ public class ShopScoreUtil {
ret += 0.2;
}
}
if (null != countMap.get("电影院")) {
if (null != countMap.get("电影院")) {
ret += 0.1;
}
if (null != countMap.get("健身中心")) {
if (null != countMap.get("健身中心")) {
ret += 0.2;
}
if (null != countMap.get("美容院")) {
if (null != countMap.get("美容院")) {
ret += 0.1;
if (countMap.get("美容院") >= 5) {
if (countMap.get("美容院") >= 5) {
ret += 0.2;
}
}
if (null != countMap.get("大型超市")) {
if (null != countMap.get("大型超市")) {
ret += 0.2;
}
if (null != countMap.get("高尔夫球场")) {
if (null != countMap.get("高尔夫球场")) {
ret += 0.5;
}
if (null != countMap.get("私立学校")) {
if (null != countMap.get("私立学校")) {
ret += 0.2;
if (countMap.get("私立学校") >= 5) {
if (countMap.get("私立学校") >= 5) {
ret += 0.3;
}
}
if (null != countMap.get("整形")) {
if (null != countMap.get("整形")) {
ret += 0.2;
if (countMap.get("整形") >= 5) {
if (countMap.get("整形") >= 5) {
ret += 0.1;
}
}
if (null != countMap.get("洗浴")) {
if (null != countMap.get("洗浴")) {
ret += 0.1;
}
if (null != countMap.get("私立医院")) {
if (null != countMap.get("私立医院")) {
ret += 0.2;
}
if (null != countMap.get("星级酒店")) {
if (null != countMap.get("星级酒店")) {
ret += 0.2;
if (countMap.get("星级酒店") >= 5) {
if (countMap.get("星级酒店") >= 5) {
ret += 0.2;
}
}
@@ -259,32 +259,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边人群消费能力弱";
return "周边人群消费能力弱";
case 2:
return "周边人群消费能力弱";
return "周边人群消费能力弱";
case 3:
return "周边人群消费能力较弱";
return "周边人群消费能力较弱";
case 4:
return "周边人群消费能力较弱";
return "周边人群消费能力较弱";
case 5:
return "周边人群消费能力一般";
return "周边人群消费能力一般";
case 6:
return "周边人群消费能力一般";
return "周边人群消费能力一般";
case 7:
return "周边人群具有一定的消费能力";
return "周边人群具有一定的消费能力";
case 8:
return "周边人群具有一定的消费能力";
return "周边人群具有一定的消费能力";
case 9:
return "周边人群具有很强的消费能力";
return "周边人群具有很强的消费能力";
case 10:
return "周边人群具有很强的消费能力";
return "周边人群具有很强的消费能力";
default:
return "";
}
}
/**
* 房价指数
* 房价指数
*/
public static double priceScore(DistrictStatBo statBo, Integer cityPrice) {
double ret = 0d;
@@ -350,32 +350,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市中价位较低的商铺";
return "属于城市中价位较低的商铺";
case 2:
return "属于城市中价位较低的商铺";
return "属于城市中价位较低的商铺";
case 3:
return "属于城市中价位较低的商铺";
return "属于城市中价位较低的商铺";
case 4:
return "属于略低于城市均价的商铺";
return "属于略低于城市均价的商铺";
case 5:
return "属于接近城市均价的商铺";
return "属于接近城市均价的商铺";
case 6:
return "属于略高于城市均价的商铺";
return "属于略高于城市均价的商铺";
case 7:
return "属于城市中价位较高的商铺";
return "属于城市中价位较高的商铺";
case 8:
return "属于城市中价位较高的商铺";
return "属于城市中价位较高的商铺";
case 9:
return "属于城市中价位非常高的商铺";
return "属于城市中价位非常高的商铺";
case 10:
return "属于城市中价位非常高的商铺";
return "属于城市中价位非常高的商铺";
default:
return "";
}
}
/**
* 租金指数
* 租金指数
*/
public static double rentScore(DistrictBusinessStatRentBo statBo, Integer cityPrice, String paymentPattern) {
double ret = 0d;
@@ -422,7 +422,7 @@ public class ShopScoreUtil {
}
}
if ("押三付三".equals(paymentPattern) || "付三押三".equals(paymentPattern)) {
if ("押三付三".equals(paymentPattern) || "付三押三".equals(paymentPattern)) {
ret += 0.5;
}
}
@@ -434,63 +434,63 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市中租金便宜的商铺";
return "属于城市中租金便宜的商铺";
case 2:
return "属于城市中租金便宜的商铺";
return "属于城市中租金便宜的商铺";
case 3:
return "属于城市中租金较便宜的商铺";
return "属于城市中租金较便宜的商铺";
case 4:
return "属于略低于城市租金均价的商铺";
return "属于略低于城市租金均价的商铺";
case 5:
return "属于接近城市租金均价的商铺";
return "属于接近城市租金均价的商铺";
case 6:
return "属于略高于城市租金均价的商铺";
return "属于略高于城市租金均价的商铺";
case 7:
return "属于城市中租金较高的商铺";
return "属于城市中租金较高的商铺";
case 8:
return "属于城市中租金较高的商铺";
return "属于城市中租金较高的商铺";
case 9:
return "属于城市中租金昂贵的商铺";
return "属于城市中租金昂贵的商铺";
case 10:
return "属于城市中租金昂贵的商铺";
return "属于城市中租金昂贵的商铺";
default:
return "";
}
}
/**
* 商铺综合指数
* 商铺综合指数
*/
public static double detailScore(District mall, SeaweedNumberic numberic) {
double ret = 0d;
// 商铺类型
// 商铺类型
String estateType = mall.getEstateCharge();
if (StringUtils.contains(estateType, "购物中心")) {
if (StringUtils.contains(estateType, "购物中心")) {
ret += 8;
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
ret += 7;
} else if ("专项商铺".equals(estateType)) {
} else if ("专项商铺".equals(estateType)) {
ret += 6;
} else {
ret += 5;
}
// 商圈
// 商圈
String businessQuarter = mall.getBusinessQuarter();
// TODO A类+1,B类+0.5
// TODO A类+1,B类+0.5
if (StringUtils.isNotBlank(businessQuarter)) {
ret += 0.5;
}
// 板块
// 板块
String block = "";
// TODO A类+1,B类+0.5
// TODO A类+1,B类+0.5
if (StringUtils.isNotBlank(block)) {
ret += 0.5;
}
// 建筑规模
// 建筑规模
if (null != numberic && null != numberic.getBuildArea()) {
int area = numberic.getBuildArea();
if (area > CITY_AVG_MALL_AREA && ((area - CITY_AVG_MALL_AREA) * 1.0 / CITY_AVG_MALL_AREA > 0.2)) {
@@ -500,10 +500,10 @@ public class ShopScoreUtil {
}
}
// 装修状况
// TODO 目前没有装修字段
// 装修状况
// TODO 目前没有装修字段
// 停车位
// 停车位
if (null != mall.getCarSiteCount()) {
double t = (mall.getCarSiteCount() - CITY_AVG_CAR_SITE_COUNT) * 1.0 / CITY_AVG_CAR_SITE_COUNT;
if (t > 0.2) {
@@ -513,7 +513,7 @@ public class ShopScoreUtil {
}
}
// 楼龄
// 楼龄
if (null != numberic && null != numberic.getFinishBuildYear()) {
int year = numberic.getFinishBuildYear();
if (year > CITY_AVG_FINISH_YAER && ((year - CITY_AVG_FINISH_YAER) * 1.0 / CITY_AVG_FINISH_YAER > 0.2)) {
@@ -530,7 +530,7 @@ public class ShopScoreUtil {
ret += 0.5;
}
// 物业费
// 物业费
if (null != numberic && null != numberic.getEstateCharge()) {
double c = numberic.getEstateCharge();
if (c > CITY_AVG_ESTATE_CHARGE && ((c - CITY_AVG_ESTATE_CHARGE) * 1.0 / CITY_AVG_ESTATE_CHARGE > 0.2)) {
@@ -547,35 +547,35 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 2:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 3:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 4:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 5:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 6:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 7:
return "属于城市的优质商铺";
return "属于城市的优质商铺";
case 8:
return "属于城市的优质商铺";
return "属于城市的优质商铺";
case 9:
return "属于城市的高端商铺";
return "属于城市的高端商铺";
case 10:
return "属于城市的高端商铺";
return "属于城市的高端商铺";
default:
return "";
}
}
/**
* 商铺综合指数--建筑规模
* 商铺综合指数--建筑规模
*/
public static double detailScore1(String estateType, Integer buildArea) {
if (StringUtils.contains(estateType, "购物中心")) {
if (StringUtils.contains(estateType, "购物中心")) {
if (null == buildArea) {
return 5d;
}
@@ -593,9 +593,9 @@ public class ShopScoreUtil {
} else {
return 5d;
}
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
return 6d;
} else if ("专项商铺".equals(estateType)) {
} else if ("专项商铺".equals(estateType)) {
return 7d;
} else {
return 5d;
@@ -603,15 +603,15 @@ public class ShopScoreUtil {
}
/**
* 商铺综合指数--装修
* 商铺综合指数--装修
*/
public static double detailScore2(String estateType, String buildArea) {
// TODO 目前没有装修字段
// TODO 目前没有装修字段
return 5d;
}
/**
* 商铺综合指数--停车位
* 商铺综合指数--停车位
*/
public static double detailScore3(Integer carSiteCount) {
if (null == carSiteCount) {
@@ -637,7 +637,7 @@ public class ShopScoreUtil {
}
/**
* 商铺综合指数--楼龄
* 商铺综合指数--楼龄
*/
public static double detailScore4(Integer year) {
if (null == year) {
@@ -666,44 +666,44 @@ public class ShopScoreUtil {
}
/**
* 环境指数--公共聚客点
* 环境指数--公共聚客点
*/
public static double aroundScore1(Map<String, Integer> countMap) {
double ret = 0d;
if (null != countMap.get("医院")) {
if (null != countMap.get("医院")) {
ret += 1;
if (countMap.get("医院") >= 3) {
if (countMap.get("医院") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("地铁站")) {
if (null != countMap.get("地铁站")) {
ret += 1;
if (countMap.get("地铁站") >= 3) {
if (countMap.get("地铁站") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("公交点")) {
if (null != countMap.get("公交点")) {
ret += 1;
if (countMap.get("公交点") >= 3) {
if (countMap.get("公交点") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("公园")) {
if (null != countMap.get("公园")) {
ret += 1;
if (countMap.get("公园") >= 2) {
if (countMap.get("公园") >= 2) {
ret += 0.5;
}
}
if (null != countMap.get("学校")) {
if (null != countMap.get("学校")) {
ret += 1;
if (countMap.get("学校") >= 3) {
if (countMap.get("学校") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("体育馆")) {
if (null != countMap.get("体育馆")) {
ret += 1;
if (countMap.get("体育馆") >= 2) {
if (countMap.get("体育馆") >= 2) {
ret += 0.5;
}
}
@@ -712,32 +712,32 @@ public class ShopScoreUtil {
}
/**
* 环境指数--商业聚客点
* 环境指数--商业聚客点
*/
public static double aroundScore2(Map<String, Integer> countMap) {
double ret = 0d;
if (null != countMap.get("银行")) {
if (null != countMap.get("银行")) {
ret += 1;
if (countMap.get("银行") >= 3) {
if (countMap.get("银行") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("商场")) {
if (null != countMap.get("商场")) {
ret += 1;
if (countMap.get("商场") >= 3) {
if (countMap.get("商场") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("大型超市")) {
if (null != countMap.get("大型超市")) {
ret += 1;
if (countMap.get("大型超市") >= 3) {
if (countMap.get("大型超市") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("餐饮")) {
if (null != countMap.get("餐饮")) {
ret += 1;
if (countMap.get("餐饮") >= 10) {
if (countMap.get("餐饮") >= 10) {
ret += 0.5;
}
}
@@ -749,32 +749,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边公共或商业配套非常差,客源稀少";
return "周边公共或商业配套非常差,客源稀少";
case 2:
return "周边公共或商业配套非常差,客源稀少";
return "周边公共或商业配套非常差,客源稀少";
case 3:
return "周边公共或商业配套较差,客源较少";
return "周边公共或商业配套较差,客源较少";
case 4:
return "周边公共或商业配套较差,客源较少";
return "周边公共或商业配套较差,客源较少";
case 5:
return "周边公共或商业配套一般,客源一般";
return "周边公共或商业配套一般,客源一般";
case 6:
return "周边公共或商业配套一般,客源一般";
return "周边公共或商业配套一般,客源一般";
case 7:
return "周边公共或商业配套较成熟,客源较丰富";
return "周边公共或商业配套较成熟,客源较丰富";
case 8:
return "周边公共或商业配套较成熟,客源较丰富";
return "周边公共或商业配套较成熟,客源较丰富";
case 9:
return "周边公共或商业配套非常成熟,客源丰富";
return "周边公共或商业配套非常成熟,客源丰富";
case 10:
return "周边公共或商业配套非常成熟,客源丰富";
return "周边公共或商业配套非常成熟,客源丰富";
default:
return "";
}
}
/**
* 人口指数--居民人口
* 人口指数--居民人口
*/
@Deprecated
public static double peopleScore1(double density) {
@@ -810,56 +810,56 @@ public class ShopScoreUtil {
}
/**
* 计算居民人口密度得分
* 计算居民人口密度得分
* @author yinjihuan
* @date 2016-03-04
* @param density 居民人口密度
* @return 居民人口密度得分
* @param density 居民人口密度
* @return 居民人口密度得分
*/
public static double calcPeopleDensityScore(double density) {
/*居民人口密度得分规则如下:
10 10*市均人口密度 < 居民人口密度
9 9*市均人口密度 < 居民人口密度 <= 10*市均人口密度
8 8*市均人口密度 < 居民人口密度 <= 9*市均人口密度
7 7*市均人口密度 < 居民人口密度 <= 8*市均人口密度
6 6*市均人口密度 < 居民人口密度 <= 7*市均人口密度
5 4*市均人口密度 < 居民人口密度 <= 6*市均人口密度
4 2*市均人口密度 < 居民人口密度 <= 4*市均人口密度
3 1*市均人口密度 < 居民人口密度 <= 2*市均人口密度
2 0.5*市均人口密度 < 居民人口密度 <= 1*市均人口密度
1 居民人口密度 <= 0.5*市均人口密度 */
/*居民人口密度得分规则如下:
10 10*市均人口密度 < 居民人口密度
9 9*市均人口密度 < 居民人口密度 <= 10*市均人口密度
8 8*市均人口密度 < 居民人口密度 <= 9*市均人口密度
7 7*市均人口密度 < 居民人口密度 <= 8*市均人口密度
6 6*市均人口密度 < 居民人口密度 <= 7*市均人口密度
5 4*市均人口密度 < 居民人口密度 <= 6*市均人口密度
4 2*市均人口密度 < 居民人口密度 <= 4*市均人口密度
3 1*市均人口密度 < 居民人口密度 <= 2*市均人口密度
2 0.5*市均人口密度 < 居民人口密度 <= 1*市均人口密度
1 居民人口密度 <= 0.5*市均人口密度 */
return doCalcDensityScore(density, CITY_AVG_HOUSE_DENSITY);
}
/**
* 计算办公人口密度得分
* 计算办公人口密度得分
* @author yinjihuan
* @date 2016-03-04
* @param density 办公人口密度
* @return 居民人口密度得分
* @param density 办公人口密度
* @return 居民人口密度得分
*/
public static double calcOfficeDensityScore(double density) {
/*办公人口密度计算规则如下:
10 10*市均办公人口密度 < 办公人口密度
9 9*市均办公人口密度 < 办公人口密度 <= 10*市均办公人口密度
8 8*市均办公人口密度 < 办公人口密度 <= 9*市均办公人口密度
7 7*市均办公人口密度 < 办公人口密度 <= 8*市均办公人口密度
6 6*市均办公人口密度 < 办公人口密度 <= 7*市均办公人口密度
5 4*市均办公人口密度 < 办公人口密度 <= 6*市均办公人口密度
4 2*市均办公人口密度 < 办公人口密度 <= 4*市均办公人口密度
3 1*市均办公人口密度 < 办公人口密度 <= 2*市均办公人口密度
2 0.5*市均办公人口密度 < 办公人口密度 <= 1*市均办公人口密度
1 办公人口密度 <= 0.5*市均办公人口密度 */
/*办公人口密度计算规则如下:
10 10*市均办公人口密度 < 办公人口密度
9 9*市均办公人口密度 < 办公人口密度 <= 10*市均办公人口密度
8 8*市均办公人口密度 < 办公人口密度 <= 9*市均办公人口密度
7 7*市均办公人口密度 < 办公人口密度 <= 8*市均办公人口密度
6 6*市均办公人口密度 < 办公人口密度 <= 7*市均办公人口密度
5 4*市均办公人口密度 < 办公人口密度 <= 6*市均办公人口密度
4 2*市均办公人口密度 < 办公人口密度 <= 4*市均办公人口密度
3 1*市均办公人口密度 < 办公人口密度 <= 2*市均办公人口密度
2 0.5*市均办公人口密度 < 办公人口密度 <= 1*市均办公人口密度
1 办公人口密度 <= 0.5*市均办公人口密度 */
return doCalcDensityScore(density, CITY_AVG_OFFICE_DENSITY);
}
/**
* 计算密度得分
* @param density 密度
* @param cityAvgDensity 市平均密度
* 计算密度得分
* @param density 密度
* @param cityAvgDensity 市平均密度
* @return
*/
private static double doCalcDensityScore(double density, double cityAvgDensity) {
@@ -917,7 +917,7 @@ public class ShopScoreUtil {
}
/**
* 人口指数--办公人口
* 人口指数--办公人口
*/
@Deprecated
public static double peopleScore2(double density) {
@@ -991,25 +991,25 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "人流量稀少";
return "人流量稀少";
case 2:
return "人流量稀少";
return "人流量稀少";
case 3:
return "人流量较少";
return "人流量较少";
case 4:
return "人流量较少";
return "人流量较少";
case 5:
return "人流量一般";
return "人流量一般";
case 6:
return "人流量一般";
return "人流量一般";
case 7:
return "人流量较大";
return "人流量较大";
case 8:
return "人流量较大";
return "人流量较大";
case 9:
return "人流量庞大";
return "人流量庞大";
case 10:
return "人流量庞大";
return "人流量庞大";
default:
return "";
}
@@ -21,17 +21,17 @@ public class Test {
g2d.dispose();
g2d = image.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,360);
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,180);
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.fillArc(40,40,320,320,90,360);
g2d.setColor(new Color(0,115,230));
g2d.setFont(new Font("宋体",Font.BOLD,120));
g2d.drawString("4分",126,250);
g2d.setFont(new Font("宋体",Font.BOLD,120));
g2d.drawString("4分",126,250);
g2d.dispose();
ImageIO.write(image, "png", new File("D:/test.png"));
}
@@ -30,7 +30,7 @@ public class ChafangtongContextLoaderListener extends ContextLoaderListener {
}
super.contextInitialized(event);
// Ф¤ИИ
// 预热
if (LOGGER.isInfoEnabled()) {
LOGGER.info("warm up keyword links...");
}
@@ -30,7 +30,7 @@ import com.fangjia.dal.seaweed.model.District;
import com.fangjia.service.mongo.fangjia.BusStationService;
/**
* 环境指数
* 环境指数
* @author yk
*
*/
@@ -54,13 +54,13 @@ public class AroundController extends BaseController {
double lng = district.getLng2()/10000000000d;
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
String[] ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "机场", "网吧" };
String[] ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "机场", "网吧" };
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
@@ -71,24 +71,24 @@ public class AroundController extends BaseController {
JSONObject json = baiduApiService.searchNearby(keys[i], lat, lng, 1000, model.getBaiduMapKey());
countMap.put(keys[i], getTotal(json));
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
model.setAirPort("虹桥机场");
model.setAirPort("虹桥机场");
model.setAirPortLat(31.200062);
model.setAirPortLng(121.352578);
countMap.put("机场", 1);
countMap.put("机场", 1);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
model.setAirPort("浦东机场");
model.setAirPort("浦东机场");
model.setAirPortLat(31.160702);
model.setAirPortLng(121.807085);
countMap.put("机场", 1);
countMap.put("机场", 1);
}
}
@@ -120,22 +120,22 @@ public class AroundController extends BaseController {
double lng = mall.getLng2()/10000000000d;
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
String[] ks = new String[] { "医院", "公园", "学校", "体育馆" };
String[] ks = new String[] { "医院", "公园", "学校", "体育馆" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
JSONObject json = baiduApiService.searchNearby(ks[i], lat, lng, radius, model.getBaiduMapKey());
countMap.put(ks[i], getTotal(json));
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
double score1 = ShopScoreUtil.aroundScore1(countMap);
model.setScore1(score1);
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
JSONObject json = baiduApiService.searchNearby(ks[i], lat, lng, radius, model.getBaiduMapKey());
@@ -123,7 +123,7 @@ public class AutocompleteController {
//nameQuery.add(new TermQuery(new Term("address", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("addr_alias_std", keyword)), Occur.SHOULD);
nameQuery.add(new TermQuery(new Term("keyword", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
srQuery1.add(nameQuery, Occur.SHOULD);
params.add(new QueryParam("$sr", new SrQuery(srQuery1)));
List<District> districts = districtService.findAllByParams(params, 0, limit, new String[] { "region", "name","address", "addrAlias" });
@@ -138,7 +138,7 @@ public class AutocompleteController {
bo.setRegion(district.getRegion());
ret.add(bo);
}
//对自动完成出来的结果按长短排序
//对自动完成出来的结果按长短排序
if(ret.size() > 0){
Collections.sort(ret, new Comparator<AutoCompleteBo>() {
public int compare(AutoCompleteBo o1, AutoCompleteBo o2) {
@@ -104,16 +104,16 @@ public abstract class BaseController {
}
/**
* 根据cookie或者用户输入关键字,填充经纬度、mall信息到cookie和model
* 根据cookie或者用户输入关键字,填充经纬度、mall信息到cookie和model
*/
protected void fillShop2CookieModel(ChafangtongModel model) {
// TODO 不用每次都去seaweed查询mall,可根据是否是新提交表单、存下的mallid来查,优化性能
// TODO 不用每次都去seaweed查询mall,可根据是否是新提交表单、存下的mallid来查,优化性能
HttpServletResponse response = ActionContext.getContext().getResponse();
String keyword = model.getQ();
if (StringUtils.isNotBlank(keyword)) {
Shop mall = null;
// open地址匹配
// open地址匹配
Map<String, Object> resMap = addressService.parse(model.getCityName(), keyword, "shop", false);
if (MapUtils.isNotEmpty(resMap)) {
if (resMap.containsKey("status") && (Integer) resMap.get("status") == 0 && resMap.containsKey("precise")
@@ -124,14 +124,14 @@ public abstract class BaseController {
}
if ("general".equals(model.getControllerName())) {
// 记录用户搜索词open匹配结果
// 记录用户搜索词open匹配结果
HttpServletRequest request = ActionContext.getContext().getRequest();
AddressMatchLog addressMatchLog = new AddressMatchLog();
addressMatchLog.setCity(model.getCityName());
addressMatchLog.setInput(model.getQ());
addressMatchLog.setIp(AnalyticsUtil.getIpAddress(request));
addressMatchLog.setUid(cookieContext.getCookieValue(request, "fpk_uid"));
addressMatchLog.setSource("房评卡");
addressMatchLog.setSource("房评卡");
addressMatchLog.setUserName(cookieContext.getCookieValue(request, "fpk_name"));
addressMatchLog.setCreationDate(new Date());
addressMatchLog.setModificationDate(new Date());
@@ -203,7 +203,7 @@ public abstract class BaseController {
}
protected void fillDistrict2CookieModel(ChafangtongModel model) {
// TODO 不用每次都去seaweed查询district,可根据是否是新提交表单、存下的districtid来查,优化性能
// TODO 不用每次都去seaweed查询district,可根据是否是新提交表单、存下的districtid来查,优化性能
HttpServletResponse response = ActionContext.getContext().getResponse();
String keyword = model.getQ();
if (StringUtils.isNotBlank(keyword)) {
@@ -31,7 +31,7 @@ import com.fangjia.dal.seaweed.model.District;
import com.fangjia.service.mongo.fangjia.BizShopService;
/**
* 消费指数
* 消费指数
* @author yk
*
*/
@@ -54,7 +54,7 @@ public class ConsumController extends BaseController {
double lat = district.getLat2()/10000000000d;
double lng = district.getLng2()/10000000000d;
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "美食"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "美食"));
double cityConsumMin = model.getCityConsumMin()!=null?model.getCityConsumMin():15;
double cityConsumMax = model.getCityConsumMax()!=null?model.getCityConsumMax():150;
@@ -62,7 +62,7 @@ public class ConsumController extends BaseController {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, JSONObject> result = baiduApiService.searchNearBy(Arrays.asList(ks), lat, lng, 1000, model.getBaiduMapKey());
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks) {
@@ -87,13 +87,13 @@ public class ConsumController extends BaseController {
// model.setAroundSell(aroundMarkers);
// }
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
if (null != model.getAvgConsumption()) {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, JSONObject> result = baiduApiService.searchNearBy(Arrays.asList(ks), lat, lng, 1000, model.getBaiduMapKey());
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks) {
@@ -35,7 +35,7 @@ import javax.swing.plaf.synth.Region;
import java.util.*;
/**
* 数据中心展示Controller
* 数据中心展示Controller
*
* @author wenyan
*/
@@ -48,39 +48,39 @@ public class DataCenterController {
private DistrictService districtService;
private HouseService houseService;
private RegionStatTrendService regionStatTrendService;
private static final List<String> OPEN_CITY_LIST = Arrays.asList("上海", "北京");
private static final List<String> OPEN_CITY_LIST = Arrays.asList("上海", "北京");
private Map<String, String> PROVINCE_CITY = new HashMap<String, String>(){{
put("北京","北京");
put("天津","天津");
put("上海","上海");
put("重庆","重庆");
put("河北","石家庄");
put("山西","太原");
put("内蒙古","呼和浩特");
put("辽宁","沈阳");
put("吉林","长春");
put("黑龙江","哈尔滨");
put("江苏","南京");
put("浙江","杭州");
put("安徽","合肥");
put("福建","福州");
put("江西","南昌");
put("山东","济南");
put("河南","郑州");
put("湖北","武汉");
put("湖南","长沙");
put("广东","广州");
put("广西","南宁");
put("海南","海口");
put("四川","成都");
put("贵州","贵阳");
put("云南","昆明");
put("西藏","拉萨");
put("陕西","西安");
put("甘肃","兰州");
put("青海","西宁");
put("宁夏","银川");
put("新疆","乌鲁木齐");
put("北京","北京");
put("天津","天津");
put("上海","上海");
put("重庆","重庆");
put("河北","石家庄");
put("山西","太原");
put("内蒙古","呼和浩特");
put("辽宁","沈阳");
put("吉林","长春");
put("黑龙江","哈尔滨");
put("江苏","南京");
put("浙江","杭州");
put("安徽","合肥");
put("福建","福州");
put("江西","南昌");
put("山东","济南");
put("河南","郑州");
put("湖北","武汉");
put("湖南","长沙");
put("广东","广州");
put("广西","南宁");
put("海南","海口");
put("四川","成都");
put("贵州","贵阳");
put("云南","昆明");
put("西藏","拉萨");
put("陕西","西安");
put("甘肃","兰州");
put("青海","西宁");
put("宁夏","银川");
put("新疆","乌鲁木齐");
}};
public DataCenterModel summaryAction(DataCenterModel model) {
@@ -215,7 +215,7 @@ public class DataCenterController {
public Object findCityAvgPriceAction(@Param(name = "province") String province) {
JsonModel model = new JsonModel();
Map<String, Object> result = new HashMap<String, Object>();
if(RegionData.getAllCity().contains(province) && !"吉林".equals(province)){
if(RegionData.getAllCity().contains(province) && !"吉林".equals(province)){
result.put("type", "city");
result.put("cityStat", regionStatService.findRegionStat(province, null));
List<RegionStat> stats = new ArrayList<RegionStat>(RegionData.getAllRegions(province).size());
@@ -260,7 +260,7 @@ public class DataCenterController {
private List<RegionStat> getAllCityPrice() {
List<String> citys = serverAreaService.findAllSupportGujia();
citys.add("拉萨");
citys.add("拉萨");
List<RegionStat> cityStats = regionStatService.findRegionStatByCityName(citys);
return cityStats;
}
@@ -13,7 +13,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* Òâ¼û·´À¡
* 意见反馈
* Created by wenyan on 2015/11/24.
*/
public class FeedbackController {
@@ -53,7 +53,7 @@ import com.fangjia.service.mongo.fangjia.DistrictHotService;
import com.fangjia.service.mongo.fangjia.PricePredictService;
/**
* 首页
* 首页
*
* @author yk
*
@@ -91,7 +91,7 @@ public class GeneralController extends BaseController {
}
model.setDistrict(district);
/* 坐标 */
/* 坐标 */
double lat = district.getLat2()/10000000000d;
double lng = district.getLng2()/10000000000d;
double radius = getRadius();
@@ -99,16 +99,16 @@ public class GeneralController extends BaseController {
String city = district.getCity();
String region = district.getRegion();
// 房价指数
// 房价指数
RegionStat cityStat = regionStatService.findByCity(model.getCityName());
DistrictStatBo statBo = districtStatService.findYearPeriodStatBo(districtKey);
model.setStatBo(statBo);
DistrictStat stat = statBo.getDefaultDistrictStat();
String estateType = district.getEstateType2();
if(!estateType.contains("别墅")){
estateType = "小区";
if(!estateType.contains("别墅")){
estateType = "小区";
}else{
estateType = "别墅";
estateType = "别墅";
}
List<Integer> rentList = new ArrayList<Integer>();
Map<Integer,Integer> districtStatRents = districtStatRentService.findByDistrictStatRent(districtKey, estateType);
@@ -133,13 +133,13 @@ public class GeneralController extends BaseController {
model.setPriceScore(DistrictScoreUtil.priceScore2(null == stat ? null: stat.getAvgPrice(), pricelist.get(0), pricelist.get(1), rentList));
// 潜力指数
// 潜力指数
int avgPrice = 0;
String buildType = "小区";
String buildType = "小区";
if (null == statBo.getDistrictStat()
&& null != statBo.getVillaDistrictStat()) {
avgPrice = statBo.getVillaDistrictStat().getAvgPrice();
buildType = "别墅";
buildType = "别墅";
} else if (null != statBo.getDistrictStat()) {
avgPrice = statBo.getDistrictStat().getAvgPrice();
}
@@ -166,56 +166,56 @@ public class GeneralController extends BaseController {
model.setRankScore(DistrictScoreUtil.rankScore2(houseCountRatio, dealPriceCountRatio));
long t = System.currentTimeMillis();
// 消费指数
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, 1000, "美食");
String[] allKw = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院",
"学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧", "发电厂", "变电站", "垃圾焚烧厂", "化工厂"};
// 消费指数
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, 1000, "美食");
String[] allKw = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院",
"学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧", "发电厂", "变电站", "垃圾焚烧厂", "化工厂"};
Map<String,JSONObject> searchResult = baiduApiService.searchNearBy(Arrays.asList(allKw), lat, lng, 1000, model.getBaiduMapKey());
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(searchResult.get(ks[i])));
}
model.setConsumScore(DistrictScoreUtil.consumScore(avgConsumption,countMap));
// 环境指数
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧" };
// 厌恶设施
String[] keys = new String[] { "发电厂", "变电站", "垃圾焚烧厂", "化工厂" };
// 环境指数
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园","机场", "网吧" };
// 厌恶设施
String[] keys = new String[] { "发电厂", "变电站", "垃圾焚烧厂", "化工厂" };
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(searchResult.get(ks[i])));
}
// 添加厌恶设施
// 添加厌恶设施
for (int i = 0; i < keys.length; i++) {
countMap.put(keys[i], getTotal(searchResult.get(ks[i])));
}
System.out.println("API耗时:" + (System.currentTimeMillis() -t));
System.out.println("API耗时:" + (System.currentTimeMillis() -t));
Map<String, List<BusStation>> stationMap = busStationService
.getNearByStations(city, lat, lng, 1000);
countMap.put("地铁站", null == stationMap.get("地铁") ? null : stationMap
.get("地铁").size());
countMap.put("公交点", null == stationMap.get("公交") ? null : stationMap
.get("公交").size());
countMap.put("地铁站", null == stationMap.get("地铁") ? null : stationMap
.get("地铁").size());
countMap.put("公交点", null == stationMap.get("公交") ? null : stationMap
.get("公交").size());
model.setAroundScore(DistrictScoreUtil.aroundScore(countMap));
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils
.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
}
}
// 楼盘指数
// 楼盘指数
model.setDetailScore(DistrictScoreUtil.detailScore(district,seaweedNumbericDao.findDistrict(city, region,district.getName())));
double totalScore = 0d;
@@ -511,12 +511,12 @@ public class GeneralController extends BaseController {
double radius = getRadius();
List<BusStation> metros = null;
List<BusStation> buses = null;
// 综合得分
// 综合得分
SeaweedNumberic numberic = seaweedNumbericDao.findShop(mall.getCity(),
mall.getRegion(), mall.getName());
model.setDetailScore(ShopScoreUtil.detailScore(mall, numberic));
// 房价
// 房价
BizRegionStat cityStat = bizRegionStatService.findCitySellPrice(mall.getCity(),
weekend);
DistrictStatBo statBo = shopStatService.findAllShopStat(
@@ -526,22 +526,22 @@ public class GeneralController extends BaseController {
null == cityStat ? null : cityStat.getAvgPrice()));
model.setStatBo(statBo);
// 租金
// 租金
BizRegionStat cityStatRent = bizRegionStatService.findCityRentPrice(mall.getCity(), weekend);
DistrictBusinessStatRentBo statRentBo = districtBusinessStatRentService
.findMallStatBo(new DistrictKey(mall.getCity(), mall.getRegion(), mall.getName()), weekend);
model.setRentScore(ShopScoreUtil.rentScore(statRentBo,null == cityStatRent ? null : cityStatRent.getAvgPrice(), mall.getPaymentPattern()));
// 地段
// 地段
Map<String, List<BusStation>> stationMap = busStationService
.getNearByStations(mall.getCity(), lat, lng, radius);
metros = stationMap.get("地铁");
buses = stationMap.get("公交");
metros = stationMap.get("地铁");
buses = stationMap.get("公交");
model.setLocalScore(ShopScoreUtil.localScore(mall.getLoopLineInfo(),
null == metros ? 0 : metros.size(),
null == buses ? 0 : buses.size()));
// 人口
// 人口
int cityAvgPrice = cityPriceLevelService.findCityPriceLevel(city);
cityAvgPrice = cityAvgPrice == 0 ? 7000 : cityAvgPrice;
@@ -549,7 +549,7 @@ public class GeneralController extends BaseController {
lng, radius);
int totalHouseCount = getTotalHouseCount(districts, cityAvgPrice);
// 居民人口密度
// 居民人口密度
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
double density = totalHouseCount * 2.49 / circleArea;
double peopleScore1 = ShopScoreUtil.peopleScore1(density);
@@ -558,38 +558,38 @@ public class GeneralController extends BaseController {
radius);
int totalOfficeCount = getTotalOfficeCount(offices);
// 办公人口
// 办公人口
density = totalOfficeCount / circleArea;
double peopleScore2 = ShopScoreUtil.peopleScore2(density);
model.setPeopleScore(peopleScore1 > peopleScore2 ? peopleScore1
: peopleScore2);
String[] allKs = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"
String[] allKs = new String[]{"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"
};
Map<String,JSONObject> searchResult = baiduApiService.searchNearBy(Arrays.asList(allKs), lat, lng, radius, model.getBaiduMapKey());
// 消费
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
// 消费
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店","大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks){
countMap.put(k, getTotal(searchResult.get(k)));
}
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, radius, "餐厅");
Double avgConsumption = bizShopService.findAroundAvgConsumption(lat,lng, radius, "餐厅");
model.setConsumScore(ShopScoreUtil.consumScore(avgConsumption, countMap));
// 环境
ks = new String[] { "医院", "公园", "学校", "体育馆" };
// 环境
ks = new String[] { "医院", "公园", "学校", "体育馆" };
countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks){
countMap.put(k, getTotal(searchResult.get(k)));
}
countMap.put("地铁站", null == metros ? null : metros.size());
countMap.put("公交点", null == buses ? null : buses.size());
countMap.put("地铁站", null == metros ? null : metros.size());
countMap.put("公交点", null == buses ? null : buses.size());
double aroundScore1 = ShopScoreUtil.aroundScore1(countMap);
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
countMap = new HashMap<String, Integer>(ks.length);
for (String k : ks){
countMap.put(k, getTotal(searchResult.get(k)));
@@ -752,7 +752,7 @@ public class GeneralController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
} else {
@@ -771,7 +771,7 @@ public class GeneralController extends BaseController {
}
return oldHouseCount + hightLevelDistrictHouseCount
+ commonDistrictHouseCount;// 总户数
+ commonDistrictHouseCount;// 总户数
}
return 0;
}
@@ -848,13 +848,13 @@ public class GeneralController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount
+ office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount
+ office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount
+ office.getHouseholdCount();
} else {
@@ -41,12 +41,12 @@ public class LocalController extends BaseController {
double lng = mall.getLng2()/10000000000.0;
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(model.getCityName(), lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
if("上海".equals(model.getCityName())){
// 虹桥机场 121.352578,31.200062
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
if("上海".equals(model.getCityName())){
// 虹桥机场 121.352578,31.200062
model.setDisHongqiaoAirport(GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062));
// 虹桥火车站 121.32795,31.1991
// 虹桥火车站 121.32795,31.1991
model.setDisHongqiaoStation(GeoUtils.calculateDistance(lng, lat, 121.32795, 31.1991));
}
model.setTabScore(ShopScoreUtil.localScore(mall.getLoopLineInfo(), null == model.getMetroStations() ? 0 : model
@@ -42,7 +42,7 @@ public class NodistrictController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没小区,直接返回
// 周边没小区,直接返回
List<District> districts = districtService.findDistrict(lat, lng, radius, model.getCityName());
if (CollectionUtils.isEmpty(districts)) {
return model;
@@ -54,7 +54,7 @@ public class NodistrictController extends BaseController {
model.setCityPrice(cityStat.getAvgPrice());
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(districts, new Comparator<District>() {
public int compare(District o1, District o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -102,11 +102,11 @@ public class NodistrictController extends BaseController {
model.setPriceNearest(priceNearest);
// 范围内均价
// 范围内均价
if (priceCount > 0 && stats.size() > 0) {
model.setAreaPrice(priceCount / stats.size());
Map<String, Integer> priceMap = districtStatService.getCityDistriceMinAndMaxPrice(model.getCityName());
//设置价格
//设置价格
model.setCityDistrictMinSellPrice(priceMap.get("cityDistrictMinSellPrice"));
model.setCityDistrictMaxSellPrice(priceMap.get("cityDistrictMaxSellPrice"));
@@ -124,7 +124,7 @@ public class NodistrictController extends BaseController {
}
}
// 由低到高排序
// 由低到高排序
Collections.sort(stats, new Comparator<DistrictStat>() {
public int compare(DistrictStat o1, DistrictStat o2) {
return o1.getAvgPrice() - o2.getAvgPrice();
@@ -139,7 +139,7 @@ public class NodistrictController extends BaseController {
}
model.setPriceBtm5(priceBtm5);
// 由高到低排序
// 由高到低排序
Collections.reverse(stats);
List<DistrictStat> priceTop5 = new ArrayList<DistrictStat>(5);
for (DistrictStat s : stats) {
@@ -158,13 +158,13 @@ public class NodistrictController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没小区,直接返回
// 周边没小区,直接返回
List<District> districts = districtService.findDistrict(lat, lng, radius, model.getCityName());
if (CollectionUtils.isEmpty(districts)) {
return model;
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(districts, new Comparator<District>() {
public int compare(District o1, District o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -325,7 +325,7 @@ public class NodistrictController extends BaseController {
double lng = model.getLng();
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
@@ -342,20 +342,20 @@ public class NodistrictController extends BaseController {
double lng = model.getLng();
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
model.setAirPort("虹桥机场");
model.setAirPort("虹桥机场");
model.setAirPortLat(31.200062);
model.setAirPortLng(121.352578);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
model.setAirPort("浦东机场");
model.setAirPort("浦东机场");
model.setAirPortLat(31.160702);
model.setAirPortLng(121.807085);
}
@@ -32,7 +32,7 @@ public class NofoundController extends BaseController {
return model.redirect("/general/district?q=" + URLEncoder.encode(model.getQ(), "UTF-8")+"&cityName="+URLEncoder.encode(model.getCityName(), "UTF-8"));
}
// 查询半径内小区
// 查询半径内小区
final double lat = model.getLat();
final double lng = model.getLng();
final double radius = getRadius();
@@ -50,7 +50,7 @@ public class NofoundController extends BaseController {
return model;
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(tmpDistricts, new Comparator<District>() {
public int compare(District o1, District o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -106,7 +106,7 @@ public class NofoundController extends BaseController {
final double lat = model.getLat();
final double lng = model.getLng();
List<Shop> shops = shopService.searchNearby(lat, lng, getRadius());
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(shops, new Comparator<Shop>() {
public int compare(Shop o1, Shop o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -49,7 +49,7 @@ public class NoshopController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没商铺,直接返回
// 周边没商铺,直接返回
List<Shop> shops = shopService.searchNearby(lat, lng, radius);
if (CollectionUtils.isEmpty(shops)) {
return model;
@@ -61,7 +61,7 @@ public class NoshopController extends BaseController {
model.setCityPrice(cityStat.getAvgPrice());
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(shops, new Comparator<Shop>() {
public int compare(Shop o1, Shop o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -102,7 +102,7 @@ public class NoshopController extends BaseController {
model.setPriceNearest(priceNearest);
// 范围内均价
// 范围内均价
if (priceCount > 0 && stats.size() > 0) {
model.setAreaPrice(priceCount / stats.size());
@@ -120,7 +120,7 @@ public class NoshopController extends BaseController {
}
}
// 由低到高排序
// 由低到高排序
Collections.sort(stats, new Comparator<DistrictStat>() {
public int compare(DistrictStat o1, DistrictStat o2) {
return o1.getAvgPrice() - o2.getAvgPrice();
@@ -135,7 +135,7 @@ public class NoshopController extends BaseController {
}
model.setPriceBtm5(priceBtm5);
// 由高到低排序
// 由高到低排序
Collections.reverse(stats);
List<DistrictStat> priceTop5 = new ArrayList<DistrictStat>(5);
for (DistrictStat s : stats) {
@@ -154,7 +154,7 @@ public class NoshopController extends BaseController {
final double lng = model.getLng();
final double radius = getRadius();
// 周边没商铺,直接返回
// 周边没商铺,直接返回
List<Shop> shops = shopService.searchNearby(lat, lng, radius);
if (CollectionUtils.isEmpty(shops)) {
return model;
@@ -166,7 +166,7 @@ public class NoshopController extends BaseController {
model.setCityRentPrice(cityStat.getAvgPrice());
}
// 按距离排序,由近到远
// 按距离排序,由近到远
Collections.sort(shops, new Comparator<Shop>() {
public int compare(Shop o1, Shop o2) {
double dis1 = GeoUtils.calculateDistance(lng, lat, o1.getLng2() / 10000000000.0, o1.getLat2() / 10000000000.0);
@@ -201,7 +201,7 @@ public class NoshopController extends BaseController {
model.setRentNearest(priceNearest);
// 范围内均价
// 范围内均价
if (priceCount > 0 && stats.size() > 0) {
model.setAreaRentPrice(priceCount / stats.size());
@@ -219,7 +219,7 @@ public class NoshopController extends BaseController {
}
}
// 由低到高排序
// 由低到高排序
Collections.sort(stats, new Comparator<DistrictBusinessStatRent>() {
public int compare(DistrictBusinessStatRent o1, DistrictBusinessStatRent o2) {
return o1.getAvgPrice() - o2.getAvgPrice();
@@ -234,7 +234,7 @@ public class NoshopController extends BaseController {
}
model.setRentBtm5(priceBtm5);
// 由高到低排序
// 由高到低排序
Collections.reverse(stats);
List<DistrictBusinessStatRent> priceTop5 = new ArrayList<DistrictBusinessStatRent>(5);
for (DistrictBusinessStatRent s : stats) {
@@ -254,16 +254,16 @@ public class NoshopController extends BaseController {
final double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(model.getCityName(), lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
// 虹桥机场 121.352578,31.200062
// 虹桥机场 121.352578,31.200062
model.setDisHongqiaoAirport(GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062));
// 虹桥火车站 121.32795,31.1991
// 虹桥火车站 121.32795,31.1991
model.setDisHongqiaoStation(GeoUtils.calculateDistance(lng, lat, 121.32795, 31.1991));
// 周边没商铺,直接返回
// 周边没商铺,直接返回
List<Shop> shops = shopService.searchNearby(lat, lng, radius);
if (CollectionUtils.isNotEmpty(shops)) {
int priceCount = 0;
@@ -278,7 +278,7 @@ public class NoshopController extends BaseController {
}
}
// 范围内均价
// 范围内均价
if (priceCount > 0 && count > 0) {
model.setAreaPrice(priceCount / count);
}
@@ -380,7 +380,7 @@ public class NoshopController extends BaseController {
double lat = model.getLat();
double lng = model.getLng();
double radius = getRadius();
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
@@ -397,8 +397,8 @@ public class NoshopController extends BaseController {
double lng = model.getLng();
double radius = getRadius();
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
return model;
}
@@ -617,7 +617,7 @@ public class NoshopController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
oldDistrictCount++;
@@ -636,15 +636,15 @@ public class NoshopController extends BaseController {
}
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
}
return model;
@@ -691,11 +691,11 @@ public class NoshopController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount + office.getHouseholdCount();
} else {
otherLevelCount = otherLevelCount + office.getHouseholdCount();
@@ -78,13 +78,13 @@ public class PeopleController extends BaseController {
JSONArray officesObj = JSONArray.fromObject(offices);
model.setOffices(officesObj.toString());
// 居民人口密度
// 居民人口密度
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
int totalHouseCount = model.getTotalHouseCount();
double density = totalHouseCount * 2.49 / circleArea;
double score1 = ShopScoreUtil.populationScore(density);
data.put("populationScore",score1);
// 办公人口
// 办公人口
int totalCountOffice = model.getTotalCountOffice();
density = totalCountOffice / circleArea;
double score2 = ShopScoreUtil.officePopulationScore(density);
@@ -124,26 +124,26 @@ public class PeopleController extends BaseController {
JSONArray officesObj = JSONArray.fromObject(offices);
model.setOffices(officesObj.toString());
// 居民人口密度
// 居民人口密度
/*double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
int totalHouseCount = model.getTotalHouseCount();
double density = totalHouseCount * 2.49 / circleArea;
double score1 = ShopScoreUtil.peopleScore1(density);
model.setScore1(score1);
// 办公人口
// 办公人口
int totalCountOffice = model.getTotalCountOffice();
density = totalCountOffice / circleArea;
double score2 = ShopScoreUtil.peopleScore2(density);
model.setScore2(score2);*/
//圆形面积
//圆形面积
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
//设置居民人口密度得分
//设置居民人口密度得分
double peopleDensityScore = setPeopleDensityScore(model, radius, circleArea);
//设置办公人口得分
//设置办公人口得分
double officeDensityScore = setOfficeDensityScore(model, circleArea);
model.setTabScore(peopleDensityScore > officeDensityScore ? peopleDensityScore : officeDensityScore);
@@ -182,7 +182,7 @@ public class PeopleController extends BaseController {
}
/**
* 设置办公人口得分
* 设置办公人口得分
* @author yinjihuan
* @date 2016-03-04
* @param model
@@ -190,18 +190,18 @@ public class PeopleController extends BaseController {
* @return
*/
private double setOfficeDensityScore(PeopleModel model, double circleArea) {
//办公人数总数
//办公人数总数
int totalCountOffice = model.getTotalCountOffice();
//办公人口密度=(圆形区域内办公人数总数/圆形面积)
//办公人口密度=(圆形区域内办公人数总数/圆形面积)
double density = totalCountOffice / circleArea;
//办公人口密度得分
//办公人口密度得分
double officeDensityScore = ShopScoreUtil.calcOfficeDensityScore(density);
model.setScore2(officeDensityScore);
return officeDensityScore;
}
/**
* 设置居民人口密度得分
* 设置居民人口密度得分
* @author yinjihuan
* @date 2016-03-04
* @param model
@@ -209,11 +209,11 @@ public class PeopleController extends BaseController {
* @return
*/
private double setPeopleDensityScore(PeopleModel model, double radius, double circleArea) {
// 圆形区域内总户数
// 圆形区域内总户数
int totalHouseCount = model.getTotalHouseCount();
//居民人口密度(居民人口密度 = 圆形区域内总户数*2.49/圆形面积)
//居民人口密度(居民人口密度 = 圆形区域内总户数*2.49/圆形面积)
double density = totalHouseCount * 2.49 / circleArea;
//人口密度得分
//人口密度得分
double peopleDensityScore = ShopScoreUtil.calcPeopleDensityScore(density);
model.setScore1(peopleDensityScore);
return peopleDensityScore;
@@ -319,7 +319,7 @@ public class PeopleController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
oldDistrictCount++;
@@ -338,15 +338,15 @@ public class PeopleController extends BaseController {
}
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);// 总小区数
model.setCommonDistrictCount(commonDistrictCount);// 高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);// 普通小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setOldDistrictCount(oldDistrictCount);// 老工户 小区数
}
return model;
@@ -393,11 +393,11 @@ public class PeopleController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount + office.getHouseholdCount();
} else {
otherLevelCount = otherLevelCount + office.getHouseholdCount();
@@ -43,10 +43,10 @@ public class PredictController extends BaseController{
model.setStatBo(statBo);
int avgPrice = 0;
String buildType = "小区";
String buildType = "小区";
if (null == statBo.getDistrictStat() && null != statBo.getVillaDistrictStat()) {
avgPrice = statBo.getVillaDistrictStat().getAvgPrice();
buildType = "别墅";
buildType = "别墅";
} else if (null != statBo.getDistrictStat()) {
avgPrice = statBo.getDistrictStat().getAvgPrice();
}
@@ -81,7 +81,7 @@ public class PredictController extends BaseController{
}
private void addDistrictStat(List<JSONObject> seriesOptions, DistrictKey districtKey, int weeks) {
List<String> list = Arrays.asList(StringUtils.split(districtService.findDistrictKind(districtKey), ",,"));
List<String> list = Arrays.asList(StringUtils.split(districtService.findDistrictKind(districtKey), ",,"));
List<DistrictStatBo> districtStatBoList = districtStatService.findAllDistrictStatByKind(districtKey, new Date(), weeks,
list);
JSONArray districtJa = new JSONArray();
@@ -130,7 +130,7 @@ public class PredictController extends BaseController{
if (villaJa.length() > 0) {
JSONObject jo2 = new JSONObject();
jo2.put("name", districtKey.getName() + "(别墅)");
jo2.put("name", districtKey.getName() + "(别墅)");
jo2.put("data", villaJa.toString());
jo2.put("yAxis", 0);
seriesOptions.add(jo2);
@@ -35,7 +35,7 @@ import java.net.URLEncoder;
import java.util.*;
/**
* 价格指数
* 价格指数
* @author yk
*
*/
@@ -51,15 +51,15 @@ public class PriceController extends BaseController {
final static ChafangtongCookieContext cookieContext = ChafangtongCookieContext.getInstance();
public Object districtAction(PriceModel model) throws UnsupportedEncodingException {
/**
* 将"全市相对最低"指标数字变更成上海小区均价升序,前0到3%的均价的中位数。
* "全市相对最高"指标数字变更成上海小区均价升序,前97%到100%的均价的中位数
* 2016-07-05 yinjihuan修改
* 将"全市相对最低"指标数字变更成上海小区均价升序,前0到3%的均价的中位数。
* "全市相对最高"指标数字变更成上海小区均价升序,前97%到100%的均价的中位数
* 2016-07-05 yinjihuan修改
*/
Map<String, Integer> priceMap = districtStatService.getCityDistriceMinAndMaxPrice(model.getCityName());
if (null == priceMap) {
return model.redirect("/noResult/district?q=" + URLEncoder.encode(model.getDistrictName(), "UTF-8") + "&cityName=" +URLEncoder.encode(model.getCityName(), "UTF-8"));
}
//设置价格
//设置价格
model.setCityDistrictMinSellPrice(priceMap.get("cityDistrictMinSellPrice"));
model.setCityDistrictMaxSellPrice(priceMap.get("cityDistrictMaxSellPrice"));
@@ -108,17 +108,17 @@ public class PriceController extends BaseController {
if(StringUtils.isNotBlank(district.getRegion())){
params.add(new QueryParam("region", district.getRegion()));
}
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
params.add(new QueryParam("endMonthDate", lastMonthEndDate));
List<RegionStatRent> regionStatRentList=regionStatRentDao.findAllByParams(params);
model.setRegionStatRents(regionStatRentList);
model.setRentStatBos(rentBos);
String estateType = district.getEstateType2();
if(!estateType.contains("别墅")){
estateType = "小区";
if(!estateType.contains("别墅")){
estateType = "小区";
}else{
estateType = "别墅";
estateType = "别墅";
}
List<Integer> rentList = new ArrayList<Integer>();
Map<Integer,Integer> districtStatRents = districtStatRentService.findByDistrictStatRent(districtKey, estateType);
@@ -211,7 +211,7 @@ public class PriceController extends BaseController {
}
List<JSONObject> seriesOptions = new ArrayList<JSONObject>();
String title = name + "均价走势";
String title = name + "均价走势";
DistrictKey districtKey = new DistrictKey(city, region, name);
addDistrictStat(seriesOptions, districtKey, weeks);
@@ -114,7 +114,7 @@ public class RentController extends BaseController {
}
List<JSONObject> seriesOptions = new ArrayList<JSONObject>();
String title = name + "×â½ð×ßÊÆ";
String title = name + "租金走势";
DistrictKey districtKey = new DistrictKey(city, region, name);
addDistrictStat(seriesOptions, districtKey, weeks);
@@ -124,7 +124,7 @@ public class ReportController extends BaseController {
model.setShowPdfLink(true);
}
// 综合指数
// 综合指数
SeaweedNumberic numberic = seaweedNumbericDao.findShop(shop.getCity(), shop.getRegion(), shop.getName());
model.setDetailScore(ShopScoreUtil.detailScore(shop, numberic));
model.setDetailScore1(ShopScoreUtil.detailScore1(shop.getEstateType(), null == numberic ? null : numberic.getBuildArea()));
@@ -132,7 +132,7 @@ public class ReportController extends BaseController {
model.setDetailScore3(ShopScoreUtil.detailScore3(shop.getCarSiteCount()));
model.setDetailScore4(ShopScoreUtil.detailScore4(null == numberic ? null : numberic.getFinishBuildYear()));
// 房价指数
// 房价指数
Date weekend = DateUtil.getFirstDayOfWeek(new Date());
BizRegionStat cityStat = bizRegionStatService.findCitySellPrice(city, weekend);
if (null != cityStat) {
@@ -170,7 +170,7 @@ public class ReportController extends BaseController {
model.setSellTradeUrl(model.getCityUrl() + "/cImg/" + SecurityUtil.encode(urlBuilder.toString())
+ (isRefreshCache ? "?__refresh_cache=1" : ""));
// 租金指数
// 租金指数
DistrictBusinessStatRentBo retnStatBo = districtBusinessStatRentService.findMallStatBo(new DistrictKey(shop.getCity(),
shop.getRegion(), shop.getName()), weekend);
model.setRentStatBo(retnStatBo);
@@ -203,15 +203,15 @@ public class ReportController extends BaseController {
model.setRentTradeUrl(model.getCityUrl() + "/cImg/" + SecurityUtil.encode(urlBuilder.toString())
+ (isRefreshCache ? "?__refresh_cache=1" : ""));
// 地段指数
// 地段指数
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
// 虹桥机场 121.352578,31.200062
// 虹桥机场 121.352578,31.200062
model.setDisHongqiaoAirport(GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062));
// 虹桥火车站 121.32795,31.1991
// 虹桥火车站 121.32795,31.1991
model.setDisHongqiaoStation(GeoUtils.calculateDistance(lng, lat, 121.32795, 31.1991));
model.setLocalScore(ShopScoreUtil.localScore(shop.getLoopLineInfo(), null == model.getMetroStations() ? 0 : model
@@ -263,7 +263,7 @@ public class ReportController extends BaseController {
model.setPieColors(Arrays.asList(new String[]{"#5491c7" ,"#f0776e" ,"#66bd7d" ,"#f5a549" ,"#c075eb"}));
model.setPieMarkers(jFreeChartImageService.getAroundBizTypePieMarkers(lat, lng, radius));
// 人口指数
// 人口指数
int cityAvgPrice = cityPriceLevelService.findCityPriceLevel(city);
cityAvgPrice = cityAvgPrice == 0 ? 7000 : cityAvgPrice;
model.setCityAvgPrice(cityAvgPrice);
@@ -274,14 +274,14 @@ public class ReportController extends BaseController {
List<DistrictInfoBo> offices = findDistricts(city, "office", lat, lng, radius);
offices = getOfficeCommDataInfo(offices, model);
// 居民人口密度
// 居民人口密度
double circleArea = Math.PI * Math.pow(radius / 1000.0, 2);
int totalHouseCount = model.getTotalHouseCount();
double density = totalHouseCount * 2.49 / circleArea;
double peopleScore1 = ShopScoreUtil.peopleScore1(density);
model.setPeopleScore1(peopleScore1);
// 办公人口
// 办公人口
int totalCountOffice = model.getTotalCountOffice();
density = totalCountOffice / circleArea;
double peopleScore2 = ShopScoreUtil.peopleScore2(density);
@@ -289,17 +289,17 @@ public class ReportController extends BaseController {
model.setPeopleScore(peopleScore1 > peopleScore2 ? peopleScore1 : peopleScore2);
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
if (null != model.getAvgConsumption()) {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
List<String> allKw = Arrays.asList(new String[]{ "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市",
"高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"});
List<String> allKw = Arrays.asList(new String[]{ "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市",
"高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴","医院", "公园", "学校", "体育馆","银行", "商场", "大型超市", "餐饮"});
Map<String,JSONObject> baiduKwResult = baiduApiService.searchNearBy(allKw, lat, lng, radius, model.getBaiduMapKey());
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
Integer c = getTotal(baiduKwResult.get(ks[i]));
@@ -310,8 +310,8 @@ public class ReportController extends BaseController {
model.setConsumCountMap(countMap);
model.setConsumScore(ShopScoreUtil.consumScore(model.getAvgConsumption(), countMap));
// 环境指数
ks = new String[] { "医院", "公园", "学校", "体育馆" };
// 环境指数
ks = new String[] { "医院", "公园", "学校", "体育馆" };
Map<String, Integer> aroundCountMap = new HashMap<String, Integer>();
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
@@ -320,14 +320,14 @@ public class ReportController extends BaseController {
countMap.put(ks[i], c);
}
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
aroundCountMap.putAll(countMap);
double aroundScore1 = ShopScoreUtil.aroundScore1(countMap);
model.setAroundScore1(aroundScore1);
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
ks = new String[] { "银行", "商场", "大型超市", "餐饮" };
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
Integer c = getTotal(baiduKwResult.get(ks[i]));
@@ -441,7 +441,7 @@ public class ReportController extends BaseController {
model.setShowPdfLink(true);
}
// 楼盘指数
// 楼盘指数
SeaweedNumberic numberic = seaweedNumbericDao.findDistrict(city, region, district.getName());
model.setDetailScore(DistrictScoreUtil.detailScore(district, numberic));
@@ -454,9 +454,9 @@ public class ReportController extends BaseController {
model.setDetailScore4(DistrictScoreUtil.detailScore4(nullNumberic ? null : numberic.getCubagePercent()));
model.setDetailScore5(DistrictScoreUtil.detailScore5(district.getBuildType(), nullNumberic ? null : numberic.getCarSiteCount()));
// 房价指数
// 房价指数
RegionStat cityStat = regionStatService.findByCity(city);
// Integer cityLeave = 0;//最高房价和最低房价的差值
// Integer cityLeave = 0;//最高房价和最低房价的差值
if (null != cityStat) {
model.setCityPrice(cityStat.getAvgPrice());
// Integer citySellMin = model.getCityDistrictMinSellPrice();
@@ -481,7 +481,7 @@ public class ReportController extends BaseController {
if(StringUtils.isNotBlank(district.getRegion())){
params.add(new QueryParam("region", district.getRegion()));
}
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
Date lastMonthEndDate = DateUtil.getLastEndMonthDate(new Date());// 检索上上月的数据
params.add(new QueryParam("endMonthDate", lastMonthEndDate));
List<RegionStatRent> regionStatRentList=regionStatRentDao.findAllByParams(params);
model.setRegionStatRents(regionStatRentList);
@@ -490,10 +490,10 @@ public class ReportController extends BaseController {
rentBo = districtStatRentService.findByDistrictStatRent(districtKey,2);
List<Integer> rentList = new ArrayList<Integer>();
String estateType = district.getEstateType2();
if(!estateType.contains("别墅")){
estateType = "小区";
if(!estateType.contains("别墅")){
estateType = "小区";
}else{
estateType = "别墅";
estateType = "别墅";
}
Map<Integer,Integer> districtStatRents = districtStatRentService.findByDistrictStatRent(districtKey, estateType);
@@ -523,7 +523,7 @@ public class ReportController extends BaseController {
if (null != stat) {
Map<String, Integer> priceMap = districtStatService.getCityDistriceMinAndMaxPrice(model.getCityName());
//设置价格
//设置价格
model.setCityDistrictMinSellPrice(priceMap.get("cityDistrictMinSellPrice"));
model.setCityDistrictMaxSellPrice(priceMap.get("cityDistrictMaxSellPrice"));
@@ -541,11 +541,11 @@ public class ReportController extends BaseController {
}
}
// 潜力指数
String buildType = "小区";
// 潜力指数
String buildType = "小区";
if (null == statBo.getDistrictStat() && null != statBo.getVillaDistrictStat()) {
avgPrice = statBo.getVillaDistrictStat().getAvgPrice();
buildType = "别墅";
buildType = "别墅";
} else if (null != statBo.getDistrictStat()) {
avgPrice = statBo.getDistrictStat().getAvgPrice();
}
@@ -572,9 +572,9 @@ public class ReportController extends BaseController {
model.setSellTradeUrl(model.getCityUrl() + "/cImg/" + SecurityUtil.encode(urlBuilder.toString())
+ (isRefreshCache ? "?__refresh_cache=1" : ""));
// 稀缺指数
// 稀缺指数
model.setRegionOrg(regionBlockService.getOrgName(city, region, "region"));
model.setBlockOrg(block + "板块");
model.setBlockOrg(block + "板块");
model.setRegionDistrictCount(districtService.findRegionDistrictCount(city, region));
//model.setBlockDistrictCount(districtService.findBlockDistrictCount(city, region, block));
model.setCityDistrictCount(districtService.findCityDistrictCount(city));
@@ -615,8 +615,8 @@ public class ReportController extends BaseController {
model.setMaxDealPriceCount(districtAnalyDataService.findMaxDealCountByCity(city));
model.setMaxSellCount(districtAnalyDataService.findMaxSellCountByCity(city));
model.setDistrictAnalyData(districtAnalyData);
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
// 消费指数
model.setAvgConsumption(bizShopService.findAroundAvgConsumption(lat, lng, radius, "餐厅"));
double cityConsumMin = model.getCityConsumMin();
double cityConsumMax = model.getCityConsumMax();
@@ -624,11 +624,11 @@ public class ReportController extends BaseController {
model.setHigher((model.getAvgConsumption() - cityConsumMin) * 100.0 / (cityConsumMax - cityConsumMin));
}
List<String> allKs = Arrays.asList(new String[]{
"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧", "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧"
"KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴",
"医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧", "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧"
});
Map<String,JSONObject> kwResult = baiduApiService.searchNearBy(allKs, lat, lng, radius, model.getBaiduMapKey());
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
String[] ks = new String[] { "KTV", "电影院", "健身中心", "商场", "美容院", "星级酒店", "大型超市", "高尔夫球场", "私立学校", "整形", "咖啡厅", "洗浴" };
Map<String, Integer> countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(kwResult.get(ks[i])));
@@ -636,34 +636,34 @@ public class ReportController extends BaseController {
model.setConsumCountMap(countMap);
model.setConsumScore(DistrictScoreUtil.consumScore(model.getAvgConsumption(), countMap));
// 环境指数
// 环境指数
Map<String, List<BusStation>> stationMap = busStationService.getNearByStations(city, lat, lng, radius);
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
model.setMetroStations(stationMap.get("地铁"));
model.setBusStations(stationMap.get("公交"));
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧" };
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
ks = new String[] { "医院", "学校", "写字楼", "银行", "ATM", "超市", "停车场", "公园", "网吧" };
//厌恶设施
String[] keys = new String[]{"发电厂","变电站","垃圾焚烧厂","化工厂"};
countMap = new HashMap<String, Integer>(ks.length);
for (int i = 0; i < ks.length; i++) {
countMap.put(ks[i], getTotal(kwResult.get(ks[i])));
}
//添加厌恶设施
//添加厌恶设施
for (int i = 0; i < keys.length; i++) {
countMap.put(ks[i], getTotal(kwResult.get(ks[i])));
}
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
countMap.put("地铁站", null == model.getMetroStations() ? null : model.getMetroStations().size());
countMap.put("公交点", null == model.getBusStations() ? null : model.getBusStations().size());
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
// 虹桥机场 121.352578,31.200062
// 浦东机场 121.807085,31.160702
double dis = GeoUtils.calculateDistance(lng, lat, 121.352578, 31.200062);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
} else {
dis = GeoUtils.calculateDistance(lng, lat, 121.807085, 31.160702);
if (dis <= radius) {
countMap.put("机场", 1);
countMap.put("机场", 1);
}
}
@@ -763,7 +763,7 @@ public class ReportController extends BaseController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if (district.getName().endsWith("村")) {
if (district.getName().endsWith("村")) {
oldHouseCount += count;
} else {
if (avgPrice >= model.getCityAvgPrice()) {
@@ -775,10 +775,10 @@ public class ReportController extends BaseController {
}
}
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);// 总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);// 高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);// 普通户数
model.setOldHouseCount(oldHouseCount);// 老工房 户数
}
return model;
}
@@ -823,11 +823,11 @@ public class ReportController extends BaseController {
}
if (StringUtils.isNotBlank(office.getBedKind())) {
if (office.getBedKind().equals("甲级")) {
if (office.getBedKind().equals("甲级")) {
bestLevelCount = bestLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("乙级")) {
} else if (office.getBedKind().equals("乙级")) {
betterLevelCount = betterLevelCount + office.getHouseholdCount();
} else if (office.getBedKind().equals("丙级")) {
} else if (office.getBedKind().equals("丙级")) {
goodLevelCount = goodLevelCount + office.getHouseholdCount();
} else {
otherLevelCount = otherLevelCount + office.getHouseholdCount();
@@ -875,7 +875,7 @@ public class ReportController extends BaseController {
return model;
}
//获取报告编号
//获取报告编号
public String getNumber(){
String number = "";
while(StringUtil.isBlank(number)){
@@ -917,7 +917,7 @@ public class ReportController extends BaseController {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district.getCity(), district
.getRegion(), district.getName()));
DistrictStat districtStat = null;
if (StringUtils.contains(evaluation.getBuildType(), "别墅")) {
if (StringUtils.contains(evaluation.getBuildType(), "别墅")) {
districtStat = districtStatBo.getVillaDistrictStat();
} else {
districtStat = districtStatBo.getDistrictStat();
@@ -962,7 +962,7 @@ public class ReportController extends BaseController {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district.getCity(), district
.getRegion(), district.getName()));
DistrictStat districtStat = null;
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
districtStat = districtStatBo.getVillaDistrictStat();
} else {
districtStat = districtStatBo.getDistrictStat();
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.Random;
/**
*估价报告查看
*估价报告查看
*@author wenyan
*/
public class ReportViewController extends BaseController {
@@ -47,7 +47,7 @@ public class ReportViewController extends BaseController {
String serialNumber;
// 根据id查找商铺
// 根据id查找商铺
Shop shop = null;
if (ObjectId.isValid(model.getId())) {
shop = shopService.findById(model.getId());
@@ -236,7 +236,7 @@ public class ReportViewController extends BaseController {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district.getCity(), district
.getRegion(), district.getName()));
DistrictStat districtStat = null;
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
districtStat = districtStatBo.getVillaDistrictStat();
} else {
districtStat = districtStatBo.getDistrictStat();
@@ -254,7 +254,7 @@ public class ReportViewController extends BaseController {
return avgPrice;
}
//获取报告编号
//获取报告编号
public String getNumber(){
String number = "";
while(StringUtil.isBlank(number)){
@@ -27,7 +27,7 @@ import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.district.ShopStatService;
/**
* 报告样例
* 报告样例
* Created by wenyan on 2015/11/27.
*/
public class SampleController extends BaseController{
@@ -41,7 +41,7 @@ public class SampleController extends BaseController{
DistrictKey districtKey = new DistrictKey(model.getCityName(), model.getRegion(), model.getDistrictName());
District district = districtService.findDistrict(districtKey,"district");
model.setDistrict(district);
/* 获取下载份数,菜单控制by tom */
/* 获取下载份数,菜单控制by tom */
String uid = cookieContext.getCookieValue(request, "fpk_uid");
if (StringUtils.isNotBlank(uid)) {
FpkUsers fpkUser = fpkUsersService.findById(SecurityUtil
@@ -61,7 +61,7 @@ public class SampleController extends BaseController{
DistrictKey districtKey = new DistrictKey(model.getCityName(), model.getRegion(), model.getDistrictName());
District district = districtService.findDistrict(districtKey,"shop");
model.setDistrict(district);
/* 获取下载份数,菜单控制by tom */
/* 获取下载份数,菜单控制by tom */
String uid = cookieContext.getCookieValue(request, "fpk_uid");
if (StringUtils.isNotBlank(uid)) {
FpkUsers fpkUser = fpkUsersService.findById(SecurityUtil
@@ -136,7 +136,7 @@ public class SearchController {
//nameQuery.add(new TermQuery(new Term("address", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("addr_alias_std", keyword)), Occur.SHOULD);
nameQuery.add(new TermQuery(new Term("keyword", keyword)), Occur.SHOULD);
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
//nameQuery.add(new TermQuery(new Term("keyword_cjk", keyword)), Occur.SHOULD);//这个重要,因seaweed不支持模糊搜索,当输入"中远两"需用此进行搜索
srQuery1.add(nameQuery, Occur.SHOULD);
params.add(new QueryParam("$sr", new SrQuery(srQuery1)));
List<District> districts = districtService.findAllByParams(params, 0, limit, new String[] { "region", "name","address", "addrAlias" });
@@ -151,7 +151,7 @@ public class SearchController {
bo.setRegion(district.getRegion());
ret.add(bo);
}
//对自动完成出来的结果按长短排序
//对自动完成出来的结果按长短排序
if(ret.size() > 0){
Collections.sort(ret, new Comparator<AutoCompleteBo>() {
public int compare(AutoCompleteBo o1, AutoCompleteBo o2) {
@@ -35,11 +35,11 @@ public class ShapeController {
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,360);
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,rim);
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.fillArc(50,50,300,300,90,360);
g2d.setColor(new Color(0,115,230));
Map<TextAttribute, Object> attributes = new HashMap<TextAttribute, Object>();
@@ -61,7 +61,7 @@ public class ShapeController {
unitStart = 200 + 25;
}else if("0".equals(scoreStr)){
scoreStr ="-";
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString(scoreStr, 200 - w + 10, 230);
unitStart = 175;
}else{
@@ -70,11 +70,11 @@ public class ShapeController {
}
if("0".equals(scoreStr)){
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 200);
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 200);
}else{
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 252);
g2d.setFont(new Font("微软雅黑", Font.BOLD, 12*a).deriveFont(attributes));
g2d.drawString("分", unitStart, 252);
}
g2d.dispose();
cache.put(model.getScore(), image);
@@ -33,33 +33,33 @@ public class UserController {
mav.setModel(data);
String password = model.getPassword();
if (StringUtils.isBlank(model.getUserName())) {
data.put("userNameMsg","用户名不能为空");
data.put("userNameMsg","用户名不能为空");
return mav;
}
if (StringUtils.isBlank(model.getPassword())) {
data.put("passwordMsg","密码不能为空");
data.put("passwordMsg","密码不能为空");
return mav;
}
FpkUsers user = fpkUsersDao.findByName(model.getUserName());
if (null == user) {
data.put("userNameMsg","用户名不存在");
data.put("userNameMsg","用户名不存在");
return mav;
}
if (!user.getPassword().equals(DigestUtils.md5Hex(password))) {
data.put("passwordMsg","密码错误");
data.put("passwordMsg","密码错误");
return mav;
}
if(!user.isEnabled()){
data.put("userNameMsg","账户被禁用,请联系我们!");
data.put("userNameMsg","账户被禁用,请联系我们!");
return mav;
}
if(user.getExpiryDate() != null && user.getExpiryDate().before(new Date())){
data.put("userNameMsg","您的账户已过期!");
data.put("userNameMsg","您的账户已过期!");
return mav;
}
@@ -82,7 +82,7 @@ public class UserController {
}
}
if(city == null || location == null){
data.put("userNameMsg","权限不足!");
data.put("userNameMsg","权限不足!");
}else{
if(StringUtils.isNotBlank(model.getForm())){
location = URLDecoder.decode(model.getForm(),"UTF-8");
@@ -118,7 +118,7 @@ public class UserController {
mav.setModel(data);
FpkUsers users = model.getUser();
if(!users.getPassword().equals(DigestUtils.md5Hex(model.getPasswordOld()))){
data.put("passwordOldMsg","原密码错误");
data.put("passwordOldMsg","原密码错误");
return mav;
}
Map<String,Object> map = new HashMap<String, Object>();
@@ -12,7 +12,7 @@ import java.io.IOException;
import java.util.Map;
/**
* 该标签主要用于把Java对象转成JavaScript对象输出
* 该标签主要用于把Java对象转成JavaScript对象输出
*/
public class JsonDirective implements TemplateDirectiveModel {
@@ -73,7 +73,7 @@ public class AccessLogFilter implements Filter {
LOGGER.error("error process request: request_url=" + analyticsBean.requestUrl + ", referer="
+ analyticsBean.refererUrl, rootCause);
}
// 记录运行超过1秒的请求到日志中
// 记录运行超过1秒的请求到日志中
final long time = System.currentTimeMillis() - start;
final String actionUri = (String) request.getAttribute(ActionContext.ACTION_URI);
if (time > 1000 || (!ChafangtongConfig.getConfig().isProductionEnvironment() && executeCounter.getTotalCount() > 0)) {
@@ -94,7 +94,7 @@ public class AccessLogFilter implements Filter {
private void writeAccessLog(AnalyticsBean analyticsBean, long duration, String actionUri, int statusCode, String method) {
StringBuilder logStr = new StringBuilder();
// 不要改变顺序
// 不要改变顺序
logStr.append(DATE_FORMAT.format(analyticsBean.startTime));// 1
logStr.append(SPLIT).append(StringUtils.defaultString(analyticsBean.connectionIp));// 2
logStr.append(SPLIT).append(StringUtils.defaultString(analyticsBean.ip));// 3
@@ -105,7 +105,7 @@ public class AnalyticsBean {
}
/**
* 获得连接客户端的IP(部署环境下一般都设有nginx等http服务器)
* 获得连接客户端的IP(部署环境下一般都设有nginx等http服务器)
*
* @param request
* @return
@@ -123,7 +123,7 @@ public class AnalyticsBean {
String citySpell = getCitySpell(request.getRequestURL().toString());
ServerArea city = ServerAreaData.getServerAreaByNameOrSpellDefaultNull(citySpell);
if (null != city) {
// 保存至cookie
// 保存至cookie
Cookie cityCookie = cookieContext.createCookie(CookieName.COOKIE_CITY, citySpell);
cityCookie.setMaxAge(Integer.MAX_VALUE);
response.addCookie(cityCookie);
@@ -137,7 +137,7 @@ public class AnalyticsBean {
}
private String createUID(HttpServletRequest request, HttpServletResponse response) {
// 设置UUID
// 设置UUID
String uuid = new ObjectId().toString();
Cookie uuidCookie = cookieContext.createCookie(CookieName.UID, uuid);
uuidCookie.setMaxAge(Integer.MAX_VALUE);
@@ -152,7 +152,7 @@ public class AnalyticsBean {
}
private String createSID(HttpServletRequest request, HttpServletResponse response) {
// 设置session id
// 设置session id
String sid = new ObjectId().toString();
Cookie uuidCookie = cookieContext.createCookie(CookieName.SID, sid);
uuidCookie.setMaxAge(-1);
@@ -165,7 +165,7 @@ public class AnalyticsBean {
}
/**
* 请求url,不包括query string
* 请求url,不包括query string
*
* @return
*/
@@ -174,7 +174,7 @@ public class AnalyticsBean {
}
/**
* 请求url后的请求参数,如果参数不为空则包括问号在内
* 请求url后的请求参数,如果参数不为空则包括问号在内
*
* @return
*/
@@ -183,7 +183,7 @@ public class AnalyticsBean {
}
/**
* 请求uri
* 请求uri
*
* @return
*/
@@ -192,7 +192,7 @@ public class AnalyticsBean {
}
/**
* 来源url
* 来源url
*
* @return
*/
@@ -201,7 +201,7 @@ public class AnalyticsBean {
}
/**
* 完整的请求url,包括query string
* 完整的请求url,包括query string
*
* @return
*/
@@ -210,7 +210,7 @@ public class AnalyticsBean {
}
/**
* 是否刷新缓存
* 是否刷新缓存
*
* @return
*/
@@ -219,7 +219,7 @@ public class AnalyticsBean {
}
/**
* 当前城市,可能为null
* 当前城市,可能为null
*
* @return
*/
@@ -228,7 +228,7 @@ public class AnalyticsBean {
}
/**
* 当前城市,不会为null
* 当前城市,不会为null
*
* @return
*/
@@ -237,7 +237,7 @@ public class AnalyticsBean {
}
/**
* cookie中的uid,如果没有则生成新的uid
* cookie中的uid,如果没有则生成新的uid
*
* @return
*/
@@ -246,7 +246,7 @@ public class AnalyticsBean {
}
/**
* 全局的请求id
* 全局的请求id
*
* @return
*/
@@ -255,7 +255,7 @@ public class AnalyticsBean {
}
/**
* cookie中的会话id,如果没有则生成新的sid
* cookie中的会话id,如果没有则生成新的sid
*
* @return
*/
@@ -264,7 +264,7 @@ public class AnalyticsBean {
}
/**
* 是否为ajax请求
* 是否为ajax请求
*
* @return
*/
@@ -273,7 +273,7 @@ public class AnalyticsBean {
}
/**
* 访问者的真实ip
* 访问者的真实ip
*
* @return
*/
@@ -282,7 +282,7 @@ public class AnalyticsBean {
}
/**
* 访问者标识,可能为null
* 访问者标识,可能为null
*
* @return
*/
@@ -291,7 +291,7 @@ public class AnalyticsBean {
}
/**
* 连接ip
* 连接ip
*
* @return
*/
@@ -300,7 +300,7 @@ public class AnalyticsBean {
}
/**
* cookie中的uid,如果没有则为空字符串
* cookie中的uid,如果没有则为空字符串
*
* @return
*/
@@ -309,7 +309,7 @@ public class AnalyticsBean {
}
/**
* cookie中的会话id,如果没有则为空字符串
* cookie中的会话id,如果没有则为空字符串
*
* @return
*/
@@ -318,7 +318,7 @@ public class AnalyticsBean {
}
/**
* 请求开始时间
* 请求开始时间
*
* @return
*/
@@ -59,12 +59,12 @@ public class AnalyticsFilter implements Filter {
ServletException {
final AnalyticsBean analyticsBean = AnalyticsBean.get(request, response);
// 点击日志
// 点击日志
if (analyticsBean.requestUrl.indexOf("/__utm.gif") > -1) {
processUtmGifLog(request, response, analyticsBean);
return;
}
// // 判断URL是否合法,不合法则重定向
// // 判断URL是否合法,不合法则重定向
// String redirectUrl = checkUrlFormat(analyticsBean);
// if (null != redirectUrl) {
// if (analyticsBean.isSpider()) {
@@ -84,7 +84,7 @@ public class AnalyticsFilter implements Filter {
threadLocalData.put(ThreadLocalKey.DisableCache, "1");
}
//
// // 切换城市
// // 切换城市
// FangjiaServerAreaContextHolder.setServerArea(analyticsBean.city);
// threadLocalData.put(ThreadLocalKey.FromSpider, analyticsBean.isSpider());
chain.doFilter(request, response);
@@ -105,7 +105,7 @@ public class AnalyticsFilter implements Filter {
responseOutputStream.close();
String userAgent = analyticsBean.userAgent;
if (userAgent != null && (userAgent.indexOf("Googlebot-Image") >= 0 || userAgent.indexOf("Baidu") >= 0)) {
// 过滤爬虫的访问
// 过滤爬虫的访问
return;
}
jmsTemplate.send(utmgifDestination, new MessageCreator() {
@@ -138,7 +138,7 @@ public class AnalyticsFilter implements Filter {
}
/**
* 判断URL是否合法,合法则返回null,否则返回重定向URL
* 判断URL是否合法,合法则返回null,否则返回重定向URL
*
* @param requestUrl
* @param requestUri
@@ -148,7 +148,7 @@ public class AnalyticsFilter implements Filter {
private String checkUrlFormat(AnalyticsBean analyticsBean) {
ChafangtongConfig fangjiaConfig = ChafangtongConfig.getConfig();
String hostName = StringUtils.substringBetween(analyticsBean.requestUrl, "http://", "/");
// 如果hostName中有端口号,则把端口号去掉
// 如果hostName中有端口号,则把端口号去掉
int index = hostName.indexOf(":");
if (index > 0) {
hostName = hostName.substring(0, index);
@@ -168,7 +168,7 @@ public class AnalyticsFilter implements Filter {
return fangjiaConfig.getCityDomainName(city) + analyticsBean.requestUri + analyticsBean.queryString;
}
if (city != null) {
// 找到对应的城市,或者是一个有效的二级域名
// 找到对应的城市,或者是一个有效的二级域名
return null;
}
if (prefixSplit[0].equalsIgnoreCase("www")) {
@@ -53,7 +53,7 @@ public class SpiderValidateFilter implements Filter {
private void checkReload() {
if (this.reloading.compareAndSet(false, true)) {
try {
// 5分钟reload一次
// 5分钟reload一次
if (System.currentTimeMillis() - lastReloadTimestamp < 300000) {
return;
}
@@ -87,13 +87,13 @@ public class SpiderValidateFilter implements Filter {
if (isValidUserAgent(ua)) {
for (String spiderName : spiderDomains.keySet()) {
if (!ua.contains(spiderName)) {
// 未声明自己为spider则跳过
// 未声明自己为spider则跳过
continue;
}
if (null == ip) {
spider = new Spider(spiderName, ip, ua);
spider.setFake(true);
// 对ip为null的蜘蛛暂时不入数据库
// 对ip为null的蜘蛛暂时不入数据库
} else {
spider = spiders.get(ip);
if (null == spider) {
@@ -106,7 +106,7 @@ public class SpiderValidateFilter implements Filter {
} else {
spider = new Spider("unkown", ip, ua);
spider.setFake(true);
// 对userAgent为null的蜘蛛暂时不入数据库
// 对userAgent为null的蜘蛛暂时不入数据库
}
}
if (spider != null && spider.isFake()) {
@@ -145,7 +145,7 @@ public class SpiderValidateFilter implements Filter {
private void validateSpider(Spider spider) {
if (null == spider.getId()) {
// 新发现的蜘蛛
// 新发现的蜘蛛
checkSpider(spider);
spiderService.upsertByIp(spider);
spiders.put(spider.getIp(), spider);
@@ -153,23 +153,23 @@ public class SpiderValidateFilter implements Filter {
LOGGER.info("find new spider: " + spider);
}
} else if (spider.isVerified()) {
// 已人工验证的蜘蛛
// 已人工验证的蜘蛛
spiders.put(spider.getIp(), spider);
} else if (spider.isFake()) {
// 已发现的假蜘蛛
// 已发现的假蜘蛛
Date yestoday = DateUtils.addDays(new Date(), -1);
if (spider.getModificationDate().before(yestoday)) {
// 删除超过1天的假蜘蛛信息
// 删除超过1天的假蜘蛛信息
spiderService.deleteByIp(spider.getIp());
spiders.remove(spider.getIp());
} else {
spiders.put(spider.getIp(), spider);
}
} else {
// 已发现的真蜘蛛
// 已发现的真蜘蛛
Date lastWeek = DateUtils.addDays(new Date(), -7);
if (spider.getModificationDate().before(lastWeek)) {
// 重新验证超过7天的真蜘蛛
// 重新验证超过7天的真蜘蛛
checkSpider(spider);
if (spider.isFake()) {
spiderService.deleteByIp(spider.getIp());
@@ -191,10 +191,10 @@ public class SpiderValidateFilter implements Filter {
String host = nslookup(spider.getIp());
if (null != host) {
spider.setHost(host);
// 不是相同域的为假蜘蛛
// 不是相同域的为假蜘蛛
spider.setFake(!isSameDomain(host, spiderDomains.get(spider.getName())));
} else {
// 反向解析失败,则默认为真蜘蛛
// 反向解析失败,则默认为真蜘蛛
spider.setHost(spider.getIp());
spider.setFake(false);
}
@@ -31,7 +31,7 @@ import java.net.URLEncoder;
import java.util.*;
/**
* 查房通权限拦截器
* 查房通权限拦截器
* Created by wenyan on 2015/11/12.
*/
public class AuthenticationInterceptor implements Interceptor {
@@ -75,11 +75,11 @@ public class AuthenticationInterceptor implements Interceptor {
isPassed = false;
}
if(isPassed && city == null){
LOGGER.info("无法访问" + request.getRequestURI() + "请用cityName 指定访问资源所在的城市");
LOGGER.info("无法访问" + request.getRequestURI() + "请用cityName 指定访问资源所在的城市");
error = "noAuth";
}
if(isPassed && !isAccessible(user, city, request)){
LOGGER.info("无法访问" + request.getRequestURI() + "!!!请到菜单管理添加菜单");
LOGGER.info("无法访问" + request.getRequestURI() + "!!!请到菜单管理添加菜单");
isPassed = false;
error = "noAuth";
}
@@ -235,7 +235,7 @@ public class BaseModel extends ModelAndViewSupport {
}
/**
* 如果queryString不为空则在前面加上问号"?",否则不加
* 如果queryString不为空则在前面加上问号"?",否则不加
*
* @return
*/
@@ -5,7 +5,7 @@ import com.fangjia.service.bo.DistrictStatBo;
public class ConsumModel extends ChafangtongModel {
private static final long serialVersionUID = 6142958920656840695L;
private Double avgConsumption; // 周边餐饮人均消费
private Double avgConsumption; // 周边餐饮人均消费
private DistrictStatBo statBo;
private Double higher;
@@ -3,17 +3,17 @@ package com.fangjia.chafangtong.model;
public final class Models {
/**
* 404错误面页的model
* 404错误面页的model
*/
public static final BaseModel NOT_FOUNT = createModel(404, "/error");
/**
* 一般错误面页的model
* 一般错误面页的model
*/
public static final BaseModel ERROR = createModel(500, "/error");
/**
* 500错误面页的model
* 500错误面页的model
*/
public static final BaseModel FORBIDDEN = createModel(400, "/forbidden");
@@ -13,7 +13,7 @@ public class NoResultModel extends ChafangtongModel {
private double maxLng;
double centerLat;
double centerLng;
String type; // r: 矩形搜索(最大最小经纬度),c:圆形搜索(中心点、半径)
String type; // r: 矩形搜索(最大最小经纬度),c:圆形搜索(中心点、半径)
List<Map<String, String>> result;
public List<AroundMarker> getInsideShops() {
@@ -11,15 +11,15 @@ import com.fangjia.service.bo.DistrictStatRentBo;
public class NodistrictModel extends ChafangtongModel {
private static final long serialVersionUID = -2866501361955105846L;
// 房价
// 房价
Integer areaPrice;
Integer cityPrice;
Double priceLeft;
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
// 租金
// 租金
Integer areaRent1;
Integer areaRent2;
Integer areaRent3;
@@ -30,7 +30,7 @@ public class NodistrictModel extends ChafangtongModel {
DistrictStatRent[] rentRank3;
DistrictStatRent[] rentRank4;
Double avgConsumption; // 周边餐饮人均消费
Double avgConsumption; // 周边餐饮人均消费
Double higher;
List<BusStation> metroStations;
@@ -11,30 +11,30 @@ import com.fangjia.service.bo.DistrictStatBo;
public class NoshopModel extends ChafangtongModel {
private static final long serialVersionUID = -170439161907268598L;
// 房价
// 房价
Integer areaPrice;
Integer cityPrice;
Double priceLeft;
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
List<DistrictStatBo> priceNearest; // 最近的3个商铺价格
List<DistrictStat> priceTop5; // 最高的5个
List<DistrictStat> priceBtm5; // 最低的5个
// 租金
// 租金
Integer areaRentPrice;
Integer cityRentPrice;
Double rentLeft;
List<DistrictBusinessStatRent> rentNearest; // 最近的3个商铺价格
List<DistrictBusinessStatRent> rentTop5; // 最高的5个
List<DistrictBusinessStatRent> rentBtm5; // 最低的5个
List<DistrictBusinessStatRent> rentNearest; // 最近的3个商铺价格
List<DistrictBusinessStatRent> rentTop5; // 最高的5个
List<DistrictBusinessStatRent> rentBtm5; // 最低的5个
// 地段
// 地段
List<BusStation> metroStations;
List<BusStation> busStations;
double disHongqiaoAirport;
double disHongqiaoStation;
Map<String, Double> typePercentMap;
// 人口
// 人口
int cityAvgPrice;
String districts;
String offices;
@@ -55,8 +55,8 @@ public class NoshopModel extends ChafangtongModel {
Double left1;
Double left2;
// 消费
Double avgConsumption; // 周边餐饮人均消费
// 消费
Double avgConsumption; // 周边餐饮人均消费
Double higher;
private final String[] PIE_COLOR_RGBS = new String[] { "#C6DBF7", "#F5EEBD", "#DEE7C6", "#FFD7BD", "#D6C3E7", "#C3E1E7",
@@ -29,7 +29,7 @@ public class ReportModel extends ChafangtongModel {
List<String> pieColors;
List<String> pieMarkers;
// 综合指数
// 综合指数
double detailScore;
double detailScore1;
double detailScore2;
@@ -39,7 +39,7 @@ public class ReportModel extends ChafangtongModel {
double shopArea;
List<Object[]> aroundTypes;
// 房价指数
// 房价指数
double priceScore;
Integer cityPrice;
DistrictStatBo statBo;
@@ -48,21 +48,21 @@ public class ReportModel extends ChafangtongModel {
List<RegionStatRent> regionStatRents;
List<DistrictStatRentBo> rentStatBos;
// 租金指数
// 租金指数
double rentScore;
DistrictBusinessStatRentBo rentStatBo;
String regionPayment;
Double rentLeft;
String rentTradeUrl;
// 地段指数
// 地段指数
double localScore;
double localScore1;
double localScore2;
Integer regionPrice;
String aroundPieUrl;
// 人口指数
// 人口指数
double peopleScore;
double peopleScore1;
double peopleScore2;
@@ -79,26 +79,26 @@ public class ReportModel extends ChafangtongModel {
Double left1;
Double left2;
// 消费指数
// 消费指数
double consumScore;
Double avgConsumption; // 周边餐饮人均消费
Double avgConsumption; // 周边餐饮人均消费
Double higher;
Map<String, Integer> consumCountMap;
// 环境指数
// 环境指数
double aroundScore;
double aroundScore1;
double aroundScore2;
Map<String, Integer> aroundCountMap;
// 潜力指数
// 潜力指数
double predictScore;
Integer predictPrice;
Double predictMarkup;
Integer districtMinPrice;
Integer districtMaxPrice;
// 稀缺指数
// 稀缺指数
double rankScore;
DistrictHot districtHot;
DistrictAttentionRank districtAttention;
@@ -113,7 +113,7 @@ public class ReportModel extends ChafangtongModel {
double totalScore;
private FpkDownload fpkDownload;
//报告编号
//报告编号
private String serialNum;
private Integer totalPrice;
@@ -3,7 +3,7 @@ package com.fangjia.chafangtong.model;
import org.sothis.web.mvc.ModelAndViewSupport;
/**
* 用于restAPI的ModelAndView
* 用于restAPI的ModelAndView
*
* @author velna
*
@@ -49,7 +49,7 @@ public class ChartImgServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");// 注意编码
request.setCharacterEncoding("UTF-8");// 注意编码
String reqUrl = request.getRequestURI();
String i = reqUrl.substring(reqUrl.indexOf("/cImg/") + 6, reqUrl.length());
@@ -107,7 +107,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 处理均价类走势图
* 处理均价类走势图
*
* @throws IOException
*/
@@ -170,7 +170,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 处理租金类走势图
* 处理租金类走势图
*
* @throws IOException
*/
@@ -233,7 +233,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 周边行业饼图
* 周边行业饼图
*
* @throws IOException
*/
@@ -305,7 +305,7 @@ public class ChartImgServlet extends HttpServlet {
}
/**
* 卖家关注度排行柱状图
* 卖家关注度排行柱状图
*
* @throws IOException
*/
@@ -56,7 +56,7 @@ public class ReportServlet extends HttpServlet {
System.setProperty("javax.xml.transform.TransformerFactory",
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
// 字体文件
// 字体文件
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
FONT_PATHS.add(classLoader.getResource("districtreport/SIMSUN.TTC").toString());
FONT_PATHS.add(classLoader.getResource("districtreport/SIMHEI.TTF").toString());
@@ -106,11 +106,11 @@ public class ReportServlet extends HttpServlet {
PdfCopy copy = new PdfCopy(document, resp.getOutputStream());
document.open();
document.newPage();
// // 封面
// // 封面
// PdfReader reader = new PdfReader(FRONTCOVER_DATA);
// PdfImportedPage coverPage = copy.getImportedPage(reader, 1);
// copy.addPage(coverPage);
// // 目录
// // 目录
// reader = new PdfReader(DIRECTORY_DATA);
// PdfImportedPage directoryPage = copy.getImportedPage(reader, 1);
// copy.addPage(directoryPage);
@@ -129,7 +129,7 @@ public class ReportServlet extends HttpServlet {
}
/**
* 根据页面URL获取内容
* 根据页面URL获取内容
*/
private byte[] getPageData(String pagePath,HttpServletRequest request) {
long start = System.currentTimeMillis();
@@ -151,7 +151,7 @@ public class ReportServlet extends HttpServlet {
html = html.replaceAll("&ensp;", "&#8194;");
renderer.setDocumentFromString(html);
// 解决中文支持问题
// 解决中文支持问题
ITextFontResolver fontResolver = renderer.getFontResolver();
for (String path : FONT_PATHS) {
fontResolver.addFont(path, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
@@ -14,68 +14,68 @@ import com.fangjia.service.bo.DistrictStatRentBo;
public class DistrictScoreUtil {
/**
* 城市平均租金(确认)
* 城市平均租金(确认)
*/
private final static int CITY_AVG_RENT_PRICE = 5847;
/**
* 市均餐饮人均消费(确认)
* 市均餐饮人均消费(确认)
*/
private final static int CITY_AVG_CONSUMPTION = 50;
/**
* 上月房源平均发布量(确认)
* 上月房源平均发布量(确认)
* modify by shibb 2015-6-18
*/
// private final static int LAST_MONTH_HOUSES_AVG = 200;
private final static int LAST_MONTH_HOUSES_AVG = 65;
/**
* 半年房源平均发布量(确认)
* 半年房源平均发布量(确认)
*/
private final static int HALF_YEAR_HOUSES_AVG = 1000;
/**
* 市均容积率(确认)
* 市均容积率(确认)
*/
private final static double CITY_AVG_CUBAGE_PERCENT = 2.0;
/**
* 市均绿化率(确认)
* 市均绿化率(确认)
*/
private final static double CITY_AVG_VIRESCENCE_PERCENT = 40;
/**
* 城市户均占地面积(确认)
* 城市户均占地面积(确认)
*/
private final static double CITY_AVG_HOUSEHOLD_ALLAREA = 50;
/**
* 城市户均建筑面积(确认)
* 城市户均建筑面积(确认)
*/
private final static double CITY_AVG_HOUSEHOLD_BUILDAREA = 100;
/**
* 市均停车位(确认)
* 市均停车位(确认)
*/
private final static double CITY_AVG_CAR_SITE = 300;
/**
* 市均物业费(确认)
* 市均物业费(确认)
*/
private final static double CITY_AVG_ESTATE_CHARGE = 1.59;
/**
* 稀缺度指数中关注度所占比重
* 稀缺度指数中关注度所占比重
*/
private final static int ATTENTION_RATIO = 7;
/**
* 稀缺度指数中挂牌量所占比重
* 稀缺度指数中挂牌量所占比重
*/
private final static int HOT_RATIO = 3;
/**
* 房价指数
* 房价指数
* modify by shibb 2015-6-19
*/
public static double priceScore(Integer districtPrice, Integer cityPrice, Integer leave, List<DistrictStatRentBo> rentBos) {
@@ -184,11 +184,11 @@ public class DistrictScoreUtil {
}
/**
* 新的计算房价指数的方法
* 新的计算房价指数的方法
*
* @param districtAvgPrice 小区均价
* @param districtAvgPrice 小区均价
* @param cityAvgPrice
* @param mPrice 方差
* @param mPrice 方差
* @param rentBos
* @return
*/
@@ -254,32 +254,32 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市中房价较低的住宅";
return "属于城市中房价较低的住宅";
case 2:
return "属于城市中房价较低的住宅";
return "属于城市中房价较低的住宅";
case 3:
return "属于城市中房价较低的住宅";
return "属于城市中房价较低的住宅";
case 4:
return "属于接近城市均价的住宅";
return "属于接近城市均价的住宅";
case 5:
return "属于接近城市均价的住宅";
return "属于接近城市均价的住宅";
case 6:
return "属于略高于城市均价的住宅";
return "属于略高于城市均价的住宅";
case 7:
return "属于城市中房价较高的住宅";
return "属于城市中房价较高的住宅";
case 8:
return "属于城市中房价较高的住宅";
return "属于城市中房价较高的住宅";
case 9:
return "属于城市中房价非常高的住宅";
return "属于城市中房价非常高的住宅";
case 10:
return "属于城市中房价非常高的住宅";
return "属于城市中房价非常高的住宅";
default:
return "";
}
}
/**
* 消费指数
* 消费指数
* modify by shibb 2015-6-18
*/
public static double consumScore(Double avgConsumption, Map<String, Integer> countMap) {
@@ -317,12 +317,12 @@ public class DistrictScoreUtil {
}
}
if (null != countMap.get("商场")) {
if (null != countMap.get("商场")) {
ret += 0.2;
// if (countMap.get("商场") >= 5) {
// if (countMap.get("商场") >= 5) {
// ret += 0.3;
// }
if (countMap.get("商场") >= 8) {
if (countMap.get("商场") >= 8) {
ret += 0.3;
}
}
@@ -335,48 +335,48 @@ public class DistrictScoreUtil {
ret += 0.1;
}
}
if (null != countMap.get("电影院")) {
if (null != countMap.get("电影院")) {
ret += 0.1;
}
if (null != countMap.get("健身中心")) {
if (null != countMap.get("健身中心")) {
ret += 0.2;
}
if (null != countMap.get("美容院")) {
if (null != countMap.get("美容院")) {
ret += 0.1;
// if (countMap.get("美容院") >= 5) {
// if (countMap.get("美容院") >= 5) {
// ret += 0.2;
// }
if (countMap.get("美容院") >= 20) {
if (countMap.get("美容院") >= 20) {
ret += 0.1;
}
}
if (null != countMap.get("大型超市")) {
if (null != countMap.get("大型超市")) {
ret += 0.2;
}
if (null != countMap.get("高尔夫球场")) {
if (null != countMap.get("高尔夫球场")) {
ret += 0.5;
}
if (null != countMap.get("私立学校")) {
if (null != countMap.get("私立学校")) {
ret += 0.2;
if (countMap.get("私立学校") >= 5) {
if (countMap.get("私立学校") >= 5) {
ret += 0.3;
}
}
if (null != countMap.get("整形")) {
if (null != countMap.get("整形")) {
ret += 0.2;
if (countMap.get("整形") >= 3) {
if (countMap.get("整形") >= 3) {
ret += 0.3;
}
}
if (null != countMap.get("洗浴")) {
if (null != countMap.get("洗浴")) {
ret += 0.1;
}
if (null != countMap.get("私立医院")) {
if (null != countMap.get("私立医院")) {
ret += 0.2;
}
if (null != countMap.get("星级酒店")) {
if (null != countMap.get("星级酒店")) {
ret += 0.2;
// if (countMap.get("星级酒店") >= 5) {
// if (countMap.get("星级酒店") >= 5) {
// ret += 0.2;
// }
}
@@ -388,44 +388,44 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边消费水平非常低,生活成<br>本低廉";
return "周边消费水平非常低,生活成<br>本低廉";
case 2:
return "周边消费水平非常低,生活成<br>本低廉";
return "周边消费水平非常低,生活成<br>本低廉";
case 3:
return "周边消费水平较低,生活成<br>本较低";
return "周边消费水平较低,生活成<br>本较低";
case 4:
return "周边消费水平较低,生活成<br>本较低";
return "周边消费水平较低,生活成<br>本较低";
case 5:
return "周边消费水平一般";
return "周边消费水平一般";
case 6:
return "周边消费水平一般";
return "周边消费水平一般";
case 7:
return "周边消费水平较高,生活成<br>本较高";
return "周边消费水平较高,生活成<br>本较高";
case 8:
return "周边消费水平较高,生活成<br>本较高";
return "周边消费水平较高,生活成<br>本较高";
case 9:
return "周边消费水平非常高,生活成<br>本昂贵";
return "周边消费水平非常高,生活成<br>本昂贵";
case 10:
return "周边消费水平非常高,生活成<br>本昂贵";
return "周边消费水平非常高,生活成<br>本昂贵";
default:
return "";
}
}
/**
* 环境指数计算
* 环境指数计算
* modify by shibb 2015-6-18
*/
public static double aroundScore(Map<String, Integer> countMap) {
double ret = 0d;
int schoolCount = null == countMap.get("学校") ? 0 : countMap.get("学校");
int hospitalCount = null == countMap.get("医院") ? 0 : countMap.get("医院");
int bankCount = null == countMap.get("银行") ? 0 : countMap.get("银行");
int schoolCount = null == countMap.get("学校") ? 0 : countMap.get("学校");
int hospitalCount = null == countMap.get("医院") ? 0 : countMap.get("医院");
int bankCount = null == countMap.get("银行") ? 0 : countMap.get("银行");
if (null != countMap.get("公交点")) {
int busCount = countMap.get("公交点");
if (null == countMap.get("地铁站") || countMap.get("地铁站") == 0) {
if (null != countMap.get("公交点")) {
int busCount = countMap.get("公交点");
if (null == countMap.get("地铁站") || countMap.get("地铁站") == 0) {
if (busCount <= 3) {
ret += 1;
} else if (busCount <= 8) {
@@ -438,7 +438,7 @@ public class DistrictScoreUtil {
ret += 5;
}
} else {
int metroCount = countMap.get("地铁站");
int metroCount = countMap.get("地铁站");
if (metroCount < 1) {
if (busCount <= 3) {
ret += 1;
@@ -490,27 +490,27 @@ public class DistrictScoreUtil {
}
}
if (null != countMap.get("写字楼") && countMap.get("写字楼") >= 5) {
if (null != countMap.get("写字楼") && countMap.get("写字楼") >= 5) {
ret += 0.5;
}
if (null != countMap.get("停车场")) {
if (null != countMap.get("停车场")) {
ret += 0.5;
}
// if (null != countMap.get("超市") && countMap.get("超市") >= 5) {
// if (null != countMap.get("超市") && countMap.get("超市") >= 5) {
// ret += 0.5;
// }
if (null != countMap.get("超市") && countMap.get("超市") >= 15) {
if (null != countMap.get("超市") && countMap.get("超市") >= 15) {
ret += 0.5;
}
// if (null != countMap.get("公园") && countMap.get("公园") >= 5) {
// if (null != countMap.get("公园") && countMap.get("公园") >= 5) {
// ret += 0.5;
// }
if (null != countMap.get("公园")) {
if (null != countMap.get("公园")) {
ret += 0.5;
}
//add by shibb
if (null != countMap.get("发电站") || null != countMap.get("变电站") || null != countMap.get("垃圾焚烧厂") || null != countMap.get("化工厂")) {
if (null != countMap.get("发电站") || null != countMap.get("变电站") || null != countMap.get("垃圾焚烧厂") || null != countMap.get("化工厂")) {
ret -= 1;
}
@@ -521,32 +521,32 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边公共配套非常差,生活很不便";
return "周边公共配套非常差,生活很不便";
case 2:
return "周边公共配套非常差,生活很不便";
return "周边公共配套非常差,生活很不便";
case 3:
return "周边公共配套较差,生活较为不便";
return "周边公共配套较差,生活较为不便";
case 4:
return "周边公共配套较差,生活较为不便";
return "周边公共配套较差,生活较为不便";
case 5:
return "周边公共配套一般,生活便利<br>指数一般";
return "周边公共配套一般,生活便利<br>指数一般";
case 6:
return "周边公共配套一般,生活便利<br>指数一般";
return "周边公共配套一般,生活便利<br>指数一般";
case 7:
return "周边公共配套较成熟,生活便利";
return "周边公共配套较成熟,生活便利";
case 8:
return "周边公共配套较成熟,生活便利";
return "周边公共配套较成熟,生活便利";
case 9:
return "周边公共配套非常成熟,生活<br>很便利";
return "周边公共配套非常成熟,生活<br>很便利";
case 10:
return "周边公共配套非常成熟,生活<br>很便利";
return "周边公共配套非常成熟,生活<br>很便利";
default:
return "";
}
}
/**
* 小区综合指数
* 小区综合指数
*/
public static double detailScore(District district, SeaweedNumberic numberic) {
double ret = 0d;
@@ -556,11 +556,11 @@ public class DistrictScoreUtil {
year = numberic.getFinishBuildYear();
}
// 类型
if (StringUtils.endsWith(district.getName(), "洋房")) {
// 类型
if (StringUtils.endsWith(district.getName(), "洋房")) {
ret += 9;
} else {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (StringUtils.contains(district.getEstateType2(), "别墅")) {
if (year >= 1920 && year <= 1949) {
ret += 9;
} else {
@@ -577,7 +577,7 @@ public class DistrictScoreUtil {
}
}
// 户均占地面积
// 户均占地面积
if (null != numberic && null != numberic.getHouseholdCount() && null != numberic.getAllArea()
&& numberic.getHouseholdCount() > 0 && numberic.getAllArea() > 0) {
double d = numberic.getAllArea() * 1.0 / numberic.getHouseholdCount();
@@ -589,7 +589,7 @@ public class DistrictScoreUtil {
}
}
// 户均建筑面积
// 户均建筑面积
if (null != numberic && null != numberic.getHouseholdCount() && null != numberic.getBuildArea()
&& numberic.getHouseholdCount() > 0 && numberic.getBuildArea() > 0) {
double d = numberic.getBuildArea() * 1.0 / numberic.getHouseholdCount();
@@ -602,7 +602,7 @@ public class DistrictScoreUtil {
}
}
// 绿化率
// 绿化率
if (null != numberic && null != numberic.getVirescencePercent()) {
double d = numberic.getVirescencePercent();
if (d > CITY_AVG_VIRESCENCE_PERCENT && ((d - CITY_AVG_VIRESCENCE_PERCENT) / CITY_AVG_VIRESCENCE_PERCENT > 0.2)) {
@@ -612,7 +612,7 @@ public class DistrictScoreUtil {
}
}
// 容积率
// 容积率
if (null != numberic && null != numberic.getCubagePercent()) {
double d = numberic.getCubagePercent();
if (d > CITY_AVG_CUBAGE_PERCENT && ((d - CITY_AVG_CUBAGE_PERCENT) / CITY_AVG_CUBAGE_PERCENT > 0.2)) {
@@ -622,7 +622,7 @@ public class DistrictScoreUtil {
}
}
// 停车位
// 停车位
if (null != numberic && null != numberic.getCarSiteCount()) {
double d = numberic.getCarSiteCount();
if (d > CITY_AVG_CAR_SITE && ((d - CITY_AVG_CAR_SITE) / CITY_AVG_CAR_SITE > 0.2)) {
@@ -639,7 +639,7 @@ public class DistrictScoreUtil {
ret += 0.5;
}
// 物业费
// 物业费
if (null != numberic && null != numberic.getEstateCharge()) {
double d = numberic.getEstateCharge();
if (d > CITY_AVG_ESTATE_CHARGE && ((d - CITY_AVG_ESTATE_CHARGE) * 1.0 / CITY_AVG_ESTATE_CHARGE > 0.2)) {
@@ -656,32 +656,32 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 2:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 3:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 4:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 5:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 6:
return "属于城市的普通住宅";
return "属于城市的普通住宅";
case 7:
return "属于城市的优质住宅";
return "属于城市的优质住宅";
case 8:
return "属于城市的优质住宅";
return "属于城市的优质住宅";
case 9:
return "属于城市的高端住宅";
return "属于城市的高端住宅";
case 10:
return "属于城市的高端住宅";
return "属于城市的高端住宅";
default:
return "";
}
}
/**
* 户均占地面积
* 户均占地面积
*/
public static double detailScore1(Integer householdCount, Integer allArea) {
if (null == householdCount || null == allArea || householdCount <= 0 || allArea <= 0) {
@@ -705,7 +705,7 @@ public class DistrictScoreUtil {
}
/**
* 户均建筑面积
* 户均建筑面积
*/
public static double detailScore2(Integer householdCount, Integer buildArea) {
if (null == householdCount || null == buildArea || householdCount <= 0 || buildArea <= 0) {
@@ -729,7 +729,7 @@ public class DistrictScoreUtil {
}
/**
* 绿化率
* 绿化率
*/
public static double detailScore3(Double virescencePercent) {
if (null == virescencePercent) {
@@ -752,7 +752,7 @@ public class DistrictScoreUtil {
}
/**
* 容积率
* 容积率
*/
public static double detailScore4(Double cubagePercent) {
if (null == cubagePercent) {
@@ -777,13 +777,13 @@ public class DistrictScoreUtil {
}
/**
* 停车位
* 停车位
*/
public static double detailScore5(String buildType, Integer carSiteCount) {
if (StringUtils.isNotBlank(buildType)) {
buildType = buildType.replaceAll(",", "");
if ("独栋".equals(buildType) || "双拼".equals(buildType) || "联排".equals(buildType) || "叠加".equals(buildType)
|| "花园洋房".equals(buildType) || "老洋房".equals(buildType) || "四合院".equals(buildType)) {
if ("独栋".equals(buildType) || "双拼".equals(buildType) || "联排".equals(buildType) || "叠加".equals(buildType)
|| "花园洋房".equals(buildType) || "老洋房".equals(buildType) || "四合院".equals(buildType)) {
return 9d;
}
}
@@ -810,8 +810,8 @@ public class DistrictScoreUtil {
}
/**
* 潜力指数
* 稀缺指数
* 潜力指数
* 稀缺指数
* modify by shibb
*/
public static double rankScore(int regionClickRank, int regionDistrictCount, int lastMonthHouses, int halfYearHouse) {
@@ -897,7 +897,7 @@ public class DistrictScoreUtil {
// ret -= 1;
// }
//regionDistrictCount小区平均关注度
//regionDistrictCount小区平均关注度
if (regionClickRank > regionDistrictCount) {
double d = (regionClickRank - regionDistrictCount) * 1.0 / regionDistrictCount;
if (d > 0.3) {
@@ -914,8 +914,8 @@ public class DistrictScoreUtil {
}
/**
* 潜力指数
* 稀缺指数
* 潜力指数
* 稀缺指数
* add by shibb
*/
public static double rankScore2(double hotRatio, double attentionRatio) {
@@ -927,27 +927,27 @@ public class DistrictScoreUtil {
int s = (int) score;
switch (s) {
case 0:
return "市场上有大量挂牌房源";
return "市场上有大量挂牌房源";
case 1:
return "市场上有大量挂牌房源";
return "市场上有大量挂牌房源";
case 2:
return "市场上有大量挂牌房源";
return "市场上有大量挂牌房源";
case 3:
return "挂牌房源量较充足";
return "挂牌房源量较充足";
case 4:
return "挂牌房源量较充足";
return "挂牌房源量较充足";
case 5:
return "挂牌房源量一般";
return "挂牌房源量一般";
case 6:
return "挂牌房源量一般";
return "挂牌房源量一般";
case 7:
return "市场上房源较稀缺";
return "市场上房源较稀缺";
case 8:
return "市场上房源较稀缺";
return "市场上房源较稀缺";
case 9:
return "市场上房源非常稀缺";
return "市场上房源非常稀缺";
case 10:
return "市场上房源非常稀缺";
return "市场上房源非常稀缺";
default:
return "";
}
@@ -997,23 +997,23 @@ public class DistrictScoreUtil {
case 1:
return "";
case 2:
return "房价跌幅明显,预计升值能力较弱";
return "房价跌幅明显,预计升值能力较弱";
case 3:
return "房价跌幅较明显,预计升值能力较弱";
return "房价跌幅较明显,预计升值能力较弱";
case 4:
return "房价走势较为平稳,预计未来<br>波动不大";
return "房价走势较为平稳,预计未来<br>波动不大";
case 5:
return "房价走势平稳,预计未来波动不大";
return "房价走势平稳,预计未来波动不大";
case 6:
return "房价走势较为平稳,预计未来<br>波动不大";
return "房价走势较为平稳,预计未来<br>波动不大";
case 7:
return "房价涨幅明显,未来走势理想";
return "房价涨幅明显,未来走势理想";
case 8:
return "房价涨幅明显,未来走势理想";
return "房价涨幅明显,未来走势理想";
case 9:
return "房价涨幅较高,未来走势乐观";
return "房价涨幅较高,未来走势乐观";
case 10:
return "房价涨幅较高,未来走势乐观";
return "房价涨幅较高,未来走势乐观";
default:
return "";
}
@@ -1024,7 +1024,7 @@ public class DistrictScoreUtil {
if (StringUtils.isBlank(date)) {
return 0;
}
Pattern p = Pattern.compile("(\\d{4})[-|年|.]?(\\d{1,2})?[-|月|.]?(\\d{1,2})?日?");
Pattern p = Pattern.compile("(\\d{4})[-|年|.]?(\\d{1,2})?[-|月|.]?(\\d{1,2})?日?");
Matcher m = p.matcher(date);
Integer year = 0;
if (m.find()) {
@@ -12,52 +12,52 @@ import com.fangjia.service.bo.DistrictStatBo;
public class ShopScoreUtil {
/**
* 市均停车位(确认)
* 市均停车位(确认)
*/
private final static int CITY_AVG_CAR_SITE_COUNT = 683;
/**
* 市均餐饮人均消费(确认)
* 市均餐饮人均消费(确认)
*/
private final static int CITY_AVG_CONSUMPTION = 50;
/**
* 市均商场建筑规模(面积)(确认)
* 市均商场建筑规模(面积)(确认)
*/
private final static int CITY_AVG_MALL_AREA = 119250;
/**
* 市均居民人口密度(确认)
* 市均居民人口密度(确认)
*/
//private final static double CITY_AVG_HOUSE_DENSITY = 3030;
private final static double CITY_AVG_HOUSE_DENSITY = 3631;
/**
* 市均办公人口密度(确认)
* 市均办公人口密度(确认)
*/
//private final static double CITY_AVG_OFFICE_DENSITY = 3030;
private final static double CITY_AVG_OFFICE_DENSITY = 3631;
/**
* 市均商场竣工年份(确认)
* 市均商场竣工年份(确认)
*/
private final static int CITY_AVG_FINISH_YAER = 2007;
/**
* 市均商场物业费(确认)
* 市均商场物业费(确认)
*/
private final static double CITY_AVG_ESTATE_CHARGE = 3.57;
/**
* 地段指数
* 地段指数
*/
public static double localScore(String loopLineInfo, int metros, int buses) {
double ret = 0d;
if ("内环以内".equals(loopLineInfo)) {
if ("内环以内".equals(loopLineInfo)) {
ret += 8;
} else if ("中内之间".equals(loopLineInfo) || "中内环间".equals(loopLineInfo)) {
} else if ("中内之间".equals(loopLineInfo) || "中内环间".equals(loopLineInfo)) {
ret += 6;
} else if ("中外之间".equals(loopLineInfo) || "中外环间".equals(loopLineInfo)) {
} else if ("中外之间".equals(loopLineInfo) || "中外环间".equals(loopLineInfo)) {
ret += 5;
} else if ("外环以外".equals(loopLineInfo)) {
} else if ("外环以外".equals(loopLineInfo)) {
ret += 4;
} else {
ret += 3;
@@ -69,8 +69,8 @@ public class ShopScoreUtil {
ret += 0.5;
}
// TODO 板块
// TODO A类+1,B类+0.5
// TODO 板块
// TODO A类+1,B类+0.5
return ret > 10 ? 10 : ret;
}
@@ -79,32 +79,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "位于城市中偏远的地段";
return "位于城市中偏远的地段";
case 2:
return "位于城市中偏远的地段";
return "位于城市中偏远的地段";
case 3:
return "位于城市中较偏远的地段";
return "位于城市中较偏远的地段";
case 4:
return "位于城市中较偏远的地段";
return "位于城市中较偏远的地段";
case 5:
return "位于城市中普通地段";
return "位于城市中普通地段";
case 6:
return "位于城市中普通地段";
return "位于城市中普通地段";
case 7:
return "位于城市中较好的地段";
return "位于城市中较好的地段";
case 8:
return "位于城市中较好的地段";
return "位于城市中较好的地段";
case 9:
return "位于城市中黄金地段";
return "位于城市中黄金地段";
case 10:
return "位于城市中黄金地段";
return "位于城市中黄金地段";
default:
return "";
}
}
/**
* 地段指数--公共交通
* 地段指数--公共交通
*/
public static double localScore1(int metroCount, int busCount) {
if (metroCount > 2) {
@@ -137,7 +137,7 @@ public class ShopScoreUtil {
}
/**
* 地段指数--周边业态
* 地段指数--周边业态
*/
public static double localScore2(Map<String, Integer> typeCountMap) {
double ret = 0d;
@@ -160,7 +160,7 @@ public class ShopScoreUtil {
}
/**
* 消费指数
* 消费指数
*/
public static double consumScore(Double avgConsumption, Map<String, Integer> countMap) {
double ret = 0d;
@@ -197,9 +197,9 @@ public class ShopScoreUtil {
}
}
if (null != countMap.get("商场")) {
if (null != countMap.get("商场")) {
ret += 0.2;
if (countMap.get("商场") >= 5) {
if (countMap.get("商场") >= 5) {
ret += 0.3;
}
}
@@ -209,45 +209,45 @@ public class ShopScoreUtil {
ret += 0.2;
}
}
if (null != countMap.get("电影院")) {
if (null != countMap.get("电影院")) {
ret += 0.1;
}
if (null != countMap.get("健身中心")) {
if (null != countMap.get("健身中心")) {
ret += 0.2;
}
if (null != countMap.get("美容院")) {
if (null != countMap.get("美容院")) {
ret += 0.1;
if (countMap.get("美容院") >= 5) {
if (countMap.get("美容院") >= 5) {
ret += 0.2;
}
}
if (null != countMap.get("大型超市")) {
if (null != countMap.get("大型超市")) {
ret += 0.2;
}
if (null != countMap.get("高尔夫球场")) {
if (null != countMap.get("高尔夫球场")) {
ret += 0.5;
}
if (null != countMap.get("私立学校")) {
if (null != countMap.get("私立学校")) {
ret += 0.2;
if (countMap.get("私立学校") >= 5) {
if (countMap.get("私立学校") >= 5) {
ret += 0.3;
}
}
if (null != countMap.get("整形")) {
if (null != countMap.get("整形")) {
ret += 0.2;
if (countMap.get("整形") >= 5) {
if (countMap.get("整形") >= 5) {
ret += 0.1;
}
}
if (null != countMap.get("洗浴")) {
if (null != countMap.get("洗浴")) {
ret += 0.1;
}
if (null != countMap.get("私立医院")) {
if (null != countMap.get("私立医院")) {
ret += 0.2;
}
if (null != countMap.get("星级酒店")) {
if (null != countMap.get("星级酒店")) {
ret += 0.2;
if (countMap.get("星级酒店") >= 5) {
if (countMap.get("星级酒店") >= 5) {
ret += 0.2;
}
}
@@ -259,32 +259,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边人群消费能力弱";
return "周边人群消费能力弱";
case 2:
return "周边人群消费能力弱";
return "周边人群消费能力弱";
case 3:
return "周边人群消费能力较弱";
return "周边人群消费能力较弱";
case 4:
return "周边人群消费能力较弱";
return "周边人群消费能力较弱";
case 5:
return "周边人群消费能力一般";
return "周边人群消费能力一般";
case 6:
return "周边人群消费能力一般";
return "周边人群消费能力一般";
case 7:
return "周边人群具有一定的消费能力";
return "周边人群具有一定的消费能力";
case 8:
return "周边人群具有一定的消费能力";
return "周边人群具有一定的消费能力";
case 9:
return "周边人群具有很强的消费能力";
return "周边人群具有很强的消费能力";
case 10:
return "周边人群具有很强的消费能力";
return "周边人群具有很强的消费能力";
default:
return "";
}
}
/**
* 房价指数
* 房价指数
*/
public static double priceScore(DistrictStatBo statBo, Integer cityPrice) {
double ret = 0d;
@@ -350,32 +350,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市中价位较低的商铺";
return "属于城市中价位较低的商铺";
case 2:
return "属于城市中价位较低的商铺";
return "属于城市中价位较低的商铺";
case 3:
return "属于城市中价位较低的商铺";
return "属于城市中价位较低的商铺";
case 4:
return "属于略低于城市均价的商铺";
return "属于略低于城市均价的商铺";
case 5:
return "属于接近城市均价的商铺";
return "属于接近城市均价的商铺";
case 6:
return "属于略高于城市均价的商铺";
return "属于略高于城市均价的商铺";
case 7:
return "属于城市中价位较高的商铺";
return "属于城市中价位较高的商铺";
case 8:
return "属于城市中价位较高的商铺";
return "属于城市中价位较高的商铺";
case 9:
return "属于城市中价位非常高的商铺";
return "属于城市中价位非常高的商铺";
case 10:
return "属于城市中价位非常高的商铺";
return "属于城市中价位非常高的商铺";
default:
return "";
}
}
/**
* 租金指数
* 租金指数
*/
public static double rentScore(DistrictBusinessStatRentBo statBo, Integer cityPrice, String paymentPattern) {
double ret = 0d;
@@ -422,7 +422,7 @@ public class ShopScoreUtil {
}
}
if ("押三付三".equals(paymentPattern) || "付三押三".equals(paymentPattern)) {
if ("押三付三".equals(paymentPattern) || "付三押三".equals(paymentPattern)) {
ret += 0.5;
}
}
@@ -434,63 +434,63 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市中租金便宜的商铺";
return "属于城市中租金便宜的商铺";
case 2:
return "属于城市中租金便宜的商铺";
return "属于城市中租金便宜的商铺";
case 3:
return "属于城市中租金较便宜的商铺";
return "属于城市中租金较便宜的商铺";
case 4:
return "属于略低于城市租金均价的商铺";
return "属于略低于城市租金均价的商铺";
case 5:
return "属于接近城市租金均价的商铺";
return "属于接近城市租金均价的商铺";
case 6:
return "属于略高于城市租金均价的商铺";
return "属于略高于城市租金均价的商铺";
case 7:
return "属于城市中租金较高的商铺";
return "属于城市中租金较高的商铺";
case 8:
return "属于城市中租金较高的商铺";
return "属于城市中租金较高的商铺";
case 9:
return "属于城市中租金昂贵的商铺";
return "属于城市中租金昂贵的商铺";
case 10:
return "属于城市中租金昂贵的商铺";
return "属于城市中租金昂贵的商铺";
default:
return "";
}
}
/**
* 商铺综合指数
* 商铺综合指数
*/
public static double detailScore(District mall, SeaweedNumberic numberic) {
double ret = 0d;
// 商铺类型
// 商铺类型
String estateType = mall.getEstateCharge();
if (StringUtils.contains(estateType, "购物中心")) {
if (StringUtils.contains(estateType, "购物中心")) {
ret += 8;
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
ret += 7;
} else if ("专项商铺".equals(estateType)) {
} else if ("专项商铺".equals(estateType)) {
ret += 6;
} else {
ret += 5;
}
// 商圈
// 商圈
String businessQuarter = mall.getBusinessQuarter();
// TODO A类+1,B类+0.5
// TODO A类+1,B类+0.5
if (StringUtils.isNotBlank(businessQuarter)) {
ret += 0.5;
}
// 板块
// 板块
String block = "";
// TODO A类+1,B类+0.5
// TODO A类+1,B类+0.5
if (StringUtils.isNotBlank(block)) {
ret += 0.5;
}
// 建筑规模
// 建筑规模
if (null != numberic && null != numberic.getBuildArea()) {
int area = numberic.getBuildArea();
if (area > CITY_AVG_MALL_AREA && ((area - CITY_AVG_MALL_AREA) * 1.0 / CITY_AVG_MALL_AREA > 0.2)) {
@@ -500,10 +500,10 @@ public class ShopScoreUtil {
}
}
// 装修状况
// TODO 目前没有装修字段
// 装修状况
// TODO 目前没有装修字段
// 停车位
// 停车位
if (null != mall.getCarSiteCount()) {
double t = (mall.getCarSiteCount() - CITY_AVG_CAR_SITE_COUNT) * 1.0 / CITY_AVG_CAR_SITE_COUNT;
if (t > 0.2) {
@@ -513,7 +513,7 @@ public class ShopScoreUtil {
}
}
// 楼龄
// 楼龄
if (null != numberic && null != numberic.getFinishBuildYear()) {
int year = numberic.getFinishBuildYear();
if (year > CITY_AVG_FINISH_YAER && ((year - CITY_AVG_FINISH_YAER) * 1.0 / CITY_AVG_FINISH_YAER > 0.2)) {
@@ -530,7 +530,7 @@ public class ShopScoreUtil {
ret += 0.5;
}
// 物业费
// 物业费
if (null != numberic && null != numberic.getEstateCharge()) {
double c = numberic.getEstateCharge();
if (c > CITY_AVG_ESTATE_CHARGE && ((c - CITY_AVG_ESTATE_CHARGE) * 1.0 / CITY_AVG_ESTATE_CHARGE > 0.2)) {
@@ -547,35 +547,35 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 2:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 3:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 4:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 5:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 6:
return "属于城市的普通商铺";
return "属于城市的普通商铺";
case 7:
return "属于城市的优质商铺";
return "属于城市的优质商铺";
case 8:
return "属于城市的优质商铺";
return "属于城市的优质商铺";
case 9:
return "属于城市的高端商铺";
return "属于城市的高端商铺";
case 10:
return "属于城市的高端商铺";
return "属于城市的高端商铺";
default:
return "";
}
}
/**
* 商铺综合指数--建筑规模
* 商铺综合指数--建筑规模
*/
public static double detailScore1(String estateType, Integer buildArea) {
if (StringUtils.contains(estateType, "购物中心")) {
if (StringUtils.contains(estateType, "购物中心")) {
if (null == buildArea) {
return 5d;
}
@@ -593,9 +593,9 @@ public class ShopScoreUtil {
} else {
return 5d;
}
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
} else if (StringUtils.contains(estateType, "写字楼商铺")) {
return 6d;
} else if ("专项商铺".equals(estateType)) {
} else if ("专项商铺".equals(estateType)) {
return 7d;
} else {
return 5d;
@@ -603,15 +603,15 @@ public class ShopScoreUtil {
}
/**
* 商铺综合指数--装修
* 商铺综合指数--装修
*/
public static double detailScore2(String estateType, String buildArea) {
// TODO 目前没有装修字段
// TODO 目前没有装修字段
return 5d;
}
/**
* 商铺综合指数--停车位
* 商铺综合指数--停车位
*/
public static double detailScore3(Integer carSiteCount) {
if (null == carSiteCount) {
@@ -637,7 +637,7 @@ public class ShopScoreUtil {
}
/**
* 商铺综合指数--楼龄
* 商铺综合指数--楼龄
*/
public static double detailScore4(Integer year) {
if (null == year) {
@@ -666,44 +666,44 @@ public class ShopScoreUtil {
}
/**
* 环境指数--公共聚客点
* 环境指数--公共聚客点
*/
public static double aroundScore1(Map<String, Integer> countMap) {
double ret = 0d;
if (null != countMap.get("医院")) {
if (null != countMap.get("医院")) {
ret += 1;
if (countMap.get("医院") >= 3) {
if (countMap.get("医院") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("地铁站")) {
if (null != countMap.get("地铁站")) {
ret += 1;
if (countMap.get("地铁站") >= 3) {
if (countMap.get("地铁站") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("公交点")) {
if (null != countMap.get("公交点")) {
ret += 1;
if (countMap.get("公交点") >= 3) {
if (countMap.get("公交点") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("公园")) {
if (null != countMap.get("公园")) {
ret += 1;
if (countMap.get("公园") >= 2) {
if (countMap.get("公园") >= 2) {
ret += 0.5;
}
}
if (null != countMap.get("学校")) {
if (null != countMap.get("学校")) {
ret += 1;
if (countMap.get("学校") >= 3) {
if (countMap.get("学校") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("体育馆")) {
if (null != countMap.get("体育馆")) {
ret += 1;
if (countMap.get("体育馆") >= 2) {
if (countMap.get("体育馆") >= 2) {
ret += 0.5;
}
}
@@ -712,32 +712,32 @@ public class ShopScoreUtil {
}
/**
* 环境指数--商业聚客点
* 环境指数--商业聚客点
*/
public static double aroundScore2(Map<String, Integer> countMap) {
double ret = 0d;
if (null != countMap.get("银行")) {
if (null != countMap.get("银行")) {
ret += 1;
if (countMap.get("银行") >= 3) {
if (countMap.get("银行") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("商场")) {
if (null != countMap.get("商场")) {
ret += 1;
if (countMap.get("商场") >= 3) {
if (countMap.get("商场") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("大型超市")) {
if (null != countMap.get("大型超市")) {
ret += 1;
if (countMap.get("大型超市") >= 3) {
if (countMap.get("大型超市") >= 3) {
ret += 0.5;
}
}
if (null != countMap.get("餐饮")) {
if (null != countMap.get("餐饮")) {
ret += 1;
if (countMap.get("餐饮") >= 10) {
if (countMap.get("餐饮") >= 10) {
ret += 0.5;
}
}
@@ -749,32 +749,32 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "周边公共或商业配套非常差,客源稀少";
return "周边公共或商业配套非常差,客源稀少";
case 2:
return "周边公共或商业配套非常差,客源稀少";
return "周边公共或商业配套非常差,客源稀少";
case 3:
return "周边公共或商业配套较差,客源较少";
return "周边公共或商业配套较差,客源较少";
case 4:
return "周边公共或商业配套较差,客源较少";
return "周边公共或商业配套较差,客源较少";
case 5:
return "周边公共或商业配套一般,客源一般";
return "周边公共或商业配套一般,客源一般";
case 6:
return "周边公共或商业配套一般,客源一般";
return "周边公共或商业配套一般,客源一般";
case 7:
return "周边公共或商业配套较成熟,客源较丰富";
return "周边公共或商业配套较成熟,客源较丰富";
case 8:
return "周边公共或商业配套较成熟,客源较丰富";
return "周边公共或商业配套较成熟,客源较丰富";
case 9:
return "周边公共或商业配套非常成熟,客源丰富";
return "周边公共或商业配套非常成熟,客源丰富";
case 10:
return "周边公共或商业配套非常成熟,客源丰富";
return "周边公共或商业配套非常成熟,客源丰富";
default:
return "";
}
}
/**
* 人口指数--居民人口
* 人口指数--居民人口
*/
@Deprecated
public static double peopleScore1(double density) {
@@ -810,56 +810,56 @@ public class ShopScoreUtil {
}
/**
* 计算居民人口密度得分
* 计算居民人口密度得分
* @author yinjihuan
* @date 2016-03-04
* @param density 居民人口密度
* @return 居民人口密度得分
* @param density 居民人口密度
* @return 居民人口密度得分
*/
public static double calcPeopleDensityScore(double density) {
/*居民人口密度得分规则如下:
10 10*市均人口密度 < 居民人口密度
9 9*市均人口密度 < 居民人口密度 <= 10*市均人口密度
8 8*市均人口密度 < 居民人口密度 <= 9*市均人口密度
7 7*市均人口密度 < 居民人口密度 <= 8*市均人口密度
6 6*市均人口密度 < 居民人口密度 <= 7*市均人口密度
5 4*市均人口密度 < 居民人口密度 <= 6*市均人口密度
4 2*市均人口密度 < 居民人口密度 <= 4*市均人口密度
3 1*市均人口密度 < 居民人口密度 <= 2*市均人口密度
2 0.5*市均人口密度 < 居民人口密度 <= 1*市均人口密度
1 居民人口密度 <= 0.5*市均人口密度 */
/*居民人口密度得分规则如下:
10 10*市均人口密度 < 居民人口密度
9 9*市均人口密度 < 居民人口密度 <= 10*市均人口密度
8 8*市均人口密度 < 居民人口密度 <= 9*市均人口密度
7 7*市均人口密度 < 居民人口密度 <= 8*市均人口密度
6 6*市均人口密度 < 居民人口密度 <= 7*市均人口密度
5 4*市均人口密度 < 居民人口密度 <= 6*市均人口密度
4 2*市均人口密度 < 居民人口密度 <= 4*市均人口密度
3 1*市均人口密度 < 居民人口密度 <= 2*市均人口密度
2 0.5*市均人口密度 < 居民人口密度 <= 1*市均人口密度
1 居民人口密度 <= 0.5*市均人口密度 */
return doCalcDensityScore(density, CITY_AVG_HOUSE_DENSITY);
}
/**
* 计算办公人口密度得分
* 计算办公人口密度得分
* @author yinjihuan
* @date 2016-03-04
* @param density 办公人口密度
* @return 居民人口密度得分
* @param density 办公人口密度
* @return 居民人口密度得分
*/
public static double calcOfficeDensityScore(double density) {
/*办公人口密度计算规则如下:
10 10*市均办公人口密度 < 办公人口密度
9 9*市均办公人口密度 < 办公人口密度 <= 10*市均办公人口密度
8 8*市均办公人口密度 < 办公人口密度 <= 9*市均办公人口密度
7 7*市均办公人口密度 < 办公人口密度 <= 8*市均办公人口密度
6 6*市均办公人口密度 < 办公人口密度 <= 7*市均办公人口密度
5 4*市均办公人口密度 < 办公人口密度 <= 6*市均办公人口密度
4 2*市均办公人口密度 < 办公人口密度 <= 4*市均办公人口密度
3 1*市均办公人口密度 < 办公人口密度 <= 2*市均办公人口密度
2 0.5*市均办公人口密度 < 办公人口密度 <= 1*市均办公人口密度
1 办公人口密度 <= 0.5*市均办公人口密度 */
/*办公人口密度计算规则如下:
10 10*市均办公人口密度 < 办公人口密度
9 9*市均办公人口密度 < 办公人口密度 <= 10*市均办公人口密度
8 8*市均办公人口密度 < 办公人口密度 <= 9*市均办公人口密度
7 7*市均办公人口密度 < 办公人口密度 <= 8*市均办公人口密度
6 6*市均办公人口密度 < 办公人口密度 <= 7*市均办公人口密度
5 4*市均办公人口密度 < 办公人口密度 <= 6*市均办公人口密度
4 2*市均办公人口密度 < 办公人口密度 <= 4*市均办公人口密度
3 1*市均办公人口密度 < 办公人口密度 <= 2*市均办公人口密度
2 0.5*市均办公人口密度 < 办公人口密度 <= 1*市均办公人口密度
1 办公人口密度 <= 0.5*市均办公人口密度 */
return doCalcDensityScore(density, CITY_AVG_OFFICE_DENSITY);
}
/**
* 计算密度得分
* @param density 密度
* @param cityAvgDensity 市平均密度
* 计算密度得分
* @param density 密度
* @param cityAvgDensity 市平均密度
* @return
*/
private static double doCalcDensityScore(double density, double cityAvgDensity) {
@@ -917,7 +917,7 @@ public class ShopScoreUtil {
}
/**
* 人口指数--办公人口
* 人口指数--办公人口
*/
@Deprecated
public static double peopleScore2(double density) {
@@ -991,25 +991,25 @@ public class ShopScoreUtil {
int s = (int) score;
switch (s) {
case 1:
return "人流量稀少";
return "人流量稀少";
case 2:
return "人流量稀少";
return "人流量稀少";
case 3:
return "人流量较少";
return "人流量较少";
case 4:
return "人流量较少";
return "人流量较少";
case 5:
return "人流量一般";
return "人流量一般";
case 6:
return "人流量一般";
return "人流量一般";
case 7:
return "人流量较大";
return "人流量较大";
case 8:
return "人流量较大";
return "人流量较大";
case 9:
return "人流量庞大";
return "人流量庞大";
case 10:
return "人流量庞大";
return "人流量庞大";
default:
return "";
}
@@ -21,17 +21,17 @@ public class Test {
g2d.dispose();
g2d = image.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.setColor(new Color(178,178,178));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,360);
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.setColor(new Color(0,115,230));//改变扇形颜色
g2d.fillArc(0,0,400,400,90,180);
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.setColor(new Color(229,229,229));//改变扇形颜色
g2d.fillArc(40,40,320,320,90,360);
g2d.setColor(new Color(0,115,230));
g2d.setFont(new Font("宋体",Font.BOLD,120));
g2d.drawString("4分",126,250);
g2d.setFont(new Font("宋体",Font.BOLD,120));
g2d.drawString("4分",126,250);
g2d.dispose();
ImageIO.write(image, "png", new File("D:/test.png"));
}
@@ -14,7 +14,7 @@ import com.fangjia.auto.service.AutocompleteService;
import com.fangjia.core.util.DataUtil;
/**
* 自动完成接口
* 自动完成接口
*
* @author dxy
* @deprecated instead of {@link AutocompleteController}
@@ -22,7 +22,7 @@ import com.fangjia.core.util.DataUtil;
*/
public class AutoController {
/**
* 自动完成
* 自动完成
*
* @deprecated
* @param model
@@ -40,7 +40,7 @@ public class AutoController {
DataUtil.escapeSolr(model.getQ()), (model.getLimit() > 100 || model.getLimit() <= 0 ? 10 : model.getLimit()));
/**
* 该方法以及过期,这个地方仅仅是为了兼容老版本
* 该方法以及过期,这个地方仅仅是为了兼容老版本
*/
List<Map<String, Object>> suggestList = new ArrayList<Map<String, Object>>();
for (Map<String, Object> obj : list) {
@@ -63,7 +63,7 @@ public class AutoController {
}
/**
* 输入纠错
* 输入纠错
*
* @deprecated
* @param model
@@ -9,7 +9,7 @@ import com.fangjia.auto.service.AutocompleteService;
import com.fangjia.core.util.DataUtil;
/**
* 新自动完成接口
* 新自动完成接口
*
* @author dxy
*
@@ -17,7 +17,7 @@ import com.fangjia.core.util.DataUtil;
public class AutocompleteController {
/**
* 自动完成
* 自动完成
*
* @param model
* @return
@@ -34,7 +34,7 @@ public class AutocompleteController {
}
/**
* 输入纠错
* 输入纠错
*
* @param model
* @return
@@ -3,7 +3,7 @@ package com.fangjia.auto.model;
import org.sothis.web.mvc.ModelAndViewSupport;
/**
* 用于restAPI的ModelAndView
* 用于restAPI的ModelAndView
*
* @author velna
*
@@ -79,13 +79,13 @@ public class AutocompleteService {
}
/**
* 自动完成
* 自动完成
*
* @param cat
* @param city
* @param keyword
* @param limit
* @param isDupl 默认不重复
* @param isDupl 默认不重复
* @return
*/
@SuppressWarnings("unchecked")
@@ -168,7 +168,7 @@ public class AutocompleteService {
}
/**
* 输入纠错
* 输入纠错
*
* @param cat
* @param type
@@ -16,23 +16,23 @@ public class AveragerConfigModel extends BaseModel {
private String display;
private String region;
private String name;
private Integer status; // 0-正常 1-禁用
private Integer sampleFetchCount; // 样本获取数量
private Integer sampleMaxValue; // 样本允许最大值
private Integer sampleMinValue; // 样本允许最小值
private Integer ownTypeLimit; // 自身样本计算的最低要求
private Integer sampleQueueStart; // 样本队列取值区间最小值
private Integer sampleQueueEnd; // 样本队列取值区间最大值
private Integer status; // 0-正常 1-禁用
private Integer sampleFetchCount; // 样本获取数量
private Integer sampleMaxValue; // 样本允许最大值
private Integer sampleMinValue; // 样本允许最小值
private Integer ownTypeLimit; // 自身样本计算的最低要求
private Integer sampleQueueStart; // 样本队列取值区间最小值
private Integer sampleQueueEnd; // 样本队列取值区间最大值
private Integer aroundRadius; // 周边最大半径
private Integer aroundLimit; // 周边小区最大数量限制
private Integer valueCluType; //类簇的用值类型 0-默认 1-中位数 2-最大值 3-最小值
private Integer aroundRadius; // 周边最大半径
private Integer aroundLimit; // 周边小区最大数量限制
private Integer valueCluType; //类簇的用值类型 0-默认 1-中位数 2-最大值 3-最小值
private Integer aroundDiffMinPercent; //样本与周边对比的最小相差比例
private Integer aroundDiffMaxPercent; //样本与周边对比的最大相差比例
private Integer guidingPriceExpirationDay; //指导价过期天数
private Integer uncomforableSampleDay; //样本换算需要间隔时间
private Integer masterIntervenePercent; //主小区影响从小区可信度衰减比例
private Integer aroundDiffMinPercent; //样本与周边对比的最小相差比例
private Integer aroundDiffMaxPercent; //样本与周边对比的最大相差比例
private Integer guidingPriceExpirationDay; //指导价过期天数
private Integer uncomforableSampleDay; //样本换算需要间隔时间
private Integer masterIntervenePercent; //主小区影响从小区可信度衰减比例
private Integer time;
private String site;
@@ -58,12 +58,12 @@ public class AdController {
} else {
adSpace.setCity("all");
}
if (StringUtils.isNotBlank(model.getPageId()) && model.getPageId().equals("全国首页")) {
if (StringUtils.isNotBlank(model.getPageId()) && model.getPageId().equals("全国首页")) {
adSpace.setCity("all");
}
adSpaceService.saveOrUpdate(adSpace);
BeanUtils.copyProperties(adSpace, model);
model.flash().setAttribute("message", StringUtils.isBlank(model.getId()) ? "添加成功" : "修改成功");
model.flash().setAttribute("message", StringUtils.isBlank(model.getId()) ? "添加成功" : "修改成功");
return model.redirect("show?id=" + adSpace.getId());
} else if (StringUtils.isNotBlank(model.getId())) {
AdSpace adSpace = adSpaceService.findAdSpaceById(model.getId());
@@ -108,38 +108,38 @@ public class AdController {
}
try {
// 发邮件给用户
// 发邮件给用户
Mail mail = new Mail();
mail.setReceiver(new MailUser(cpdbApp.getEmail()));
mail.setSubject("房价网—中国不动产大数据库CPDB演示");
mail.setSubject("房价网—中国不动产大数据库CPDB演示");
StringBuffer emailMsg = new StringBuffer();
emailMsg.append("尊敬的用户:<br/><br/>")
.append("&emsp;&emsp;感谢您申请房价网的<b>房价数据测试平台</b>免费试用账号!<br/><br/>")
.append("&emsp;&emsp;您现在可以在48小时内免费体验<b>房价数据测试平台</b>的所有功能了!<br/><br/>")
.append("&emsp;&emsp;登陆链接:<a href=\"http://user.fangjia.com/fangjiatong2/users/userCenterLogin?__from=cpdbemail\">房价数据测试平台</a><br/>")
.append("&emsp;&emsp;用户名:")
emailMsg.append("尊敬的用户:<br/><br/>")
.append("&emsp;&emsp;感谢您申请房价网的<b>房价数据测试平台</b>免费试用账号!<br/><br/>")
.append("&emsp;&emsp;您现在可以在48小时内免费体验<b>房价数据测试平台</b>的所有功能了!<br/><br/>")
.append("&emsp;&emsp;登陆链接:<a href=\"http://user.fangjia.com/fangjiatong2/users/userCenterLogin?__from=cpdbemail\">房价数据测试平台</a><br/>")
.append("&emsp;&emsp;用户名:")
.append(cpdbApp.getEmail())
.append("<br/>")
.append("&emsp;&emsp;密码:")
.append("&emsp;&emsp;密码:")
.append(fjtuser.getPassword())
.append("<br/><br/>")
.append("&emsp;&emsp;由于该账号为<b>限时使用</b>,所以请尽快开始使用。<br/><br/>")
.append("&emsp;&emsp;<b>房价数据测试平台</b>是凭借<b>中国不动产大数据库CPDB</b>的基础上,整合优势力量,推出的测试平台。<br/><br/>")
.append("&emsp;&emsp;CPDB大数据库包括")
.append("&emsp;&emsp;<ul><li>住宅物业的实时挂牌价格、成交参考、房源、楼盘详情、照片、地图</li>")
.append("&emsp;&emsp;<li>商业地产的均价、详情、消费分析、竞争对手情报</li>")
.append("&emsp;&emsp;<li>城市行情、历史数据等</li></ul><br/>")
.append("&emsp;&emsp;CPDB(China Property Data Base)是由房价网通过<b>10年积累</b>和国际领先的<b>专利技术</b>(OLKD),打造的精确到每一户房产微观数据的“中国不动产大数据库”。<br/>")
.append("&emsp;&emsp;CPDB的数据覆盖全国<b>100个</b>城市、<b>15万</b>楼盘,拥有<b>5000万套</b>房产的个性化微观数据,革命性的实现了“<b>一户一信息</b>”,是目前中国最大、最专业、最实时的不动产微观数据库。<br/><br/>")
.append("&emsp;&emsp;关于<b>中国不动产大数据库CPDB</b>的更多相关内容,您可以通过附件中的PPT演示文稿更全面的了解。<br/><br/>")
.append("&emsp;&emsp;您可以将此封邮件转发给其他用到不动产大数据库的伙伴,比如银行、电商平台、贷款公司、评估机构、房地产营销机构、软件公司、金融类网站等等,相信给会他们带来极大帮助。<br/><br/>")
.append("&emsp;&emsp;如有任何疑问,欢迎您致电客服电话:021-6239 2522。<br/><br/>").append("&emsp;&emsp;谢谢您。<br/><br/>")
.append("&emsp;&emsp;祝您生活愉快,工作顺利。");
.append("&emsp;&emsp;由于该账号为<b>限时使用</b>,所以请尽快开始使用。<br/><br/>")
.append("&emsp;&emsp;<b>房价数据测试平台</b>是凭借<b>中国不动产大数据库CPDB</b>的基础上,整合优势力量,推出的测试平台。<br/><br/>")
.append("&emsp;&emsp;CPDB大数据库包括")
.append("&emsp;&emsp;<ul><li>住宅物业的实时挂牌价格、成交参考、房源、楼盘详情、照片、地图</li>")
.append("&emsp;&emsp;<li>商业地产的均价、详情、消费分析、竞争对手情报</li>")
.append("&emsp;&emsp;<li>城市行情、历史数据等</li></ul><br/>")
.append("&emsp;&emsp;CPDB(China Property Data Base)是由房价网通过<b>10年积累</b>和国际领先的<b>专利技术</b>(OLKD),打造的精确到每一户房产微观数据的“中国不动产大数据库”。<br/>")
.append("&emsp;&emsp;CPDB的数据覆盖全国<b>100个</b>城市、<b>15万</b>楼盘,拥有<b>5000万套</b>房产的个性化微观数据,革命性的实现了“<b>一户一信息</b>”,是目前中国最大、最专业、最实时的不动产微观数据库。<br/><br/>")
.append("&emsp;&emsp;关于<b>中国不动产大数据库CPDB</b>的更多相关内容,您可以通过附件中的PPT演示文稿更全面的了解。<br/><br/>")
.append("&emsp;&emsp;您可以将此封邮件转发给其他用到不动产大数据库的伙伴,比如银行、电商平台、贷款公司、评估机构、房地产营销机构、软件公司、金融类网站等等,相信给会他们带来极大帮助。<br/><br/>")
.append("&emsp;&emsp;如有任何疑问,欢迎您致电客服电话:021-6239 2522。<br/><br/>").append("&emsp;&emsp;谢谢您。<br/><br/>")
.append("&emsp;&emsp;祝您生活愉快,工作顺利。");
mail.setContent(emailMsg.toString());
mail.setImportant(true);
mail.setAttachment(true);
mail.setAttachmentDes("CPDB大数据库示例");
mail.setAttachmentName("CPDB大数据库示例.pptx");
mail.setAttachmentDes("CPDB大数据库示例");
mail.setAttachmentName("CPDB大数据库示例.pptx");
mail.setAttachmentUrl("http://static.fangjia.com/res/static_logo/CPDB.pptx");
emailService.sendHtmlMailWithFile(mail);
@@ -179,17 +179,17 @@ public class AdController {
private Map<String, String> getPositionMap() {
Map<String, String> positionMap = new ListOrderedMap();
positionMap.put("header;right;top", "头部右上");
positionMap.put("header;center;middle", "头部居中");
positionMap.put("body;right;top", "体部右上");
positionMap.put("body;right;middle", "体部右中");
positionMap.put("body;right;down", "体部右下");
positionMap.put("body;center;top", "体部中上");
positionMap.put("body;center;middle", "体部居中");
positionMap.put("body;center;down", "体部中下");
positionMap.put("footer;center;middle", "底部居中");
positionMap.put("side;left;middle", "对联左中");
positionMap.put("side;right;middle", "对联右中");
positionMap.put("header;right;top", "头部右上");
positionMap.put("header;center;middle", "头部居中");
positionMap.put("body;right;top", "体部右上");
positionMap.put("body;right;middle", "体部右中");
positionMap.put("body;right;down", "体部右下");
positionMap.put("body;center;top", "体部中上");
positionMap.put("body;center;middle", "体部居中");
positionMap.put("body;center;down", "体部中下");
positionMap.put("footer;center;middle", "底部居中");
positionMap.put("side;left;middle", "对联左中");
positionMap.put("side;right;middle", "对联右中");
return positionMap;
}
@@ -110,9 +110,9 @@ public class AddressAnalyController {
OutputStream os = null;
BufferedOutputStream fos = null;
if(model.getType().equals("风控")){
if(model.getType().equals("风控")){
titles = new String[]{"城市","地址", "面积", "贷款余额", "房价总价","区域","近12月涨幅","CLTV值","物业类型"};
titles = new String[]{"城市","地址", "面积", "贷款余额", "房价总价","区域","近12月涨幅","CLTV值","物业类型"};
for (AddressDetail detail : addressDetails) {
AddressAnalyticsResult analy = resultMap.get(detail.getNumber());
if(analy == null){
@@ -128,9 +128,9 @@ public class AddressAnalyController {
}
}
}else if(model.getType().equals("营销")){
}else if(model.getType().equals("营销")){
titles = new String[]{"城市","地址", "面积", "贷款余额", "房价总价","区域","近12月涨幅","物业类型"};
titles = new String[]{"城市","地址", "面积", "贷款余额", "房价总价","区域","近12月涨幅","物业类型"};
for (AddressDetail detail : addressDetails) {
AddressAnalyticsResult analy = resultMap.get(detail.getNumber());
if(analy == null){
@@ -148,14 +148,14 @@ public class AddressAnalyController {
try {
HttpServletResponse response = ActionContext.getContext().getResponse();
response.setCharacterEncoding("UTF-8");
//response.reset();// 清空输出流
//response.reset();// 清空输出流
response.setContentType("application/x-download;charset=UTF-8");
fileName = new String(fileName.getBytes("GBK"),"ISO-8859-1");
if(fileName.length()>150){//解决IE 6.0 bug
if(fileName.length()>150){//解决IE 6.0 bug
fileName = new String(fileName.getBytes("GBK"),"ISO-8859-1");
}
response.setHeader( "Content-Disposition", "attachment;filename=" + fileName);
os = response.getOutputStream();// 取得输出流
os = response.getOutputStream();// 取得输出流
wb.write(os);
os.flush();
} catch (Exception e) {

Some files were not shown because too many files have changed in this diff Show More