修改代码字符编码

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
@@ -122,7 +122,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 是否启用页面静态缓存,默认为false
* 是否启用页面静态缓存,默认为false
*
* @return
*/
@@ -131,7 +131,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 得到页面静态缓存的存放路径
* 得到页面静态缓存的存放路径
*
* @return
*/
@@ -140,7 +140,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 得到fangjia网spider的user agent,默认为goojiaSpider
* 得到fangjia网spider的user agent,默认为goojiaSpider
*
* @return
*/
@@ -149,7 +149,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 得到网站根域名
* 得到网站根域名
*
* @return
*/
@@ -219,7 +219,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 是否开启google 统计
* 是否开启google 统计
*
* @return
*/
@@ -228,7 +228,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 全站检索列表分页最大页码
* 全站检索列表分页最大页码
*
* @return
*/
@@ -237,7 +237,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 内部链接关键字
* 内部链接关键字
*
* @return
*/
@@ -246,7 +246,7 @@ public class FangjiaConfig extends Configuration {
}
/**
* 上海的推荐学校
* 上海的推荐学校
*
* @return
*/
@@ -23,7 +23,7 @@ public class CompanyController {
String kind = model.getDataType();
List<BaishengData> datas = baishengDataService.findBaishengDataByKind(model.getCityName(), kind);
Map<String, Object> map = new HashMap<String, Object>();
if(kind.equals("Ç××Ó¹ºÎï")){
if(kind.equals("亲子购物")){
map.put("result", shopGroupByType(datas));
}else{
map.put("result", datas);
@@ -36,7 +36,7 @@ public class CompanyController {
}
public Object findShopCategoryAction(CompanyModel model){
String kind = "Ç××Ó¹ºÎï";
String kind = "亲子购物";
List<BaishengData> datas = baishengDataService.findBaishengDataByKind(model.getCityName(), kind);
List<String> cats = new ArrayList<String>();
for(BaishengData data : datas){
@@ -83,7 +83,7 @@ public class DistrictChartController {
if(null != rets){
System.out.println("³¤¶È£º"+rets.size());
System.out.println("长度:"+rets.size());
model.setRets(rets);
}
model.setViewType("json");
@@ -46,7 +46,7 @@ public class HelpController {
String sessionCode = (String) request.getSession().getAttribute("feedbackCode");
if (!StringUtils.equalsIgnoreCase(sessionCode, model.getFormCode())) {
data.put("status", 1);
data.put("msg", "验证码不正确!");
data.put("msg", "验证码不正确!");
ret.setJsonModel(data);
return ret;
}
@@ -54,7 +54,7 @@ public class HelpController {
GlkFeedback entity = model.getFeedback();
if (null == entity) {
data.put("status", 1);
data.put("msg", "未知错误!");
data.put("msg", "未知错误!");
ret.setJsonModel(data);
return ret;
}
@@ -69,7 +69,7 @@ public class HelpController {
glkFeedbackService.save(model.getFeedback());
data.put("status", 0);
data.put("msg", "感谢您的反馈!");
data.put("msg", "感谢您的反馈!");
ret.setJsonModel(data);
return ret;
}
@@ -105,15 +105,15 @@ public class MapController {
if(null != userRole.getSupportCity()){
model.setSupportCity(userRole.getSupportCity());
if(!userRole.getSupportCity().contains(model.getCityName())){
model.setCityName("上海");
model.setCityName("上海");
}
}else{
if(null == userRole.getSupportCity()){
model.setCityName("上海");
model.setCityName("上海");
}
}
}else{
model.setCityName("上海");
model.setCityName("上海");
}
ServerArea serverAreaEnum = ServerAreaData.getServerAreaByDisplay(model.getCityName());
model.setLat(new Double(serverAreaEnum.getLat() * 10000000000L).longValue());
@@ -160,7 +160,7 @@ public class MapController {
districts.addAll(newDistricts);
districts = getDistrictCommDataInfo(districts, model);
//按首字母排序
//按首字母排序
// NameComparator comparator = new NameComparator();
// Collections.sort(offices,comparator);
// Collections.sort(districts,comparator);
@@ -191,7 +191,7 @@ public class MapController {
}
}
//查找核心商圈的小区,新盘, 写字楼
//查找核心商圈的小区,新盘, 写字楼
List<DistrictInfoBo> districts_in = findDistricts(model, points_in);
List<DistrictInfoBo> newDistricts_in = findNewsDistricts(model, points_in);
List<DistrictInfoBo> offices_in = findOffices(model, points_in);
@@ -200,7 +200,7 @@ public class MapController {
districts_in.addAll(newDistricts_in);
districts_in = getDistrictCommDataInfo(districts_in, model);
//查找次级商圈的小区,新盘, 写字楼
//查找次级商圈的小区,新盘, 写字楼
List<DistrictInfoBo> districts_mid = findDistricts(model, points_mid);
List<DistrictInfoBo> newDistricts_mid = findNewsDistricts(model, points_mid);
List<DistrictInfoBo> offices_mid = findOffices(model, points_mid);
@@ -209,7 +209,7 @@ public class MapController {
districts_mid.addAll(newDistricts_mid);
districts_mid = getDistrictCommDataInfo(districts_mid, model);
//去除次级商圈中核心商圈的数据
//去除次级商圈中核心商圈的数据
//findOuterRingData(districts_in, districts_mid);
model.setViewType("json");
@@ -286,7 +286,7 @@ public class MapController {
if(district.getHouseholdCount()!=null){
cell2.setCellValue(district.getHouseholdCount());
}else{
cell2.setCellValue("暂无");
cell2.setCellValue("暂无");
}
index ++;
@@ -335,12 +335,12 @@ public class MapController {
model.setCommonDistrictHouseCountOut(model.getCommonDistrictHouseCount());
model.setHightDistrictHouseCountOut(model.getHightDistrictHouseCount());
model.setTotalDistrictCountOut(model.getTotalDistrictCount());//总小区数
model.setCommonDistrictCountOut(model.getCommonDistrictCount());//高级小区数
model.setHightDistrictCountOut(model.getHightDistrictCount());//普通小区数
model.setTotalDistrictCountOut(model.getTotalDistrictCount());//总小区数
model.setCommonDistrictCountOut(model.getCommonDistrictCount());//高级小区数
model.setHightDistrictCountOut(model.getHightDistrictCount());//普通小区数
model.setOldHouseCountOut(model.getOldHouseCount());//老工房 户数
model.setOldDistrictCountOut(model.getOldDistrictCount());//老工户 小区数
model.setOldHouseCountOut(model.getOldHouseCount());//老工房 户数
model.setOldDistrictCountOut(model.getOldDistrictCount());//老工户 小区数
}else{
model.setTotalHouseCountIn(model.getTotalHouseCount());
model.setCommonDistrictHouseCountIn(model.getCommonDistrictHouseCount());
@@ -420,18 +420,18 @@ public class MapController {
OutputStream os = null;
BufferedOutputStream fos = null;
HSSFWorkbook wb = writeExcel(model.getResult(), model.getInResult(), model.getOutResult());
String fileName = "商圈统计" + DateUtil.formatToYYYYMMDD(new Date()) + ".xls";
String fileName = "商圈统计" + DateUtil.formatToYYYYMMDD(new Date()) + ".xls";
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) {
@@ -485,7 +485,7 @@ public class MapController {
businessCircleService.save(businessCircle);
}else{
model.setMsg("此商圈名已存在!");
model.setMsg("此商圈名已存在!");
}
}
@@ -494,7 +494,7 @@ public class MapController {
return model;
}
//我关注的商圈
//我关注的商圈
public Object myAttentionBusinessCircleAction(MapModel model, HttpServletRequest request){
CoresiteCookieContext cookieContext = CoresiteCookieContext.getInstance();
String uid = cookieContext.getCookieValue(request, "geluke_uid");
@@ -533,13 +533,13 @@ public class MapController {
private HSSFWorkbook createComplexExcel(String result, String inResult, String outResult){
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
wb.setSheetName(0, "概况");
s = createExcelData(result, s, "内圆");
wb.setSheetName(0, "概况");
s = createExcelData(result, s, "内圆");
if(StringUtils.isNotBlank(outResult)){
s = createExcelData(inResult, s, "内环");
s = createExcelData(outResult, s, "外环");
s = createExcelData(inResult, s, "内环");
s = createExcelData(outResult, s, "外环");
}else{
s = createExcelData(inResult, s, "外环");
s = createExcelData(inResult, s, "外环");
}
@@ -550,31 +550,31 @@ public class MapController {
private HSSFSheet createExcelData(String result, HSSFSheet s, String keyword){
String[] array = result.split("-");
HSSFRow row = s.createRow(s.getPhysicalNumberOfRows()+1 );
row.createCell((short)0).setCellValue(keyword+ "总户数");
row.createCell((short)1).setCellValue(array[0] + "户");
row.createCell((short)0).setCellValue(keyword+ "总户数");
row.createCell((short)1).setCellValue(array[0] + "户");
HSSFRow row1 = s.createRow(s.getPhysicalNumberOfRows()+1 );
row1.createCell((short)1).setCellValue(keyword + "半径:"+CommonUtils.round(array[1])+"米");
row1.createCell((short)1).setCellValue(keyword + "半径:"+CommonUtils.round(array[1])+"米");
if(Integer.parseInt(array[2])!=0 || Integer.parseInt(array[3])!=0){
HSSFRow row2 = s.createRow(s.getPhysicalNumberOfRows()+1 );
row2.createCell((short)1).setCellValue("老工房:"+array[2]+"户("+array[3]+"小区)");
row2.createCell((short)1).setCellValue("老工房:"+array[2]+"户("+array[3]+"小区)");
}
if(Integer.parseInt(array[4])!=0 || Integer.parseInt(array[5])!=0){
HSSFRow row3 = s.createRow(s.getPhysicalNumberOfRows()+1 );
row3.createCell((short)1).setCellValue("高级商品房:"+array[4]+"户("+array[5]+"小区)");
row3.createCell((short)1).setCellValue("高级商品房:"+array[4]+"户("+array[5]+"小区)");
}
if(Integer.parseInt(array[6])!=0 || Integer.parseInt(array[7])!=0){
HSSFRow row4 = s.createRow(s.getPhysicalNumberOfRows()+1 );
row4.createCell((short)1).setCellValue("普通商品房:"+array[6]+"户("+array[7]+"小区)");
row4.createCell((short)1).setCellValue("普通商品房:"+array[6]+"户("+array[7]+"小区)");
}
if(Integer.parseInt(array[8])!=0 || Integer.parseInt(array[9])!=0){
HSSFRow row5 = s.createRow(s.getPhysicalNumberOfRows() +1);
row5.createCell((short)1).setCellValue("写字楼人数" + array[8]+"人("+array[9]+"个)");
row5.createCell((short)1).setCellValue("写字楼人数" + array[8]+"人("+array[9]+"个)");
}
s.createRow(s.getPhysicalNumberOfRows() + 1);
@@ -583,36 +583,36 @@ public class MapController {
}
//半径0-高级小区数1-普通小区数2-老房子小区数3-新房小区数4-办公楼数5-总居民数6-高级小区户数7-普通小区户数8-老房户数9-新盘导入10-办公楼人数11-甲级人数12-乙级人数13-丙级人数14-其它15-可导入办公楼人数
//-超市数-银行数-餐饮数-学校数-医院数-公交数
//半径0-高级小区数1-普通小区数2-老房子小区数3-新房小区数4-办公楼数5-总居民数6-高级小区户数7-普通小区户数8-老房户数9-新盘导入10-办公楼人数11-甲级人数12-乙级人数13-丙级人数14-其它15-可导入办公楼人数
//-超市数-银行数-餐饮数-学校数-医院数-公交数
private HSSFWorkbook createSimpleExcel(String result){
String[] array = result.split("-");
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
wb.setSheetName(0, "概况");
wb.setSheetName(0, "概况");
Date date = new Date();
int year = date.getYear()+1900 + 1;
HSSFCellStyle cs = wb.createCellStyle();
HSSFFont font = wb.createFont();
font.setFontName("宋体");// 设置字体
font.setFontHeightInPoints((short) 12);// 字体大小
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);// 加粗
font.setFontName("宋体");// 设置字体
font.setFontHeightInPoints((short) 12);// 字体大小
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);// 加粗
cs.setFont(font);
HSSFCellStyle cs1 = wb.createCellStyle();
HSSFFont font1 = wb.createFont();
font1.setFontName("宋体");// 设置字体
font1.setFontHeightInPoints((short) 12);// 字体大小
font1.setFontName("宋体");// 设置字体
font1.setFontHeightInPoints((short) 12);// 字体大小
cs1.setFont(font1);
HSSFCellStyle cs2 = wb.createCellStyle();
HSSFFont font2 = wb.createFont();
font2.setFontName("宋体");// 设置字体
font2.setFontHeightInPoints((short) 12);// 字体大小
font2.setFontName("宋体");// 设置字体
font2.setFontHeightInPoints((short) 12);// 字体大小
font2.setColor(HSSFFont.COLOR_RED);
cs2.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
cs2.setFont(font2);
@@ -624,12 +624,12 @@ public class MapController {
HSSFRow row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell cell0 = row.createCell(0);
cell0.setCellStyle(cs);
cell0.setCellValue("商圈半径");
cell0.setCellValue("商圈半径");
HSSFCell cell2 = row.createCell(2);
cell2.setCellValue(CommonUtils.round(array[0]));
cell2.setCellStyle(cs2);
HSSFCell cell3 = row.createCell(3);
cell3.setCellValue("米");
cell3.setCellValue("米");
cell3.setCellStyle(cs1);
s.createRow(s.getPhysicalNumberOfRows());
}
@@ -638,25 +638,25 @@ public class MapController {
HSSFRow juming_row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell juming_cell0 = juming_row.createCell(0);
juming_cell0.setCellStyle(cs);
juming_cell0.setCellValue("居民户数");
juming_cell0.setCellValue("居民户数");
HSSFCell juming_cell2 = juming_row.createCell(2);
juming_cell2.setCellValue(Integer.parseInt(array[6]));
juming_cell2.setCellStyle(cs2);
// juming_cell2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
HSSFCell juming_cell3 = juming_row.createCell(3);
juming_cell3.setCellValue("户");
juming_cell3.setCellValue("户");
juming_cell3.setCellStyle(cs1);
if(Integer.parseInt(array[7])>0){
HSSFRow hight_row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell hight_cell1 = hight_row.createCell(1);
hight_cell1.setCellValue("高级商品房");
hight_cell1.setCellValue("高级商品房");
hight_cell1.setCellStyle(cs1);
HSSFCell hight_cell2 = hight_row.createCell(2);
hight_cell2.setCellValue(Integer.parseInt(array[7]));
hight_cell2.setCellStyle(cs2);
HSSFCell hight_cell3 = hight_row.createCell(3);
hight_cell3.setCellValue("户");
hight_cell3.setCellValue("户");
hight_cell3.setCellStyle(cs1);
}
@@ -665,11 +665,11 @@ public class MapController {
HSSFCell comm_cell1 = comm_row.createCell(1);
HSSFCell comm_cell2 = comm_row.createCell(2);
HSSFCell comm_cell3 = comm_row.createCell(3);
comm_cell1.setCellValue("普通商品房");
comm_cell1.setCellValue("普通商品房");
comm_cell1.setCellStyle(cs1);
comm_cell2.setCellValue(Integer.parseInt(array[8]));
comm_cell2.setCellStyle(cs2);
comm_cell3.setCellValue("户");
comm_cell3.setCellValue("户");
comm_cell3.setCellStyle(cs1);
}
@@ -679,11 +679,11 @@ public class MapController {
HSSFCell old_cell2 = old_row.createCell(2);
HSSFCell old_cell3 = old_row.createCell(3);
old_cell1.setCellStyle(cs1);
old_cell1.setCellValue("新村居民");
old_cell1.setCellValue("新村居民");
old_cell2.setCellStyle(cs2);
old_cell2.setCellValue(Integer.parseInt(array[9]));
old_cell3.setCellStyle(cs1);
old_cell3.setCellValue("户");
old_cell3.setCellValue("户");
}
s.createRow(s.getPhysicalNumberOfRows());
@@ -695,11 +695,11 @@ public class MapController {
HSSFCell new_district_cell0 = new_district_row.createCell(0);
HSSFCell new_district_cell2 = new_district_row.createCell(2);
HSSFCell new_district_cell3 = new_district_row.createCell(3);
new_district_cell0.setCellValue(year+"年新盘导入");
new_district_cell0.setCellValue(year+"年新盘导入");
new_district_cell0.setCellStyle(cs);
new_district_cell2.setCellValue(Integer.parseInt(array[10]));
new_district_cell2.setCellStyle(cs2);
new_district_cell3.setCellValue("户");
new_district_cell3.setCellValue("户");
new_district_cell3.setCellStyle(cs1);
s.createRow(s.getPhysicalNumberOfRows());
@@ -711,21 +711,21 @@ public class MapController {
// HSSFCell price_cell1 = price_row.createCell(2);
// HSSFCell price_cell2 = price_row.createCell(3);
// price_cell0.setCellStyle(cs);
// price_cell0.setCellValue("商品房均价");
// price_cell0.setCellValue("商品房均价");
// price_cell1.setCellStyle(cs2);
// price_cell1.setCellValue(Integer.parseInt(array[26]));
// price_cell2.setCellStyle(cs1);
// price_cell2.setCellValue("元/平米");
// price_cell2.setCellValue("元/平米");
// if(Integer.parseInt(array[23])>0){
// HSSFRow hight_price_row = s.createRow(s.getPhysicalNumberOfRows() );
// HSSFCell hight_price_cell1 = hight_price_row.createCell(1);
// HSSFCell hight_price_cell2 = hight_price_row.createCell(2);
// HSSFCell hight_price_cell3 = hight_price_row.createCell(3);
// hight_price_cell1.setCellValue("高级商品房");
// hight_price_cell1.setCellValue("高级商品房");
// hight_price_cell1.setCellStyle(cs1);
// hight_price_cell2.setCellValue(Integer.parseInt(array[23]));
// hight_price_cell2.setCellStyle(cs2);
// hight_price_cell3.setCellValue("元/平米");
// hight_price_cell3.setCellValue("元/平米");
// hight_price_cell3.setCellStyle(cs1);
// }
// if(Integer.parseInt(array[24])>0){
@@ -733,11 +733,11 @@ public class MapController {
// HSSFCell common_price_cell1 = common_price_row.createCell(1);
// HSSFCell common_price_cell2 = common_price_row.createCell(2);
// HSSFCell common_price_cell3 = common_price_row.createCell(3);
// common_price_cell1.setCellValue("普通商品房");
// common_price_cell1.setCellValue("普通商品房");
// common_price_cell1.setCellStyle(cs1);
// common_price_cell2.setCellValue(Integer.parseInt(array[24]));
// common_price_cell2.setCellStyle(cs2);
// common_price_cell3.setCellValue("元/平米");
// common_price_cell3.setCellValue("元/平米");
// common_price_cell3.setCellStyle(cs1);
// }
// if(Integer.parseInt(array[25])>0){
@@ -745,11 +745,11 @@ public class MapController {
// HSSFCell old_price_cell1 = old_price_row.createCell(1);
// HSSFCell old_price_cell2 = old_price_row.createCell(2);
// HSSFCell old_price_cell3 = old_price_row.createCell(3);
// old_price_cell1.setCellValue("新村");
// old_price_cell1.setCellValue("新村");
// old_price_cell1.setCellStyle(cs1);
// old_price_cell2.setCellValue(Integer.parseInt(array[25]));
// old_price_cell2.setCellStyle(cs2);
// old_price_cell3.setCellValue("元/平米");
// old_price_cell3.setCellValue("元/平米");
// old_price_cell3.setCellStyle(cs1);
// }
//
@@ -762,22 +762,22 @@ public class MapController {
HSSFCell office_cell2 = office_row.createCell(2);
HSSFCell office_cell3 = office_row.createCell(3);
office_cell0.setCellStyle(cs);
office_cell0.setCellValue("办公人口");
office_cell0.setCellValue("办公人口");
office_cell2.setCellStyle(cs2);
office_cell2.setCellValue(Integer.parseInt(array[11]));
office_cell3.setCellStyle(cs1);
office_cell3.setCellValue("人");
office_cell3.setCellValue("人");
if(Integer.parseInt(array[12])>0){
HSSFRow best_row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell best_cell1 = best_row.createCell(1);
HSSFCell best_cell2 = best_row.createCell(2);
HSSFCell best_cell3 = best_row.createCell(3);
best_cell1.setCellValue("甲级");
best_cell1.setCellValue("甲级");
best_cell1.setCellStyle(cs1);
best_cell2.setCellValue(Integer.parseInt(array[12]));
best_cell2.setCellStyle(cs2);
best_cell3.setCellValue("人");
best_cell3.setCellValue("人");
best_cell3.setCellStyle(cs1);
}
@@ -786,11 +786,11 @@ public class MapController {
HSSFCell better_cell1 = better_row.createCell(1);
HSSFCell better_cell2 = better_row.createCell(2);
HSSFCell better_cell3 = better_row.createCell(3);
better_cell1.setCellValue("乙级");
better_cell1.setCellValue("乙级");
better_cell1.setCellStyle(cs1);
better_cell2.setCellValue(Integer.parseInt(array[13]));
better_cell2.setCellStyle(cs2);
better_cell3.setCellValue("人");
better_cell3.setCellValue("人");
better_cell3.setCellStyle(cs1);
}
@@ -799,11 +799,11 @@ public class MapController {
HSSFCell good_cell1 = good_row.createCell(1);
HSSFCell good_cell2 = good_row.createCell(2);
HSSFCell good_cell3 = good_row.createCell(3);
good_cell1.setCellValue("丙级");
good_cell1.setCellValue("丙级");
good_cell1.setCellStyle(cs1);
good_cell2.setCellValue(Integer.parseInt(array[14]));
good_cell2.setCellStyle(cs2);
good_cell3.setCellValue("人");
good_cell3.setCellValue("人");
good_cell3.setCellStyle(cs1);
}
@@ -812,11 +812,11 @@ public class MapController {
HSSFCell other_cell1 = other_row.createCell(1);
HSSFCell other_cell2 = other_row.createCell(2);
HSSFCell other_cell3 = other_row.createCell(3);
other_cell1.setCellValue("其它");
other_cell1.setCellValue("其它");
other_cell1.setCellStyle(cs1);
other_cell2.setCellValue(Integer.parseInt(array[15]));
other_cell2.setCellStyle(cs2);
other_cell3.setCellValue("人");
other_cell3.setCellValue("人");
other_cell3.setCellStyle(cs1);
}
@@ -831,11 +831,11 @@ public class MapController {
HSSFCell office_cell0 = office_row1.createCell(0);
HSSFCell office_cell22 = office_row1.createCell(2);
HSSFCell office_cell33 = office_row1.createCell(3);
office_cell0.setCellValue(year+"年可导入办公人数");
office_cell0.setCellValue(year+"年可导入办公人数");
office_cell0.setCellStyle(cs);
office_cell22.setCellValue(Integer.parseInt(array[16]));
office_cell22.setCellStyle(cs2);
office_cell33.setCellValue("人");
office_cell33.setCellValue("人");
office_cell33.setCellStyle(cs1);
}
@@ -846,7 +846,7 @@ public class MapController {
HSSFRow gkd_title_row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell gkd_title_cell1 = gkd_title_row.createCell(0);
gkd_title_cell1.setCellStyle(cs);
gkd_title_cell1.setCellValue("商业聚客点");
gkd_title_cell1.setCellValue("商业聚客点");
if(Integer.parseInt(array[17])>0){
HSSFRow market_row = s.createRow(s.getPhysicalNumberOfRows() );
@@ -854,11 +854,11 @@ public class MapController {
HSSFCell market_cell2 = market_row.createCell(2);
HSSFCell market_cell3 = market_row.createCell(3);
market_cell1.setCellValue("超市");
market_cell1.setCellValue("超市");
market_cell1.setCellStyle(cs1);
market_cell2.setCellValue(Integer.parseInt(array[17]));
market_cell2.setCellStyle(cs2);
market_cell3.setCellValue("个");
market_cell3.setCellValue("个");
market_cell3.setCellStyle(cs1);
}
@@ -867,11 +867,11 @@ public class MapController {
HSSFCell bank_cell1 = bank_row.createCell(1);
HSSFCell bank_cell2 = bank_row.createCell(2);
HSSFCell bank_cell3 = bank_row.createCell(3);
bank_cell1.setCellValue("银行");
bank_cell1.setCellValue("银行");
bank_cell1.setCellStyle(cs1);
bank_cell2.setCellValue(Integer.parseInt(array[18]));
bank_cell2.setCellStyle(cs2);
bank_cell3.setCellValue("个");
bank_cell3.setCellValue("个");
bank_cell3.setCellStyle(cs1);
}
@@ -880,11 +880,11 @@ public class MapController {
HSSFCell eat_cell1 = eat_row.createCell(1);
HSSFCell eat_cell2 = eat_row.createCell(2);
HSSFCell eat_cell3 = eat_row.createCell(3);
eat_cell1.setCellValue("餐饮");
eat_cell1.setCellValue("餐饮");
eat_cell1.setCellStyle(cs1);
eat_cell2.setCellValue(Integer.parseInt(array[19]));
eat_cell2.setCellStyle(cs2);
eat_cell3.setCellValue("个");
eat_cell3.setCellValue("个");
eat_cell3.setCellStyle(cs1);
}
@@ -894,18 +894,18 @@ public class MapController {
if(Integer.parseInt(array[20])>0||Integer.parseInt(array[21])>0||Integer.parseInt(array[22])>0){
HSSFRow gkd_title_row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell gkd_title_cell1 = gkd_title_row.createCell(0);
gkd_title_cell1.setCellValue("公共聚客点");
gkd_title_cell1.setCellValue("公共聚客点");
gkd_title_cell1.setCellStyle(cs);
if(Integer.parseInt(array[20])>0){
HSSFRow school_row = s.createRow(s.getPhysicalNumberOfRows() );
HSSFCell school_cell1 = school_row.createCell(1);
HSSFCell school_cell2 = school_row.createCell(2);
HSSFCell school_cell3 = school_row.createCell(3);
school_cell1.setCellValue("学校");
school_cell1.setCellValue("学校");
school_cell1.setCellStyle(cs1);
school_cell2.setCellValue(Integer.parseInt(array[20]));
school_cell2.setCellStyle(cs2);
school_cell3.setCellValue("个");
school_cell3.setCellValue("个");
school_cell3.setCellStyle(cs1);
}
@@ -914,11 +914,11 @@ public class MapController {
HSSFCell hspt_cell1 = hspt_row.createCell(1);
HSSFCell hspt_cell2 = hspt_row.createCell(2);
HSSFCell hspt_cell3 = hspt_row.createCell(3);
hspt_cell1.setCellValue("医院");
hspt_cell1.setCellValue("医院");
hspt_cell1.setCellStyle(cs1);
hspt_cell2.setCellValue(Integer.parseInt(array[21]));
hspt_cell2.setCellStyle(cs2);
hspt_cell3.setCellValue("个");
hspt_cell3.setCellValue("个");
hspt_cell3.setCellStyle(cs1);
}
@@ -927,11 +927,11 @@ public class MapController {
HSSFCell bus_cell1 = bus_row.createCell(1);
HSSFCell bus_cell2 = bus_row.createCell(2);
HSSFCell bus_cell3 = bus_row.createCell(3);
bus_cell1.setCellValue("公交点");
bus_cell1.setCellValue("公交点");
bus_cell1.setCellStyle(cs1);
bus_cell2.setCellValue(Integer.parseInt(array[22]));
bus_cell2.setCellStyle(cs2);
bus_cell3.setCellValue("个");
bus_cell3.setCellValue("个");
bus_cell3.setCellStyle(cs1);
}
@@ -975,11 +975,11 @@ public class MapController {
}
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();
@@ -1057,7 +1057,7 @@ public class MapController {
district.setAvgPrice(avgPrice);
district.setKind(commData.getKind());
if(district.getName().endsWith("村")){
if(district.getName().endsWith("村")){
oldHouseCount += count;
oldDistrictCount ++;
if(avgPrice > 0){
@@ -1087,16 +1087,16 @@ public class MapController {
}
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);//总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);//高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);//普通户数
model.setTotalHouseCount(oldHouseCount + hightLevelDistrictHouseCount + commonDistrictHouseCount);//总户数
model.setCommonDistrictHouseCount(commonDistrictHouseCount);//高级商品房户数
model.setHightDistrictHouseCount(hightLevelDistrictHouseCount);//普通户数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);//总小区数
model.setCommonDistrictCount(commonDistrictCount);//高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);//普通小区数
model.setTotalDistrictCount(oldDistrictCount + commonDistrictCount + hightLevelDistrictCount);//总小区数
model.setCommonDistrictCount(commonDistrictCount);//高级小区数
model.setHightDistrictCount(hightLevelDistrictCount);//普通小区数
model.setOldHouseCount(oldHouseCount);//老工房 户数
model.setOldDistrictCount(oldDistrictCount);//老工户 小区数
model.setOldHouseCount(oldHouseCount);//老工房 户数
model.setOldDistrictCount(oldDistrictCount);//老工户 小区数
model.setNewDistrictCount(newDistrictCount);
model.setNewDistrictHouseCount(newDistrictHouseCount);
@@ -1120,7 +1120,7 @@ public class MapController {
}
private List<DistrictInfoBo> districtNameByStages(List<DistrictInfoBo> districts){
//移除有分期的
//移除有分期的
for(int i=districts.size()-1;i>=0;i--){
DistrictInfoBo district = districts.get(i);
boolean flag = false;
@@ -1146,7 +1146,7 @@ public class MapController {
}
private String deleteStages(String name){
String[] filters = new String[]{"一期","二期","三期","四期","五期","六期","七期","八期","九期","十期"};
String[] filters = new String[]{"一期","二期","三期","四期","五期","六期","七期","八期","九期","十期"};
for(String filter : filters){
if(name.endsWith(filter)){
name = name.replace(filter, "");
@@ -37,7 +37,7 @@ public class UserController {
cookieContext.saveCookie(response, "geluke_uid", user.id);
} else {
model.setFlag("error");
model.setMsg("手机号或密码不符!");
model.setMsg("手机号或密码不符!");
}
}
model.setJsonModel(model);
@@ -56,7 +56,7 @@ public class UserController {
model.setFlag("success");
} else {
model.setFlag("error");
model.setMsg("该手机号已使用!");
model.setMsg("该手机号已使用!");
}
model.setJsonModel(model);
return model;
@@ -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 || (!GelukeConfig.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
*/
@@ -65,12 +65,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()) {
@@ -90,7 +90,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);
@@ -111,7 +111,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() {
@@ -144,7 +144,7 @@ public class AnalyticsFilter implements Filter {
}
/**
* 判断URL是否合法,合法则返回null,否则返回重定向URL
* 判断URL是否合法,合法则返回null,否则返回重定向URL
*
* @param requestUrl
* @param requestUri
@@ -155,7 +155,7 @@ public class AnalyticsFilter implements Filter {
GelukeConfig fangjiaConfig = GelukeConfig.getConfig();
IPSeeker.init(FangjiaConfig.getConfig().getIpdatfile());
String hostName = StringUtils.substringBetween(analyticsBean.requestUrl, "http://", "/");
// 如果hostName中有端口号,则把端口号去掉
// 如果hostName中有端口号,则把端口号去掉
int index = hostName.indexOf(":");
if (index > 0) {
hostName = hostName.substring(0, index);
@@ -175,7 +175,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);
}
@@ -236,7 +236,7 @@ public class BaseModel extends ModelAndViewSupport {
}
/**
* 如果queryString不为空则在前面加上问号"?",否则不加
* 如果queryString不为空则在前面加上问号"?",否则不加
*
* @return
*/
@@ -33,7 +33,7 @@ public class DistrictModel extends BaseModel{
}
public Integer getPageSize() {
// ĬÈÏ20
// 默认20
return (null != pageSize && 0 != pageSize) ? pageSize : 20;
}
@@ -32,11 +32,11 @@ public class RandomCodeServlet extends HttpServlet {
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 设置不缓存图片
// 设置不缓存图片
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "No-cache");
response.setDateHeader("Expires", 0);
// 指定生成的相应图片
// 指定生成的相应图片
response.setContentType("image/jpeg");
ConfigurableCaptchaService cs = new ConfigurableCaptchaService();
@@ -3,17 +3,17 @@ package com.fangjia.geluke.test;
public class GeoHelper {
// 赤道半径 earth radius
// 赤道半径 earth radius
public static double EARTH_RADIUS = 6378137;
/// 极半径 polar radius
/// 极半径 polar radius
public static double POLAR_RADIUS = 6356725;
/// 纬度的弧度
/// 纬度的弧度
public static double RadLat(double Lat) {
return Lat * Math.PI / 180;
}
/// 经度的弧度
/// 经度的弧度
public static double RadLon(double Lon) {
return Lon * Math.PI / 180;
}
@@ -1,9 +1,9 @@
package com.fangjia.geluke.test;
public class JWD {
static double Rc = 6378137; // 赤道半径
static double Rj = 6356725; // 极半径
double m_LoDeg, m_LoMin, m_LoSec; // longtitude 经度
static double Rc = 6378137; // 赤道半径
static double Rj = 6356725; // 极半径
double m_LoDeg, m_LoMin, m_LoSec; // longtitude 经度
double m_LaDeg, m_LaMin, m_LaSec;
double m_Longitude, m_Latitude;
double m_RadLo, m_RadLa;
@@ -43,13 +43,13 @@ public class JWD {
// JWD B = new JWD(BJD, BWD);
// return B;
// }
//! 已知点A经纬度,根据B点据A点的距离,和方位,求B点的经纬度
//! 已知点A经纬度,根据B点据A点的距离,和方位,求B点的经纬度
/*!
* /param longitude 已知点A经度
* /param latitude 已知点A纬度
* /param distance B点到A点的距离
* /param angle B点相对于A点的方位
* /return B点的经纬度坐标
* /param longitude 已知点A经度
* /param latitude 已知点A纬度
* /param distance B点到A点的距离
* /param angle B点相对于A点的方位
* /return B点的经纬度坐标
*/
// public static JWD GetJWDB(double longitude, double latitude, double distance, double angle)
// {
@@ -57,12 +57,12 @@ public class JWD {
// return GetJWDB(A, distance, angle);
// }
//! 计算点A 和 点B的经纬度,求他们的距离和点B相对于点A的方位
//! 计算点A 和 点B的经纬度,求他们的距离和点B相对于点A的方位
/*!
* \param A A点经纬度
* \param B B点经纬度
* \param angle B相对于A的方位, 不需要返回该值,则将其设为空
* \return A点B点的角度
* \param A A点经纬度
* \param B B点经纬度
* \param angle B相对于A的方位, 不需要返回该值,则将其设为空
* \return A点B点的角度
*/
public static double angle(JWD A, JWD B)
{
@@ -71,7 +71,7 @@ public class JWD {
// double out = Math.sqrt(dx * dx + dy * dy);
double angle = 0.0;
angle = Math.atan(Math.abs(dx/dy))*180./Math.PI;
// 判断象限
// 判断象限
double dLo = B.m_Longitude - A.m_Longitude;
double dLa = B.m_Latitude - A.m_Latitude;
if(dLo > 0 && dLa <= 0) {
@@ -2,30 +2,30 @@ package com.fangjia.geluke.test;
public class LatLon
{
// 赤道半径 earth radius
// 赤道半径 earth radius
public static double EARTH_RADIUS = 6378137;
/// 极半径 polar radius
/// 极半径 polar radius
public static double POLAR_RADIUS = 6356725;
/// <param name="lat">维度</param>
/// <param name="lon">经度</param>
/// <param name="lat">维度</param>
/// <param name="lon">经度</param>
public LatLon(double lat, double lon)
{
this.Lat = lat;
this.Lon = lon;
}
/// 纬度
/// 纬度
public double Lat;
/// 经度
/// 经度
public double Lon ;
/// 纬度的弧度
/// 纬度的弧度
public double RadLat() {
return Lat * Math.PI / 180;
}
/// 经度的弧度
/// 经度的弧度
public double RadLon() {
return Lon * Math.PI / 180;
}
@@ -7,24 +7,24 @@ import com.fangjia.core.City;
public class CityUtils {
static String[][] hotCitys = {{"上海","shanghai"},{"北京","beijing"},{"广州","guangzhou"},{"深圳","shenzhen"},{"杭州","hangzhou"},{"苏州","suzhou"},{"天津","tianjin"},{"大连","dalian"}};
static String[][] hotCitys = {{"上海","shanghai"},{"北京","beijing"},{"广州","guangzhou"},{"深圳","shenzhen"},{"杭州","hangzhou"},{"苏州","suzhou"},{"天津","tianjin"},{"大连","dalian"}};
static String[][] huaDongCitys = {{"上海","shanghai"},{"杭州","hangzhou"},{"南京","nanjing"},{"宁波","ningbo"},{"苏州","suzhou"},{"无锡","wuxi"},{"济南","jinan"},{"青岛","qingdao"},{"烟台","yantai"},{"温州","wenzhou"},{"绍兴","shaoxing"}, {"常州","changzhou"},{"南通","nantong"},{"金华","jinghua"},{"嘉兴","jiaxing"},{"昆山","kunshan"},{"常熟","changshu"}};
static String[][] huaDongCitys = {{"上海","shanghai"},{"杭州","hangzhou"},{"南京","nanjing"},{"宁波","ningbo"},{"苏州","suzhou"},{"无锡","wuxi"},{"济南","jinan"},{"青岛","qingdao"},{"烟台","yantai"},{"温州","wenzhou"},{"绍兴","shaoxing"}, {"常州","changzhou"},{"南通","nantong"},{"金华","jinghua"},{"嘉兴","jiaxing"},{"昆山","kunshan"},{"常熟","changshu"}};
static String[][] huaBeiCitys = {{"北京","beijing"},{"天津","tianjin"},{"沈阳","shenyang"},{"石家庄","shijiazhuang"},{"大连","dalian"},{"太原","taiyuan"},{"哈尔滨","haerbin"}};
static String[][] huaBeiCitys = {{"北京","beijing"},{"天津","tianjin"},{"沈阳","shenyang"},{"石家庄","shijiazhuang"},{"大连","dalian"},{"太原","taiyuan"},{"哈尔滨","haerbin"}};
static String[][] huaNanCitys = {{"广州","guangzhou"},{"深圳","shenzhen"},{"武汉","wuhan"},{"合肥","hefei"},{"福州","fuzhou"},{"长沙","changsha"},{"厦门","xiamen"},{"郑州","zhengzhou"},{"南昌","nanchang"},{"佛山","foshan"},{"东莞","dongguan"},{"珠海","zhuhai"}};
static String[][] huaNanCitys = {{"广州","guangzhou"},{"深圳","shenzhen"},{"武汉","wuhan"},{"合肥","hefei"},{"福州","fuzhou"},{"长沙","changsha"},{"厦门","xiamen"},{"郑州","zhengzhou"},{"南昌","nanchang"},{"佛山","foshan"},{"东莞","dongguan"},{"珠海","zhuhai"}};
static String[][] xiBuCitys = {{"成都","chengdu"},{"西安","xian"},{"重庆","chongqing"},{"贵阳","guiyang"},{"昆明","kunming"}};
static String[][] xiBuCitys = {{"成都","chengdu"},{"西安","xian"},{"重庆","chongqing"},{"贵阳","guiyang"},{"昆明","kunming"}};
static String[][] aToGCitys = {{"北京","beijing"},{"成都","chengdu"},{"长沙","changsha"},{"常州","changzhou"},{"常熟","changshu"},{"大连","dalian"},{"重庆","chongqing"},{"东莞","dongguan"},{"福州","fuzhou"},{"佛山","foshan"},{"广州","guangzhou"},{"贵阳","guiyang"}};
static String[][] aToGCitys = {{"北京","beijing"},{"成都","chengdu"},{"长沙","changsha"},{"常州","changzhou"},{"常熟","changshu"},{"大连","dalian"},{"重庆","chongqing"},{"东莞","dongguan"},{"福州","fuzhou"},{"佛山","foshan"},{"广州","guangzhou"},{"贵阳","guiyang"}};
static String[][] hToNCitys = { {"杭州","hangzhou"},{"合肥","hefei"},{"济南","jinan"},{"哈尔滨","haerbin"},{"嘉兴","jiaxing"},{"金华","jinghua"},{"昆明","kunming"},{"昆山","kunshan"},{"南京","nanjing"},{"宁波","ningbo"},{"南昌","nanchang"},{"南通","nantong"}};
static String[][] hToNCitys = { {"杭州","hangzhou"},{"合肥","hefei"},{"济南","jinan"},{"哈尔滨","haerbin"},{"嘉兴","jiaxing"},{"金华","jinghua"},{"昆明","kunming"},{"昆山","kunshan"},{"南京","nanjing"},{"宁波","ningbo"},{"南昌","nanchang"},{"南通","nantong"}};
static String[][] oToTCitys = { {"青岛","qingdao"},{"上海","shanghai"},{"深圳","shenzhen"},{"沈阳","shenyang"},{"石家庄","shijiazhuang"},{"苏州","suzhou"},{"绍兴","shaoxing"},{"天津","tianjin"},{"太原 ","taiyuan"}};
static String[][] oToTCitys = { {"青岛","qingdao"},{"上海","shanghai"},{"深圳","shenzhen"},{"沈阳","shenyang"},{"石家庄","shijiazhuang"},{"苏州","suzhou"},{"绍兴","shaoxing"},{"天津","tianjin"},{"太原 ","taiyuan"}};
static String[][] uToZCitys = { {"武汉","wuhan"},{"温州","wenzhou"},{"无锡","wuxi"},{"西安","xian"},{"厦门","xiamen"},{"烟台","yantai"},{"郑州","zhengzhou"},{"珠海","zhuhai"}};
static String[][] uToZCitys = { {"武汉","wuhan"},{"温州","wenzhou"},{"无锡","wuxi"},{"西安","xian"},{"厦门","xiamen"},{"烟台","yantai"},{"郑州","zhengzhou"},{"珠海","zhuhai"}};
public static List<City> getHotCity(){
return getCitys(hotCitys);
@@ -39,16 +39,16 @@ public class InsidePolygon {
}
/**
* 判定一个经纬度点与区域的关系
* @param point 需要判断的经纬度点
* @return boolean 如果点在区域内,true;如果在区域外,false
* 判定一个经纬度点与区域的关系
* @param point 需要判断的经纬度点
* @return boolean 如果点在区域内,true;如果在区域外,false
*/
public static boolean aboutZone(Point point, List<Point> vPoint)
{
if(vPoint==null||vPoint.size()==0) return false;
int I = 0;
//求出最大值, 得到一个落在矩形外的点, 由该点与point组成的线段, 与多边形求交, 交点为奇数则为
// 在多边形内
//求出最大值, 得到一个落在矩形外的点, 由该点与point组成的线段, 与多边形求交, 交点为奇数则为
// 在多边形内
I = 1;
int odd = 0;