diff --git a/projects/fangjia-bkoff/pom.xml b/projects/fangjia-bkoff/pom.xml index 41b8a352d..69e2d3b60 100644 --- a/projects/fangjia-bkoff/pom.xml +++ b/projects/fangjia-bkoff/pom.xml @@ -178,6 +178,11 @@ 1.0.0 jdk18 + + com.alibaba + easyexcel + 4.0.1 + diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/ApiUserController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/ApiUserController.java index 691eb9427..54be64383 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/ApiUserController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/ApiUserController.java @@ -1,11 +1,13 @@ package com.fangjia.bkoff.controllers; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.util.DateUtils; +import com.alibaba.excel.write.metadata.WriteSheet; import com.fangjia.bkoff.model.ApiUserModel; import com.fangjia.bkoff.model.JsonModel; -import com.fangjia.core.util.BeanUtils; -import com.fangjia.core.util.DataUtil; -import com.fangjia.core.util.DateUtil; -import com.fangjia.core.util.StringUtil; +import com.fangjia.core.util.*; +import com.fangjia.dal.QueryParam; import com.fangjia.dal.mongo.fangjia.model.ServerArea; import com.fangjia.dal.mongo.model.ApiInvokeStatistical; import com.fangjia.dal.mongo.model.ApiUserCfg; @@ -27,23 +29,33 @@ import com.fangjia.service.sql.UserService; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.time.DateUtils; import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.bson.types.ObjectId; import org.json.JSONArray; +import org.sothis.core.util.CollectionUtils; import org.sothis.web.mvc.ActionContext; import org.sothis.web.mvc.annotation.Param; +import scala.Int; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.math.BigDecimal; import java.net.URLEncoder; +import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; + /** * api用户开通等管理controller * @@ -62,7 +74,6 @@ public class ApiUserController { private ApiVisitCountService apiVisitCountService; private ApiCountCityService apiCountCityService; - /** * 所有api用户的信息展示 * @@ -303,14 +314,15 @@ public class ApiUserController { user.put("password", DigestUtils.md5Hex(model.getPassword())); // // // 更改用户密码 - this.userService.updateById(user,userId); + this.userService.updateById(user, userId); // 刷新缓存 this.apiUserService.clearApiUserAuthorityCache(userId); model.setViewType("redirect"); - model.setViewParam("location", "/apiUser/edit?userId="+userId); + model.setViewParam("location", "/apiUser/edit?userId=" + userId); return model; } + public Object editPwdAction(ApiUserModel model) { Long userId = model.getUserId(); User user = this.userService.findById(userId); @@ -718,6 +730,8 @@ public class ApiUserController { apiUserAuthorityService.update(authority); } } + // 刷新缓存 + this.apiUserService.clearApiUserAuthorityCache(userId); return model; } @@ -973,7 +987,21 @@ public class ApiUserController { } else { cities = new ArrayList(); } - List analys = openUriAnalyService.findOpenUriAnalyLogs(model.getUserId(), null, startDate, endDate); + // 只查询正式账号 + List queryParams = Arrays.asList(new QueryParam("isTest", 0)); + List apiUsers = this.apiUserService.findApiUsersByParamsSortDate(queryParams); + // 获取正式账号的ids + List ids = new ArrayList(); + for (ApiUser apiUser : apiUsers) { + ids.add((int) apiUser.getId()); + } + List analyAll = openUriAnalyService.findOpenUriAnalyLogs(model.getUserId(), null, startDate, endDate); + List analys = new ArrayList(); + for (OpenUriAnaly analy : analyAll) { + if (ids.contains(analy.getApiUserId())) { + analys.add(analy); + } + } List bos = null; List eachCityBos = null; if (model.getWay() == null) { @@ -1014,9 +1042,7 @@ public class ApiUserController { } } } - List userIds = new ArrayList(); for (StatAnalyBo boTemp : bos) { - userIds.add(Long.valueOf(boTemp.getUserId())); List apiVisitCounts = apiVisitCountService.findAllApiVisitCount(Long.valueOf(boTemp.getUserId()), null, startDate, endDate); int total = 0; for (ApiVisitCount apiVisitCount : apiVisitCounts) { @@ -1025,7 +1051,6 @@ public class ApiUserController { boTemp.setBillingCount(total); } - List apiUsers = apiUserService.findApiUserByIds(userIds); Map idUserMap = new HashMap(); for (ApiUser apiUser : apiUsers) { idUserMap.put(apiUser.getId(), apiUser); @@ -1049,8 +1074,234 @@ public class ApiUserController { return model; } + public Object exportAction(ApiUserModel model, HttpServletResponse response) throws IllegalAccessException { + Date startDate = null; + Date endDate = null; + if (StringUtils.isBlank(model.getBegDate()) && StringUtils.isBlank(model.getEndDate())) { + startDate = DateUtil.add(DateUtil.formatToYYYYMMDD(new Date()), -7); + endDate = DateUtil.parseStringToDate(DateUtil.formatToYYYYMMDD(new Date())); + } else { + if (StringUtils.isNotBlank(model.getBegDate())) { + startDate = DateUtil.parseStringToDate(model.getBegDate()); + } + if (StringUtils.isNotBlank(model.getEndDate())) { + endDate = DateUtil.parseStringToDate(model.getEndDate()); + } - public Object userVisitStatAction(ApiUserModel model) { + } + if (startDate != null) { + model.setBegDate(DateUtil.formatToYYYYMMDD(startDate)); + } + + if (endDate != null) { + model.setEndDate(DateUtil.formatToYYYYMMDD(endDate)); + } + Date nowDate = DateUtil.parseStringToDate(DateUtil.formatToYYYYMMDD(new Date())); + Date lastWeek = DateUtil.add(DateUtil.formatToYYYYMMDD(new Date()), -7); + Date lastMonth = DateUtil.add(DateUtil.formatToYYYYMMDD(new Date()), -30); + + long diffInMillies = Math.abs(endDate.getTime() - startDate.getTime()); + + // 将毫秒转换为天数 + long days = diffInMillies / (1000 * 60 * 60 * 24); // 使用long来计算天数 + + // 只查询正式账号、未过期、未禁用 + List queryParams = Arrays.asList(new QueryParam("isTest", 0), + new QueryParam("status", 0), + new QueryParam("deadTime", QueryParam.GREATER_THAN_EQUAL_OPERATOR, new Date())); + List apiUsers = this.apiUserService.findApiUsersByParamsSortDate(queryParams); + + //所有API + List allApi = openResourceService.findAll(); + // 所有API的URI与name对应Map + Map apiMap = converMapData(allApi); + List bosAll = new ArrayList(); + if (CollectionUtils.isNotEmpty(apiUsers)) { + // 根据访问遍历用户 + for (ApiUser apiUser : apiUsers) { + long id = apiUser.getId(); + // 获取每个用户的访问 + ApiUserAuthority authority = apiUserAuthorityService.findByUserId(id); + // 用户有的api + List userApi = authority.getOpenResourseUris(); + Map countMap = authority.getTotalCountMap(); + // 获取用户名 + User user = userService.findById(id); + long date = DateUtil.parseStringToDate("2016-11-23").getTime(); + if (startDate.getTime() >= date && endDate.getTime() > date) { + List apiInvokeStatisticalList = apiInvokeStatisticalService.findApiInvokeStatisticalList(id, startDate, endDate); + List weekApiInvokeStatisticalList; + if (lastWeek == startDate && nowDate == endDate) { + weekApiInvokeStatisticalList = apiInvokeStatisticalList; + } else { + weekApiInvokeStatisticalList = apiInvokeStatisticalService.findApiInvokeStatisticalList(id, lastWeek, nowDate); + } + List monthApiInvokeStatisticalList; + if (lastMonth == startDate && nowDate == endDate) { + monthApiInvokeStatisticalList = apiInvokeStatisticalList; + } else { + monthApiInvokeStatisticalList = apiInvokeStatisticalService.findApiInvokeStatisticalList(id, lastMonth, nowDate); + } + Map> resultMap = getCountByUri(apiInvokeStatisticalList); + Map> weekResultMap = getCountByUri(weekApiInvokeStatisticalList); + Map> monthResultMap = getCountByUri(monthApiInvokeStatisticalList); + + // 遍历用户所有的api + for (String url : userApi) { + // 统计用过的api + String urlName = apiMap.get(url); + StatAnalyBo bo = new StatAnalyBo(); + if (resultMap.containsKey(url)) { + // 自定义时间的数据 + bo.setSuccessEffectiveTime(resultMap.get(url).get("successEffectiveCount")); + bo.setSuccessInvalidTime(resultMap.get(url).get("successInvalidCount")); + bo.setDefeatTime(resultMap.get(url).get("defeatCount")); + bo.setCount(resultMap.get(url).get("totalCount")); + double dailyUse = bo.getCount() * 1.0 / days; + bo.setDailyUse(dailyUse); + } + if (weekResultMap.containsKey(url)) { + // 近一周数据 + bo.setWeekSuccessEffectiveTime(weekResultMap.get(url).get("successEffectiveCount")); + bo.setWeekSuccessInvalidTime(weekResultMap.get(url).get("successInvalidCount")); + bo.setWeekDefeatTime(weekResultMap.get(url).get("defeatCount")); + bo.setWeekCount(weekResultMap.get(url).get("totalCount")); + double dailyUse = bo.getWeekCount() * 1.0 / 7; + bo.setWeekDailyUse(dailyUse); + } + if (monthResultMap.containsKey(url)) { + // 成功有效次数 + bo.setMonthSuccessEffectiveTime(monthResultMap.get(url).get("successEffectiveCount")); + // 成功无效次数 + bo.setMonthSuccessInvalidTime(monthResultMap.get(url).get("successInvalidCount")); + // 失败次数 + bo.setMonthDefeatTime(monthResultMap.get(url).get("defeatCount")); + bo.setMonthCount(monthResultMap.get(url).get("totalCount")); + double dailyUse = bo.getMonthCount() * 1.0 / 30; + bo.setMonthDailyUse(dailyUse); + } + + bo.setUrl(url); + bo.setUrlName(urlName); + bo.setDeadline(apiUser.getDeadTime()); + bo.setUserId((int) id); + bo.setUserName(user.getDisplayName()); + //剩余调用量 + long curVistedCount = apiVisitCountService.findApiVisitCountByDay(id, url, DateUtil.truncateDay(new Date())); + long historyCount = apiVisitCountService.findApiVisitAllCount(id, url, DateUtil.truncateDay(new Date())); + if (countMap != null && countMap.containsKey(url)) { + Integer totalCount = countMap.get(url); + long usedCount = curVistedCount + historyCount; + bo.setSurplusCallCount(Integer.valueOf((int) (totalCount - usedCount))); + } + bosAll.add(bo); + } + } + } + this.buildReport(bosAll, response, startDate, endDate); + } + model.setViewType("stream"); + return model; + } + + private void buildReport(List bos, HttpServletResponse response, Date startDate, Date endDate) { + try { + List> dataList = new ArrayList>(); + + for (StatAnalyBo bo : bos) { + List row = new ArrayList(); + row.add(bo.getUserId() != null ? bo.getUserId().toString() : ""); + row.add(bo.getUserName() != null ? bo.getUserName().toString() : ""); + row.add(bo.getDeadline() != null ? DateUtils.format(bo.getDeadline(), "yyyy/MM/dd") : ""); + row.add(bo.getUrl() != null ? bo.getUrl().toString() : ""); + row.add(bo.getUrlName() != null ? bo.getUrlName().toString() : ""); + row.add(bo.getSurplusCallCount() != null ? bo.getSurplusCallCount().toString() : ""); + // 上周 + row.add(bo.getWeekCount() != null ? bo.getWeekCount().toString() : ""); + if (bo.getWeekDailyUse() != null) { + // 格式化为保留一位小数的字符串 + String formattedDailyUse = String.format("%.1f", bo.getWeekDailyUse()); + row.add(formattedDailyUse); + } else { + row.add(""); + } + row.add(bo.getWeekSuccessEffectiveTime() != null ? bo.getWeekSuccessEffectiveTime().toString() : ""); + row.add(bo.getWeekSuccessInvalidTime() != null ? bo.getWeekSuccessInvalidTime().toString() : ""); + row.add(bo.getWeekDefeatTime() != null ? bo.getWeekDefeatTime().toString() : ""); + // 上个月 + row.add(bo.getMonthCount() != null ? bo.getMonthCount().toString() : ""); + if (bo.getMonthDailyUse() != null) { + // 格式化为保留一位小数的字符串 + String formattedDailyUse = String.format("%.1f", bo.getMonthDailyUse()); + row.add(formattedDailyUse); + } else { + row.add(""); + } + row.add(bo.getMonthSuccessEffectiveTime() != null ? bo.getMonthSuccessEffectiveTime().toString() : ""); + row.add(bo.getMonthSuccessInvalidTime() != null ? bo.getMonthSuccessInvalidTime().toString() : ""); + row.add(bo.getMonthDefeatTime() != null ? bo.getMonthDefeatTime().toString() : ""); + // 自定义时间 + row.add(bo.getCount() != null ? bo.getCount().toString() : ""); + if (bo.getDailyUse() != null) { + // 格式化为保留一位小数的字符串 + String formattedDailyUse = String.format("%.1f", bo.getDailyUse()); + row.add(formattedDailyUse); + } else { + row.add(""); + } + row.add(bo.getSuccessEffectiveTime() != null ? bo.getSuccessEffectiveTime().toString() : ""); + row.add(bo.getSuccessInvalidTime() != null ? bo.getSuccessInvalidTime().toString() : ""); + row.add(bo.getDefeatTime() != null ? bo.getDefeatTime().toString() : ""); + dataList.add(row); + } + + String dateStr ="("+ DateUtils.format(startDate, "yyyy/MM/dd") + "—" + DateUtils.format(endDate, "yyyy/MM/dd") +")"; + String fileName = "用户账号使用统计" + dateStr + ".xlsx"; +// ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build(); + String displayName = URLEncoder.encode(fileName, "UTF-8"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + displayName + "\""); + response.setContentType("application/x-download;charset=utf-8"); + Workbook workbook = new XSSFWorkbook(); + Sheet sheet = workbook.createSheet("用户账号使用统计"); + List head = Arrays.asList( + "用户ID", "账号", "合同到期时间", "接口", "接口名称", "剩余使用次数", + "访问次数(近一周)", "日均访问量(近一周)","成功并有效(近一周)", "成功并无效(近一周)","失败次数(近一周)", + "访问次数(近一月)", "日均访问量(近一月)","成功并有效(近一月)", "成功并无效(近一月)","失败次数(近一月)", + "访问次数"+dateStr, "日均访问量"+dateStr,"成功并有效"+dateStr, "成功并无效"+dateStr,"失败次数"+dateStr + ); + // 创建表头 + Row headRow = sheet.createRow(0); + for (int i = 0; i < head.size(); i++) { + Cell cell = headRow.createCell(i); + cell.setCellValue(head.get(i)); + } + // 写入数据,从第二行 + for (int i = 0; i < dataList.size(); i++) { + Row row = sheet.createRow(i + 1); + List data = dataList.get(i); + for (int j = 0; j < data.size(); j++) { + Cell cell = row.createCell(j); + cell.setCellValue(data.get(j)); + } + } + ServletOutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + } catch (IOException e) { + } + + } + + List> formatHead(String[] headArr) { + List> head = new ArrayList>(); + for (String name : headArr) { + List temp = new ArrayList(); + temp.add(name); + head.add(temp); + } + return head; + } + + public Object userVisitStatAction(ApiUserModel model) throws IllegalAccessException { Date startDate = null; Date endDate = null; if (StringUtils.isNotBlank(model.getBegDate())) { @@ -1073,8 +1324,12 @@ public class ApiUserController { // bos = createAnalyBosByUser(analys); // model.setChartSeries(toChartString(bos)); // }else if(model.getWay() == 2){ + Long userId = model.getUserId(); + ApiUserAuthority authority = apiUserAuthorityService.findByUserId(userId); + Map countMap = authority.getTotalCountMap(); + ApiUser apiUser = apiUserService.findApiUserById(userId); if (model.getWay() == 2) { - User user = userService.findById(model.getUserId()); + User user = userService.findById(userId); if (user != null) { model.setUserName(user.getDisplayName()); } @@ -1118,6 +1373,16 @@ public class ApiUserController { boTemp.setSuccessEffectiveTime(resultMap.get(url).get("successEffectiveCount")); boTemp.setSuccessInvalidTime(resultMap.get(url).get("successInvalidCount")); boTemp.setDefeatTime(resultMap.get(url).get("defeatCount")); + if (apiUser != null) { + boTemp.setDeadline(apiUser.getDeadTime()); + } + long curVistedCount = apiVisitCountService.findApiVisitCountByDay(userId, url, DateUtil.truncateDay(new Date())); + long historyCount = apiVisitCountService.findApiVisitAllCount(userId, url, DateUtil.truncateDay(new Date())); + if (countMap != null && countMap.containsKey(url)) { + Integer totalCount = countMap.get(url); + long usedCount = curVistedCount + historyCount; + boTemp.setSurplusCallCount(Integer.valueOf((int) (totalCount - usedCount))); + } } } } @@ -1623,6 +1888,7 @@ public class ApiUserController { Integer successEffectiveCount = detailMap.get("successEffectiveCount"); Integer successInvalidCount = detailMap.get("successInvalidCount"); Integer defeatCount = detailMap.get("defeatCount"); + Integer totalCount = detailMap.get("totalCount"); if (successEffectiveCount != null) { successEffectiveCount = successEffectiveCount + apiInvokeStatistical.getSuccessEffectiveTime(); } else { @@ -1639,10 +1905,16 @@ public class ApiUserController { } else { defeatCount = apiInvokeStatistical.getDefeatTime(); } + if (totalCount != null) { + totalCount = totalCount + apiInvokeStatistical.getTotalTime(); + } else { + totalCount = apiInvokeStatistical.getTotalTime(); + } detailMap.put("successEffectiveCount", successEffectiveCount); detailMap.put("successInvalidCount", successInvalidCount); detailMap.put("defeatCount", defeatCount); + detailMap.put("totalCount", totalCount); } return resultMap; diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DevelopmentZoneController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DevelopmentZoneController.java new file mode 100644 index 000000000..8306117fe --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DevelopmentZoneController.java @@ -0,0 +1,263 @@ +package com.fangjia.bkoff.controllers; + +import com.fangjia.bkoff.model.DevelopmentZoneModel; +import com.fangjia.bkoff.model.JsonModel; +import com.fangjia.bkoff.model.LatlngPolygonModel; +import com.fangjia.core.util.GeoUtils; +import com.fangjia.core.util.ThreadLocalData; +import com.fangjia.core.util.ThreadLocalKey; +import com.fangjia.dal.mongo.model.DevelopmentZone; +import com.fangjia.dal.mongo.model.LatlngPolygon; +import com.fangjia.dal.mongo.model.StatsIndex; +import com.fangjia.dal.mongo.model.bkoff.BkoffUsers; +import com.fangjia.service.mongo.bkoff.BkoffUsersService; +import com.fangjia.service.mongo.fangjia.DevelopmentZoneService; +import com.fangjia.service.mongo.fangjia.LatlngPolygonService; +import org.apache.commons.lang.StringUtils; +import org.sothis.core.util.Pager; + +import java.util.*; + +import static com.fangjia.core.util.GeoUtils.LAT; +import static com.fangjia.core.util.GeoUtils.LNG; + +/** + * Created by dxy on 2015/6/8. + */ +public class DevelopmentZoneController { + private DevelopmentZoneService developmentZoneService; + private BkoffUsersService bkoffUsersService; + + public Object listAction(DevelopmentZoneModel model) { + Pager pager = model.getPager(30); + if (pager.getCurrentPage() > 100) { + pager.setCurrentPage(1); + } + long countDev = developmentZoneService.countDev(model.getProvince(), model.getName(), model.getLevel()); + pager.setTotalRows((int) countDev); + List developmentZones = developmentZoneService.findDevelopmentZone(model.getProvince(), model.getName(), model.getLevel(), pager); + model.setDevelopmentZoneList(developmentZones); + model.setPager(pager); + return model; + } + + public Object showAction(DevelopmentZoneModel model) { + if (model.getId() == null) { + return model; + } + + model.setDevelopmentZone(developmentZoneService.findDevelopmentZone(model.getId())); + return model; + } + + public Object editAction(DevelopmentZoneModel model) { + if (model.getId() == null) { + return model; + } + + model.setDevelopmentZone(developmentZoneService.findDevelopmentZone(model.getId())); + return model; + } + + public Object deleteAction(LatlngPolygonModel model) { + JsonModel ret = new JsonModel(); + if (model.getId() == null) { + return ret; + } + developmentZoneService.deleteDevelopmentZone(model.getId()); + return ret; + } + + public Object saveOrUpdateAction(DevelopmentZoneModel model) { + String userId = (String) ThreadLocalData.getInstance().get(ThreadLocalKey.UserId); + BkoffUsers user = bkoffUsersService.findBkoffUsersById(userId); + JsonModel ret = new JsonModel(); + Map data = new HashMap(); + ret.setJsonModel(data); + if (model.getId() == null) { + // name province bdLocation level 不能为空 + if (StringUtils.isBlank(model.getProvince()) || StringUtils.isBlank(model.getName()) || StringUtils.isBlank(model.getLevel())) { + data.put("msg", "保存失败(开发区名称,所在省份,级别不能为空)"); + return ret; + } + DevelopmentZone entity = new DevelopmentZone(); + // name province bdLocation level 不能为空/ + entity.setName(model.getName()); + entity.setProvince(model.getProvince()); + // 新加开发区,围栏不是必须有的 + if (model.getBdShape() != null && !model.getBdShape().toString().equals("[]")) { + String locationStr = model.getBdShape().toString().replaceAll("\\[", "").replaceAll("\\]", "").replaceAll(" ", ""); + List> bdLocationList = new ArrayList>(); + String[] splitStr = locationStr.split(";"); + for (int i = 0; i < splitStr.length; i++) { + String[] splitStr2 = splitStr[i].split(","); + List location = new ArrayList(); + location.add(Double.parseDouble(splitStr2[0])); + location.add(Double.parseDouble(splitStr2[1])); + bdLocationList.add(location); + } + //加上第一个,形成首尾闭合 + bdLocationList.add(bdLocationList.get(0)); + model.setBdShape(bdLocationList); + // 百度经纬度 + Map bdShape = new HashMap(); + bdShape.put("type", "polygon"); + bdShape.put("coordinates", model.getBdShape()); + entity.setBdShape(bdShape); + // 高德经纬度 + Map shape = new HashMap(); + shape.put("type", "polygon"); + Object coordinates = convertGeoList(model.getBdShape()); + shape.put("coordinates", coordinates); + entity.setShape(shape); + } + + entity.setLevel(model.getLevel()); + String aliasString = model.getAlias().replaceAll(",", ","); + List alias = Arrays.asList(aliasString.split("\\s*,\\s*")); + entity.setAlias(alias); + entity.setAddress(StringUtils.isBlank(model.getAddress()) ? "" : model.getAddress()); + entity.setArea(StringUtils.isBlank(model.getArea()) ? "" : model.getArea()); + entity.setBlock(StringUtils.isBlank(model.getBlock()) ? "" : model.getBlock()); + entity.setBuildDate(StringUtils.isBlank(model.getBuildDate()) ? "" : model.getBuildDate()); + entity.setCreateTime(new Date()); + entity.setIndustry(StringUtils.isBlank(model.getIndustry()) ? "" : model.getIndustry()); + entity.setNameEn(StringUtils.isBlank(model.getNameEn()) ? "" : model.getNameEn()); + entity.setType(StringUtils.isBlank(model.getType()) ? "" : model.getType()); + entity.setUrl(StringUtils.isBlank(model.getUrl()) ? "" : model.getUrl()); + entity.setCityName1(StringUtils.isBlank(model.getCityName1()) ? "" : model.getCityName1()); + entity.setDistrict(StringUtils.isBlank(model.getDistrict()) ? "" : model.getDistrict()); + //记录操作人员 + entity.setOperator(user.getRealName()); + developmentZoneService.saveDevelopmentZone(entity); + data.put("msg", "保存成功"); + } else { +// DevelopmentZone entity = developmentZoneService.findDevelopmentZone(model.getId()); + Map udata = new HashMap(); + if (StringUtils.isNotBlank(model.getProvince())) { + udata.put("province", model.getProvince()); + } + if (StringUtils.isNotBlank(model.getName())) { + udata.put("name", model.getName()); + } + if (StringUtils.isNotBlank(model.getLevel())) { + udata.put("level", model.getLevel()); + } + if (model.getBdShape() != null && !model.getBdShape().toString().equals("[]")) { + String locationStr = model.getBdShape().toString().replaceAll("\\[", "").replaceAll("\\]", "").replaceAll(" ", ""); + List> bdLocationList = new ArrayList>(); + String[] splitStr = locationStr.split(";"); + for (int i = 0; i < splitStr.length; i++) { + String[] splitStr2 = splitStr[i].split(","); + List location = new ArrayList(); + location.add(Double.parseDouble(splitStr2[0])); + location.add(Double.parseDouble(splitStr2[1])); + bdLocationList.add(location); + } + //加上第一个,形成首尾闭合 + bdLocationList.add(bdLocationList.get(0)); + model.setBdShape(bdLocationList); + // 百度经纬度 + Map bdShape = new HashMap(); + bdShape.put("type", "polygon"); + bdShape.put("coordinates", model.getBdShape()); + udata.put("bdShape", bdShape); + // 高德经纬度 + Map shape = new HashMap(); + shape.put("type", "polygon"); + Object coordinates = convertGeoList(model.getBdShape()); + shape.put("coordinates", coordinates); + udata.put("shape", shape); + } + if (StringUtils.isNotBlank(model.getAlias())) { + String aliasString = model.getAlias().replaceAll(",", ","); + List alias = Arrays.asList(aliasString.split("\\s*,\\s*")); + udata.put("alias", alias); + } + if (StringUtils.isNotBlank(model.getAddress())) { + udata.put("address", model.getAddress()); + } + if (StringUtils.isNotBlank(model.getArea())) { + udata.put("area", model.getArea()); + } + if (StringUtils.isNotBlank(model.getBlock())) { + udata.put("block", model.getBlock()); + } + if (StringUtils.isNotBlank(model.getBuildDate())) { + udata.put("buildDate", model.getBuildDate()); + } + if (StringUtils.isNotBlank(model.getIndustry())) { + udata.put("industry", model.getIndustry()); + } + if (StringUtils.isNotBlank(model.getNameEn())) { + udata.put("nameEn", model.getNameEn()); + } + if (StringUtils.isNotBlank(model.getType())) { + udata.put("type", model.getType()); + } + if (StringUtils.isNotBlank(model.getUrl())) { + udata.put("url", model.getUrl()); + } + if (StringUtils.isNotBlank(model.getCityName1())) { + udata.put("cityName1", model.getCityName1()); + } + if (StringUtils.isNotBlank(model.getDistrict())){ + udata.put("district", model.getDistrict()); + } + udata.put("createTime", new Date()); + //记录操作人员 + udata.put("operator", user.getRealName()); + developmentZoneService.updateDevelopmentZone(udata, model.getId()); + data.put("msg", "修改成功"); + } + + return ret; + } + + public JsonModel provincesAction() { + JsonModel model = new JsonModel(); + List provinces = developmentZoneService.findProvinces(); + model.setJsonModel(provinces); + return model; + } + + public JsonModel citiesAction(DevelopmentZoneModel model) { + JsonModel jsonModel = new JsonModel(); + List cities = developmentZoneService.findCities(model.getProvince()); + jsonModel.setJsonModel(cities); + return jsonModel; + } + + public JsonModel districtsAction(DevelopmentZoneModel model) { + JsonModel jsonModel = new JsonModel(); + List districts = developmentZoneService.findDistricts(model.getCityName1()); + jsonModel.setJsonModel(districts); + return jsonModel; + } + + public void setDevelopmentZoneService(DevelopmentZoneService developmentZoneService) { + this.developmentZoneService = developmentZoneService; + } + + public void setBkoffUsersService(BkoffUsersService bkoffUsersService) { + this.bkoffUsersService = bkoffUsersService; + } + //将百度坐标转为高德坐标 + + public List> convertGeoList(List> bdLocationList) { + List> gdLocationList = new ArrayList>(); + + // 使用增强的 for 循环遍历列表 + for (List bdLocation : bdLocationList) { + List gdLocation = new ArrayList(); + // 将百度坐标转为高德坐标 + Map map = GeoUtils.bd09ToGcj02(bdLocation.get(0), bdLocation.get(1)); + gdLocation.add(map.get(LAT)); + gdLocation.add(map.get(LNG)); + gdLocationList.add(gdLocation); + } + return gdLocationList; + } + + +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java index db5bf7e45..080f08f51 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java @@ -331,7 +331,7 @@ public class DistrictController { for (QueryParam pa : params) { fenQiParams.add(pa); } - fenQiParams.add(new QueryParam("masterDistrictNname", "master")); + fenQiParams.add(new QueryParam("masterDistrictName", "master")); fenQiParams.add(new QueryParam("visible", 0)); int fenQiCount = (int) districtService.findDistrictCount(0, fenQiParams); // int surplusDistrictCount = @@ -373,7 +373,7 @@ public class DistrictController { } else if (model.getValid() != null && model.getValid() == 3) { // 分期数据处理 params.add(new QueryParam("visible", 0)); - params.add(new QueryParam("masterDistrictNname", "master")); + params.add(new QueryParam("masterDistrictName", "master")); districts = districtService.findDistrictList(pager, params, sortParams); List vos = new ArrayList(); for (District district : districts) { @@ -3513,8 +3513,8 @@ public class DistrictController { if (type.equals("master")) { masterDistrict = districtService.findById(id); } - if (dis != null && dis.getMasterDistrictNname() != null - && dis.getMasterDistrictNname().equals("master")) { + if (dis != null && dis.getMasterDistrictName() != null + && dis.getMasterDistrictName().equals("master")) { json.setSuccess(false); json.setMsg(dis.getName() + "已经是主小区了"); return json; @@ -3532,13 +3532,13 @@ public class DistrictController { String type = stas[1]; if (type.equals("master")) { Map data = new HashMap(); - data.put("masterDistrictNname", "master"); + data.put("masterDistrictName", "master"); districtService.updateById(data, id); // 设置为人工操作分期标识 districtService.setPersonOperate(id); } else { Map data = new HashMap(); - data.put("masterDistrictNname", masterDistrict.getName()); + data.put("masterDistrictName", masterDistrict.getName()); districtService.updateById(data, id); } } @@ -3566,8 +3566,8 @@ public class DistrictController { json.setMsg("小区不存在,请检查是否输入正确"); return json; } - if (slaveDistrict.getMasterDistrictNname() != null - && slaveDistrict.getMasterDistrictNname().equals("master")) { + if (slaveDistrict.getMasterDistrictName() != null + && slaveDistrict.getMasterDistrictName().equals("master")) { json.setSuccess(false); json.setMsg(slaveDistrict.getName() + "已经是主小区了"); return json; @@ -3576,7 +3576,7 @@ public class DistrictController { if (slaveDistrict.getCity().equals(masterDistrict.getCity()) && slaveDistrict.getRegion().equals(masterDistrict.getRegion())) { Map data = new HashMap(); - data.put("masterDistrictNname", masterDistrict.getName()); + data.put("masterDistrictName", masterDistrict.getName()); districtService.updateById(data, slaveId); // 设置为人工操作分期标识 districtService.setPersonOperate(masterDistrict.getId()); @@ -3601,9 +3601,9 @@ public class DistrictController { if (model.getId() != null && !model.getId().equals("")) { District slaveDistrict = districtService.findById(model.getId()); District masterDistrict = districtService.findDistrict(new DistrictKey(slaveDistrict.getCity(), - slaveDistrict.getRegion(), slaveDistrict.getMasterDistrictNname()), "district"); + slaveDistrict.getRegion(), slaveDistrict.getMasterDistrictName()), "district"); Map data = new HashMap(); - data.put("masterDistrictNname", null); + data.put("masterDistrictName", null); districtService.updateById(data, model.getId()); // 设置为人工操作分期标识 if (masterDistrict != null) { @@ -3627,7 +3627,7 @@ public class DistrictController { List slaves = districtService.findSlaves(masterDistrict.getCity(), masterDistrict.getRegion(), masterDistrict.getName()); Map data = new HashMap(); - data.put("masterDistrictNname", null); + data.put("masterDistrictName", null); for (District district : slaves) { districtService.updateById(data, district.getId()); } @@ -3654,7 +3654,7 @@ public class DistrictController { params.add(new QueryParam("visible", 0)); params.add(new QueryParam("city", slaveDistrict.getCity())); params.add(new QueryParam("region", slaveDistrict.getRegion())); - params.add(new QueryParam("name", slaveDistrict.getMasterDistrictNname())); + params.add(new QueryParam("name", slaveDistrict.getMasterDistrictName())); List list = districtService.findAllByParams(params); if (list == null || list.size() == 0) { json.setSuccess(false); @@ -3669,18 +3669,18 @@ public class DistrictController { for (District district : slaves) { if (district.getId().equals(slaveId)) { Map data = new HashMap(); - data.put("masterDistrictNname", "master"); + data.put("masterDistrictName", "master"); districtService.updateById(data, district.getId()); // 设置为人工操作分期标识 districtService.setPersonOperate(district.getId()); } else { Map data = new HashMap(); - data.put("masterDistrictNname", slaveDistrict.getName()); + data.put("masterDistrictName", slaveDistrict.getName()); districtService.updateById(data, district.getId()); } } Map data = new HashMap(); - data.put("masterDistrictNname", slaveDistrict.getName()); + data.put("masterDistrictName", slaveDistrict.getName()); districtService.updateById(data, masterDistrict.getId()); } return json; diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/InquiryController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/InquiryController.java index 6e8ae8ffc..c96fd1c20 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/InquiryController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/InquiryController.java @@ -74,6 +74,8 @@ public class InquiryController { role = fjtRoleService.findRolesByName("农行"); }else if(2 == bkoffUsers.getSupportInquiryTask().intValue()){ role = fjtRoleService.findRolesByName("深圳农行"); + }else if(3 == bkoffUsers.getSupportInquiryTask().intValue()){ + role = fjtRoleService.findRolesByName("大正评估"); } List zqUserIds = userCityService.findUserIdByCity("肇庆"); @@ -87,6 +89,8 @@ public class InquiryController { } }else if(vo2.getRole()==16){ userIds.add(vo2.getId()); + }else if(vo2.getRole()==18){ + userIds.add(vo2.getId()); } } diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/LoginController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/LoginController.java index 39d884683..a51c6999c 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/LoginController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/LoginController.java @@ -84,7 +84,7 @@ public class LoginController { return model.redirect("/users/selfEdit"); } else { String forward = StringUtils.defaultIfEmpty(model.getForward(), "/"); - if(forward.endsWith("/login/login")){ + if(forward.contains("/login/login") || forward.contains("/login/index")){ return model.redirect("/"); }else{ return model.redirect(forward); diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/TownshipController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/TownshipController.java new file mode 100644 index 000000000..af225d92a --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/TownshipController.java @@ -0,0 +1,84 @@ +package com.fangjia.bkoff.controllers; + +import com.fangjia.bkoff.model.DevelopmentZoneModel; +import com.fangjia.bkoff.model.JsonModel; +import com.fangjia.bkoff.model.TownshipModel; +import com.fangjia.core.util.ThreadLocalData; +import com.fangjia.core.util.ThreadLocalKey; +import com.fangjia.dal.mongo.model.Township; +import com.fangjia.dal.mongo.model.bkoff.BkoffUsers; +import com.fangjia.service.mongo.bkoff.BkoffUsersService; +import com.fangjia.service.mongo.fangjia.TownshipService; +import org.apache.commons.lang.StringUtils; +import org.sothis.core.util.Pager; + +import java.util.*; + +/** + * Created by dxy on 2015/6/8. + */ +public class TownshipController { + private TownshipService townshipService; + private BkoffUsersService bkoffUsersService; + + public Object listAction(TownshipModel model) { + Pager pager = model.getPager(30); + if (pager.getCurrentPage() > 100) { + pager.setCurrentPage(1); + } + long countDev = townshipService.countTownship(model.getProvince(), model.getCity1(), model.getDistrict(),model.getStreet()); + pager.setTotalRows((int) countDev); + List townships = townshipService.findTownship(model.getProvince(), model.getCity1(), model.getDistrict(),model.getStreet(), pager); + model.setTownshipList(townships); + model.setPager(pager); + return model; + } + + public Object editAction(TownshipModel model) { + if (model.getId() == null) { + return model; + } + + model.setTownship(townshipService.findTownship(model.getId())); + return model; + } + + public Object updateAction(TownshipModel model) { + String userId = (String) ThreadLocalData.getInstance().get(ThreadLocalKey.UserId); + BkoffUsers user = bkoffUsersService.findBkoffUsersById(userId); + JsonModel ret = new JsonModel(); + Map data = new HashMap(); + if (model.getId() != null) { + Map udata = new HashMap(); + if (StringUtils.isNotBlank(model.getAlias())) { + String aliasString = model.getAlias().replaceAll(",", ","); + List alias = Arrays.asList(aliasString.split("\\s*,\\s*")); + udata.put("alias", alias); + } + udata.put("updateTime", new Date()); + //记录操作人员 + udata.put("operator", user.getRealName()); + townshipService.updateTownship(udata, model.getId()); + data.put("msg", "修改成功"); + } + ret.setJsonModel(data); + return ret; + } + + + public void setBkoffUsersService(BkoffUsersService bkoffUsersService) { + this.bkoffUsersService = bkoffUsersService; + } + + public TownshipService getTownshipService() { + return townshipService; + } + + public void setTownshipService(TownshipService townshipService) { + this.townshipService = townshipService; + } + + public BkoffUsersService getBkoffUsersService() { + return bkoffUsersService; + } +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/VillageIdentifyController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/VillageIdentifyController.java new file mode 100644 index 000000000..771eaa2e4 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/VillageIdentifyController.java @@ -0,0 +1,139 @@ +package com.fangjia.bkoff.controllers; + +import com.fangjia.bkoff.model.AverageStatisticsModel; +import com.fangjia.bkoff.model.JsonModel; +import com.fangjia.bkoff.model.VillageIdentifyModel; +import com.fangjia.bkoff.util.ExcelUtils; +import com.fangjia.dal.QueryParam; +import com.fangjia.dal.mongo.model.VillageIdentify; +import com.fangjia.service.mongo.fangjia.VillageIdentifyService; +import org.apache.commons.lang.StringUtils; +import org.sothis.core.util.Pager; +import org.sothis.web.mvc.ActionContext; +import org.sothis.web.mvc.interceptors.MultipartHttpServletRequest; +import org.springframework.core.io.ClassPathResource; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.net.URLEncoder; + +public class VillageIdentifyController { + private VillageIdentifyService villageIdentifyService; + + public Object importResultAction(VillageIdentifyModel model) { + Pager pager = model.getPager(25); + pager.setTotalRows(villageIdentifyService.count(model.getVillageType(), model.getCity1(), model.getAddress())); + model.setVillageIdentifyList(villageIdentifyService.findAll(model.getVillageType(), model.getCity1(), model.getAddress(), pager)); + return model; + } + + public void expectAction(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + + // 编码文件名,避免乱码 + String fileName = "涉农结果导入后台模板.xlsx"; + String encodedFileName = encodeFileName(fileName, request); + + // 设置 Content-Disposition 响应头 + response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedFileName + "\""); + + // 使用 ClassPathResource 来获取资源文件 + ClassPathResource resource = new ClassPathResource(fileName); + InputStream in = resource.getInputStream(); + OutputStream out = response.getOutputStream(); + + byte[] buffer = new byte[1024]; + int bytesRead; + + while ((bytesRead = in.read(buffer)) != -1) { + out.write(buffer, 0, bytesRead); + } + + out.flush(); + + } + + private String encodeFileName(String fileName, HttpServletRequest request) throws IOException { + String userAgent = request.getHeader("User-Agent"); + String encodedFileName; + + if (userAgent.contains("MSIE") || userAgent.contains("Trident")) { + // 针对IE浏览器 + encodedFileName = URLEncoder.encode(fileName, "UTF-8").replace("+", "%20"); + } else { + // 针对其他浏览器 + encodedFileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1"); + } + + return encodedFileName; + } + + public Object uploadAction(HttpServletRequest request) throws IOException { + Object fileInputStream = ActionContext.getContext().getParameters().get("fileInputStream")[0]; + JsonModel ret = new JsonModel(); + Map data = new HashMap(); + Map dataMap = ExcelUtils.read((InputStream) fileInputStream, 0, 0); + List> addressList = dataMap.get("data"); + List> headers = dataMap.get("header"); + + if (!("涉农类型".equals(headers.get(0)) && "地址".equals(headers.get(2)))) { + data.put("msg", "模板错误"); + } else if (addressList.size() > 100000) { + data.put("msg", "该批次数据量超过100000条"); + } else { + //模板正确,数据不超过100000,开始处理数据 + for (List row : addressList) { + + Map updata = new HashMap(); + // 创建一个包含所有key的list + List keys = Arrays.asList( + "villageType", "cityParam", "address", "province", "provinceCode", + "city1", "cityCode", "district", "districtCode", "town", "townCode", + "committee", "committeeCode", "typeCode", "typeName", "verifyFlag", "addrVerify", + "countyLevelCity", "administrativeTowns", "devDistrict", + "devDistrictName", "devLevel", "countyGov", "addrArea" + ); + + // 遍历keys list并从row中获取相应的值放入updata中 + for (int i = 0; i < keys.size(); i++) { + if (i < row.size() && StringUtils.isNotBlank(row.get(i))) { + updata.put(keys.get(i), row.get(i)); + } + } + + // 处理特定情况: cityParam + String cityParam = ""; + if (StringUtils.isNotBlank(row.get(1))) { + cityParam = row.get(1); + updata.put("cityParam", cityParam); + } + + // 添加createTime + updata.put("createTime", new Date()); + List queryParams = new ArrayList(); + queryParams.add(new QueryParam("address", updata.get("address"))); + if ("" != cityParam) { + queryParams.add(new QueryParam("cityParam", cityParam)); + } + queryParams.add(new QueryParam("villageType", updata.get("villageType"))); + // 保存/更新 + villageIdentifyService.updateByparams(updata, queryParams); + } + data.put("msg", "保存成功"); + } + + + ret.setJsonModel(data); + return ret; + } + + public void setVillageIdentifyService(VillageIdentifyService villageIdentifyService) { + this.villageIdentifyService = villageIdentifyService; + } +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/interceptor/FileUploadInterceptor.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/interceptor/FileUploadInterceptor.java new file mode 100644 index 000000000..6d1da882e --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/interceptor/FileUploadInterceptor.java @@ -0,0 +1,35 @@ +package com.fangjia.bkoff.interceptor; + +import org.apache.commons.fileupload.servlet.ServletFileUpload; +import org.sothis.core.beans.Bean; +import org.sothis.core.beans.Scope; +import org.sothis.web.mvc.ActionContext; +import org.sothis.web.mvc.ActionInvocation; +import org.sothis.web.mvc.ActionInvocationException; +import org.sothis.web.mvc.Interceptor; +import org.sothis.web.mvc.interceptors.HttpMultipartException; +import org.sothis.web.mvc.interceptors.MultipartHttpServletRequest; + +import javax.servlet.http.HttpServletRequest; + +/** + * 文件上传拦截器 + * @author wenyan + */ +@Bean(scope = Scope.SINGLETON) +public class FileUploadInterceptor implements Interceptor { + + public Object intercept(ActionInvocation invocation) throws ActionInvocationException { + ActionContext context = invocation.getActionContext(); + HttpServletRequest request = context.getRequest(); + if (ServletFileUpload.isMultipartContent(request)) { + try { + context.setRequest(new MultipartHttpServletRequest(request)); + } catch (HttpMultipartException e) { + throw new ActionInvocationException("error process multipart reqeust: ", e); + } + } + return invocation.invoke(); + } + +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/DevelopmentZoneModel.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/DevelopmentZoneModel.java new file mode 100644 index 000000000..54f85ab42 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/DevelopmentZoneModel.java @@ -0,0 +1,197 @@ +package com.fangjia.bkoff.model; + +import com.fangjia.dal.mongo.model.DevelopmentZone; +import com.fangjia.dal.mongo.model.LatlngPolygon; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public class DevelopmentZoneModel extends BaseModel { + private String id; + private String address; + private String buildDate; + private Date createTime; + private String industry; + private String area; + + private String level; + private String name; + private String alias; +// private List addr_alias; + private String nameEn; + private String province; + private String type; + private String url; + private String district; + + List> shape; + List> bdShape; + + private String block; + + private DevelopmentZone developmentZone; + private List developmentZoneList; + + private String cityName1; + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getBuildDate() { + return buildDate; + } + + public void setBuildDate(String buildDate) { + this.buildDate = buildDate; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getIndustry() { + return industry; + } + + public void setIndustry(String industry) { + this.industry = industry; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNameEn() { + return nameEn; + } + + public void setNameEn(String nameEn) { + this.nameEn = nameEn; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public List> getShape() { + return shape; + } + + public void setShape(List> shape) { + this.shape = shape; + } + + public List> getBdShape() { + return bdShape; + } + + public void setBdShape(List> bdShape) { + this.bdShape = bdShape; + } + + public String getBlock() { + return block; + } + + public void setBlock(String block) { + this.block = block; + } + + public DevelopmentZone getDevelopmentZone() { + return developmentZone; + } + + public void setDevelopmentZone(DevelopmentZone developmentZone) { + this.developmentZone = developmentZone; + } + + public List getDevelopmentZoneList() { + return developmentZoneList; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public void setDevelopmentZoneList(List developmentZoneList) { + this.developmentZoneList = developmentZoneList; + } + + public String getCityName1() { + return cityName1; + } + + public void setCityName1(String cityName1) { + this.cityName1 = cityName1; + } +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/TownshipModel.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/TownshipModel.java new file mode 100644 index 000000000..7de4c3b55 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/TownshipModel.java @@ -0,0 +1,286 @@ +package com.fangjia.bkoff.model; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fangjia.dal.mongo.model.Township; + +import java.util.List; + +public class TownshipModel extends BaseModel { + private String province; + private String city1; + private String district; + private String street; + private String pid; + private String id; + + @JSONField(name = "tjj_province_code") + private String tjjProvinceCode; + + @JSONField(name = "tjj_city_code") + private String tjjCityCode; + + @JSONField(name = "tjj_district_code") + private String tjjDistrictCode; + + @JSONField(name = "tjj_street_code") + private String tjjStreetCode; + + @JSONField(name = "tjj_source_year") + private Integer tjjSourceYear; + + @JSONField(name = "mzb_province_code") + private String mzbProvinceCode; + + @JSONField(name = "mzb_city_code") + private String mzbCityCode; + + @JSONField(name = "mzb_district_code") + private String mzbDistrictCode; + + @JSONField(name = "mzb_district_name") + private String mzbDistrictName; + + @JSONField(name = "mzb_street_code") + private String mzbStreetCode; + + private String type; + + + private String alias; + + + @JSONField(name = "street_pinyin") + private String streetPinyin; + + //民政部区域和统计局区域是否相同,1为相同,0为不同,为了解决2条的问题 + @JSONField(name = "district_diff") + private Integer districtDiff; + + + //乡镇街道是否输出 0:不输出 1:输出 + @JSONField(name = "street_output") + private Integer streetOutput; + + + @JSONField(name = "province_short") + private String provinceShort; + + @JSONField(name = "city_short") + private String cityShort; + + @JSONField(name = "district_short") + private String districtShort; + + private Township township; + private List townshipList; + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getPid() { + return pid; + } + + public void setPid(String pid) { + this.pid = pid; + } + + public String getTjjProvinceCode() { + return tjjProvinceCode; + } + + public void setTjjProvinceCode(String tjjProvinceCode) { + this.tjjProvinceCode = tjjProvinceCode; + } + + public String getTjjCityCode() { + return tjjCityCode; + } + + public void setTjjCityCode(String tjjCityCode) { + this.tjjCityCode = tjjCityCode; + } + + public String getTjjDistrictCode() { + return tjjDistrictCode; + } + + public void setTjjDistrictCode(String tjjDistrictCode) { + this.tjjDistrictCode = tjjDistrictCode; + } + + public String getTjjStreetCode() { + return tjjStreetCode; + } + + public void setTjjStreetCode(String tjjStreetCode) { + this.tjjStreetCode = tjjStreetCode; + } + + public Integer getTjjSourceYear() { + return tjjSourceYear; + } + + public void setTjjSourceYear(Integer tjjSourceYear) { + this.tjjSourceYear = tjjSourceYear; + } + + public String getMzbProvinceCode() { + return mzbProvinceCode; + } + + public void setMzbProvinceCode(String mzbProvinceCode) { + this.mzbProvinceCode = mzbProvinceCode; + } + + public String getMzbCityCode() { + return mzbCityCode; + } + + public void setMzbCityCode(String mzbCityCode) { + this.mzbCityCode = mzbCityCode; + } + + public String getMzbDistrictCode() { + return mzbDistrictCode; + } + + public void setMzbDistrictCode(String mzbDistrictCode) { + this.mzbDistrictCode = mzbDistrictCode; + } + + public String getMzbDistrictName() { + return mzbDistrictName; + } + + public void setMzbDistrictName(String mzbDistrictName) { + this.mzbDistrictName = mzbDistrictName; + } + + public String getMzbStreetCode() { + return mzbStreetCode; + } + + public void setMzbStreetCode(String mzbStreetCode) { + this.mzbStreetCode = mzbStreetCode; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + public String getStreetPinyin() { + return streetPinyin; + } + + public void setStreetPinyin(String streetPinyin) { + this.streetPinyin = streetPinyin; + } + + public Integer getDistrictDiff() { + return districtDiff; + } + + public void setDistrictDiff(Integer districtDiff) { + this.districtDiff = districtDiff; + } + + public Integer getStreetOutput() { + return streetOutput; + } + + public void setStreetOutput(Integer streetOutput) { + this.streetOutput = streetOutput; + } + + public String getProvinceShort() { + return provinceShort; + } + + public void setProvinceShort(String provinceShort) { + this.provinceShort = provinceShort; + } + + public String getCityShort() { + return cityShort; + } + + public void setCityShort(String cityShort) { + this.cityShort = cityShort; + } + + public String getDistrictShort() { + return districtShort; + } + + public void setDistrictShort(String districtShort) { + this.districtShort = districtShort; + } + + public String getCity1() { + return city1; + } + + public void setCity1(String city1) { + this.city1 = city1; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public Township getTownship() { + return township; + } + + public void setTownship(Township township) { + this.township = township; + } + + public List getTownshipList() { + return townshipList; + } + + public void setTownshipList(List townshipList) { + this.townshipList = townshipList; + } +} + diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/VillageIdentifyModel.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/VillageIdentifyModel.java new file mode 100644 index 000000000..40c172b33 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/VillageIdentifyModel.java @@ -0,0 +1,365 @@ +package com.fangjia.bkoff.model; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fangjia.dal.mongo.model.Township; +import com.fangjia.dal.mongo.model.VillageIdentify; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.web.multipart.MultipartFile; + +import javax.xml.crypto.Data; +import java.util.List; +import java.util.Date; + +public class VillageIdentifyModel extends BaseModel { + private String province; + private String city1; + private String district; + private String town; + private String committee; + private String type; + private String provinceCode; + private String cityCode; + private String districtCode; + private String townCode; + private String committeeCode; + private String typeCode; + private String typeName; + private String verifyFlag;//涉农标识 + private String addrVerify;//地址是否有效信息 + + private String countyLevelCity;//是否为县级市 + private String administrativeTowns;//是否市辖建制镇 + private String countyGov;//是否为县政府 + private String devDistrict;//是否为开发区 + private String devDistrictName;//开发区 + private String devLevel;//开发区等级 + + private Double lat; + private Double lng; + + private String addrArea; + + + //测试时使用 + private String splitCommittee; + private String splitStreet; + private String poiName; + private String splitStreetNum; + private String dev; + private String communitySource;//居委来源 + private String matchPoiName;//匹配poi的名称 + private String regionInfo;//围栏区域信息 + + private String tjjDistrictName; + + private Date createTime; + private String villageType; + private MultipartFile file; + private List villageIdentifyList; + private String address; + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity1() { + return city1; + } + + public void setCity1(String city1) { + this.city1 = city1; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getTown() { + return town; + } + + public void setTown(String town) { + this.town = town; + } + + public String getCommittee() { + return committee; + } + + public void setCommittee(String committee) { + this.committee = committee; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getProvinceCode() { + return provinceCode; + } + + public void setProvinceCode(String provinceCode) { + this.provinceCode = provinceCode; + } + + public String getCityCode() { + return cityCode; + } + + public void setCityCode(String cityCode) { + this.cityCode = cityCode; + } + + public String getDistrictCode() { + return districtCode; + } + + public void setDistrictCode(String districtCode) { + this.districtCode = districtCode; + } + + public String getTownCode() { + return townCode; + } + + public void setTownCode(String townCode) { + this.townCode = townCode; + } + + public String getCommitteeCode() { + return committeeCode; + } + + public void setCommitteeCode(String committeeCode) { + this.committeeCode = committeeCode; + } + + public String getTypeCode() { + return typeCode; + } + + public void setTypeCode(String typeCode) { + this.typeCode = typeCode; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getVerifyFlag() { + return verifyFlag; + } + + public void setVerifyFlag(String verifyFlag) { + this.verifyFlag = verifyFlag; + } + + public String getAddrVerify() { + return addrVerify; + } + + public void setAddrVerify(String addrVerify) { + this.addrVerify = addrVerify; + } + + public String getCountyLevelCity() { + return countyLevelCity; + } + + public void setCountyLevelCity(String countyLevelCity) { + this.countyLevelCity = countyLevelCity; + } + + public String getAdministrativeTowns() { + return administrativeTowns; + } + + public void setAdministrativeTowns(String administrativeTowns) { + this.administrativeTowns = administrativeTowns; + } + + public String getCountyGov() { + return countyGov; + } + + public void setCountyGov(String countyGov) { + this.countyGov = countyGov; + } + + public String getDevDistrict() { + return devDistrict; + } + + public void setDevDistrict(String devDistrict) { + this.devDistrict = devDistrict; + } + + public String getDevDistrictName() { + return devDistrictName; + } + + public void setDevDistrictName(String devDistrictName) { + this.devDistrictName = devDistrictName; + } + + public String getDevLevel() { + return devLevel; + } + + public void setDevLevel(String devLevel) { + this.devLevel = devLevel; + } + + public Double getLat() { + return lat; + } + + public void setLat(Double lat) { + this.lat = lat; + } + + public Double getLng() { + return lng; + } + + public void setLng(Double lng) { + this.lng = lng; + } + + public String getAddrArea() { + return addrArea; + } + + public void setAddrArea(String addrArea) { + this.addrArea = addrArea; + } + + public String getSplitCommittee() { + return splitCommittee; + } + + public void setSplitCommittee(String splitCommittee) { + this.splitCommittee = splitCommittee; + } + + public String getSplitStreet() { + return splitStreet; + } + + public void setSplitStreet(String splitStreet) { + this.splitStreet = splitStreet; + } + + public String getPoiName() { + return poiName; + } + + public void setPoiName(String poiName) { + this.poiName = poiName; + } + + public String getSplitStreetNum() { + return splitStreetNum; + } + + public void setSplitStreetNum(String splitStreetNum) { + this.splitStreetNum = splitStreetNum; + } + + public String getDev() { + return dev; + } + + public void setDev(String dev) { + this.dev = dev; + } + + public String getCommunitySource() { + return communitySource; + } + + public void setCommunitySource(String communitySource) { + this.communitySource = communitySource; + } + + public String getMatchPoiName() { + return matchPoiName; + } + + public void setMatchPoiName(String matchPoiName) { + this.matchPoiName = matchPoiName; + } + + public String getRegionInfo() { + return regionInfo; + } + + public void setRegionInfo(String regionInfo) { + this.regionInfo = regionInfo; + } + + public String getTjjDistrictName() { + return tjjDistrictName; + } + + public void setTjjDistrictName(String tjjDistrictName) { + this.tjjDistrictName = tjjDistrictName; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getVillageType() { + return villageType; + } + + public void setVillageType(String villageType) { + this.villageType = villageType; + } + + public MultipartFile getFile() { + return file; + } + + public void setFile(MultipartFile file) { + this.file = file; + } + + public List getVillageIdentifyList() { + return villageIdentifyList; + } + + public void setVillageIdentifyList(List villageIdentifyList) { + this.villageIdentifyList = villageIdentifyList; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } +} + diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/util/ExcelUtils.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/util/ExcelUtils.java new file mode 100644 index 000000000..bc9974c76 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/util/ExcelUtils.java @@ -0,0 +1,148 @@ +package com.fangjia.bkoff.util; + +import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import org.apache.commons.lang.StringUtils; +import org.apache.poi.ss.formula.eval.ErrorEval; +import org.apache.poi.ss.usermodel.*; + +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * excel读写工具类 + * + * @author shenjian + * @since 2021/07/12 + */ +public class ExcelUtils { + public static Map read(InputStream inputStream, int sheetIndex, int skipRow) { + // sheetIndex sheet下标 + // skipRow 跳过的表头行数 + Map map = new HashMap(); + List> ret = new ArrayList>(); + InputStream inp = null; + try { + inp = inputStream; + BufferedInputStream bufferedInputStream = new BufferedInputStream(inp, 1024 * 200); + Workbook workbook = WorkbookFactory.create(bufferedInputStream); + workbook.setForceFormulaRecalculation(true); + Sheet sheet = workbook.getSheetAt(sheetIndex); + //行号 + int rowIndex = 0; + for (Row row : sheet) { + rowIndex++; + if (rowIndex <= skipRow) { + continue; + } + short minColIx = 0; + short maxColIx = row.getLastCellNum(); + List rowData = new ArrayList(); + for (short colIx = minColIx; colIx < maxColIx; colIx++) { + Cell cell = row.getCell(colIx); + if (cell == null) { + rowData.add(colIx, null); + } else { + if (StringUtils.isNotBlank(cell.toString())) { + rowData.add(getCellValue(cell).toString()); + }else { + rowData.add(""); + } + } + } + ret.add(rowData); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (inp != null) { + try { + inp.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + map.put("header", ret.subList(0, 1).get(0)); + map.put("data", ret.subList(1, ret.size())); + return map; + } + + public static Object getCellValue(Cell cell) { + switch (cell.getCellType()) { + case Cell.CELL_TYPE_BLANK: + return null; + case Cell.CELL_TYPE_BOOLEAN: + return cell.getBooleanCellValue(); + case Cell.CELL_TYPE_ERROR: + + return ErrorEval.getText(cell.getErrorCellValue()); + case Cell.CELL_TYPE_FORMULA: + try { + return cell.getNumericCellValue(); + } catch (Exception e) { + try { + return cell.getStringCellValue(); + } catch (Exception ex) { + return cell.getRichStringCellValue().getString(); + } + } + case Cell.CELL_TYPE_NUMERIC: + if (org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(cell)) { + return cell.getDateCellValue(); + } + return cell.getNumericCellValue(); + case Cell.CELL_TYPE_STRING: + return cell.getStringCellValue(); + default: + return null; + } + } + + public static class SimpleExcelListener extends AnalysisEventListener { + private List> dataList = new ArrayList>(); + private List headers = new ArrayList(); + + @Override + public void invoke(Object o, AnalysisContext analysisContext) { + Map map = (Map) o; + dataList.add(new ArrayList(map.values())); + } + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + for (Object val : headMap.values()) { + headers.add((String) val); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + + } + + List> getDataList() { + return dataList; + } + + void setDataList(List> dataList) { + this.dataList = dataList; + } + + public List getHeaders() { + return headers; + } + + public void setHeaders(List headers) { + this.headers = headers; + } + } +} diff --git a/projects/fangjia-bkoff/src/main/resources/ftl/city.ftl b/projects/fangjia-bkoff/src/main/resources/ftl/city.ftl index b72f6b106..0a6ac6c87 100644 --- a/projects/fangjia-bkoff/src/main/resources/ftl/city.ftl +++ b/projects/fangjia-bkoff/src/main/resources/ftl/city.ftl @@ -9,7 +9,7 @@
diff --git a/projects/fangjia-bkoff/src/main/resources/sothis.properties b/projects/fangjia-bkoff/src/main/resources/sothis.properties index 46c1ca032..5e138d238 100644 --- a/projects/fangjia-bkoff/src/main/resources/sothis.properties +++ b/projects/fangjia-bkoff/src/main/resources/sothis.properties @@ -4,7 +4,7 @@ sothis.viewResolver.class=org.sothis.web.mvc.DefaultModelAndViewResolver sothis.actionMapper.class=org.sothis.web.mvc.DefaultActionMapper sothis.interceptors.params.class=org.sothis.web.mvc.interceptors.ParametersInterceptor -sothis.interceptors.upload.class=org.sothis.web.mvc.interceptors.FileUploadInterceptor +sothis.interceptors.upload.class=com.fangjia.bkoff.interceptor.FileUploadInterceptor sothis.interceptors.auth.class=com.fangjia.bkoff.interceptor.AuthInterceptor sothis.interceptors.stack.default=upload,params,auth diff --git a/projects/fangjia-bkoff/src/main/resources/娑夊啘缁撴灉瀵煎叆鍚庡彴妯℃澘.xlsx b/projects/fangjia-bkoff/src/main/resources/娑夊啘缁撴灉瀵煎叆鍚庡彴妯℃澘.xlsx new file mode 100644 index 000000000..f43174e2b Binary files /dev/null and b/projects/fangjia-bkoff/src/main/resources/娑夊啘缁撴灉瀵煎叆鍚庡彴妯℃澘.xlsx differ diff --git a/projects/fangjia-bkoff/src/main/webapp/apiUser/add.ftl b/projects/fangjia-bkoff/src/main/webapp/apiUser/add.ftl index 29ae67e83..2f3071de2 100644 --- a/projects/fangjia-bkoff/src/main/webapp/apiUser/add.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/apiUser/add.ftl @@ -1,169 +1,207 @@ <#ftl attributes={"content_type":"text/html; charset=UTF-8"}> <#compress> - - - - - api鐢ㄦ埛鏂板 - - <#include "/common_js.ftl" /> - - - - <#include "/layout/header.ftl" /> -
-${msg!''} - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 鏍忎綅 - - 鍊� -
鏄电О
鐢ㄦ埛鍚�
瀵嗙爜
璐︽埛绫诲瀷 - -
璐︽埛鐢ㄩ�� - -
鏄惁鐩戞帶 - 涓嶇洃鎺� - 鐩戞帶 -
Email
閿�鍞礋璐d汉
鍏徃
浼颁环璋冩暣姣旂巼(娉ㄦ剰:璁剧疆璇ュ弬鏁板悗浼颁环鎺ュ彛鐨勮繑鍥炰环鏍煎皢涔樹互璇ョ郴鏁�)
siteName
鍒版湡鏃堕棿
ip鍦板潃(姣忚涓�涓狪P鍦板潃)
-
-
- + + + <#include "/layout/header.ftl" /> +
+ ${msg!''} + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 鏍忎綅 + + 鍊� +
鏄电О
鐢ㄦ埛鍚�
瀵嗙爜
璐︽埛绫诲瀷 + +
璐︽埛鐢ㄩ�� + +
鏄惁鐩戞帶 + 涓嶇洃鎺� + 鐩戞帶 +
Email
閿�鍞礋璐d汉
鍏徃
浼颁环璋冩暣姣旂巼(娉ㄦ剰:璁剧疆璇ュ弬鏁板悗浼颁环鎺ュ彛鐨勮繑鍥炰环鏍煎皢涔樹互璇ョ郴鏁�) +
siteName
鍒版湡鏃堕棿
ip鍦板潃(姣忚涓�涓狪P鍦板潃) +
+
+
+ - - + function getRandomElement(arr) { + return arr[parseInt(Math.random() * arr.length)]; + } + + function createPassword() { + var password = ""; + + // 纭繚鑷冲皯鍖呭惈涓�涓壒娈婂瓧绗� + password += getRandomElement(special); + + // 闅忔満閫夋嫨鍏朵綑7涓瓧绗� + for (var i = 0; i < 7; i++) { + password += getRandomElement(numAndengAndENGAndSpecial); + } + + // 灏嗙敓鎴愮殑瀵嗙爜鎵撲贡椤哄簭 + password = password.split('').sort(() => 0.5 - Math.random()).join(''); + + return password; + } + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl b/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl index 893f21d79..4f5ec9781 100644 --- a/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl @@ -12,9 +12,9 @@ + + + + <#include "/layout/header.ftl"/> +
+
+
+
+ + + 涓嬭浇妯℃澘 +
+
+
+ 娑夊啘绫诲瀷锛� + + 鍩庡競锛� + + + 鍦板潃锛� + + +
+
+ <#if villageIdentifyList??> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#if (villageIdentifyList??&&villageIdentifyList?size>0)> + <#list villageIdentifyList as it> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
娑夊啘绫诲瀷鍩庡競(鍙傛暟)鍦板潃鐪佷唤鐪佷唤缂栫爜鍩庡競鍩庡競缂栫爜鍖哄幙鍖哄幙缂栫爜涔¢晣琛楅亾涔¢晣琛楅亾缂栫爜灞呭灞呭缂栫爜鍩庝埂缂栫爜鍩庝埂鍒嗙被娑夊啘鏍囪瘑鍦板潃楠岃瘉鏄惁鍘跨骇甯�鏄惁甯傝緰寤哄埗闀�鏄惁寮�鍙戝尯寮�鍙戝尯鍚嶇О寮�鍙戝尯绾у埆鏄惁鍘挎斂搴�鎵�灞炲尯鍩�鏃堕棿
${it.villageType!}${it.cityParam!}${it.address!}${it.province!}${it.provinceCode!}${it.city1!}${it.cityCode!}${it.district!}${it.districtCode!}${it.town!}${it.townCode!}${it.committee!}${it.committeeCode!}${it.typeCode!}${it.typeName!}${it.verifyFlag!}${it.addrVerify!}${it.countyLevelCity!}${it.administrativeTowns!}${it.devDistrict!}${it.devDistrictName!}${it.devLevel!}${it.countyGov!}${it.addrArea!}${it.createTime?string("yyyy-MM-dd")}
+ + <#if pager??> + <@d_pager action = "base" currentPage = pager.currentPage controller = "villageIdentify" totalPages = pager.totalPages/> + +
+
+ + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/yugudan/add.ftl b/projects/fangjia-bkoff/src/main/webapp/yugudan/add.ftl index 1a2c42cf1..10353a22b 100644 --- a/projects/fangjia-bkoff/src/main/webapp/yugudan/add.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/yugudan/add.ftl @@ -1085,7 +1085,7 @@ html { - + + + + + - -
-
CPDB-鍏ㄥ浗鎴夸环鎸囨暟
-
-
- <#list cityStats! as stat> - ${stat.city}锛�${stat.avgPrice}鍏�/銕� - + +<#include "/header/v6/_header.ftl"/> + +
+
+
+
+

+

+

鑷缓涓浗鍦板潃/鎴夸骇澶ф暟鎹簱CPDB锛圕hina Property Database锛夛紝

+

鍖呭惈鍦板潃搴撱�佹ゼ鐩樺簱銆佸晢閾恒�佸啓瀛楁ゼ绛変俊鎭殑鏁版嵁瀛楀吀锛岀敤浜庡瓨鍌ㄥ拰绠$悊妤肩洏淇℃伅銆�

+

閫氳繃鍦板潃鏍囧噯鍖栨媶鍒嗗姞涓奊PS鍧愭爣锛屽疄鐜板湴鍧�浠峰�肩簿鍑嗗尮閰嶃��

+ + +
- -
-
-
- CPDB-涓浗鎴夸骇澶ф暟鎹簱 - - CPDB锛圕hina Property Data Base锛夋槸鐢辨埧浠风綉閫氳繃10骞寸Н绱�鍜屽浗闄呴鍏堢殑涓撳埄鎶�鏈�锛圤LKD锛夛紝鎵撻�犵殑绮剧‘鍒版瘡涓�鎴锋埧浜у井瑙傛暟鎹殑鈥滀腑鍥戒笉鍔ㄤ骇澶ф暟鎹簱鈥濄�� -
CPDB鐨勬暟鎹鐩栧叏鍥�300涓�鍩庡競銆�30涓�妤肩洏锛屾嫢鏈�5000涓囧鎴夸骇鐨勪釜鎬у寲寰鏁版嵁锛岄潻鍛芥�х殑瀹炵幇浜嗏��涓�鎴蜂竴淇℃伅鈥濓紝鏄洰鍓嶄腑鍥芥渶澶с�佹渶涓撲笟銆佹渶瀹炴椂鐨勪笉鍔ㄤ骇寰鏁版嵁搴撱�� -
- - CPDB涓殑鎴夸骇澶ф暟鎹簲鐢ㄥ箍娉涳紝澶氬勾鏉ュ悜鍚勫ぇ閾惰銆佹斂搴滄満鏋勫強浜掕仈缃戦噾铻嶇瓑鎻愪緵闈炲父鏈変环鍊肩殑鏁版嵁浜у搧鍜屾湇鍔★紝浠ュ叾鏉冨▉鎬у拰褰卞搷鍔涙垚涓烘埧浜уぇ鏁版嵁棰嗗煙鐨勬爣鏉嗐�� - - - 鎴垮湴浜уぇ鏁版嵁鍏嶈垂浣撻獙>> - -
- -
- 璋佸湪浣跨敤CPDB - 閾�  琛�  - 鐢靛晢骞冲彴 - 璐锋鍏徃 - 璇勪及鏈烘瀯 - 鎴夸骇钀ラ攢鏈烘瀯 - 杞欢鍏徃 - 閲戣瀺绫荤綉绔� - 浼氬憳涓績 -
- -
- CPDB搴旂敤 - CPDB搴旂敤 -
- 鎴夸环鍖归厤 - 杩涜鍦板潃鍖归厤鎴夸环 - 绮惧噯鍖归厤銆佷竴鎴蜂竴浠� +
+

鐥涚偣涓庢寫鎴�

+
+
+
+ 鏁版嵁淇℃伅
-
- 鎴垮湴浜ц惀閿�绛栧垝 - 鎴垮湴浜у競鍦哄垎鏋愬強钀ラ攢绛栧垝 - 鎴垮湴浜ч攢鍞緟鍔� -
-
- 璐锋椋庢帶 - 璐锋椋庨櫓鎺у埗浣撶郴 - 璐峰悗缁煎悎绠$悊 -
-
- 鏁版嵁妞嶅叆 - 灏嗘暟鎹鍏ュ鎴疯蒋浠� - 涓庡獟浣撶殑鏁版嵁妞嶅叆 -
-
- 骞垮憡绮惧噯钀ラ攢 - 鍟嗕笟DM绮惧噯鎶曢�� - 閲戣瀺浜у搧绮惧噯钀ラ攢 -
-
- 瀹氬埗瑙e喅鏂规 - 鏍规嵁瀹㈡埛闇�姹傦紝杩涜鏁版嵁鐨勪簩娆℃寲鎺樺拰鍒嗘瀽锛屼粠鑰屽紑鍙戝拰瀹氬埗涓撲笟杞欢 +
+

甯傞潰涓婄殑鎴夸骇鏁版嵁鏉ユ簮澶氱澶氭牱锛屾棤鏍囨潌鍨嬫暟鎹湇鍔″叕鍙搞��

- -
- CPDB鏋勬垚鍥� -
- 浜戝瓨鍌� - 浜戣绠� - 搴旂敤浜庡悇绉嶉渶姹� - CPDB -
- 鍘熷鏁版嵁閲囬泦 - 浜掕仈缃戞捣閲忔暟鎹姄鍙� - 绗笁鏂规暟鎹笭閬� - 鍚堜綔鏈烘瀯涓撲笟鏁版嵁 -
-
- 鏁版嵁娓呮礂 - 鍘婚櫎閲嶅銆佹棤鏁堢殑鏁版嵁锛屽苟杩涜姊崇悊 -
-
- 鏁版嵁鍏宠仈 - 鏍规嵁闇�姹傚鏁版嵁杩涜鍖归厤鍜屽叧鑱� -
-
- 鏁版嵁鎸栨帢 - 涓撳埄OLKD 鎶�鏈紝瀵规暟鎹繘琛屽畾鍚戞悳绱㈠拰鎸栨帢锛屽苟娣卞叆鍒嗘瀽銆佸鐞� -
+
+
+
+
闅句互鍒嗚鲸鍑嗙‘鎬�
+
+
+

鎴夸骇鏁版嵁缁村害澶氥�佹潅涔憋紝鏃犳硶寰楀埌绮惧噯澶氬厓鏁版嵁锛屽苟杩涜鏁村悎銆�

- -
- CPDB 鈥滀笉鍔ㄤ骇澶ф暟鎹簱鈥濅紭鍔� -
-
- 瑕嗙洊闈㈠箍 - 鏁版嵁搴撶洰鍓嶅凡瑕嗙洊鍏ㄥ浗300涓煄甯傦紝30涓囦釜妤肩洏 - 5000涓囧鎴夸骇寰鏁版嵁锛屽疄鐜扳�滀竴鎴蜂竴淇℃伅鈥� - 鎷ユ湁6500涓囨潯浼颁环璁板綍銆�200涓囧紶灏忓尯鍥剧墖 -
-
- 鏁版嵁绮惧噯 - 鑷富鐮斿彂鐨勫畾鍚戞悳绱㈠強鏁版嵁鎸栨帢(OLKD)涓撳埄鎶�鏈� - 鏅鸿兘鍖栦簯璁$畻绯荤粺 - 涓板瘜鐨勬暟鎹簮娓犻亾 - 璧勬繁鎵т笟璇勪及甯堝悎浣滃洟闃� - 寮哄ぇ瀹㈡湇鍥㈤槦鏍稿噯銆佹牎楠屾満鍒� -
-
- 瀹炴椂鏈夋晥 - 鍙叉棤鍓嶄緥鐨勬埧浜ф暟鎹疄鏃舵洿鏂版妧鏈� - 姣忔棩鏁版嵁鏇存柊閲忚揪瓒呰繃20涓囨潯 - 楂樻晥鐨勫兊灏告暟鎹瓫閫夌郴缁� -
+
+
+ 鑳藉姏钖勫急 +
+
+

鎴夸骇鏁版嵁绯荤粺澶勭悊鑳藉姏钖勫急锛屾暟鎹搷搴旈�熷害杈句笉鍒拌姹傘��

- -
- 鍥㈤槦浠嬬粛 -
- 楂樻柊鎶�鏈洟闃�   璧板湪鍥介檯鍓嶆部 - - 1CPDB鎷ユ湁寮哄ぇ鐨�鎶�鏈洟闃�锛屽叾鏍稿績鎶�鏈汉鍛樻潵鑷叏鐞冭憲鍚嶄紒涓氾紝鎷ユ湁涓栫晫绾ч珮鏂版妧鏈�傜敱CPDB鎶�鏈簿鑻辫嚜涓荤爺鍙戠殑瀹氬悜鎼滅储鍙婃暟鎹寲鎺橈紙OLKD锛夋妧鏈紝宸茶幏寰楀浗瀹朵笓鍒╋紝鍙鍏ㄤ簰鑱旂綉娴烽噺鏁版嵁杩涜鎼滈泦鏁寸悊鍜屾繁搴﹀垎鏋愶紝涓斿簲鐢ㄥ箍娉涖�� -
2CPDB鎷ユ湁涓氬唴棰嗗厛鐨�鍐呭鍥㈤槦锛屽叿澶囦赴瀵岀殑琛屼笟缁忛獙锛屼汉宸ヤ粙鍏ユ暟鎹殑瀹℃牳鍙婃牎楠岋紝鏃跺埢鐩戞帶鏁版嵁鐨勭簿鍑嗘�с�� -
3CPDB鐨�鍟嗗姟杩愯惀鍥㈤槦瀹炲姏瓒呯兢锛岄�氳繃涓庡悇绫诲浗闄呯煡鍚嶄紒涓氱殑鍚堜綔锛屼笉鏂赴瀵孋PDB鐨勬暟鎹簮锛屽悓鏃朵篃灏咰PDB鎺ㄥ箍銆佸簲鐢ㄥ埌鏇村鐨勯鍩熴�� -
- - 鏇村鎴夸骇澶ф暟鎹粙缁嶈鐐瑰嚮鏌ョ湅>> - -
-
-
- -
-
-
    -
  • 鍜ㄨ鐢佃瘽锛�021-62391139
  • - -
  • -
  • 鍟嗗姟鍚堜綔锛岃鎻愪氦淇℃伅鑾峰緱浜у搧浣撻獙
  • -
  • *濮撳悕:
  • -
  • *鍏徃:
  • -
  • *鐢甸偖:
  • -
  • *鎵嬫満:
  • -
  • 鎮ㄧ殑淇℃伅宸叉彁浜ゆ垚鍔燂紒
  • -
  • 鎴戜滑浼氬敖蹇仈绯绘偍锛�
  • -
  • 鎮ㄤ篃鍙洿鎺ユ嫧鎵撶數璇�
  • -
  • 021-62391139
  • -
  • 鎻愪氦
  • -
-
- -
-
-
-
CPDB鏁版嵁绉嶇被
-
- 绮惧噯浼颁环鏁版嵁 -
    -
  • 瑕嗙洊鍏ㄥ浗300涓煄甯傘��30涓囦釜灏忓尯
  • -
  • 绱6500涓囨潯浼颁环璁板綍
  • -
  • 涓�鎴蜂竴浠风殑绮惧噯璇勪及
  • -
-
-
- 浣忓畢鐗╀笟淇℃伅 -
    -
  • 妤肩洏鍧囦环
  • -
  • 妤肩洏绉熼噾
  • -
  • 妤肩洏璇︽儏
  • -
  • 妤兼爧淇℃伅
  • -
  • 鎴愪氦璁板綍
  • -
  • 鎴愪氦鏁版嵁缁熻
  • -
  • 鎴夸环璧板娍
  • -
  • 鍦板浘灞曠ず
  • -
  • 鍏稿瀷鎴挎簮
  • -
  • 鎸傜墝鎴挎簮缁熻
  • -
  • 妤肩洏鐜鍒嗘瀽
  • -
  • 涓撲笟鍒嗘瀽鎶ュ憡
  • -
  • 妤肩洏鍥剧墖搴擄紙瓒呰繃200涓囧紶锛�
  • -
-
-
- 鍟嗕笟鍦颁骇淇℃伅 -
    -
  • 鍦板浘瀹氫綅
  • -
  • 鍟嗛摵\鍐欏瓧妤煎潎浠�
  • -
  • 鍟嗛摵\鍐欏瓧妤肩閲�
  • -
  • 鍟嗛摵\鍐欏瓧妤艰鎯�
  • -
  • 娑堣垂鑳藉姏鍒嗘瀽
  • -
  • 绔炰簤瀵规墜鎯呮姤
  • -
-
-
- 鍩庡競鎴夸骇琛屾儏 -
    -
  • 鍩庡競鎴夸骇鍧囦环
  • -
  • 鍩庡競鎴夸骇鍧囦环璧板娍
  • -
  • 鍩庡競鎴夸环娑ㄨ穼骞�
  • -
-
-
- 钀ラ攢鏈嶅姟 -
    -
  • 鐩爣瀹㈡埛鍖归厤
  • -
  • 瀹㈡埛琛屼负鍒嗘瀽
  • -
  • 钀ラ攢鍐崇瓥杈呭姪
  • -
  • 甯傚満鎺ㄥ箍鍙傝��
  • -
-
-
- 鐮旂┒棰嗗煙 -
    -
  • 鎴夸环鍘嗗彶鏁版嵁鏌ヨ
  • -
  • 鍦板煙鎴垮湴浜х患鍚堝垎鏋�
  • -
-
-
-
-
-
-
-
-
-
-
-
- - +
+

鏁版嵁缁村害灞曠ず

+
+
+
琛屾斂鍖哄垝搴�
+
鍏ㄥ浗367涓煄甯�/鍦板尯鐨勮鏀垮尯鍒掍俊鎭強琛屾斂浠g爜搴�
+
+
1

鐪佺骇琛屾斂鍖�

+
2

鍦扮骇琛屾斂鍖�

+
3

鍖�(鍘�)绾ц鏀垮尯

+
4

涔¢晣琛楅亾琛屾斂鍖�

+
5

琛屾斂鍖哄垝浠g爜搴�

+
+
+
+
鍦板潃鏁版嵁搴�
+
瑕嗙洊鍏ㄥ浗鐨勫湴鍧�澶ф暟鎹簱锛屾暟鎹粨鏋勬爣鍑嗐�侀绮掑害绮剧粏锛屽湴鍧�鍖归厤鑳藉姏琛屼笟棰嗗厛
+
+
1

鍏ㄥ浗鍦板潃搴�

+
2

鍦板潃鍒悕搴�

+
3

鍦扮悊鍧愭爣搴�

+
4

POI鏁版嵁搴�

+
5

娑夊啘鍦板潃鏍囩

+
+
+
+
妤肩洏瀛楀吀
+
渚濇墭鍥藉唴绾夸笂鎴夸骇浼板�煎钩鍙版埧浠风綉锛屽崄涓冨勾鍏ㄥ浗鎴夸骇鏁版嵁绉疮锛屼笓涓氫笓娉�
+
+
1

灏忓尯鍩虹淇℃伅

+
2

灏忓尯鍧愭爣淇℃伅

+
3

灏忓尯鍥存爮淇℃伅

+
4

灏忓尯鐗瑰緛鏍囩

+
5

灏忓尯鍛ㄨ竟淇℃伅

+
+
+
+
鍟嗕笟鍦颁骇搴�
+
鍏ㄥ浗鍟嗕笟鍦颁骇澶ф暟鎹簱锛岃В鍐冲悕鍧�鍖归厤绛夐毦棰�
+
+
1

鍐欏瓧妤煎熀纭�淇℃伅

+
2

鍐欏瓧妤煎潗鏍囦綅缃�

+
3

鍟嗛摵鍩虹淇℃伅

+
4

鍟嗛摵鍧愭爣浣嶇疆

+
5

鍟嗛摵缁忚惀涓氭��

+
+
+
+
甯傚満鍔ㄦ�佹暟鎹�
+
鑷�2006骞翠互鏉ョ殑鏃堕棿搴忓垪甯傚満鍔ㄦ�佹暟鎹Н绱紝鏁版嵁澶氬厓涓板瘜锛屾弧瓒充笉鍚屽満鏅渶姹�
+
+
1

鍩庡競/鍖哄煙/妤肩洏鎴夸环璧板娍

+
2

鍏ㄥ浗鍩庡競浣忓畢浠锋牸鎸囨暟

+
3

鍏ㄥ浗鎴夸骇鍧囦环/涓�鎴夸竴浠�

+
4

鍏ㄥ浗鎴夸骇绉熼噾浠锋牸鏁版嵁

+
5

鍏ㄥ浗鎴夸骇鍑虹/鍑哄敭鏍锋湰

+
6

鍏ㄥ浗浜屾墜鎴夸綇瀹呮垚浜ゆ暟鎹�

+
7

鍏ㄥ浗鎴夸骇鍙告硶娉曟媿鏁版嵁

+
8

鍏ㄥ浗鎴夸骇璇勪及妗堜緥鏍锋湰

+
+
- -<#assign NO_TOOL=true> -<#include "/header/v5/_footer.ftl" /> - - -<#include "/analytics.ftl" /> + +<#include "/header/v6/_footer.ftl"/> + + + \ No newline at end of file diff --git a/projects/fangjia-coresite/src/main/webapp/baidu_analysis.ftl b/projects/fangjia-coresite/src/main/webapp/baidu_analysis.ftl index 78defc5e3..4f947ef1a 100644 --- a/projects/fangjia-coresite/src/main/webapp/baidu_analysis.ftl +++ b/projects/fangjia-coresite/src/main/webapp/baidu_analysis.ftl @@ -17,3 +17,5 @@ s.parentNode.insertBefore(hm, s); })(); + + diff --git a/projects/fangjia-coresite/src/main/webapp/company/about.ftl b/projects/fangjia-coresite/src/main/webapp/company/about.ftl index e59fd49cf..6867ffbf8 100644 --- a/projects/fangjia-coresite/src/main/webapp/company/about.ftl +++ b/projects/fangjia-coresite/src/main/webapp/company/about.ftl @@ -1,437 +1,221 @@ - -鍏徃绠�浠� - 鎴夸环缃� fangjia.com - - -<#include "../jsconstants.ftl" /> + + 鎴夸环缃戠數璇�-鍦板潃鏁版嵁浠峰�煎簲鐢紝涓撲笟鐨勯噾铻嶆満鏋勬湇鍔″晢 + + + <#include "../jsconstants.ftl" /> - - - - - - - - - - - + + + + + -<#include "/header/v5/_header.ftl"/> +<#include "/header/v6/_header.ftl"/> - -