diff --git a/deliverables/k8s/fangjia-static.yaml b/deliverables/k8s/fangjia-static.yaml index da58e88a9..fa7f9b842 100644 --- a/deliverables/k8s/fangjia-static.yaml +++ b/deliverables/k8s/fangjia-static.yaml @@ -98,4 +98,4 @@ spec: ports: - port: 8080 targetPort: 8080 - nodePort: 30005 \ No newline at end of file + nodePort: 30013 \ No newline at end of file diff --git a/deliverables/k8s/fangjia-youda-manager.yaml b/deliverables/k8s/fangjia-youda-manager.yaml new file mode 100644 index 000000000..2fa388c75 --- /dev/null +++ b/deliverables/k8s/fangjia-youda-manager.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fangjia-youda-manager + namespace: fangjia +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + revisionHistoryLimit: 5 + selector: + matchLabels: + project: fangjia-youda-manager + app: fangjia + template: + metadata: + labels: + project: fangjia-youda-manager + app: fangjia + spec: + imagePullSecrets: + - name: nexus-registry-secret + nodeSelector: + app: fangjia + containers: + - name: fangjia-youda-manager + image: 192.168.0.19:9012/fangjia-youda-manager:1.1 + imagePullPolicy: Always + ports: + - containerPort: 8080 + name: web + protocol: TCP + readinessProbe: + httpGet: + path: /login + port: web + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + httpGet: + path: /login + port: web + initialDelaySeconds: 10 + periodSeconds: 5 + volumeMounts: + - name: host-time + mountPath: /etc/localtime + volumes: + - name: host-time + hostPath: + path: /etc/localtime +--- +apiVersion: v1 +kind: Service +metadata: + name: fangjia-youda-manager + namespace: fangjia + labels: + project: fangjia-youda-manager + app: fangjia +spec: + type: NodePort + selector: + project: fangjia-youda-manager + app: fangjia + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30006 \ No newline at end of file diff --git a/deliverables/k8s/fangjia-youda-web-business.yaml b/deliverables/k8s/fangjia-youda-web-business.yaml new file mode 100644 index 000000000..ee19e4c63 --- /dev/null +++ b/deliverables/k8s/fangjia-youda-web-business.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fangjia-youda-web-business + namespace: fangjia +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + revisionHistoryLimit: 5 + selector: + matchLabels: + project: fangjia-youda-web-business + app: fangjia + template: + metadata: + labels: + project: fangjia-youda-web-business + app: fangjia + spec: + imagePullSecrets: + - name: nexus-registry-secret + nodeSelector: + app: fangjia + containers: + - name: fangjia-youda-web-business + image: 192.168.0.19:9012/fangjia-youda-web-business:1.1 + imagePullPolicy: Always + ports: + - containerPort: 8080 + name: web + protocol: TCP + readinessProbe: + httpGet: + path: /login + port: web + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + httpGet: + path: /login + port: web + initialDelaySeconds: 10 + periodSeconds: 5 + volumeMounts: + - name: host-time + mountPath: /etc/localtime + volumes: + - name: host-time + hostPath: + path: /etc/localtime +--- +apiVersion: v1 +kind: Service +metadata: + name: fangjia-youda-web-business + namespace: fangjia + labels: + project: fangjia-youda-web-business + app: fangjia +spec: + type: NodePort + selector: + project: fangjia-youda-web-business + app: fangjia + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30012 \ No newline at end of file diff --git a/deliverables/k8s/fangjia-youda-web-customer.yaml b/deliverables/k8s/fangjia-youda-web-customer.yaml new file mode 100644 index 000000000..d8374216b --- /dev/null +++ b/deliverables/k8s/fangjia-youda-web-customer.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fangjia-youda-web-customer + namespace: fangjia +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + revisionHistoryLimit: 5 + selector: + matchLabels: + project: fangjia-youda-web-customer + app: fangjia + template: + metadata: + labels: + project: fangjia-youda-web-customer + app: fangjia + spec: + imagePullSecrets: + - name: nexus-registry-secret + nodeSelector: + app: fangjia + containers: + - name: fangjia-youda-web-customer + image: 192.168.0.19:9012/fangjia-youda-web-customer:1.1 + imagePullPolicy: Always + ports: + - containerPort: 8080 + name: web + protocol: TCP + readinessProbe: + httpGet: + path: /login + port: web + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + httpGet: + path: /login + port: web + initialDelaySeconds: 10 + periodSeconds: 5 + volumeMounts: + - name: host-time + mountPath: /etc/localtime + volumes: + - name: host-time + hostPath: + path: /etc/localtime +--- +apiVersion: v1 +kind: Service +metadata: + name: fangjia-youda-web-customer + namespace: fangjia + labels: + project: fangjia-youda-web-customer + app: fangjia +spec: + type: NodePort + selector: + project: fangjia-youda-web-customer + app: fangjia + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30011 \ No newline at end of file diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/RegionData.java b/projects/fangjia-core/src/main/java/com/fangjia/core/RegionData.java index 72d9cc886..d8b75d0c5 100644 --- a/projects/fangjia-core/src/main/java/com/fangjia/core/RegionData.java +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/RegionData.java @@ -167,9 +167,9 @@ public class RegionData implements PriorityOrdered { ret = format(cityRegionMap, region); } - if (null == ret) { - return region; - } +// if (null == ret) { +// return region; +// } return ret; } diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/util/BaiDuApiUtils.java b/projects/fangjia-core/src/main/java/com/fangjia/core/util/BaiDuApiUtils.java index 4f59fe761..354e4c4ff 100644 --- a/projects/fangjia-core/src/main/java/com/fangjia/core/util/BaiDuApiUtils.java +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/util/BaiDuApiUtils.java @@ -13,7 +13,7 @@ import java.util.*; */ public class BaiDuApiUtils { - private static String AK = "9E99D3540e4dafb7894f7b9fe27fa6b5"; + private static String AK = "ajgWIBd9rYsXed1hcDQqYvkX"; public static String[] AKS = new String[]{"hj5KqPjaGA3uivtg8uS8XfAnj9X1kPMr","xjFg7DfDqvQleIZasM3ph8Zi2Lw8kgCg", "4pb6fzrWIzvibDu8L1o8DGoY2h1wRIUq","ZzX6mRFfE5GKn4cpUp24Q3OyUIHnfQAR","79ac4ea49e7dedbf80b0ecd475d07784", "9E99D3540e4dafb7894f7b9fe27fa6b5","W3M5uHfcrmlAdhQjf6v93LCI", "C8bb035aacf602551e829e4c64575224", diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/util/DataUtil.java b/projects/fangjia-core/src/main/java/com/fangjia/core/util/DataUtil.java index 93218b265..e11cd2246 100644 --- a/projects/fangjia-core/src/main/java/com/fangjia/core/util/DataUtil.java +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/util/DataUtil.java @@ -25,6 +25,7 @@ import java.util.zip.GZIPOutputStream; import com.hankcs.hanlp.HanLP; import com.hankcs.hanlp.dictionary.py.Pinyin; +import com.sun.javafx.scene.transform.TransformUtils; import net.sf.json.JSON; import net.sf.json.JSONArray; import net.sf.json.JSONNull; @@ -1340,6 +1341,7 @@ public class DataUtil { GZIPOutputStream outputStream = new GZIPOutputStream(bao); outputStream.write(content.getBytes("UTF-8")); outputStream.finish(); + System.out.println(bao.toString()); return bao.toByteArray(); } @@ -1435,6 +1437,25 @@ public class DataUtil { return null; } + /** + * 匹配符合条件的字符串 + * + * @param str + * @param pattern + * @return + */ + public static List matchAll(String str, Pattern pattern) { + if (str == null) { + return null; + } + List list = new ArrayList(); + Matcher matcher = pattern.matcher(str); + while (matcher.find()) { + list.add(matcher.group()); + } + return list; + } + public static boolean isNumeric(String str) { try { Double.parseDouble(str); @@ -1805,11 +1826,26 @@ public class DataUtil { } } - public static void main(String[] args) { - System.out.println(getFirstChar("文裕花园")); - System.out.println(getFirstChar("文怡花园")); + public static boolean isChineseChar(String c) { + if (StringUtils.isNotBlank(c)) { + String temp = String.valueOf(c); + Pattern pattern = Pattern.compile("[\\u4e00-\\u9fa5\\w]+"); + Matcher matcher = pattern.matcher(temp); + return matcher.matches(); + } + return false; + } - System.out.println(FourUpSixInto("258.393", 2)); + + + + + + public static void main(String[] args) { + System.out.println(isChineseChar("6文怡a花园")); +// System.out.println(getFirstChar("文怡花园")); +// +// System.out.println(FourUpSixInto("258.393", 2)); } diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java b/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java index a24864225..509490d97 100644 --- a/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java @@ -58,7 +58,7 @@ public class ExcelUtil { row.setHeightInPoints(35); Font font = workBook.createFont(); font.setFontName("宋体"); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); + // font.setBoldweight(Font.BOLDWEIGHT_BOLD); font.setFontHeightInPoints((short) 12); CellStyle cellStyle = workBook.createCellStyle(); cellStyle.setFont(font); diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/util/RandomUtil.java b/projects/fangjia-core/src/main/java/com/fangjia/core/util/RandomUtil.java index 25f4d5a12..234c29d79 100644 --- a/projects/fangjia-core/src/main/java/com/fangjia/core/util/RandomUtil.java +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/util/RandomUtil.java @@ -39,7 +39,7 @@ public final class RandomUtil extends RandomUtils { public static void main(String[] args) { for (int i = 0; i < 1000; i++) { - System.out.println(random(0, 10)); + System.out.println(random(-9, 9)); } } } diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/util/SeaweedUtils.java b/projects/fangjia-core/src/main/java/com/fangjia/core/util/SeaweedUtils.java new file mode 100644 index 000000000..698833bd5 --- /dev/null +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/util/SeaweedUtils.java @@ -0,0 +1,202 @@ +package com.fangjia.core.util; + +import org.apache.commons.lang.StringUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class SeaweedUtils { + public static void main(String[] args){ + System.out.println(formatVirescencePercent("1")); + } + /** + * 标准化输出绿化率 + */ + public static String formatVirescencePercent(String virescence_percent) { + // 绿化率 + if (StringUtils.isNotBlank(virescence_percent) && checkValue(virescence_percent)!=null) { + double val = Double.valueOf(virescence_percent); + if (val < 1) { + return String.valueOf(val * 100); + } + if (val == 1) { + return String.valueOf(val * 10); + } + if (val >= 70) { + return "65"; + } + return String.valueOf(val); + } + return null; + } + + /** + * 标准化容积率输出 + */ + public static String formatCubagePercent(String cubage_percent) { + if (StringUtils.isNotBlank(cubage_percent) && checkValue(cubage_percent)!=null) { + double val = Double.valueOf(cubage_percent); + if (val >= 7 && val < 8) { + return "6.2"; + } + if (val >= 8 && val < 9) { + return "6.3"; + } + if (val >= 9 && val < 10) { + return "6.5"; + } + if (val >= 10) { + return "6.7"; + } + return String.valueOf(val); + } + return null; + } + + /** + * 标准化车位输出 + */ + public static String formatCarSiteCount(String car_site_count) { + if (StringUtils.isNotBlank(car_site_count) && checkValue(car_site_count)!=null) { + long val = Long.valueOf(car_site_count); + if (val > 2500 || val < 100) { + return ""; + } + return String.valueOf(val); + } + return null; + } + + /** + * 标准化户数输出 + */ + public static String formatHouseholdCount(String household_count) { + if (StringUtils.isNotBlank(household_count) && checkValue(household_count)!=null ) { + if (Integer.valueOf(household_count) < 50) { + return null; // 户数 + } + return household_count; + } + return null; + } + + /** + * 标准化总占地面积输出 + */ + public static String formatAllArea(String all_area) { + if (StringUtils.isNotBlank(all_area)) { + Double formattedVal = 0.0; + if (all_area.toString().indexOf("公顷") != -1) { + String val = all_area.toString(); + formattedVal = (Double.valueOf(val.substring(0, val.indexOf("公顷"))) * 10000); + } else if(checkValue(all_area)!=null) { + formattedVal = Double.valueOf(all_area); + } + if (formattedVal > 100000 || formattedVal == 0.0) { + return null; + } + return String.valueOf(formattedVal); + } + return null; + } + + /** + * 提取浮点数与整数 + */ + static String getNumber(String input) { + Pattern pattern = Pattern.compile("\\d+(\\.\\d+)?"); + Matcher matcher = pattern.matcher(input); + List list = new ArrayList(); + while (matcher.find()) { + list.add(matcher.group()); + } + if(list.size()>0){ + return list.get(0); + } + return null; + } + + + + + static Float checkValue(String value){ + if(StringUtils.isNotBlank(value)){ + value = getNumber(value); + if(StringUtils.isNotBlank(value)){ + value = subZeroAndDot(value); + if(isNumber(value)){ + Float v = Float.parseFloat(value); + if(v>0){ + return v; + }else{ + return null; + } + }else if(isFloat(value)){ + Float v = Float.parseFloat(value); + if(v>0){ + return v; + }else{ + return null; + } + } else{ + return null; + } + } + } + return null; + } + + static boolean isNumber(String str){ + try { + Integer.parseInt(str); + } catch (NumberFormatException e) { + return false; + } + return true; + } + + static boolean isFloat(String str){ + try { + Float.parseFloat(str); + } catch (NumberFormatException e) { + return false; + } + return true; + } + + /** + * 正则表达式去掉多余的.与0 + * @param + * @return + */ + static String subZeroAndDot(String v){ + + if(StringUtils.isNotBlank(v)){ + if(v.indexOf(".")!=-1){ + Double myNum2 = Double.valueOf(v); + BigDecimal b = new java.math.BigDecimal(myNum2); + Double myNum3 = b.setScale(2, java.math.BigDecimal.ROUND_HALF_UP).doubleValue(); + v = myNum3.toString(); + } + + if(v.indexOf(".")>-1){ + while(true) + { + if(v.endsWith("0")){ + v = v.substring(0,v.length()-1); + }else{ + break; + } + } + if(v.endsWith(".")){ + v=v.substring(0,v.length()-1); + } + } + } + return v; + } + +} diff --git a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/SaleLeadsController.java b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/SaleLeadsController.java index 3f6881dd5..9596069f4 100644 --- a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/SaleLeadsController.java +++ b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/SaleLeadsController.java @@ -1,5 +1,9 @@ package com.fangjia.coresite.controllers; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.URLEncoder; import java.util.Date; import java.util.List; @@ -7,6 +11,7 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.fangjia.core.util.DataUtil; import org.apache.commons.lang.StringUtils; import com.fangjia.coresite.model.JsonModel; @@ -37,7 +42,7 @@ public class SaleLeadsController { } public Object doAddAction(SaleLeadsModel model, HttpServletRequest req, - HttpServletResponse res) { + HttpServletResponse res) throws UnsupportedEncodingException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { model.setViewType("redirect"); String refUrl = model.getBackUrl(); @@ -122,6 +127,8 @@ public class SaleLeadsController { } } + + saleLeads = converValue(saleLeads); saleLeadsService.save(saleLeads); if(StringUtils.isNotBlank(saleLeads.getBusiness()) && saleLeads.getBusiness().contains("_")){ @@ -162,6 +169,30 @@ public class SaleLeadsController { model.setViewParam("location", url); return model; } + + private SaleLeads converValue(SaleLeads saleLeads) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, UnsupportedEncodingException { +// + Field[] fields = saleLeads.getClass().getDeclaredFields(); + for(Field s : fields){ + String name = s.getName(); + String type = s.getGenericType().toString(); + if(type.contains("java.lang.String")){ + String fildName = name.substring(0,1).toUpperCase()+name.substring(1); + Method m = saleLeads.getClass().getMethod("get"+fildName); + String value = (String)m.invoke(saleLeads); + if(StringUtils.isNotBlank(value)){ + String s1 = value.replaceAll("\\pP|\\pS", ""); + if(!DataUtil.isChineseChar(s1)){ + String newValue = new String(value.getBytes("ISO8859-1"), "UTF-8"); + m = saleLeads.getClass().getMethod("set"+fildName,String.class); + m.invoke(saleLeads, newValue); + } + } + } + } + return saleLeads; + + } public Object addDownInfoAction(SaleLeadsModel model, HttpServletRequest req, diff --git a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TermsController.java b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TermsController.java index a3832b3bd..f40b4700a 100644 --- a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TermsController.java +++ b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TermsController.java @@ -37,5 +37,9 @@ public class TermsController { public Object ydinfoAction(ResourceModel model){ return model; } + + public Object ydintrAction(ResourceModel model){ + return model; + } } diff --git a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java index c3a3756a9..cccf755b8 100644 --- a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java +++ b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java @@ -188,6 +188,8 @@ public class TrendController { // avgPrice = model.getRegionStatBo().getAvgPrice(); // } + int count = districtService.findCityDistrictCount(city); + model.setCount(count); model.setTrendView(trendView); //model.setLastestHouse(getRelatedHouse(model.getRegion(), avgPrice)); return model; diff --git a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/model/TrendModel.java b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/model/TrendModel.java index 6e7cfda75..a06cb6a31 100644 --- a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/model/TrendModel.java +++ b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/model/TrendModel.java @@ -53,6 +53,7 @@ public class TrendModel extends BaseModel implements TrendViewModel { private int showBlock; // 小区走势图里显示板块线,不为0时显示 private String errMsg; //错误信息 private int code; //错误code 1成功 -1失败 + private int count; public String getKeyword() { return keyword; } @@ -317,4 +318,11 @@ public class TrendModel extends BaseModel implements TrendViewModel { this.code = code; } + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } } diff --git a/projects/fangjia-coresite/src/main/webapp/company/about.ftl b/projects/fangjia-coresite/src/main/webapp/company/about.ftl index 778557075..16b30ed80 100644 --- a/projects/fangjia-coresite/src/main/webapp/company/about.ftl +++ b/projects/fangjia-coresite/src/main/webapp/company/about.ftl @@ -158,37 +158,36 @@ <#-- --> - + - + - + - + - + - diff --git a/projects/fangjia-coresite/src/main/webapp/index.ftl b/projects/fangjia-coresite/src/main/webapp/index.ftl index adb4588ff..b5cb130e7 100644 --- a/projects/fangjia-coresite/src/main/webapp/index.ftl +++ b/projects/fangjia-coresite/src/main/webapp/index.ftl @@ -212,7 +212,7 @@

+ +

diff --git a/projects/fangjia-coresite/src/main/webapp/terms/ydintr.ftl b/projects/fangjia-coresite/src/main/webapp/terms/ydintr.ftl new file mode 100644 index 000000000..7d4af9d84 --- /dev/null +++ b/projects/fangjia-coresite/src/main/webapp/terms/ydintr.ftl @@ -0,0 +1,61 @@ + + + + + 鍚堜綔浼欎即 - 鎴夸环缃� fangjia.com + + + <#include "../jsconstants.ftl" /> + + + + + + + + + + + + + + + + +<#include "/header/v5/_header.ftl"/> + +
+
涓婃捣鍙嬭揪鍦熷湴鎴垮湴浜ц瘎浼版湁闄愬叕鍙�
+
浼佷笟鍐呴儴鍩硅
+
+

2021骞�8鏈�9鏃ワ紝涓婃捣鍙嬭揪鍦熷湴鎴垮湴浜ц瘎浼版湁闄愬叕鍙稿氨鎴垮湴浜у緛鏀朵笟鍔′腑閬囧埌鐨勮澶氶棶棰樺紑灞曚簡浼佷笟鍐呴儴鍩硅銆傛湰娆″煿璁殑瀹楁棬鏄负浜嗚繘涓�姝ユ彁楂樺憳宸ユ妧鏈按骞冲拰宸ヤ綔鏁堢巼锛屽己鍖栧洟闃熷悎浣滄剰璇嗭紝涓哄叕鍙哥殑鍙寔缁�у彂灞曞瀹氳壇濂藉熀纭�銆傛暣涓煿璁垎涓轰簩澶у唴瀹癸紝棣栧厛鐢卞叕鍙告�讳及浠峰笀涓哄ぇ瀹惰繘琛屼笓涓氳瑙e緛鏀惰瘎浼颁笟鍔′腑鐨勬妧鏈毦鐐瑰強澶勭悊鏂规硶锛涗簩鏄紑灞曞憳宸ヨ嚜鐢变氦娴侊紝鍏徃棰嗗灞傚惉鍙栧悇閮ㄩ棬寤鸿锛屽仛鍒伴泦鎬濆箍鐩婏紝鏈夋晥娌熼�氥�傞�氳繃鏈鍩硅娲诲姩锛屽叕鍙稿憳宸ョ殑涓撲笟鎶�鏈按骞冲緱鍒颁簡寰堝ぇ鎻愰珮锛屽悓鏃朵績杩涗簡鍚勯儴闂ㄤ箣闂寸殑鍗忚皟鍚堜綔鑳藉姏锛屽渾婊¤揪鎴愪簡棰勬湡鐩殑銆�

+ +
+
+

+ 闈掓槬鍥犳ⅵ鎯宠�屽讥瓒崇弽璐碉紝浜虹敓鍥犳嫾鎼忔墠鎰堟樉鐪熷疄銆傚叕鍙镐笂涓嬫弧鎬�宸ヤ綔鐑儏锛屾棤鎯у洶闅撅紝绔嬪織涓哄弸杈剧殑鍙戝睍璐$尞鑷繁鐨勫姏閲忋�傛効鍙嬭揪姣忎綅鍛樺伐鐨勪汉鐢熷洜韪忓叆杩欎釜闆嗕綋鑰岀簿褰╃悍鍛�! +

+
+
+
+ 涓婃捣鍙嬭揪鍦熷湴鎴垮湴浜ц瘎浼版湁闄愬叕鍙�
+

2021骞�8鏈�10鏃�

+
+ +
+
+ +<#include "/header/v5/_footer.ftl"/> + + + + + diff --git a/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl b/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl index c4fb35940..ea155f653 100644 --- a/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl +++ b/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl @@ -125,6 +125,7 @@
<#if districtStatBo?? || regionStatBo??> + <#if count??>
${count!}
<#if districtStatBo??>
<#if districtStatBo.lastTimeDistrictStat??>${districtStatBo.lastTimeDistrictStat.avgPrice}<#else>鏆傛棤
<#if districtStatBo.districtStat??>${districtStatBo.districtStat.avgPrice}<#else>鏆傛棤
diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/BsEvaluationDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/BsEvaluationDao.java new file mode 100644 index 000000000..5f895886b --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/BsEvaluationDao.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.mongo.dao; + +import com.fangjia.dal.MongoDao; +import com.fangjia.dal.mongo.model.BsEvaluation; + +public interface BsEvaluationDao extends MongoDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/BsEvaluationDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/BsEvaluationDaoImpl.java new file mode 100644 index 000000000..e4d7fc080 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/BsEvaluationDaoImpl.java @@ -0,0 +1,8 @@ +package com.fangjia.dal.mongo.dao; + +import com.fangjia.dal.MongoDaoImpl; +import com.fangjia.dal.mongo.model.BsEvaluation; + +public class BsEvaluationDaoImpl extends MongoDaoImpl implements + BsEvaluationDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/fangjia/model/PaiMai.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/fangjia/model/PaiMai.java index fa5f7cb2f..e7a406dc8 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/fangjia/model/PaiMai.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/fangjia/model/PaiMai.java @@ -99,6 +99,9 @@ public class PaiMai implements MongoEntity { private Integer marketAvgPrice; /**物业类型*/ private String matchEstateType; + private String houseNum; + private String unitNum; + private String roomNum; @Id @GeneratedValue @@ -488,4 +491,28 @@ public class PaiMai implements MongoEntity { public void setMatchEstateType(String matchEstateType) { this.matchEstateType = matchEstateType; } + + public String getHouseNum() { + return houseNum; + } + + public void setHouseNum(String houseNum) { + this.houseNum = houseNum; + } + + public String getUnitNum() { + return unitNum; + } + + public void setUnitNum(String unitNum) { + this.unitNum = unitNum; + } + + public String getRoomNum() { + return roomNum; + } + + public void setRoomNum(String roomNum) { + this.roomNum = roomNum; + } } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/BsEvaluation.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/BsEvaluation.java new file mode 100644 index 000000000..d3b1b28f0 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/BsEvaluation.java @@ -0,0 +1,184 @@ +package com.fangjia.dal.mongo.model; + +import com.fangjia.dal.MongoEntity; + +import javax.persistence.*; +import java.util.Date; + +@Entity +@Table(name = "business.evaluation") +public class BsEvaluation implements MongoEntity { + private String id; + private String fullAddress; + private String commid; + private String cityName; + private String distName; + private String commName; + private String address; + private Double buildArea; + private Integer floor; + private Integer floorcnt; + private Integer roomcnt; + private Integer livingroomcnt; + private String houseaspect;//南 + private String fitment; + private Date cDate; + private Integer unitPrice; + private Integer totalPrice; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "_id") + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Column(name = "full_address") + public String getFullAddress() { + return fullAddress; + } + + public void setFullAddress(String fullAddress) { + this.fullAddress = fullAddress; + } + + @Column(name = "commid") + public String getCommid() { + return commid; + } + + public void setCommid(String commid) { + this.commid = commid; + } + + @Column(name = "cityname") + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + @Column(name = "distname") + public String getDistName() { + return distName; + } + + public void setDistName(String distName) { + this.distName = distName; + } + + @Column(name = "commname") + public String getCommName() { + return commName; + } + + public void setCommName(String commName) { + this.commName = commName; + } + + @Column(name = "address") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @Column(name = "buildarea") + public Double getBuildArea() { + return buildArea; + } + + public void setBuildArea(Double buildArea) { + this.buildArea = buildArea; + } + + @Column(name = "floor") + public Integer getFloor() { + return floor; + } + + public void setFloor(Integer floor) { + this.floor = floor; + } + + @Column(name = "floorcnt") + public Integer getFloorcnt() { + return floorcnt; + } + + public void setFloorcnt(Integer floorcnt) { + this.floorcnt = floorcnt; + } + + @Column(name = "roomcnt") + public Integer getRoomcnt() { + return roomcnt; + } + + public void setRoomcnt(Integer roomcnt) { + this.roomcnt = roomcnt; + } + + @Column(name = "livingroomcnt") + public Integer getLivingroomcnt() { + return livingroomcnt; + } + + public void setLivingroomcnt(Integer livingroomcnt) { + this.livingroomcnt = livingroomcnt; + } + + @Column(name = "houseaspect") + public String getHouseaspect() { + return houseaspect; + } + + public void setHouseaspect(String houseaspect) { + this.houseaspect = houseaspect; + } + + @Column(name = "fitment") + public String getFitment() { + return fitment; + } + + public void setFitment(String fitment) { + this.fitment = fitment; + } + + @Column(name = "c_date") + public Date getcDate() { + return cDate; + } + + public void setcDate(Date cDate) { + this.cDate = cDate; + } + + @Column(name = "unitprice") + public Integer getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Integer unitPrice) { + this.unitPrice = unitPrice; + } + + @Column(name = "totalprice") + public Integer getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(Integer totalPrice) { + this.totalPrice = totalPrice; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/DistrictFacilitys.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/DistrictFacilitys.java index 36021519c..cc946257b 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/DistrictFacilitys.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/DistrictFacilitys.java @@ -63,6 +63,7 @@ public class DistrictFacilitys implements MongoEntity { private String imgUrl3D; private List school; + private List keySchool; @Id @GeneratedValue @@ -380,4 +381,12 @@ public class DistrictFacilitys implements MongoEntity { this.school = school; } + @Column(name = "key_school") + public List getKeySchool() { + return keySchool; + } + + public void setKeySchool(List keySchool) { + this.keySchool = keySchool; + } } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/DealPrice.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/DealPrice.java index a4ababe8e..a46cd7de0 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/DealPrice.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/DealPrice.java @@ -48,6 +48,11 @@ public class DealPrice implements MongoEntity { private Integer floor;//当前楼层 private Long score; + private String matchId; + private String matchCity; + private String matchRegion; + private String matchName; + @Id @GeneratedValue @Column(name = "_id", unique = true, nullable = false) @@ -296,4 +301,40 @@ public class DealPrice implements MongoEntity { } return true; } + + @Column(name = "match_id") + public String getMatchId() { + return matchId; + } + + public void setMatchId(String matchId) { + this.matchId = matchId; + } + + @Column(name = "match_city") + public String getMatchCity() { + return matchCity; + } + + public void setMatchCity(String matchCity) { + this.matchCity = matchCity; + } + + @Column(name = "match_region") + public String getMatchRegion() { + return matchRegion; + } + + public void setMatchRegion(String matchRegion) { + this.matchRegion = matchRegion; + } + + @Column(name = "match_name") + public String getMatchName() { + return matchName; + } + + public void setMatchName(String matchName) { + this.matchName = matchName; + } } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/HouseLoudong.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/HouseLoudong.java index cf98a3665..d41b400ee 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/HouseLoudong.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/HouseLoudong.java @@ -448,6 +448,7 @@ public class HouseLoudong extends com.fangjia.dal.mongo.model.HouseLoudong{ this.openTotalPrice = openTotalPrice; } + @Column(name = "district_id") public String getDistrictId() { return districtId; } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/Loudong.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/Loudong.java index 596613062..ffb9f957f 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/Loudong.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/bkoff/Loudong.java @@ -103,7 +103,11 @@ public class Loudong implements MongoEntity { * seaweed中的小区名 */ private String nameInSeaweed; - + /** + * seaweed中的小区id + */ + private String idInSeaweed; + @Column(name = "remark") public String getRemark() { return remark; @@ -405,5 +409,12 @@ public class Loudong implements MongoEntity { this.nameInSeaweed = nameInSeaweed; } + @Column(name = "id_in_seaweed") + public String getIdInSeaweed() { + return idInSeaweed; + } + public void setIdInSeaweed(String idInSeaweed) { + this.idInSeaweed = idInSeaweed; + } } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/CommunityBasePriceDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/CommunityBasePriceDao.java new file mode 100644 index 000000000..8275f68f8 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/CommunityBasePriceDao.java @@ -0,0 +1,9 @@ +package com.fangjia.dal.mongo.open.dao; + +import com.fangjia.dal.MongoDao; +import com.fangjia.dal.mongo.open.model.CommunityBasePrice; +import com.fangjia.dal.mongo.open.model.CommunityPoi; + +public interface CommunityBasePriceDao extends MongoDao { + +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/CommunityPoiDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/CommunityPoiDao.java new file mode 100644 index 000000000..97f9d48de --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/CommunityPoiDao.java @@ -0,0 +1,9 @@ +package com.fangjia.dal.mongo.open.dao; + +import com.fangjia.dal.MongoDao; +import com.fangjia.dal.mongo.model.CountDistrictStatBycity; +import com.fangjia.dal.mongo.open.model.CommunityPoi; + +public interface CommunityPoiDao extends MongoDao { + +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/impl/CommunityBasePriceDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/impl/CommunityBasePriceDaoImpl.java new file mode 100644 index 000000000..c89477b09 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/impl/CommunityBasePriceDaoImpl.java @@ -0,0 +1,10 @@ +package com.fangjia.dal.mongo.open.dao.impl; + +import com.fangjia.dal.MongoDaoImpl; +import com.fangjia.dal.mongo.open.dao.CommunityBasePriceDao; +import com.fangjia.dal.mongo.open.dao.CommunityPoiDao; +import com.fangjia.dal.mongo.open.model.CommunityBasePrice; +import com.fangjia.dal.mongo.open.model.CommunityPoi; + +public class CommunityBasePriceDaoImpl extends MongoDaoImpl implements CommunityBasePriceDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/impl/CommunityPoiDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/impl/CommunityPoiDaoImpl.java new file mode 100644 index 000000000..e8a317b04 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/dao/impl/CommunityPoiDaoImpl.java @@ -0,0 +1,10 @@ +package com.fangjia.dal.mongo.open.dao.impl; + +import com.fangjia.dal.MongoDaoImpl; +import com.fangjia.dal.mongo.open.dao.ApiVisitCountDao; +import com.fangjia.dal.mongo.open.dao.CommunityPoiDao; +import com.fangjia.dal.mongo.open.model.CommunityPoi; +import com.fangjia.dal.mongo.tool.model.ApiVisitCount; + +public class CommunityPoiDaoImpl extends MongoDaoImpl implements CommunityPoiDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/model/CommunityBasePrice.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/model/CommunityBasePrice.java new file mode 100644 index 000000000..9321bd542 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/model/CommunityBasePrice.java @@ -0,0 +1,74 @@ +package com.fangjia.dal.mongo.open.model; + +import com.fangjia.dal.MongoEntity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * 小区建行置信度信息 + * + * @author shenjian@fangjia.com + */ +@Entity +@Table(name = "business.community_base_price_gj") +public class CommunityBasePrice implements MongoEntity { + + private static final long serialVersionUID = -8010010773207622878L; + + private String id; + private String city; + private String region; + private String name; + private Double credit; + + @Id + @Column(name = "_id") + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Column(name = "city") + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + @Column(name = "region") + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + @Column(name = "name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "credit") + public Double getCredit() { + return credit; + } + + public void setCredit(Double credit) { + this.credit = credit; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/model/CommunityPoi.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/model/CommunityPoi.java new file mode 100644 index 000000000..8427b5aa7 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/open/model/CommunityPoi.java @@ -0,0 +1,135 @@ +package com.fangjia.dal.mongo.open.model; + +import com.fangjia.dal.MongoEntity; + +import javax.persistence.*; +import java.util.Date; + +/** + * 小区周边配套统计信息 + * + * @author shenjian@fangjia.com + */ +@Entity +@Table(name = "fangjia_stat.community_poi_gj") +public class CommunityPoi implements MongoEntity { + + private static final long serialVersionUID = -7663644539542318409L; + + private String id; + private String city; + private String region; + private String name; + private Integer subway; + private Integer traffic; + private Integer bank; + private Integer primary; + private Integer junior; + private Integer hospital; + /** + * 不利设施,丧葬 + */ + private Integer funeral; + + @Id + @Column(name = "_id") + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Column(name = "city") + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + @Column(name = "region") + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + @Column(name = "name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "subway") + public Integer getSubway() { + return subway; + } + + public void setSubway(Integer subway) { + this.subway = subway; + } + + @Column(name = "traffic") + public Integer getTraffic() { + return traffic; + } + + public void setTraffic(Integer traffic) { + this.traffic = traffic; + } + + @Column(name = "bank") + public Integer getBank() { + return bank; + } + + public void setBank(Integer bank) { + this.bank = bank; + } + + @Column(name = "primary") + public Integer getPrimary() { + return primary; + } + + public void setPrimary(Integer primary) { + this.primary = primary; + } + + @Column(name = "junior") + public Integer getJunior() { + return junior; + } + + public void setJunior(Integer junior) { + this.junior = junior; + } + + @Column(name = "hospital") + public Integer getHospital() { + return hospital; + } + + public void setHospital(Integer hospital) { + this.hospital = hospital; + } + + @Column(name = "funeral") + public Integer getFuneral() { + return funeral; + } + + public void setFuneral(Integer funeral) { + this.funeral = funeral; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java index e71226a4a..69108673a 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java @@ -67,6 +67,8 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i must.add(addTerms("district_name", alias)); must.add(addMatch("cat", "sell")); must.add(addRange("avg_price", minPrice, maxPrice)); + must.add(addRangeGte("p_date", 20210501)); + bool.put("must", must); query.put("bool", bool); reqBody.put("query", query); @@ -161,6 +163,16 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i return term; } + private JSONObject addRangeGte(String name, Number min){ + JSONObject term = new JSONObject(); + JSONObject range = new JSONObject(); + JSONObject rangeValue = new JSONObject(); + rangeValue.put("gte", min); + range.put(name, rangeValue); + term.put("range", range); + return term; + } + private List wrapSeawater(List jsonList){ List seawaterList= new ArrayList(); @@ -203,6 +215,11 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i seawater.setFloor(source.getInt("floor")); }catch(Exception e){ seawater.setFloor(0); + } + try{ + seawater.setFloorInfo(source.getString("floor_info")); + }catch(Exception e){ + } if(source.containsKey("fitment")){ seawater.setFitment(source.getString("fitment")); @@ -231,6 +248,14 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i if(source.containsKey("root")){ seawater.setRoot(source.getString("root")); } + + if(source.containsKey("estate_type")){ + seawater.setEstateType(source.getString("estate_type")); + } + + if(source.containsKey("build_type")){ + seawater.setBuildType(source.getString("build_type")); + } seawaterList.add(seawater); } return seawaterList; @@ -379,11 +404,11 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i } // 不展示删除 - JSONObject param = new JSONObject(); - param.put("status", 0); - JSONObject temp = new JSONObject(); - temp.put("term", param); - jsonList.add(temp); +// JSONObject param = new JSONObject(); +// param.put("status", 0); +// JSONObject temp = new JSONObject(); +// temp.put("term", param); +// jsonList.add(temp); query.put("must", jsonList); q.put("bool", query); diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/model/Seawater.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/model/Seawater.java index c761ba76a..1af563193 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/model/Seawater.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/model/Seawater.java @@ -48,6 +48,7 @@ public class Seawater implements SeawaterEntity { private Double area; private Integer height; private Integer floor; + private String floorInfo; private String fitment; private Integer room; private Integer hall; @@ -58,6 +59,9 @@ public class Seawater implements SeawaterEntity { private String url; private String root; private Integer avgPrice; + private String purpose; + private String estateType; + private String buildType; @Id @Column(name = "_id") @@ -195,6 +199,15 @@ public class Seawater implements SeawaterEntity { this.floor = floor; } + @Column(name = "floorInfo") + public String getFloorInfo() { + return floorInfo; + } + + public void setFloorInfo(String floorInfo) { + this.floorInfo = floorInfo; + } + @Column(name = "fitment") public String getFitment() { return fitment; @@ -285,4 +298,31 @@ public class Seawater implements SeawaterEntity { public void setAvgPrice(Integer avgPrice) { this.avgPrice = avgPrice; } + + @Column(name = "purpose") + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + @Column(name = "estate_type") + public String getEstateType() { + return estateType; + } + + public void setEstateType(String estateType) { + this.estateType = estateType; + } + + @Column(name = "build_type") + public String getBuildType() { + return buildType; + } + + public void setBuildType(String buildType) { + this.buildType = buildType; + } } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/FormalReportDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/FormalReportDao.java new file mode 100644 index 000000000..a06caa12a --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/FormalReportDao.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.sql.fangjia.dao; + +import com.fangjia.dal.SqlDao; +import com.fangjia.dal.sql.model.FormalReport; + +public interface FormalReportDao extends SqlDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/FormalReportDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/FormalReportDaoImpl.java new file mode 100644 index 000000000..72ea5ebbd --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/FormalReportDaoImpl.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.sql.fangjia.dao; + +import com.fangjia.dal.GoojiaFangjiaSqlDao; +import com.fangjia.dal.sql.model.FormalReport; + +public class FormalReportDaoImpl extends GoojiaFangjiaSqlDao implements FormalReportDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/ReportFileAttachDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/ReportFileAttachDao.java new file mode 100644 index 000000000..f56745a2a --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/ReportFileAttachDao.java @@ -0,0 +1,10 @@ +package com.fangjia.dal.sql.fangjia.dao; + +import com.fangjia.dal.SqlDao; +import com.fangjia.dal.sql.model.ReportFileAttach; +import com.fangjia.dal.sql.model.UserCity; + +public interface ReportFileAttachDao extends SqlDao{ + + +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/ReportFileAttachDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/ReportFileAttachDaoImpl.java new file mode 100644 index 000000000..1a1cea675 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/ReportFileAttachDaoImpl.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.sql.fangjia.dao; + +import com.fangjia.dal.GoojiaFangjiaSqlDao; +import com.fangjia.dal.sql.model.ReportFileAttach; + +public class ReportFileAttachDaoImpl extends GoojiaFangjiaSqlDao implements ReportFileAttachDao{ +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java index 7b9f33c58..ae89641bc 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java @@ -103,6 +103,8 @@ public class FjtEvaluation implements SqlEntity{ private String finishDateStr;//竣工时间 private String useType;//房屋用途 private String certificateAddress; //产证地址 + + private Date downPdfDate;//下载报告时间 @GeneratedValue(strategy = GenerationType.AUTO) @Id @@ -751,6 +753,7 @@ public class FjtEvaluation implements SqlEntity{ this.useType = useType; } +<<<<<<< .mine @Column(name = "certificate_address") public String getCertificateAddress() { return certificateAddress; @@ -760,6 +763,19 @@ public class FjtEvaluation implements SqlEntity{ this.certificateAddress = certificateAddress; } + +======= + + @Column(name = "down_pdf_date") + public Date getDownPdfDate() { + return downPdfDate; + } + + public void setDownPdfDate(Date downPdfDate) { + this.downPdfDate = downPdfDate; + } + +>>>>>>> .theirs @Override public String toString() { return "FjtEvaluation{" + diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FormalReport.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FormalReport.java new file mode 100644 index 000000000..93f5d11fc --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FormalReport.java @@ -0,0 +1,75 @@ +package com.fangjia.dal.sql.model; + +import com.fangjia.dal.SqlEntity; + +import javax.persistence.*; +import java.util.Date; + +@Entity +@Table(name = "formal_report") +public class FormalReport implements SqlEntity { + long id; + + long evaluationId; + String queryId; + long userId; + String address; + Date dateCreated; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.AUTO) + public long getId() { + return id; + } + + @Override + public void setId(long id) { + this.id = id; + } + + @Column(name = "evaluation_id") + public long getEvaluationId() { + return evaluationId; + } + + public void setEvaluationId(long evaluationId) { + this.evaluationId = evaluationId; + } + + @Column(name = "query_id") + public String getQueryId() { + return queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + @Column(name = "user_id") + public long getUserId() { + return userId; + } + + public void setUserId(long userId) { + this.userId = userId; + } + + @Column(name = "address") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @Column(name = "c_date") + public Date getDateCreated() { + return dateCreated; + } + + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/ReportFileAttach.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/ReportFileAttach.java new file mode 100644 index 000000000..a22ef8332 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/ReportFileAttach.java @@ -0,0 +1,82 @@ +package com.fangjia.dal.sql.model; + +import com.fangjia.dal.SqlEntity; + +import javax.persistence.*; + +@Entity +@Table(name = "report_file_attach") +public class ReportFileAttach implements SqlEntity { + private long id; + private Integer userId; + private Integer evaluationId; + private String queryId; + private Integer fileClass; + private String fileName; + private String fileId; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.AUTO) + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "user_id") + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Column(name = "evaluation_id") + public Integer getEvaluationId() { + return evaluationId; + } + + public void setEvaluationId(Integer evaluationId) { + this.evaluationId = evaluationId; + } + + @Column(name = "query_id") + public String getQueryId() { + return queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + @Column(name = "file_class") + public Integer getFileClass() { + return fileClass; + } + + public void setFileClass(Integer fileClass) { + this.fileClass = fileClass; + } + + @Column(name = "file_name") + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + @Column(name = "file_id") + public String getFileId() { + return fileId; + } + + public void setFileId(String fileId) { + this.fileId = fileId; + } +} diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/OpenConfig.java b/projects/fangjia-open/src/main/java/com/fangjia/open/OpenConfig.java index e1064e8cd..c13a28b36 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/OpenConfig.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/OpenConfig.java @@ -38,6 +38,7 @@ public class OpenConfig extends Configuration { private final String ipdatfile; private final String baiduAk; + private final String defaultCity; private final boolean isOpenAllAuthority; @@ -54,6 +55,7 @@ public class OpenConfig extends Configuration { baiduAk = configuration.get("fangjia.baidu.ak"); isOpenAllAuthority = configuration.getBoolean("fangjia.isOpenAllAuthority", false); enabledAddressMatch = configuration.getBoolean("fangjia.addressMatch.enabled",false); + defaultCity = configuration.get("fangjia.default.city"); } public static OpenConfig getConfig() { @@ -134,4 +136,7 @@ public class OpenConfig extends Configuration { return enabledAddressMatch; } + public String getDefaultCity() { + return defaultCity; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java index b426d1e8e..af890d880 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java @@ -89,6 +89,7 @@ import com.fangjia.service.mongo.fangjia.ServerAreaService; import com.fangjia.service.open.WaitCrawlKeywordsService; import com.fangjia.service.sql.FjtEvaluationService; import com.fangjia.service.web.AddressService; +import org.sothis.web.mvc.annotation.Param; @Authority(role = Role.USER) public class AddressController { @@ -106,6 +107,7 @@ public class AddressController { private HouseLoudongService houseLoudongService; private FjtEvaluationService fjtEvaluationService; private AddressMatchProxyService addressMatchProxyService; + private final static String AK = OpenConfig.getConfig().getBaiduAk(); private final static Logger LOGGER = LoggerFactory.getLogger(AddressController.class); @@ -117,6 +119,8 @@ public class AddressController { private static final String GRADE_NATION = "全国评分"; private static final String GRADE_CONSUME = "消费评分"; + public final static OpenConfig CONFIG = OpenConfig.getConfig(); + /** * @deprecated see parse2Action * @param model @@ -1705,6 +1709,228 @@ public class AddressController { return mav; } + /** + * 地址标准化接口V2 + * + * @param model + * @return + */ + public Object standard2Action(AddesssMatchModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getAddress())) { + mav.setModel(BasicModel.buildBadRequestModel("地址不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); + params.put("address", model.getAddress()); + try{ + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); + } catch(Exception e){ + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); + } catch(Exception ex){ + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("status"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if(json.containsKey("result")){ + basicModel.setResult(json.get("result")); + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + + /** + * 五级地址标准化接口 + * + * @param model + * @return + */ + public Object fiveDivisionStructureAction(AddesssMatchModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getAddress())) { + mav.setModel(BasicModel.buildBadRequestModel("地址不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); + params.put("address", model.getAddress()); + // 地址验证无效也输出标准化结果 + params.put("flag", "true"); + try{ + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8"); + } catch(Exception e){ + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8"); + } catch(Exception ex){ + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("status"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if(json.containsKey("result")){ + basicModel.setResult(json.get("result")); + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + + /** + * 五级行政区划V2地址标准化接口 + * + * @param model + * @return + */ + public Object fiveDivisionStructure2Action(AddesssMatchModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getAddress())) { + mav.setModel(BasicModel.buildBadRequestModel("地址不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); + params.put("address", model.getAddress()); + // 地址验证无效也输出标准化结果 + params.put("flag", "true"); + try{ + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8"); + } catch(Exception e){ + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8"); + } catch(Exception ex){ + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("status"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if(json.containsKey("result")){ + basicModel.setResult(json.get("result")); + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + + /** + * 详细地址标准化接口 + * + * @param model + * @return + */ + public Object divisionStructureAction(AddesssMatchModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getAddress())) { + mav.setModel(BasicModel.buildBadRequestModel("地址不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); + params.put("address", model.getAddress()); + // 地址验证无效也输出标准化结果 + params.put("flag", "true"); + try{ + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/divisionStructure", params, "UTF-8"); + } catch(Exception e){ + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/divisionStructure", params, "UTF-8"); + } catch(Exception ex){ + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("status"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if(json.containsKey("result")){ + basicModel.setResult(json.get("result")); + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + + /** + * 地址标准化专用测试接口 + * @param model + * @return + */ + public Object structureAndCompleteAction(AddesssMatchModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getAddress())) { + mav.setModel(BasicModel.buildBadRequestModel("地址不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); + params.put("address", model.getAddress()); + // 地址验证无效也输出标准化结果 + params.put("flag", "true"); + try{ + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8"); + } catch(Exception e){ + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8"); + } catch(Exception ex){ + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("status"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if(json.containsKey("result")){ + basicModel.setResult(json.get("result")); + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + public Object similarityAction(AddesssMatchModel model) { RestfulModelAndView mav = new RestfulModelAndView(); if (StringUtils.isBlank(model.getAddress_1()) || StringUtils.isBlank(model.getAddress_2())) { @@ -2760,55 +2986,59 @@ public class AddressController { return mav; } BasicModel resultModel = new BasicModel(HttpStatusCodeEnum.OK); - Map resultMap = new HashMap(); - Map params = new HashMap(); - if(StringUtils.isNotBlank(model.getCity())){ - params.put("city", model.getCity()); - } - params.put("address", model.getAddress()); - params.put("useMap", "false"); - String result = addressMatchProxyService.parser(params); - if (result != null) { - JSONObject json = JSONObject.fromObject(result); - if(json.getInt("code")==200){ - JSONObject resultJson = json.getJSONObject("result"); - JSONObject searchAddress = resultJson.getJSONObject("searchAddress"); - if(resultJson.getDouble("credit")>0){ - District district = districtService.findByNameAndAlias(resultJson.getString("city"), resultJson.getString("district"), resultJson.getString("name"), "district"); - if(district != null){ - resultMap.put("riskLevel","A"); + Map resultMap = new HashMap(); + try { + Map params = new HashMap(); + if (StringUtils.isNotBlank(model.getCity())) { + params.put("city", model.getCity()); + } + params.put("address", model.getAddress()); + params.put("useMap", "false"); + String result = addressMatchProxyService.parser(params); + if (result != null) { + JSONObject json = JSONObject.fromObject(result); + if (json.getInt("code") == 200) { + JSONObject resultJson = json.getJSONObject("result"); + JSONObject searchAddress = resultJson.getJSONObject("searchAddress"); + if (resultJson.getDouble("credit") > 0) { + District district = districtService.findByNameAndAlias(resultJson.getString("city"), resultJson.getString("district"), resultJson.getString("name"), "district"); + if (district != null) { + resultMap.put("riskLevel", "A"); + resultModel.setResult(resultMap); + mav.setModel(resultModel); + return mav; + } + } + StringBuffer searchKey = new StringBuffer(); + if (searchAddress.containsKey("street")) { + searchKey.append(searchAddress.getString("street")); + } + if (searchAddress.containsKey("streetNumber")) { + searchKey.append(searchAddress.getString("streetNumber")); + } + if (StringUtils.isNotBlank(searchKey.toString()) && searchAddress.has("city") && StringUtils.isNotBlank(searchAddress.getString("city"))) { + JSONObject jsonObject = addressMatchProxyService.searchByAmap(searchAddress.getString("city"), model.getAddress()); + JSONArray poisData = jsonObject.getJSONArray("pois"); + for (int i = 0; i < poisData.size(); i++) { + String address = poisData.getJSONObject(i).getString("address"); + if (address.contains(searchKey.toString())) { + resultMap.put("riskLevel", "A"); + resultModel.setResult(resultMap); + mav.setModel(resultModel); + return mav; + } else { + continue; + } + } + resultMap.put("riskLevel", "B"); resultModel.setResult(resultMap); mav.setModel(resultModel); return mav; } } - StringBuffer searchKey = new StringBuffer(); - if(searchAddress.containsKey("street")){ - searchKey.append(searchAddress.getString("street")); - } - if(searchAddress.containsKey("streetNumber")){ - searchKey.append(searchAddress.getString("streetNumber")); - } - if(StringUtils.isNotBlank(searchKey.toString()) && searchAddress.has("city") && StringUtils.isNotBlank(searchAddress.getString("city"))){ - JSONObject jsonObject = addressMatchProxyService.searchByAmap(searchAddress.getString("city"), model.getAddress()); - JSONArray poisData = jsonObject.getJSONArray("pois"); - for (int i = 0; i < poisData.size(); i++) { - String address = poisData.getJSONObject(i).getString("address"); - if(address.contains(searchKey.toString())){ - resultMap.put("riskLevel","A"); - resultModel.setResult(resultMap); - mav.setModel(resultModel); - return mav; - }else{ - continue; - } - } - resultMap.put("riskLevel","B"); - resultModel.setResult(resultMap); - mav.setModel(resultModel); - return mav; - } } + } catch (Exception ex) { + LOGGER.error("风险识别出错:" + ex.getMessage(), ex); } resultMap.put("riskLevel","C"); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AuctionController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AuctionController.java index 13e59faa4..b515c4593 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AuctionController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AuctionController.java @@ -1,6 +1,7 @@ package com.fangjia.open.controllers; import com.fangjia.core.util.DateUtil; +import com.fangjia.core.util.HttpRequest; import com.fangjia.dal.QueryParam; import com.fangjia.dal.SortParam; import com.fangjia.dal.common.DistrictKey; @@ -14,6 +15,7 @@ import com.fangjia.open.model.BasicModel; import com.fangjia.open.model.RestfulModelAndView; import com.fangjia.service.fsh.DistrictNewPriceService; import com.fangjia.service.open.PaiMaiService; +import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.bson.types.ObjectId; @@ -23,13 +25,14 @@ import java.util.regex.Pattern; /** * 法拍数据提供接口 */ -@Authority(role = Role.USER) +//@Authority(role = Role.USER) public class AuctionController { private PaiMaiService paiMaiService; private DistrictNewPriceService districtNewPriceService; - private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url", "matchEstateType"}; + private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url", + "matchEstateType","type","count", "tradeAvgPrice", "evaluationPrice"}; public Object housesAction(AuctionModel model){ RestfulModelAndView mav = new RestfulModelAndView(); @@ -187,6 +190,79 @@ public class AuctionController { return mav; } + + public Object searchPaimaisAction(AuctionModel model) { + RestfulModelAndView mav = new RestfulModelAndView(); + List params = new ArrayList(); + if(StringUtils.isNotBlank(model.getCity())){ + params.add(new QueryParam("matchCity", model.getCity())); + } + if(StringUtils.isNotBlank(model.getDistrict())){ + params.add(new QueryParam("matchRegion", model.getDistrict())); + } + + if(StringUtils.isNotBlank(model.getName())){ + params.add(new QueryParam("matchName", model.getName())); + } + + Date startDate = null; + if(StringUtils.isNotBlank(model.getStartDate())){ + startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd"); + if(startDate != null){ + params.add(new QueryParam("startDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate)); + } + } + + List sortParams = new ArrayList(); + sortParams.add(new SortParam("startDate", false)); + List paimais = paiMaiService.findAll(params, sortParams, model.getLimit(), SEARCH_FIELDS); + if(paimais!=null && paimais.size()>0){ + for(PaiMai paiMai : paimais){ + Map map = standard(paiMai.getCity(), paiMai.getAddress()); + if(map!=null){ + if (map.containsKey("buildingNumber")) { + paiMai.setHouseNum((String) map.get("buildingNumber")); + } + if (map.containsKey("unitNumber")) { + paiMai.setUnitNum((String) map.get("unitNumber")); + } + if (map.containsKey("roomNumber")) { + paiMai.setRoomNum((String) map.get("roomNumber")); + } + } + } + } + mav.setModel(BasicModel.buildOKModel().setResult(paimais)); + return mav; + } + + + private Map standard(String city, String address){ + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", city); + params.put("address", address); + try{ + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); + } catch(Exception e){ + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); + } catch(Exception ex){ + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("status"); + String msg = json.getString("msg"); + if(json.containsKey("result")){ + return (Map)json.get("result"); + } + } + return null; + } + public void setPaiMaiService(PaiMaiService paiMaiService) { this.paiMaiService = paiMaiService; } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DealPriceController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DealPriceController.java index 8abece9e2..54c19713d 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DealPriceController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DealPriceController.java @@ -15,8 +15,10 @@ import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.mongo.model.Metro; import com.fangjia.open.model.BasicModel; +import com.fangjia.service.bo.DistrictStatBo; import org.apache.commons.lang.StringUtils; import com.fangjia.core.util.DateUtil; @@ -211,6 +213,42 @@ public class DealPriceController { mv.setModel(resMap); return mv; } + + public Object searchListAction(final DealPriceModel model) { + RestfulModelAndView mv = new RestfulModelAndView(); + mv.setViewType("rest"); + + if (StringUtils.isBlank(model.getId())) { + mv.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "楼盘编号不能为空")); + return mv; + } + District district = districtService.findDistrictById(model.getId()); + DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + + if(district == null){ + mv.setModel(BasicModel.buildBadRequestModel("该小区不存在")); + return mv; + } + DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey); + Integer minPrice = null; + Integer maxPrice = null; + if(bo.getDistrictStat()!=null){ + minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.9); + maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.1); + } + Date startDate = null; + Date endDate = null; + if(StringUtils.isNotBlank(model.getStartDate())){ + startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd"); + } + if(StringUtils.isNotBlank(model.getEndDate())){ + endDate = DateUtil.parseDate(model.getEndDate(),"yyyyMMdd"); + } + + List dealPrices = dealPriceService.getNearlySameDealPrice(model.getId(), minPrice, maxPrice, startDate, endDate, model.getLimit()); + mv.setModel(BasicModel.buildOKModel().setResult(dealPrices)); + return mv; + } private List findDealPricesByName(String city,String region ,String name){ Calendar calendar = Calendar.getInstance(); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DistrictController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DistrictController.java index 859a04ef0..395cb8a8d 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DistrictController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/DistrictController.java @@ -7,11 +7,11 @@ import javax.servlet.http.HttpServletRequest; import com.fangjia.core.RegionData; import com.fangjia.core.util.DateUtil; -import com.fangjia.dal.mongo.model.RegionStat; -import com.fangjia.dal.mongo.model.RegionStatRent; +import com.fangjia.dal.mongo.model.*; import com.fangjia.open.model.AvgPriceQueryModel; import com.fangjia.open.model.BasicModel; import com.fangjia.service.datastore.RegionStatService; +import com.fangjia.service.district.DistrictFacilitysService; import com.fangjia.service.district.DistrictStatRentService; import com.fangjia.service.district.RegionStatRentService; import com.fangjia.service.mongo.fangjia.AverageAnalyService; @@ -38,8 +38,6 @@ import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.common.FangjiaServerAreaContextHolder; import com.fangjia.dal.common.ServerAreaData; import com.fangjia.dal.mongo.fangjia.model.ServerArea; -import com.fangjia.dal.mongo.model.DistrictHouse; -import com.fangjia.dal.mongo.model.DistrictStat; import com.fangjia.dal.mongo.model.bkoff.ExtractDistrict; import com.fangjia.dal.seaweed.model.District; import com.fangjia.dal.sql.model.ApiUser; @@ -93,6 +91,7 @@ public class DistrictController { private RegionBlockService regionBlockService; private RegionStatService regionStatService; private RegionStatRentService regionStatRentService; + private DistrictFacilitysService districtFacilitysService; public static final String[] COLUMNS = { "id", "name", "estateType", "buildType", "licence", "buildArea", "allArea", @@ -444,19 +443,19 @@ public class DistrictController { * * @return */ - public Object showAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "region") String region, - @Param(name = "name") String name, HttpServletRequest request) { - RestfulModelAndView mav = new RestfulModelAndView(); - mav.setViewType("rest"); - if (StringUtils.isBlank(name) || StringUtils.isBlank(city) || StringUtils.isBlank(region)) { - mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "小区所在城市,小区名,所在区域必必须输入")); - return mav; - } else { - DistrictBo districtBo = districtService.findByFullMode(new DistrictKey(city, region, name)); - if (null == districtBo) { - mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在,请检查查询条件")); + public Object showAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "region") String region, + @Param(name = "name") String name, HttpServletRequest request) { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + if (StringUtils.isBlank(name) || StringUtils.isBlank(city) || StringUtils.isBlank(region)) { + mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "小区所在城市,小区名,所在区域必必须输入")); return mav; - } + } else { + DistrictBo districtBo = districtService.findByFullMode(new DistrictKey(city, region, name)); + if (null == districtBo) { + mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在,请检查查询条件")); + return mav; + } districtBo.setStat(this.districtStatService.findDistrictStat(districtBo.getDistrictKey())); // 去除小区描述中的html标签 districtBo.setDescription(DataUtil.removeSpecialString(districtBo.getDescription())); @@ -1146,6 +1145,25 @@ public class DistrictController { ret.put("RESULT", 200); return mav; } + + public Object facilitysAction(DistrictSearchModel model, @Param(name = "city") String city, @Param(name = "region") String region, + @Param(name = "name") String name, HttpServletRequest request) { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + if (StringUtils.isBlank(name) || StringUtils.isBlank(city) || StringUtils.isBlank(region)) { + mav.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "小区所在城市,小区名,所在区域必必须输入")); + return mav; + } else { + District districtBo = districtService.findDistrict(new DistrictKey(city, region, name), "district"); + if (null == districtBo) { + mav.setModel(new HttpCode(OpenHttpCodeEnum.TARGET_DATA_NOT_EXIST, "小区数据不存在")); + return mav; + } + DistrictFacilitys facilitys = districtFacilitysService.findByDistrict(districtBo); + mav.setModel(BasicModel.buildOKModel().setResult(facilitys)); + } + return mav; + } @@ -1230,4 +1248,7 @@ public class DistrictController { this.regionStatRentService = regionStatRentService; } + public void setDistrictFacilitysService(DistrictFacilitysService districtFacilitysService) { + this.districtFacilitysService = districtFacilitysService; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/EvaluationController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/EvaluationController.java index 67e7b084c..7ed1a83f4 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/EvaluationController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/EvaluationController.java @@ -10,9 +10,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fangjia.dal.mongo.model.BsEvaluation; +import com.fangjia.dal.mongo.model.bkoff.DealPrice; import com.fangjia.service.bo.AddrEvaResult; +import com.fangjia.service.bo.DistrictStatBo; import com.fangjia.service.bo.EvaluationBo; import com.fangjia.service.bo.HouseScorer; +import com.fangjia.service.datastore.*; +import com.fangjia.service.district.DistrictStatService; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; @@ -54,11 +59,6 @@ import com.fangjia.open.model.RestfulModelAndView; import com.fangjia.service.api.AutoCompleteService; import com.fangjia.service.api.KnowbaseService; import com.fangjia.service.common.SellSimilar; -import com.fangjia.service.datastore.BusinessEstateService; -import com.fangjia.service.datastore.DistrictService; -import com.fangjia.service.datastore.EvaluationReportService; -import com.fangjia.service.datastore.EvaluationService; -import com.fangjia.service.datastore.HouseService; import com.fangjia.service.sql.ApiUserService; import com.fangjia.service.sql.UserService; import com.fangjia.service.web.AddressService; @@ -94,6 +94,8 @@ public class EvaluationController { private ApiUserService apiUserService; private UserService userService; private AddressService addressService; + private DistrictStatService districtStatService; + private BsEvaluationService bsEvaluationService; private final static String AK = OpenConfig.getConfig().getBaiduAk(); public Object lngLatEvaluateAction(EvaluationModel model) { @@ -1005,6 +1007,44 @@ public class EvaluationController { return mav; } + public Object bsListAction(EvaluationModel model) { + RestfulModelAndView mv = new RestfulModelAndView(); + mv.setViewType("rest"); + + if (StringUtils.isBlank(model.getId())) { + mv.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "楼盘编号不能为空")); + return mv; + } + District district = districtService.findDistrictById(model.getId()); + DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + + if(district == null){ + mv.setModel(BasicModel.buildBadRequestModel("该小区不存在")); + return mv; + } + DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey); + Integer minPrice = null; + Integer maxPrice = null; + if(bo.getDistrictStat()!=null){ + minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8); + maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2); + } + Date startDate = null; + Date endDate = null; + if(StringUtils.isNotBlank(model.getStartDate())){ + startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd"); + } + if(StringUtils.isNotBlank(model.getEndDate())){ + endDate = DateUtil.parseDate(model.getEndDate(),"yyyyMMdd"); + } + + List dealPrices = bsEvaluationService.getNearlySameEvaluation(model.getId(), minPrice, maxPrice, startDate, endDate, model.getLimit()); + mv.setModel(BasicModel.buildOKModel().setResult(dealPrices)); + return mv; + } + + + public void setEvaluationService(EvaluationService evaluationService) { this.evaluationService = evaluationService; } @@ -1017,6 +1057,18 @@ public class EvaluationController { this.knowbaseService = knowbaseService; } + + + public void setDistrictStatService(DistrictStatService districtStatService) { + this.districtStatService = districtStatService; + } + + + + public void setBsEvaluationService(BsEvaluationService bsEvaluationService) { + this.bsEvaluationService = bsEvaluationService; + } + public void setAutoCompleteService(AutoCompleteService autoCompleteService) { this.autoCompleteService = autoCompleteService; } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java index ebb6c9025..ff5708174 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java @@ -11,6 +11,8 @@ import com.fangjia.dal.mongo.model.DistrictFacilitys; import com.fangjia.dal.mongo.model.FangjiaOfficialAreaMap; import com.fangjia.dal.mongo.model.Metro; import com.fangjia.dal.mongo.model.StatsIndex; +import com.fangjia.dal.seawater.dao.SeawaterDao; +import com.fangjia.dal.seawater.model.Seawater; import com.fangjia.dal.seaweed.model.District; import com.fangjia.dal.sql.model.ApiUser; import com.fangjia.datastore.driver.FacetResult; @@ -29,6 +31,7 @@ import com.fangjia.open.ws.query.CollateralSampleQuery; import com.fangjia.open.ws.query.ShopCollateralSampleQuery; import com.fangjia.service.address.AddressParser; import com.fangjia.service.bo.Collateral; +import com.fangjia.service.bo.DistrictStatBo; import com.fangjia.service.bo.Sample; import com.fangjia.service.bo.ShopSample; import com.fangjia.service.datastore.CzbankSampleService; @@ -39,11 +42,13 @@ import com.fangjia.service.datastore.bean.CollateralSampleQueryBean; import com.fangjia.service.datastore.bean.ShopCollateralSampleQueryBean; import com.fangjia.service.district.DistrictFacilitysService; import com.fangjia.service.district.DistrictStatService; +import com.fangjia.service.district.SqmetreRentService; import com.fangjia.service.menu.Item; import com.fangjia.service.menu.MenuCategoryEnum; import com.fangjia.service.menu.Value; import com.fangjia.service.mongo.fangjia.DealPriceService; import com.fangjia.service.mongo.fangjia.MetroService; +import com.fangjia.service.mongo.fangjia.SeawaterService; import com.fangjia.service.mongo.fangjia.StatsIndexService; import com.fangjia.service.open.FangjiaOfficialAreaService; import com.fangjia.service.open.HousePojo; @@ -86,6 +91,9 @@ public class HouseController { private CzbankSampleService czbankSampleService; private DistrictService districtService; private FangjiaOfficialAreaService fangjiaOfficialAreaService; + + private SeawaterService seawaterService; + private SeawaterDao seawaterDao; private List PROPERTY_TYPE_CODE_LIST = Arrays.asList("01", "02"); @@ -399,6 +407,107 @@ public class HouseController { } } + public Object listAction(final HouseSearchModel model) { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + if (StringUtils.isBlank(model.getId()) && (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getRegion()) || StringUtils.isBlank(model.getName()))) { + mav.setModel(BasicModel.buildBadRequestModel("楼盘编号或城市,区域,名称为必填项")); + return mav; + } + District district = null; + DistrictKey districtKey = null; + if(StringUtils.isNotBlank(model.getName())){ + districtKey = new DistrictKey(model.getCity(), model.getRegion(), model.getName()); + district = districtService.findDistrict(districtKey, "district"); + }else{ + district = districtService.findDistrictById(model.getId()); + if(district!=null){ + districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + } + } + + if(district == null){ + mav.setModel(BasicModel.buildBadRequestModel("该小区不存在")); + return mav; + } + DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey); + Integer minPrice = null; + Integer maxPrice = null; + if(bo.getDistrictStat()!=null){ + minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.9); + maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.1); + } + List names = new ArrayList(); + names.add(district.getName()); + if(district.getAlias() != null){ + for(String alia : district.getAlias()){ + if(StringUtils.isNotBlank(alia) && !names.contains(alia)){ + names.add(alia); + } + } + } + List houses = seawaterDao.findSeawatersFromEs("sell", district.getCity(), district.getRegion(), district.getName(), district.getAlias(), null, model.getStartTime(), model.getEndTime(),null,null,minPrice, maxPrice,null,null,"p_date", false,0, model.getPageSize(),"latest_seawater"); + //List houses1 = seawaterDao.findHouses(district.getCity(), district.getRegion(), names, minPrice, maxPrice, model.getPageSize()); + mav.setModel(BasicModel.buildOKModel().setResult(houses)); + return mav; + } + + + + public Object arroundlistAction(final HouseSearchModel model) { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + if (StringUtils.isBlank(model.getId()) && (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getRegion()) || StringUtils.isBlank(model.getName()))) { + mav.setModel(BasicModel.buildBadRequestModel("楼盘编号或城市,区域,名称为必填项")); + return mav; + } + District district = null; + DistrictKey districtKey = null; + if(StringUtils.isNotBlank(model.getName())){ + districtKey = new DistrictKey(model.getCity(), model.getRegion(), model.getName()); + district = districtService.findDistrict(districtKey, "district"); + }else{ + district = districtService.findDistrictById(model.getId()); + if(district!=null){ + districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + } + } + + if(district == null){ + mav.setModel(BasicModel.buildBadRequestModel("该小区不存在")); + return mav; + } + + //周边小区,默认10 + List districts = districtService.findNearestDistrict(district, 1000, model.getDistCount()); + List houses = new ArrayList(); + for(District dist : districts){ + districtKey = new DistrictKey(dist.getCity(), dist.getRegion(), dist.getName()); + DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey); + Integer minPrice = null; + Integer maxPrice = null; + if(bo.getDistrictStat()!=null){ + minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.9); + maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.1); + } + List names = new ArrayList(); + names.add(district.getName()); + if(district.getAlias() != null){ + for(String alia : district.getAlias()){ + if(StringUtils.isNotBlank(alia) && !names.contains(alia)){ + names.add(alia); + } + } + } + List arroundhouses = seawaterDao.findSeawatersFromEs("sell", dist.getCity(), dist.getRegion(), dist.getName(), dist.getAlias(), null, model.getStartTime(), model.getEndTime(),null,null,minPrice, maxPrice,null,null,"p_date", false,0, model.getPageSize(),"latest_seawater"); + if(arroundhouses!=null && arroundhouses.size()>0){ + houses.addAll(arroundhouses); + } + } + mav.setModel(BasicModel.buildOKModel().setResult(houses)); + return mav; + } + String getPicUrl(String url, List urls) { if (!urls.contains(url)) { urls.add(url); @@ -832,6 +941,13 @@ public class HouseController { return ret; } + public void setSeawaterService(SeawaterService seawaterService) { + this.seawaterService = seawaterService; + } + + public void setSeawaterDao(SeawaterDao seawaterDao) { + this.seawaterDao = seawaterDao; + } private boolean checkExists(FacetQueryResult houseBoList, HousePojo house) { for (HousePojo bo : houseBoList) { diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java index 1ba157ee5..1874f3500 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java @@ -31,12 +31,15 @@ import javax.validation.Valid; import com.fangjia.core.util.*; import com.fangjia.dal.*; import com.fangjia.dal.mongo.model.*; +import com.fangjia.dal.mongo.open.model.CommunityBasePrice; +import com.fangjia.dal.mongo.open.model.CommunityPoi; import com.fangjia.dal.seawater.dao.SeawaterDao; import com.fangjia.dal.seawater.model.Seawater; import com.fangjia.open.dto.*; import com.fangjia.service.district.*; import com.fangjia.service.mongo.fangjia.*; import com.fangjia.service.open.*; +import com.fangjia.service.open.impl.CommunityPoiServiceImpl; import com.fangjia.service.util.DistrictScoreUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -175,6 +178,9 @@ public class PropertyController { private SeawaterDao seawaterDao; private SeawaterService seawaterService; private SqmetreRentService sqmetreRentService; + private CommunityPoiService communityPoiService; + private CommunityBasePriceService communityBasePriceService; + private EvaluateFactorService evaluateFactorService; private FileDao fileDao = FileDao.getInstance(); private static final int DEFAULT_PAGE_SIZE = 20; @@ -390,10 +396,31 @@ public class PropertyController { put("5000", "five");// 五线 } }; + /** + * 第三方均价映射 + */ + private static final Map OTHER_PRICE_MAP = new HashMap() { + { + put("zhuge_price", "诸葛找房"); + put("anjuke_price", "安居客"); + put("fang_price", "房天下"); + put("lianjia_price", "链家"); + put("cityhouse_price", "禧泰数据"); + put("maitian_price", "麦田"); + put("ke_price", "贝壳"); + put("taofang_price", "淘房365"); + put("zhongyuan_price", "中原"); + put("tbs_price", "兔博士"); + put("qfang_price", "Q房"); + put("fangtan_price", "房探"); + put("fangduoduo_price", "房多多"); + put("wiwj_price", "我爱我家"); + } + }; /** * 利用百度API把GPS转换成Google经纬度 - * + * * @param lng * @param lat * @return @@ -415,7 +442,7 @@ public class PropertyController { /** * 利用算法模板把GPS转换成Google经纬度 - * + * * @param lng * @param lat * @return @@ -607,7 +634,7 @@ public class PropertyController { /** * 判断小区是否有经纬度 - * + * * @param district * @return */ @@ -618,7 +645,7 @@ public class PropertyController { /** * 调用匹配接口匹配小区 - * + * * @param city * @param address * @param region @@ -666,17 +693,6 @@ public class PropertyController { } String userId = FangjiaApiUtil.parseUserId(model.getToken()); - /**超级用户和上海交大账户不控制权限*/ - if (!"1007497".equals(userId) && !"1007632".equals(userId) && !"1007548".equals(userId) - && !"1007486".equals(userId) && !"1007533".equals(userId) && !"1007630".equals(userId) - && !"1007705".equals(userId) && !"1007739".equals(userId) && !"1007736".equals(userId) - && !"1007741".equals(userId) && !"1007742".equals(userId) && !"1007743".equals(userId) - && !"1007747".equals(userId) && !"1007757".equals(userId) - && model.getDetailLevel() != null && model.getDetailLevel() != 0) {// 临时权限控制 - mav.setModel(BasicModel.buildUnAuthorizedModel()); - return mav; - } - District district = null; if (StringUtils.isNotBlank(model.getId())){ if(ObjectId.isValid(model.getId())){ @@ -740,18 +756,18 @@ public class PropertyController { } else { districtInfoDto.setBuildingType(""); } - districtInfoDto.setAlias(district.getAlias()); + districtInfoDto.setAlias(district.getMappingAlias()); districtInfoDto.setAddressAlias(district.getAddrAlias()); districtInfoDto.setCommunity(district.getStreetCommunity()); districtInfoDto.setCommercialArea(district.getBusinessQuarter()); if (district.getHouseholdCount() != null) { - districtInfoDto.setTotalUnitCount(district.getHouseholdCount().toString()); + districtInfoDto.setTotalUnitCount(SeaweedUtils.formatHouseholdCount(district.getHouseholdCount().toString())); } else { districtInfoDto.setTotalUnitCount(""); } districtInfoDto.setManagementFee(district.getEstateCharge()); if (district.getCarSiteCount() != null) { - districtInfoDto.setParking(district.getCarSiteCount().toString()); + districtInfoDto.setParking(SeaweedUtils.formatCarSiteCount(district.getCarSiteCount().toString())); } else { districtInfoDto.setParking(""); } @@ -772,10 +788,10 @@ public class PropertyController { districtInfoDto.setFinishBuildTime(district.getFinishBuildingDate()); districtInfoDto.setMoveinTime(district.getLiveDate()); - districtInfoDto.setFloorSpace(district.getAllArea()); + districtInfoDto.setFloorSpace(SeaweedUtils.formatAllArea(district.getAllArea())); districtInfoDto.setConstructionSpace(district.getBuildArea()); - districtInfoDto.setPlotRatio(district.getCubagePercent()); - districtInfoDto.setGreenPercentage(district.getVirescencePercent()); + districtInfoDto.setPlotRatio(SeaweedUtils.formatCubagePercent(district.getCubagePercent())); + districtInfoDto.setGreenPercentage(SeaweedUtils.formatVirescencePercent(district.getVirescencePercent())); districtInfoDto.setPreSalePermit(district.getLicence()); districtInfoDto.setDeveloper(district.getDeveloper()); districtInfoDto.setDiscount(district.getDiscount()); @@ -792,6 +808,7 @@ public class PropertyController { districtInfoDto.setDescription(district.getDescription()); districtInfoDto.setSalesOfficeAdd(district.getSellAddress()); districtInfoDto.setSalesPhoneNumber(district.getMobile()); + districtInfoDto.setTownship(district.getTownship()); if (district.getLoudongCount() != null && district.getLoudongCount() > 0) { districtInfoDto.setBuildingCount(district.getLoudongCount()); } @@ -960,6 +977,12 @@ public class PropertyController { return mav; } + if(model.getMaxFloor() == null && model.getFloor() != null &&StringUtils.isNotBlank(model.getBuildingNumber())){ + Loudong loudong = loudongService.findForEvaluate(district.getId(), model.getBuildingNumber(), model.getUnitNumber()); + if(loudong != null && loudong.getFloors() >= model.getFloor()){ + model.setMaxFloor(loudong.getFloors()); + } + } model.setRegion(district.getRegion()); model.setDistrictName(district.getName()); if (StringUtils.isBlank(model.getPropertyType())) { @@ -996,6 +1019,32 @@ public class PropertyController { } } + // 调整面积不同面积价格 + try { + DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district)); + int orgAvgPrice = 0; + if (districtStatBo != null) { + if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) { + orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice(); + } else if (districtStatBo.getDistrictStat() != null) { + orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice(); + } + } + if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) { + int factorPrice = evaluation.getAvgPrice(); + int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice); + Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95); + Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05); + // 偏离度超过5%不进行调整 + if (minPrice <= avgPrice && avgPrice <= maxPrice) { + evaluation.setAvgPrice(avgPrice); + evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea())); + } + } + } catch (Exception ex) { + + } + if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0 && (cityPriceCredit == null || evaluation.getCredit() >= cityPriceCredit)) { Map districtPriceMap = new HashMap(); @@ -1116,7 +1165,7 @@ public class PropertyController { model.setCalDate(calDate); } /* 先到CPDB库中查找小区 */ - District district = matchDistrict(model.getCity(), model.getAddress(), model.getDistrict(), model.getName()); + District district = districtService.findDistrict(new DistrictKey(model.getCity(), model.getDistrict(), model.getName()), "district");//matchDistrict(model.getCity(), model.getAddress(), model.getDistrict(), model.getName()); if(district == null){ //防止地址模糊,名称详细的情况 district = matchDistrict(model.getCity(), model.getName(), model.getDistrict(), model.getAddress()); @@ -1166,19 +1215,52 @@ public class PropertyController { evaluationService.remove(evaluation.getId()); mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData()); return mav; + } + // 调整面积不同面积价格 + try { + DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district)); + int orgAvgPrice = 0; + if (districtStatBo != null) { + if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) { + orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice(); + } else if (districtStatBo.getDistrictStat() != null) { + orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice(); + } + } + if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) { + int factorPrice = evaluation.getAvgPrice(); + int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice); + Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95); + Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05); + // 偏离度超过5%不进行调整 + if (minPrice <= avgPrice && avgPrice <= maxPrice) { + evaluation.setAvgPrice(avgPrice); + evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea())); + } + } + } catch (Exception ex) { + } Map districtPriceMap = new LinkedHashMap(); districtPriceMap.put("city", district.getCity()); districtPriceMap.put("district", district.getRegion()); districtPriceMap.put("name", district.getName()); long totalPrice = evaluation.getBigTotalPrice(); - if(CITY_CORRECTION_FACTOR.containsKey(district.getCity())){ - totalPrice = (long)(totalPrice * (1 - CITY_CORRECTION_FACTOR.get(district.getCity()))); - evaluation.setBigTotalPrice(totalPrice); - evaluation.setAvgPrice((int)(totalPrice/evaluation.getArea())); - } + // 取消系数下调 +// if(CITY_CORRECTION_FACTOR.containsKey(district.getCity())){ +// totalPrice = (long)(totalPrice * (1 - CITY_CORRECTION_FACTOR.get(district.getCity()))); +// evaluation.setBigTotalPrice(totalPrice); +// evaluation.setAvgPrice((int)(totalPrice/evaluation.getArea())); +// } districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice()); districtPriceMap.put("unitPrice", evaluation.getAvgPrice()); + // 新增置信度 + CommunityBasePrice communityBasePrice = communityBasePriceService.getById(district.getId()); + if (communityBasePrice != null) { + districtPriceMap.put("credit", communityBasePrice.getCredit()); + } else { + districtPriceMap.put("credit", evaluation.getCredit()); + } List names = new ArrayList(); names.add(district.getName()); if(district.getAlias() != null){ @@ -1190,6 +1272,31 @@ public class PropertyController { } Integer minPrice = (int)(evaluation.getAvgPrice() * 0.8); Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.2); + Integer min10Price = (int)(evaluation.getAvgPrice() * 0.9); + Integer max10Price = (int)(evaluation.getAvgPrice() * 1.1); + // 新增第三方均价 + try { + double dCredit = 0.61; + Map rMap = getLastEvaluationPrice(district, evaluation, dCredit); + if (null != rMap) { + if (rMap.containsKey("other_price")) { + Map otherPriceMap = (Map) rMap.get("other_price"); + Map priceResultMap = new HashMap(); + for (String key : otherPriceMap.keySet()) { + Integer price = otherPriceMap.get(key); + // 剔除偏差大于10的 + if (min10Price <= price && max10Price >= price) { + if (OTHER_PRICE_MAP.containsKey(key)) { + priceResultMap.put(OTHER_PRICE_MAP.get(key), price); + } + } + } + districtPriceMap.put("otherPrice", priceResultMap); + } + } + } catch (Exception ex) { + + } List houses = seawaterDao.findHouses(district.getCity(), district.getRegion(), names,minPrice, maxPrice, 20); if(houses.size() > 3){ districtPriceMap.put("calcType", 1); @@ -1218,7 +1325,7 @@ public class PropertyController { }else if(district.getLng() != null && district.getLng() > 0){ double lng = DataUtil.roundDouble(district.getLng() / 10000000000.0,6); double lat = DataUtil.roundDouble(district.getLat() / 10000000000.0, 6); - List districts = districtService.findNearestDistrict(district.getEstateType2(), lng, lat, 1000 * 3 , 4, null); + List districts = districtService.findNearestDistrict(district.getEstateType2(), lng, lat, 1000 * 3 , 6, null); if(districts.size() < 2){ evaluationService.remove(evaluation.getId()); mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData()); @@ -1256,9 +1363,15 @@ public class PropertyController { districtDto.append("buildYear", String.valueOf(buildYear)); } districtAnalyData = districtAnalyDataService.findByDistrictKey(new DistrictKey(d)); - if(districtAnalyData != null && districtAnalyData.getHalfYearMarkup() != null){ - districtDto.append("halfYearMarkup",DataUtil.roundDouble( districtAnalyData.getHalfYearMarkup() * 100 ,2)); + if(districtAnalyData != null){ + if (districtAnalyData.getHalfYearMarkup() != null) { + districtDto.append("halfYearMarkup", DataUtil.roundDouble(districtAnalyData.getHalfYearMarkup() * 100, 2)); + } + if (districtAnalyData.getAvgPrice() != null && minPrice <= districtAnalyData.getAvgPrice() && maxPrice >= districtAnalyData.getAvgPrice()) { + districtDto.append("avgPrice", districtAnalyData.getAvgPrice()); + } } + nearCommunityDtos.add(districtDto); } Integer buildYear = districtService.getBuildYear(district); @@ -1266,6 +1379,18 @@ public class PropertyController { modelFeaturesFto.put("buildYear", String.valueOf(buildYear)); } modelFeaturesFto.append("nearCommunity", nearCommunityDtos); + + // 模型特征新增周边数量 + CommunityPoi communityPoi = communityPoiService.getById(district.getId()); + if (communityPoi != null) { + modelFeaturesFto.put("subway", communityPoi.getSubway()); + modelFeaturesFto.put("traffic", communityPoi.getTraffic()); + modelFeaturesFto.put("bank", communityPoi.getBank()); + modelFeaturesFto.put("primary", communityPoi.getPrimary()); + modelFeaturesFto.put("hospital", communityPoi.getHospital()); + modelFeaturesFto.put("junior", communityPoi.getJunior()); + modelFeaturesFto.put("funeral", communityPoi.getFuneral()); + } districtPriceMap.put("modelFeatures", modelFeaturesFto); } mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap)); @@ -1473,7 +1598,7 @@ public class PropertyController { return mav; } } - + /** * 四川锦程 定制接口 多建筑年代 * @param model @@ -1585,7 +1710,7 @@ public class PropertyController { districtPriceMap.put("buildYear", matcher3.group()); } } - + // 根据城市等 级设置D级可信度 ApiUserAuthority apiUserAuthority = apiUserAuthorityService @@ -2098,7 +2223,7 @@ public class PropertyController { /** * 小区租金查询接口 - * + * * @param model * @return */ @@ -2363,7 +2488,7 @@ public class PropertyController { mav.setModel(BasicModel.buildBadRequestModel("size(面积)不能为空")); return mav; } - District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), + District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName().replace(" ",""), "district"); if (null == district) { mav.setModel(BasicModel.buildBadRequestModel("该小区不存在")); @@ -2577,7 +2702,7 @@ public class PropertyController { /** * 批量获取小区的均价,均价走势数据 - * + * * @param request * @return */ @@ -2719,7 +2844,7 @@ public class PropertyController { /** * 批量获取小区的配套数据,最多12个小区 - * + * * @param request * @return */ @@ -2864,7 +2989,7 @@ public class PropertyController { /** * 获取JSON参数中的num参数值 - * + * * @param jo * @return */ @@ -2889,7 +3014,7 @@ public class PropertyController { /** * 获取JSON参数中的radius值 - * + * * @param jo * @return */ @@ -3697,7 +3822,7 @@ public class PropertyController { /** * 解析出关键字中的小区名 - * + * * @param keyword * @return */ @@ -3814,7 +3939,7 @@ public class PropertyController { /** * 小区统计分析接口 - * + * * @param model * @return */ @@ -3899,7 +4024,7 @@ public class PropertyController { /** * 小区交通接口 - * + * * @param model * @return */ @@ -3957,7 +4082,7 @@ public class PropertyController { /** * 小区周边接口 - * + * * @param model * @return */ @@ -4016,7 +4141,7 @@ public class PropertyController { /** * 相同小区相似户型房源挂牌量接口
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源 - * + * * @author yinjihuan * @date 2016年9月1日 * @param city @@ -4056,7 +4181,7 @@ public class PropertyController { /** * 周边小区相似户型挂牌量接口
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源 - * + * * @author yinjihuan * @date 2016年9月1日 * @param city @@ -4107,7 +4232,7 @@ public class PropertyController { /** * 小区周边一公里均价 - * + * * @author wenyan * @param model * @return @@ -4130,7 +4255,7 @@ public class PropertyController { /** * 相同小区相似户型租金范围查询接口 - * + * * @param model * @return */ @@ -4173,7 +4298,7 @@ public class PropertyController { /** * 周边小区相似户型租金范围查询接口 - * + * * @param model * @return */ @@ -4236,7 +4361,7 @@ public class PropertyController { /** * 室号查询接口 - * + * * @param model * @return */ @@ -4272,7 +4397,7 @@ public class PropertyController { /** * 楼栋楼层信息查询接口 - * + * * @param model * @return */ @@ -4297,7 +4422,7 @@ public class PropertyController { /** * 楼栋查询接口 - * + * * @param model * @return */ @@ -4342,7 +4467,7 @@ public class PropertyController { /** * 楼栋查询接口 - * + * * @param model * @return */ @@ -4795,7 +4920,7 @@ public class PropertyController { /** * 房产交易记录查询 - * + * * @param model * @return */ @@ -4855,7 +4980,7 @@ public class PropertyController { /** * 房产拍卖记录 - * + * * @param model * @return */ @@ -4916,7 +5041,7 @@ public class PropertyController { /** * 房产近期评估次数 - * + * * @param model * @return */ @@ -5412,6 +5537,36 @@ public class PropertyController { } } + public Object searchHouseLoudongAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + + if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber()) || StringUtils.isBlank(model.getRoomNumber())){ + mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号,室为必填项")); + return mav; + } + + List houseLoudongs = houseLoudongService.findAll(model.getId(), model.getHouseNumber(), model.getUnitNumber(), model.getRoomNumber()); + mav.setModel(BasicModel.buildOKModel().setResult(houseLoudongs)); + return mav; + } + + + public Object searchLoudongAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + + if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber())){ + mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号为必填项")); + return mav; + } + + + List loudongs = loudongService.findAll(model.getId(), model.getHouseNumber(), model.getUnitNumber()); + mav.setModel(BasicModel.buildOKModel().setResult(loudongs)); + return mav; + } + public void setHouseLoudongService(HouseLoudongService houseLoudongService) { this.houseLoudongService = houseLoudongService; @@ -5601,4 +5756,16 @@ public class PropertyController { public void setRentDealPriceService(RentDealPriceService rentDealPriceService) { this.rentDealPriceService = rentDealPriceService; } + + public void setCommunityPoiService(CommunityPoiService communityPoiService) { + this.communityPoiService = communityPoiService; + } + + public void setEvaluateFactorService(EvaluateFactorService evaluateFactorService) { + this.evaluateFactorService = evaluateFactorService; + } + + public void setCommunityBasePriceService(CommunityBasePriceService communityBasePriceService) { + this.communityBasePriceService = communityBasePriceService; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/requestController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/requestController.java new file mode 100644 index 000000000..d23a312bb --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/requestController.java @@ -0,0 +1,36 @@ +package com.fangjia.open.controllers; + +import com.fangjia.core.util.AnalyticsUtil; +import com.fangjia.open.interceptors.Authority; +import com.fangjia.open.interceptors.Role; +import com.fangjia.open.model.BasicModel; +import com.fangjia.open.model.RestfulModelAndView; + +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +public class requestController { + + /** + * 获取请求的request和IP信息 + * @param request + * @return + */ + public Object requestAction(HttpServletRequest request) { + RestfulModelAndView mav = new RestfulModelAndView(); + mav.setViewType("rest"); + String ip = AnalyticsUtil.getIpAddress(request); + Map map = new HashMap(); + Enumeration headerNames = request.getHeaderNames(); + while (headerNames.hasMoreElements()) { + String key = (String) headerNames.nextElement(); + String value = request.getHeader(key); + map.put(key, value); + } + map.put("ip", ip); + mav.setModel(BasicModel.buildOKModel().setResult(map)); + return mav; + } +} diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java index 4cc728b6a..826c55070 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java @@ -80,7 +80,7 @@ public class DistrictController { // response.sendRedirect("/coming"); // return null; // } - if("b".equals(login_user_type)){ + if("b".equals(login_user_type) || "gb".equals(login_user_type)){ CacheUtils.putValue(CachePolicyEnum.LONG, UsersInfoService.class, weiXinId + "_city_"+ login_user_type , model.getCityName()); } Long userId = Long.parseLong(CookieUtils.getCookieValue(request,"login_user_id")); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java index 81419d5e4..e97bc10ae 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java @@ -80,7 +80,19 @@ public class UserController { } else { weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id"); } + + String cacheWeiXinId = CookieUtils.getCookieValue(request,"login_enterpriseuser_weixinid"); + try { + if(StringUtils.isNotBlank(weiXinId) && StringUtils.isNotBlank(cacheWeiXinId)){ + System.out.println("cookie weiXinId:"+weiXinId); + response.sendRedirect("reqCityChoicePage?type=b&code="+model.getCode()); + } + } catch (IOException e) { + e.printStackTrace(); + } + if(weiXinId == null && StringUtils.isNotBlank(model.getCode())) {//微信公众号渤海银行 + System.out.println("bh OPEN_ID 随机生成:" + weiXinId); weiXinId = DataConvertUtil.getRandomString2(16); } if(weiXinId != null && !weiXinId.equals("")){ @@ -115,33 +127,49 @@ public class UserController { if(weiXinId != null && !weiXinId.equals("")){ CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response); } - System.out.println("微信OPEN_ID:" + weiXinId); + System.out.println("reqCityChoicePage 微信OPEN_ID:" + weiXinId); //企业用户入口查询企业账户开通的城市 - if(type.equals("b")){ + if(type.equals("b") || type.equals("gb")){ //Boolean isLogin = usersInfoService.checkEnterpriseWeiXinUserIsLogin(weiXinId); String cacheWeiXinId = CookieUtils.getCookieValue(request,"login_enterpriseuser_weixinid"); - if(cacheWeiXinId != null) { - Long userId = Long.parseLong(CookieUtils.getCookieValue(request,"login_user_id")); + String loginUserIdstr = CookieUtils.getCookieValue(request,"login_user_id"); + if(cacheWeiXinId != null && StringUtils.isNotBlank(loginUserIdstr)) { + Long userId = Long.parseLong(loginUserIdstr); CookieUtils.setCookie("login_user_id", userId + "", "/", 60 * 60 * 24 *7, response); try { FjtUsers users = fjtUsersService.findById(userId); - List citys = userCityService.findSupportCityByUserId(userId); - if(citys == null || citys.isEmpty()){ - citys = Arrays.asList("上海"); - } + + if(users.getRole()==17 && type.equals("gb")){ + CookieUtils.removeCookie(request, response, "login_enterpriseuser_weixinid"); + response.sendRedirect("reqLoginPage"); + }else if(users.getRole()==12 && type.equals("b")){ + CookieUtils.removeCookie(request, response, "login_enterpriseuser_weixinid"); + response.sendRedirect("bhydLoginPage?code="+model.getCode()); + }else{ + List citys = userCityService.findSupportCityByUserId(userId); + if(citys == null || citys.isEmpty()){ + citys = Arrays.asList("上海"); + } // if(users!=null && users.getRole() == 12){ // citys = Arrays.asList("上海"); // }else{ // citys = userCityService.findSupportCityByUserId(userId); // } - model.setCitys(citys); + model.setCitys(citys); + } } catch (Exception e) { model.setCitys(new ArrayList()); } } else { + CookieUtils.removeCookie(request, response, "login_enterpriseuser_weixinid"); try { - response.sendRedirect("reqLoginPage"); +// if(type.equals("bh")){ +// response.sendRedirect("bhydLoginPage?code="+model.getCode()); +// }else{ + response.sendRedirect("reqLoginPage"); +// } + } catch (IOException e) { } } @@ -173,6 +201,20 @@ public class UserController { } catch (Exception e) { } } + + public Object bhloginOutAction(UserModel model,HttpServletRequest request, HttpServletResponse response, String city) { + try { + CookieUtils.removeCookie(request, response,"login_user_id"); + CookieUtils.removeCookie(request, response,"login_user_type"); + CookieUtils.removeCookie(request, response,"login_enterpriseuser_weixinid"); + response.sendRedirect("bhydLoginPage?code=bhydcode"); + } catch (Exception e) { + e.printStackTrace(); + } + return model; + } + + public Object aboutAction(UserModel model) { return model; @@ -285,7 +327,7 @@ public class UserController { return resultModel; } CookieUtils.setCookie("login_user_id", user.getId() + "", "/", 60 * 60 * 24 *7, response); - CookieUtils.setCookie("login_user_type", "b", "/", 60 * 60 * 24 *7, response); + CookieUtils.setCookie("login_user_type", "gb", "/", 60 * 60 * 24 *7, response); CookieUtils.setCookie("login_enterpriseuser_weixinid", weiXinId, "/", 60 * 60 * 24 *7, response); //CacheUtils.putValue(CachePolicyEnum.LONG, UsersInfoService.class, weiXinId + "_" + Message.SMS_CODE_TYPE_ENTER_LOGIN , user.getId()); resultModel.setResult(Message.RESULT_SUCCESS); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java index 6ed2a56fd..272979fca 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java @@ -1,29 +1,5 @@ package com.fangjia.open.controllers.weixin; -import java.io.IOException; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.fangjia.dal.sql.model.*; -import com.fangjia.open.util.BHBankUtils; -import com.fangjia.open.util.InsidePolygon2; -import com.fangjia.service.mongo.fangjia.PriceBorderService; -import com.fangjia.service.sql.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.math.NumberUtils; -import org.apache.tools.ant.util.DateUtils; -import org.sothis.core.util.Pager; -import org.sothis.web.mvc.annotation.Param; - import com.fangjia.core.util.DataUtil; import com.fangjia.core.util.DateUtil; import com.fangjia.dal.common.DistrictKey; @@ -33,11 +9,12 @@ import com.fangjia.dal.mongo.model.LatlngPolygon; import com.fangjia.dal.mongo.model.PriceBorder; import com.fangjia.dal.mongo.model.bkoff.DistrictHouseStat; import com.fangjia.dal.seaweed.model.District; +import com.fangjia.dal.sql.model.*; import com.fangjia.open.compatible.model.JsonModel; +import com.fangjia.open.model.BasicModel; import com.fangjia.open.model.RestfulModelAndView; import com.fangjia.open.model.weixin.EvaluationModel; -import com.fangjia.open.util.InsidePolygon; -import com.fangjia.open.util.Point; +import com.fangjia.open.util.*; import com.fangjia.service.bo.DistrictStatBo; import com.fangjia.service.bo.HouseBo; import com.fangjia.service.datastore.DistrictService; @@ -50,14 +27,34 @@ import com.fangjia.service.email.EmailService; import com.fangjia.service.email.Mail; import com.fangjia.service.email.MailUser; import com.fangjia.service.mongo.bkoff.DistrictHouseStatService; -import com.fangjia.service.mongo.fangjia.AverageStatisticsService; -import com.fangjia.service.mongo.fangjia.DealPriceService; -import com.fangjia.service.mongo.fangjia.LatlngPolygonService; +import com.fangjia.service.mongo.fangjia.*; import com.fangjia.service.sms.SmsException; import com.fangjia.service.sms.SmsService; +import com.fangjia.service.sql.*; import com.fangjia.service.user.UsersInfoService; import com.fangjia.service.util.CookieUtils; import com.google.common.collect.ImmutableMap; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; +import org.apache.tools.ant.util.DateUtils; +import org.bson.types.ObjectId; +import org.sothis.core.util.Pager; +import org.sothis.web.mvc.ActionContext; +import org.sothis.web.mvc.annotation.Param; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URL; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Created by wenyan on 2016/7/15. @@ -100,11 +97,17 @@ public class WeiXinEvaluationController { private GoldLogsService goldLogsService; private PriceBorderService priceBorderService; private BohaiEvaluationAuditService bohaiEvaluationAuditService; - + private FormalReportService formalReportService; + private FileService fileService; + private ReportFileAttachService reportFileAttachService; + private final static String DD_ID = "5938c43984aec20a36f474c5"; private static List MOBILES = new ArrayList(); + private static long MAX_FILE_BYTES_SIZE = 1024 * 1024 * 5; + private FileDao fileDao = FileDao.getInstance(); + static { MOBILES.add("13916992399"); MOBILES.add("15201904147"); @@ -214,6 +217,7 @@ public class WeiXinEvaluationController { Pager pager = new Pager(10); pager.setCurrentPage(NumberUtils.toInt(page)); List fjtEvaluationList = fjtEvaluationService.findEvaluationsByUserId(userId, pager); + System.out.println("估价记录:"+fjtEvaluationList.size()); JSONArray ja = new JSONArray(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); for (int i = 0; i < fjtEvaluationList.size(); ++i) { @@ -246,7 +250,9 @@ public class WeiXinEvaluationController { jsonObject.put("shzt", "价格待审核"); //接入询价结果查询接口 + System.out.println("开始接入询价结果查询接口......"+evaluationAudit.getQueryId()); JSONObject obj = BHBankUtils.getInquireRecord(evaluationAudit.getQueryId()); + System.out.println("接入询价结果查询接口完成......"+evaluationAudit.getQueryId()); if(obj!=null){ Integer totalPrice = (Integer) obj.get("inquirePrice"); if(totalPrice>0){ @@ -259,11 +265,17 @@ public class WeiXinEvaluationController { } } else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==1) { jsonObject.put("shzt", "价格已审核"); + FormalReport report = formalReportService.findFormalReportById(evaluationAudit.getEvaluationId()); + if(report != null){ + jsonObject.put("shzt", "已申请正式报告"); + } } else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==2) { jsonObject.put("shzt", "价格待审核"); if(evaluationAudit.getHopePrice()>0){ //接入反馈结果查询接口 + System.out.println("开始接入反馈结果查询接口......"+evaluationAudit.getFeedbackId()); JSONObject object = BHBankUtils.inquireFeedbackCall(evaluationAudit.getFeedbackId()); + System.out.println("完成接入反馈结果查询接口......"+evaluationAudit.getFeedbackId()); if(object!=null){ Integer feedbackStatus = (Integer) object.get("feedbackStatus"); if(feedbackStatus!=0){ @@ -280,6 +292,11 @@ public class WeiXinEvaluationController { } }else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==3) { jsonObject.put("shzt", "审核完成"); + + FormalReport report = formalReportService.findFormalReportById(evaluationAudit.getEvaluationId()); + if(report != null){ + jsonObject.put("shzt", "已申请正式报告"); + } }else{ jsonObject.put("shzt", "-"); } @@ -431,16 +448,38 @@ public class WeiXinEvaluationController { evaluation.setAveragePrice((int)(totalPrice/evaluation.getHouseArea())); } - fjtEvaluationService.saveEvaluation(evaluation); + if(fjtUser!=null && fjtUser.getRole()==17) { + System.out.println("渤海地址搜索 "+evaluation.getAddress()); List bhDists = BHBankUtils.getDistrictByBhbank(evaluation.getAddress()); - if(bhDists.size()<1){ + JSONObject o = null; + if(bhDists.size()==0){ bhDists = BHBankUtils.getDistrictByBhbank(district.getName()); } - Map bhMatchMap = new HashMap(); if(bhDists.size()==1){ - JSONObject o = bhDists.get(0); + o = bhDists.get(0); + }else if(bhDists.size()>1){ + int mod = Integer.MAX_VALUE; + for(JSONObject jo : bhDists){ + int bhprice = 0; + if (jo.get("price") == null || jo.get("price").equals("null")) { + bhprice = 0; + } else { + double price = Double.valueOf((String)jo.get("price")); + bhprice = (int)price; + } + + int bhmod = Math.abs(bhprice - avgPrice); + if(bhmod bhMatchMap = new HashMap(); + if(o != null){ + String bhDistName = (String)o.get("name"); String regionCode = String.valueOf((Long)o.get("country")); String bhRegion = BHBankUtils.regionCodeMap.get(regionCode); @@ -466,8 +505,10 @@ public class WeiXinEvaluationController { if(StringUtils.isBlank(usersDetail.getMobile())){ usersDetail.setMobile(fjtUser.getEmail()); } + System.out.println("渤海询价搜索 "+evaluation.getAddress()); JSONObject bhApiResult = BHBankUtils.getInquirePrice(model, bhMatchMap, usersDetail, evaluation.getTotalPrice()); if(bhApiResult!=null){ + System.out.println("渤海询价搜索结果 "+bhApiResult.toString()); JSONObject dataObj = (JSONObject) bhApiResult.get("data"); String queryId = (String) dataObj.get("queryId"); Integer inquirePrice = (Integer) dataObj.get("inquirePrice"); @@ -479,6 +520,9 @@ public class WeiXinEvaluationController { auditStatus = 1; } + fjtEvaluationService.saveEvaluation(evaluation); + System.out.println("保存评估记录成功 "+evaluation.getDistrictName()); + BohaiEvaluationAudit audit = new BohaiEvaluationAudit(); audit.setEvaluationId(evaluation.getId()); audit.setQueryId(queryId); @@ -493,6 +537,9 @@ public class WeiXinEvaluationController { audit.setDateCreated(new Date()); bohaiEvaluationAuditService.saveBohaiEvaluationAudit(audit); } + }else{ + fjtEvaluationService.saveEvaluation(evaluation); + System.out.println("保存评估记录成功 "+evaluation.getDistrictName()); } Map data = new HashMap(); @@ -603,7 +650,24 @@ public class WeiXinEvaluationController { BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(evaluationId)); model.setBohaiEvaluationAudit(bohaiEvaluationAudit); + if(bohaiEvaluationAudit != null){ + List reportFiles = reportFileAttachService.findAllByParams(Integer.valueOf(evaluationId), bohaiEvaluationAudit.getQueryId(), (int)fjtUser.getId()); + if(reportFiles != null && reportFiles.size()>0){ + Map> reportFileMap = new HashMap>(); + for(ReportFileAttach rfa : reportFiles){ + List list = reportFileMap.get(rfa.getFileClass().toString()); + if(list == null){ + list = new ArrayList(); + reportFileMap.put(rfa.getFileClass().toString(), list); + } + list.add(rfa); + } + model.setReportFileMap(reportFileMap); + } + } + UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(model.getEvaluationId()); + model.setUserTrades(userTrade); if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){ Map retMap = getLoanInfo(district, evaluation.getHouseArea()); @@ -940,13 +1004,14 @@ public class WeiXinEvaluationController { if(StringUtils.isNotBlank(model.getEvaluationId()) && StringUtils.isNotBlank(model.getEmail())){ UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(model.getEvaluationId()); + + FjtEvaluation evaluation = fjtEvaluationService.findEvaluationById(Long.valueOf(model.getEvaluationId())); if(userTrade != null){ userTrade.setSend(1); userTrade.setSendEmail(model.getEmail()); userTradesService.update(userTrade); }else{ - FjtEvaluation evaluation = fjtEvaluationService.findEvaluationById(Long.valueOf(model.getEvaluationId())); - + userTrade = new UserTrades(); userTrade.setUserId(evaluation.getUserId()); userTrade.setCity(evaluation.getCity()); @@ -966,23 +1031,90 @@ public class WeiXinEvaluationController { String reporNum = "147698"+ String.valueOf(evaluation.getId()); evaluation.setReportNum(reporNum); + evaluation.setDownPdfDate(new Date()); fjtEvaluationService.updateEvaluation(evaluation); try { String smsContent = "【房价网】微信询价报告发送 用户邮箱:"+model.getEmail(); smsService.sendDingMsgByRobot(DD_ID, smsContent); - + } catch (SmsException e) { e.printStackTrace(); } } - - + sendToEmail(model.getFjtUrlKey(), model.getEvaluationId(), model.getEmail()); - + FjtUsers users = fjtUsersService.findById(evaluation.getUserId()); + if(users!=null && users.getRole()==17){ + + String converFileName = DateUtils.format(new Date(), "yyyy-MM-dd") +"_"+evaluation.getReportNum()+".pdf"; + String url = model.getFjtUrlKey() + "/evaluation/exportPdf?evaluationId="+model.getEvaluationId()+"&bkoffDownload=true&userId="+users.getId(); + String fontUrl = ActionContext.getContext().getServletContext().getRealPath("/") + "files" + File.separator + model.getEvaluationId() + File.separator; + + System.out.println(fontUrl); + try { + createFile(fontUrl+converFileName); + download(url, fontUrl, converFileName); + List uploadfiles = new ArrayList(); + uploadfiles.add(new File(fontUrl+converFileName)); + if(uploadfiles.size()>0){ + BohaiEvaluationAudit boAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(evaluation.getId()); + if(boAudit != null){ + UsersDetail usersDetail = usersDetailService.findById(users.getId()); + BHBankUtils.inquireUploadFiles2(usersDetail.getName(),boAudit.getQueryId(), 1, uploadfiles); + } + } + } catch (IOException e) { + //处理异常信息 + System.out.println(e.getMessage()); + } + } } return jsonMmodel; } + + public Object sendFormalReportApplyAction(EvaluationModel model) { + JsonModel jsonModel = new JsonModel(); + if (StringUtils.isNotBlank(model.getEvaluationId()) && StringUtils.isNotBlank(model.getAddress())) { + BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId())); + if(bohaiEvaluationAudit!=null){ + FormalReport formalReport = formalReportService.findFormalReportById(Long.valueOf(model.getEvaluationId())); + if(formalReport == null){ + formalReport = new FormalReport(); + formalReport.setEvaluationId(Long.valueOf(model.getEvaluationId())); + formalReport.setQueryId(bohaiEvaluationAudit.getQueryId()); + formalReport.setUserId(bohaiEvaluationAudit.getUserId()); + formalReport.setAddress(model.getAddress()); + formalReport.setDateCreated(new Date()); + formalReportService.save(formalReport); +// UsersDetail usersDetail = usersDetailService.findById(bohaiEvaluationAudit.getUserId()); + }else{ + if(!model.getAddress().equals(formalReport.getAddress())){ + formalReport.setAddress(model.getAddress()); + formalReportService.update(formalReport); + } + } + Integer code = BHBankUtils.inquireToReport(bohaiEvaluationAudit.getQueryId(), model.getAddress()); + Map data = new HashMap(); + data.put("code", code); + jsonModel.setJsonModel(data); + } + } + return jsonModel; + } + + public Object checkImageAction(EvaluationModel model){ + JsonModel jsonModel = new JsonModel(); + if (StringUtils.isNotBlank(model.getEvaluationId())){ + List datas = reportFileAttachService.findHouseImage(Integer.valueOf(model.getEvaluationId()), 3); + Map data = new HashMap(); + data.put("count", datas.size()); + jsonModel.setJsonModel(data); + } + return jsonModel; + } + + private void sendToEmail(String fjtUrl, String evaluationId, String email){ try { @@ -1130,6 +1262,232 @@ public class WeiXinEvaluationController { } + + + public Object upLoadEvaluationFileAction(EvaluationModel model, HttpServletRequest request){ + + RestfulModelAndView mav = new RestfulModelAndView(); + List files = model.getReportFiles(); + if(files == null || files.size()<=1){ + mav.setModel(BasicModel.buildBadRequestModel("请选择要上传的文件")); + return mav; + } + if(model.getEvaluationId()==null || model.getQueryId()==null){ + mav.setModel(BasicModel.buildBadRequestModel("评估编号或查询编号为空")); + return mav; + } + + if(model.getFileClass()==3 && files.size()<7){ + mav.setModel(BasicModel.buildBadRequestModel("上传图片不能少于6张")); + return mav; + } + + String cookieUserId = CookieUtils.getCookieValue(request, "login_user_id"); + long userId = Long.valueOf(cookieUserId); + FjtUsers fjtUser = fjtUsersService.findById(Long.valueOf(userId)); + UsersDetail usersDetail = usersDetailService.findById(fjtUser.getId()); + try { + String id = new ObjectId().toString(); + List uploadfiles = new ArrayList(); + for (CommonsMultipartFile file : files) { + if (file.getSize() == 0 ) { + continue; + } + String contentType = file.getContentType();//getPicContentType(file); + + if (StringUtils.isBlank(contentType)) { + continue; + } + ReportFileAttach reportFileAttach = reportFileAttachService.findFirstByParams(Integer.valueOf(model.getEvaluationId()), model.getQueryId(), (int)fjtUser.getId(), model.getFileClass(), file.getOriginalFilename()); + if(reportFileAttach != null){ + continue; + } + String converFileName = new String(file.getOriginalFilename().getBytes(), "UTF-8"); + String fontUrl = ActionContext.getContext().getServletContext().getRealPath("/") + "files" + File.separator + model.getEvaluationId() + File.separator+converFileName; + System.out.println(fontUrl); + createFile(fontUrl); + File tempFile = new File(fontUrl); + + try { + tempFile.createNewFile(); + } catch (IOException e) { + //处理异常信息 + } + try { + inputStreamToFile(file.getInputStream(), tempFile); + uploadfiles.add(tempFile); + } catch (IOException e) { + //处理异常信息 + } + reportFileAttach = new ReportFileAttach(); + reportFileAttach.setEvaluationId(Integer.valueOf(model.getEvaluationId())); + reportFileAttach.setQueryId(model.getQueryId()); + reportFileAttach.setUserId((int)fjtUser.getId()); + reportFileAttach.setFileClass(model.getFileClass()); + reportFileAttach.setFileName(file.getOriginalFilename()); + reportFileAttach.setFileId(id); + reportFileAttachService.save(reportFileAttach); + + fileDao.save(id,"upload","o", file.getBytes(), contentType); + String href = DataUtil.encodePicUrl(id, "o", "upload"); + String link = "http://static.fangjia.com/stc/fs/"+href; + System.out.println(link); + } + if(uploadfiles.size()>0){ + BHBankUtils.inquireUploadFiles2(usersDetail.getName(),model.getQueryId(), model.getFileClass(), uploadfiles); + } + } catch (Exception e) { + e.printStackTrace(); + mav.setModel(BasicModel.buildServerErrorModel().setMsg("文件上传失败!")); + } + return mav; + } + + + private void createFile(String path) throws IOException { + if (StringUtils.isNotEmpty(path)) { + File file = new File(path); + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + file.createNewFile(); + } + } + + public static void download(String url, String saveDir, String fileName) { + + BufferedOutputStream bos = null; + InputStream is = null; + try { + byte[] buff = new byte[8192]; + is = new URL(url).openStream(); + File file = new File(saveDir, fileName); + file.getParentFile().mkdirs(); + bos = new BufferedOutputStream(new FileOutputStream(file)); + int count = 0; + while ( (count = is.read(buff)) != -1) { + bos.write(buff, 0, count); + } + } + catch (IOException e) { + e.printStackTrace(); + } + finally { + if (is != null) { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + if (bos != null) { + try { + bos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + } + //将InputStream类型转化为File类型 + private static void inputStreamToFile(InputStream ins, File file) { + //将输出流转化为文件即可 + FileOutputStream os = null; + try { + os = new FileOutputStream(file); + int bytesRead = 0; + byte[] buffer = new byte[1024]; + while ((bytesRead = ins.read(buffer)) != -1) { + os.write(buffer, 0, bytesRead); + } + } catch (Exception e) { + throw new RuntimeException("调用inputStreamToFile产生异常:" + e.getMessage()); + } finally { + try { + if (os != null) { + os.close(); + } + if (ins != null) { + ins.close(); + } + } catch (IOException e) { + throw new RuntimeException("inputStreamToFile关闭io时产生异常:" + e.getMessage()); + } + } + } + + + + /** + * 保存图片到FS + */ + private List savePics(String districtId, List pics) { + List ret = new ArrayList(pics.size()); + for (File pic : pics) { + if (pic.length() == 0 || pic.length() > MAX_FILE_BYTES_SIZE) { + continue; + } + + String contentType = getPicContentType(pic); + if (StringUtils.isBlank(contentType)) { + continue; + } + + String picName = districtId + "/" + pic.getName(); + try { + fileService.save(picName, FileServiceImpl.SIZE_ORIGINAL, IOUtils.toByteArray(new FileInputStream(pic)), + contentType); + fileService.save(picName, FileServiceImpl.SIZE_SUMMERY, IOUtils.toByteArray(new FileInputStream(pic)), + contentType); + fileService.save(picName, FileServiceImpl.SIZE_MEDIUM, IOUtils.toByteArray(new FileInputStream(pic)), + contentType); + } catch (IOException e) { + e.printStackTrace(); + } + ret.add(picName); + } + return ret; + } + + /** + * 验证图片文件类型,目前支持gif、jpg + * + * @param pic + * @return + */ + private String getPicContentType(File pic) { + byte[] b = new byte[4]; + FileInputStream is = null; + try { + is = new FileInputStream(pic); + is.read(b, 0, b.length); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (null != is) { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + String type = DataUtil.byte2hex(b).toUpperCase(); + if (type.contains("FFD8FF") || type.contains("89504E47")) { + return "image/jpeg"; + } + if (type.contains("47494638")) { + return "image/gif"; + } + if (type.contains("424D")) { + return "image/bmp"; + } + return null; + } + + public void setFjtEvaluationService(FjtEvaluationService fjtEvaluationService) { this.fjtEvaluationService = fjtEvaluationService; @@ -1215,4 +1573,16 @@ public class WeiXinEvaluationController { public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) { this.bohaiEvaluationAuditService = bohaiEvaluationAuditService; } + + public void setFileService(FileService fileService) { + this.fileService = fileService; + } + + public void setReportFileAttachService(ReportFileAttachService reportFileAttachService) { + this.reportFileAttachService = reportFileAttachService; + } + + public void setFormalReportService(FormalReportService formalReportService) { + this.formalReportService = formalReportService; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/dto/DistrictInfoDto.java b/projects/fangjia-open/src/main/java/com/fangjia/open/dto/DistrictInfoDto.java index 1ab67359e..d938d3a8b 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/dto/DistrictInfoDto.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/dto/DistrictInfoDto.java @@ -99,6 +99,7 @@ public class DistrictInfoDto { private String salesPhoneNumber; private Integer buildingCount; private Integer finishYear; + private String township; public String getDistrict() { @@ -818,4 +819,12 @@ public class DistrictInfoDto { public void setFinishYear(Integer finishYear) { this.finishYear = finishYear; } + + public String getTownship() { + return township; + } + + public void setTownship(String township) { + this.township = township; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/filters/AnalyticsFilter.java b/projects/fangjia-open/src/main/java/com/fangjia/open/filters/AnalyticsFilter.java index e16664d16..37805ef21 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/filters/AnalyticsFilter.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/filters/AnalyticsFilter.java @@ -75,8 +75,8 @@ public class AnalyticsFilter implements Filter { if ("1".equals(request.getParameter("__refresh_cache"))) { threadLocalData.put(ThreadLocalKey.DisableCache, "1"); } - createUID(request, response); - createSID(request, response); + //createUID(request, response); + //createSID(request, response); response.addHeader("Access-Control-Allow-Origin", "*"); response.addHeader("Access-Control-Allow-Methods", "*"); chain.doFilter(request, response); diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/AuctionModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/AuctionModel.java index a4d47a4e6..65092281a 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/AuctionModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/AuctionModel.java @@ -8,6 +8,7 @@ public class AuctionModel extends FangjiaApiModel{ private String city; private String district; private String address; + private String name; private Date minStartTime; private Date maxStartTime; private Integer minStartPrice; @@ -17,6 +18,7 @@ public class AuctionModel extends FangjiaApiModel{ private Integer propertyType; private Integer status; private Integer limit = 10; + private String startDate; public String getId() { return id; @@ -121,4 +123,20 @@ public class AuctionModel extends FangjiaApiModel{ public void setStatus(Integer status) { this.status = status; } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/DealPriceModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/DealPriceModel.java index 0d51d0c46..35620322f 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/DealPriceModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/DealPriceModel.java @@ -1,6 +1,9 @@ package com.fangjia.open.model; +import java.util.Date; + public class DealPriceModel extends FangjiaApiModel{ + private String id; private String city; @@ -34,9 +37,13 @@ public class DealPriceModel extends FangjiaApiModel{ private Double size; private Integer max; + private Integer limit = 10; private String decoration; private boolean convert; + + private String startDate; + private String endDate; public String getCity() { @@ -198,4 +205,36 @@ public class DealPriceModel extends FangjiaApiModel{ public void setConvert(boolean convert) { this.convert = convert; } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/EvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/EvaluationModel.java index d5b8f42ed..71130e7bb 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/EvaluationModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/EvaluationModel.java @@ -246,6 +246,42 @@ public class EvaluationModel extends FangjiaApiModel { private Date buildDate; private String sid;//微信小程序中的sid private String code;//微信小程序中的code + private String id; + private String startDate; + private String endDate; + private Integer limit = 10; + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } public String getRegion() { return region; diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/HouseSearchModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/HouseSearchModel.java index d9f4812d8..63a85c4b3 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/HouseSearchModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/HouseSearchModel.java @@ -4,6 +4,7 @@ import com.fangjia.service.datastore.bean.HouseQueryBean; import com.fangjia.service.query.QueryBean; public class HouseSearchModel extends SearchModel { + private String id; private String kind; private String estateType; private String buildingType; @@ -116,7 +117,12 @@ public class HouseSearchModel extends SearchModel { public void setShowDetail(Boolean showDetail) { this.showDetail = showDetail; } - - - + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/PropertyEvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/PropertyEvaluationModel.java index 5953fc3a3..859658742 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/PropertyEvaluationModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/PropertyEvaluationModel.java @@ -46,7 +46,12 @@ public class PropertyEvaluationModel extends FangjiaApiModel { * 楼号 */ private String unitNumber; + /** + * 新楼号 + */ + private String houseNumber; + private String id; /** * 室号 */ @@ -905,4 +910,20 @@ public class PropertyEvaluationModel extends FangjiaApiModel { public void setAvgPrice(Integer avgPrice) { this.avgPrice = avgPrice; } + + public String getHouseNumber() { + return houseNumber; + } + + public void setHouseNumber(String houseNumber) { + this.houseNumber = houseNumber; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/SearchModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/SearchModel.java index 813f42f6c..64fb38772 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/SearchModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/SearchModel.java @@ -16,6 +16,8 @@ public abstract class SearchModel extends FangjiaApiModel { protected Integer totalPriceEnd; protected Integer avgPriceStart; protected Integer avgPriceEnd; + protected Integer startTime; + protected Integer endTime; protected Integer areaStart; protected Integer areaEnd; protected Integer room; @@ -46,6 +48,7 @@ public abstract class SearchModel extends FangjiaApiModel { private Double area; protected Integer dataPeriod;//查询天数 + private Integer distCount; /** * 获取房源数量类型 sell:只取得二手房数量 rent:只取得出租房数量 其他:不获取数量 @@ -358,4 +361,28 @@ public abstract class SearchModel extends FangjiaApiModel { public void setTotalPrice(Integer totalPrice) { this.totalPrice = totalPrice; } + + public Integer getStartTime() { + return startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public Integer getEndTime() { + return endTime; + } + + public void setEndTime(Integer endTime) { + this.endTime = endTime; + } + + public Integer getDistCount() { + return (null != distCount && 0 != distCount) ? distCount : 20; + } + + public void setDistCount(Integer distCount) { + this.distCount = distCount; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java index f6cd5a7fd..8de0977f8 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java @@ -1,15 +1,16 @@ package com.fangjia.open.model.weixin; import com.fangjia.dal.mongo.model.Evaluation; + +import java.io.File; import java.util.List; import java.util.Map; import com.fangjia.dal.seaweed.model.District; -import com.fangjia.dal.sql.model.BohaiEvaluationAudit; -import com.fangjia.dal.sql.model.EvaluationAudit; -import com.fangjia.dal.sql.model.FjtEvaluation; +import com.fangjia.dal.sql.model.*; import com.fangjia.open.model.BaseModel; import com.fangjia.service.bo.DistrictStatBo; +import org.springframework.web.multipart.commons.CommonsMultipartFile; /** @@ -48,6 +49,13 @@ public class EvaluationModel extends BaseModel{ // private String preName;//渤海接口--楼盘名称 // private String countryCode;//渤海接口--区域编码 // private String buildName;//渤海接口--地址 + + private List reportFiles; + private String queryId; + private Integer fileClass; + private Map> reportFileMap; + private UserTrades userTrades; + private String address; public void setId(String id) { @@ -260,4 +268,53 @@ public class EvaluationModel extends BaseModel{ // public void setBuildName(String buildName) { // this.buildName = buildName; // } + + + public List getReportFiles() { + return reportFiles; + } + + public void setReportFiles(List reportFiles) { + this.reportFiles = reportFiles; + } + + public String getQueryId() { + return queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + public Integer getFileClass() { + return fileClass; + } + + public void setFileClass(Integer fileClass) { + this.fileClass = fileClass; + } + + public Map> getReportFileMap() { + return reportFileMap; + } + + public void setReportFileMap(Map> reportFileMap) { + this.reportFileMap = reportFileMap; + } + + public UserTrades getUserTrades() { + return userTrades; + } + + public void setUserTrades(UserTrades userTrades) { + this.userTrades = userTrades; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java index 06d9f05f6..2c115f3b4 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java @@ -7,8 +7,10 @@ import com.fangjia.dal.sql.model.UsersDetail; import com.fangjia.open.model.weixin.EvaluationModel; import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import okhttp3.*; import org.apache.commons.lang.StringUtils; +import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.*; @@ -16,11 +18,14 @@ import java.util.*; public class BHBankUtils { // public static String token = "bohaifangjiatest";//测试token - public static String token = "bohaifangjia";//正式token - public static String nonce = "818975"; // public static String uri = "http://topen.shbrea.com.cn/API";//测试 + + + public static String token = "bohaifangjia";//正式token public static String uri ="https://open.shbrea.com.cn/API"; + + public static String nonce = "818975"; public static Map regionCodeMap = new HashMap(){{ put("310101000000","黄浦"); put("310104000000","徐汇"); @@ -41,8 +46,11 @@ public class BHBankUtils { }}; public static List getDistrictByBhbank(String address){ - List list = new ArrayList(); + try { + +// Thread.sleep(20*1000); + Map params = new HashMap(); params.put("keyword",address); @@ -56,8 +64,8 @@ public class BHBankUtils { headers.put("nonce", nonce.toString()); HttpRequest request = new HttpRequest(); String content = null; - try { content = request.get(uri +"/searchAddr/bh/", params, headers, "utf-8"); + System.out.println("/searchAddr/bh/ :"+content); if(StringUtils.isNotBlank(content)){ JSONObject jsonObj = JSONObject.fromObject(content); JSONArray data = (JSONArray) jsonObj.get("data"); @@ -99,8 +107,8 @@ public class BHBankUtils { if(StringUtils.isNotBlank(ev.getAddress())){ params.put("buildName", ev.getAddress()); } - if(StringUtils.isNotBlank(ev.getUnitNum())){ - params.put("unitCode", ev.getUnitNum()); + if(StringUtils.isNotBlank(ev.getHouseNum())){ + params.put("unitCode", ev.getHouseNum());// 渤海认为的单元号是楼栋号 } if(ev.getHouseFloor()>0){ params.put("floor", String.valueOf(ev.getHouseFloor())); @@ -112,8 +120,19 @@ public class BHBankUtils { params.put("houseNo",ev.getRoomNum()); } if(ev.getHouseArea()>0){ - params.put("groundArea", String.valueOf(ev.getHouseArea())); + if(ev.getBasementArea()!=null && ev.getBasementArea()>0){ + double area = ev.getHouseArea() - ev.getBasementArea(); + if(area>0){ + params.put("groundArea", String.valueOf(area)); + } + }else{ + params.put("groundArea", String.valueOf(ev.getHouseArea())); + } } + if(ev.getBasementArea()!=null && ev.getBasementArea()>0){ + params.put("undergroundArea", String.valueOf(ev.getBasementArea())); + } + params.put("orientName", "南"); params.put("buildYear", ev.getFinishDateStr()); fjwTotalPrice= (int)(fjwTotalPrice/10000) * 10000; @@ -180,6 +199,7 @@ public class BHBankUtils { String content = null; try { content = request.get(uri + "/inquireRecord/bh/", params, headers, "utf-8"); + System.out.println("/inquireRecord/bh/ "+content); if(StringUtils.isNotBlank(content)){ JSONObject jsonObj = JSONObject.fromObject(content); JSONObject data = (JSONObject) jsonObj.get("data"); @@ -265,6 +285,7 @@ public class BHBankUtils { String content = null; try { content = request.get(uri+"/inquireFeedbackCall/bh/", params, headers, "utf-8"); + System.out.println("/inquireFeedbackCall/bh/:"+content); if(StringUtils.isNotBlank(content)){ JSONObject jsonObj = JSONObject.fromObject(content); Integer code = (Integer) jsonObj.get("errCode"); @@ -279,4 +300,193 @@ public class BHBankUtils { } return null; } + + + + public static void inquireUploadFiles(String name, String queryId, Integer fileClass){ + String feedbackId = null; + List list = new ArrayList(); + Map params = new HashMap(); + params.put("queryId",queryId); + params.put("userName",name); + params.put("fileClass", fileClass.toString()); + + List lists = Arrays.asList("queryId", "userName", "fileClass"); + + String s = ""; + for(String key : lists){ + String value = (String)params.get(key); + if(StringUtils.isNotBlank(value)){ + s = s + value; + } + } + String s1 = null; + try { + s1 = URLEncoder.encode(s,"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + +// params.put("file", new File("d:/a.jpg") ); + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce+ s1; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + + HttpRequest request = new HttpRequest(); + String content = null; + try { + content = request.post(uri+"/inquireUploadFiles/bh/", params, headers, "utf-8"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + System.out.println(jsonObj.toString()); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + + + public static Integer inquireUploadFiles2(String name, String queryId, Integer fileClass , List uploadfiles){ + Map params = new HashMap(); + params.put("queryId",queryId); + params.put("userName",name); + params.put("fileClass", fileClass.toString()); + + List lists = Arrays.asList("queryId", "userName", "fileClass"); + + String s = ""; + for(String key : lists){ + String value = (String)params.get(key); + if(StringUtils.isNotBlank(value)){ + s = s + value; + } + } + String s1 = null; + try { + s1 = URLEncoder.encode(s,"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce+ s1; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + + String url = uri+"/inquireUploadFiles/bh/"; + try{ +// HttpResponse response= Unirest.post(url).header("sign",md5str2) +// .header("timestamp",date1.toString()) +// .header("nonce",nonce.toString()) +// .field("queryId",queryId) +// .field("fileClass",fileClass.toString()) +// .field("file", new File("d:\\a.jpg")) +// .field("userName",name).asString(); +// MultipartBody responseBody = Unirest.post(url).header("sign",md5str2) +// .header("timestamp",date1.toString()) +// .header("nonce",nonce.toString()) +// .field("queryId",queryId) +// .field("fileClass",fileClass.toString()) +// .field("userName",name); +// +// for(File file : uploadfiles){ +// responseBody.field("file", file); +// } +// HttpResponse response = responseBody.asString(); + OkHttpClient client = new OkHttpClient().newBuilder().build(); + MultipartBody.Builder builder = new MultipartBody.Builder().setType(MultipartBody.FORM) + .addFormDataPart("queryId",queryId) + .addFormDataPart("fileClass",fileClass.toString()) + .addFormDataPart("userName",name); + + for(File file : uploadfiles){ + builder.addFormDataPart("file",file.getPath(), RequestBody.create(MediaType.parse("application/octet-stream"), file)); + } + RequestBody body = builder.build(); + Request request = new Request.Builder().url(url).method("POST",body) + .addHeader("sign",md5str2) + .addHeader("timestamp",date1.toString()) + .addHeader("nonce", nonce.toString()) + .build(); + Response response = client.newCall(request).execute(); + + String content = response.body().string(); + JSONObject jsonObj = JSONObject.fromObject(content); + System.out.println("上传接口返回:"+jsonObj.toString()); + Integer code = (Integer) jsonObj.get("errCode"); + if(code == 0){ + return code; + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + + + public static Integer inquireToReport(String queryId, String reportMsg){ + String feedbackId = null; + List list = new ArrayList(); + Map params = new HashMap(); + params.put("queryId",queryId); + if(StringUtils.isNotBlank(reportMsg)){ + params.put("reportMsg",reportMsg.replace(" ","")); + } + + + List lists = Arrays.asList("queryId", "reportMsg"); + + String s = ""; + for(String key : lists){ + String value = (String)params.get(key); + if(StringUtils.isNotBlank(value)){ + s = s + value; + } + } + String s1 = null; + try { + s1 = URLEncoder.encode(s,"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce+ s1; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + HttpRequest request = new HttpRequest(); + String content = null; + try { + System.out.println("调用渤海转评估报告 "+queryId); + content = request.post(uri+"/inquireToReport/bh/", params, headers, "utf-8"); + System.out.println("完成调用渤海转评估报告 "+content); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + Integer code = (Integer) jsonObj.get("errCode"); + if (code == 0) { + return code; + } + + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/util/FileDao.java b/projects/fangjia-open/src/main/java/com/fangjia/open/util/FileDao.java index 8b6da70fa..2919c8a6c 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/util/FileDao.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/util/FileDao.java @@ -36,7 +36,7 @@ public class FileDao { try { filesCollection = new Mongo("fs.mongo.db.fangjia.com", 27000).getDB("fangjia_fs").getCollection("files"); gridFs = new GridFS(filesCollection.getDB(), "fangjia_fs"); - cappedCollection = new Mongo("capped.mongo.db.fangjia.com", Integer.getInteger("capped.mongo.port", 27017)).getDB("fangjia_fs").getCollection("files_capped"); + cappedCollection = new Mongo("capped.mongo.db.fangjia.com", Integer.getInteger("capped.mongo.port", 27000)).getDB("fangjia_fs").getCollection("files_capped"); } catch (Exception e) { e.printStackTrace(); } diff --git a/projects/fangjia-open/src/main/resources/fangjia-open.properties b/projects/fangjia-open/src/main/resources/fangjia-open.properties index aaf6af5ca..c7d4d526c 100644 --- a/projects/fangjia-open/src/main/resources/fangjia-open.properties +++ b/projects/fangjia-open/src/main/resources/fangjia-open.properties @@ -100,4 +100,5 @@ fangjia.jms.email.queue=email.queue fangjia.redis_nodes=192.168.0.79:6379,192.168.0.79:6380,192.168.0.79:6381,192.168.0.81:6382,192.168.0.81:6383,192.168.0.81:6384 -fangjia.fangjiatong.url = http://user.fangjia.com/fangjiatong2 \ No newline at end of file +fangjia.fangjiatong.url = http://user.fangjia.com/fangjiatong2 +fangjia.default.city = \u91CD\u5E86\u5E02 \ No newline at end of file diff --git a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml index a853e4c82..69ec4700c 100644 --- a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml +++ b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml @@ -16,6 +16,8 @@ com.fangjia.dal.sql.model.EvaluationAudit com.fangjia.dal.sql.model.GoldLogs com.fangjia.dal.sql.model.BohaiEvaluationAudit + com.fangjia.dal.sql.model.ReportFileAttach + com.fangjia.dal.sql.model.FormalReport true \ No newline at end of file diff --git a/projects/fangjia-open/src/main/resources/urlrewrite2.0.xml b/projects/fangjia-open/src/main/resources/urlrewrite2.0.xml index fb8d631db..c17530d88 100644 --- a/projects/fangjia-open/src/main/resources/urlrewrite2.0.xml +++ b/projects/fangjia-open/src/main/resources/urlrewrite2.0.xml @@ -1,8 +1,8 @@ - - + + @@ -33,5 +33,15 @@ /property/avgPrice + + + /address/standard + + + + + /address/fiveDivisionStructure + + \ No newline at end of file diff --git a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl index 3e07b5ef4..46ef7c552 100644 --- a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl +++ b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl @@ -26,7 +26,7 @@
- + <#if !(cityName??) || cityName == ""> <#else> @@ -48,7 +48,7 @@
    - <#if type?? && type == 'b'> + <#if type?? && (type == 'b' || type == 'gb')>
    "); } else { - html += ("" + this.zsj + " 涓囧厓

    "); + if(this.zsj!=undefined){ + html += ("" + this.zsj + " 涓囧厓

    "); + }else{ + html += ("

    "); + } + } } else { html += "

    " + this.xzrq + diff --git a/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js b/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js index 28f9d9968..607f70dfb 100644 --- a/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js +++ b/projects/fangjia-open/src/main/webapp/static/js/autoCompletion.js @@ -38,7 +38,7 @@ $(function () { return } } - var template = '

  • {1}
    {2}
  • ' + var template = '
  • {1}
    {3}-{2}
  • ' var content = "" $(data).each(function () { var district = this @@ -52,7 +52,7 @@ $(function () { var region = $(li).attr("data-region"); var isCompany=$("#t").val(); if ($("#t").val() != "c") { - saveCookie(id, name, addr) + saveCookie(id, name, addr, region) } if ($("#t").val() == "b") { location.href = "districtDetail?id=" + id+"&city="+city @@ -75,11 +75,11 @@ $(function () { * @param name * @param addr */ -function saveCookie(id, name, addr) { +function saveCookie(id, name, addr, region) { var cookieKey = "history" + $("#t").val() var history = $.cookie(cookieKey) var his = [] - var item = {id: id, name: name, addr: addr} + var item = {id: id, name: name, addr: addr, region:region} his.push(item) var ids = [] ids.push(id) @@ -108,10 +108,16 @@ function resumeHistory() { var city = $("#cityName").val() var history = $.cookie(cookieKey) if (history && history != "") { - var template = '
  • {1}
    {2}
  • ' + var template = '
  • {1}
    {3}-{2}
  • ' + var template1 = '
  • {1}
    {2}
  • ' var content = '
  • 鎼滅储鍘嗗彶
  • ' $(JSON.parse(history)).each(function () { - content = content + template.template(this.id, this.name, this.addr) + if(this.region!=undefined){ + content = content + template.template(this.id, this.name, this.addr, this.region) + }else{ + content = content + template1.template(this.id, this.name, this.addr) + } + }) $("#searchSpan ul").empty().append(content).find("li>a.item-link").click(function () { var li = $(this).parent() diff --git a/projects/fangjia-open/src/main/webapp/static/js/jquery.MultiFile.pack.js b/projects/fangjia-open/src/main/webapp/static/js/jquery.MultiFile.pack.js new file mode 100644 index 000000000..d4d959302 --- /dev/null +++ b/projects/fangjia-open/src/main/webapp/static/js/jquery.MultiFile.pack.js @@ -0,0 +1,14 @@ +/* + ### jQuery Multiple File Upload Plugin v1.47 - 2010-03-26 ### + + * Home: http://www.fyneworks.com/jquery/multiple-file-upload/ + * Code: http://code.google.com/p/jquery-multifile-plugin/ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + ### +*/ +//eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';3(X.1M)(6($){$.7.2=6(h){3(5.Q==0)8 5;3(R U[0]==\'1f\'){3(5.Q>1){l i=U;8 5.N(6(){$.7.2.14($(5),i)})};$.7.2[U[0]].14(5,$.27(U).26(1)||[]);8 5};l h=$.L({},$.7.2.D,h||{});$(\'21\').1D(\'2-S\').V(\'2-S\').1i($.7.2.15);3($.7.2.D.12){$.7.2.1s($.7.2.D.12);$.7.2.D.12=11};5.1D(\'.2-1a\').V(\'2-1a\').N(6(){X.2=(X.2||0)+1;l e=X.2;l g={e:5,E:$(5),P:$(5).P()};3(R h==\'1W\')h={m:h};l o=$.L({},$.7.2.D,h||{},($.1p?g.E.1p():($.2t?g.E.Z():11))||{},{});3(!(o.m>0)){o.m=g.E.K(\'2e\');3(!(o.m>0)){o.m=(u(g.e.1o.B(/\\b(m|2a)\\-([0-9]+)\\b/q)||[\'\']).B(/[0-9]+/q)||[\'\'])[0];3(!(o.m>0))o.m=-1;1Z o.m=u(o.m).B(/[0-9]+/q)[0]}};o.m=18 1X(o.m);o.j=o.j||g.E.K(\'j\')||\'\';3(!o.j){o.j=(g.e.1o.B(/\\b(j\\-[\\w\\|]+)\\b/q))||\'\';o.j=18 u(o.j).t(/^(j|1e)\\-/i,\'\')};$.L(g,o||{});g.A=$.L({},$.7.2.D.A,g.A);$.L(g,{n:0,J:[],2c:[],19:g.e.I||\'2\'+u(e),1k:6(z){8 g.19+(z>0?\'1U\'+u(z):\'\')},G:6(a,b){l c=g[a],k=$(b).K(\'k\');3(c){l d=c(b,k,g);3(d!=11)8 d}8 1h}});3(u(g.j).Q>1){g.j=g.j.t(/\\W+/g,\'|\').t(/^\\W|\\W$/g,\'\');g.1w=18 2h(\'\\\\.(\'+(g.j?g.j:\'\')+\')$\',\'q\')};g.M=g.19+\'25\';g.E.1j(\'\');g.1l=$(\'#\'+g.M+\'\');g.e.H=g.e.H||\'p\'+e+\'[]\';3(!g.C){g.1l.1d(\'\');g.C=$(\'#\'+g.M+\'1m\')};g.C=$(g.C);g.10=6(c,d){g.n++;c.2=g;3(d>0)c.I=c.H=\'\';3(d>0)c.I=g.1k(d);c.H=u(g.1n.t(/\\$H/q,$(g.P).K(\'H\')).t(/\\$I/q,$(g.P).K(\'I\')).t(/\\$g/q,e).t(/\\$i/q,d));3((g.m>0)&&((g.n-1)>(g.m)))c.16=1h;g.17=g.J[d]=c;c=$(c);c.1g(\'\').K(\'k\',\'\')[0].k=\'\';c.V(\'2-1a\');c.2z(6(){$(5).1O();3(!g.G(\'1R\',5,g))8 y;l a=\'\',v=u(5.k||\'\');3(g.j&&v&&!v.B(g.1w))a=g.A.1q.t(\'$1e\',u(v.B(/\\.\\w{1,4}$/q)));1r(l f 29 g.J)3(g.J[f]&&g.J[f]!=5)3(g.J[f].k==v)a=g.A.1t.t(\'$p\',v.B(/[^\\/\\\\]+$/q));l b=$(g.P).P();b.V(\'2\');3(a!=\'\'){g.1u(a);g.n--;g.10(b[0],d);c.1v().2d(b);c.F();8 y};$(5).1x({1y:\'1N\',1z:\'-1P\'});c.1Q(b);g.1A(5,d);g.10(b[0],d+1);3(!g.G(\'1S\',5,g))8 y});$(c).Z(\'2\',g)};g.1A=6(c,d){3(!g.G(\'1T\',c,g))8 y;l r=$(\'\'),v=u(c.k||\'\'),a=$(\'<1B T="2-1C" 1C="\'+g.A.Y.t(\'$p\',v)+\'">\'+g.A.p.t(\'$p\',v.B(/[^\\/\\\\]+$/q)[0])+\'\'),b=$(\'\'+g.A.F+\'\');g.C.1d(r.1d(b,\' \',a));b.1E(6(){3(!g.G(\'20\',c,g))8 y;g.n--;g.17.16=y;g.J[d]=11;$(c).F();$(5).1v().F();$(g.17).1x({1y:\'\',1z:\'\'});$(g.17).13().1g(\'\').K(\'k\',\'\')[0].k=\'\';3(!g.G(\'22\',c,g))8 y;8 y});3(!g.G(\'23\',c,g))8 y};3(!g.2)g.10(g.e,0);g.n++;g.E.Z(\'2\',g)})};$.L($.7.2,{13:6(){l a=$(5).Z(\'2\');3(a)a.C.24(\'a.2-F\').1E();8 $(5)},15:6(a){a=(R(a)==\'1f\'?a:\'\')||\'1F\';l o=[];$(\'1b:p.2\').N(6(){3($(5).1g()==\'\')o[o.Q]=5});8 $(o).N(6(){5.16=1h}).V(a)},1c:6(a){a=(R(a)==\'1f\'?a:\'\')||\'1F\';8 $(\'1b:p.\'+a).28(a).N(6(){5.16=y})},S:{},1s:6(b,c,d){l e,k;d=d||[];3(d.1G.1H().1I("1J")<0)d=[d];3(R(b)==\'6\'){$.7.2.15();k=b.14(c||X,d);1K(6(){$.7.2.1c()},1L);8 k};3(b.1G.1H().1I("1J")<0)b=[b];1r(l i=0;i35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';3(V.1r)(6($){$.8.2=6(l){3(5.Z==0)c 5;3(10 X[0]==\'1e\'){3(5.Z>1){h C=X;c 5.R(6(){$.8.2.18($(5),C)})};$.8.2[X[0]].18(5,$.2l(X).2i(1)||[]);c 5};h l=$.Q({},$.8.2.l,l||{});$(\'2g\').1F(\'2-U\').Y(\'2-U\').1H($.8.2.1a);3($.8.2.l.1b){$.8.2.1W($.8.2.l.1b);$.8.2.l.1b=15};5.1F(\'.2-1k\').Y(\'2-1k\').R(6(){V.2=(V.2||0)+1;h 19=V.2;h 2={e:5,E:$(5),P:$(5).P()};3(10 l==\'2o\')l={j:l};h o=$.Q({},$.8.2.l,l||{},($.1S?2.E.1S():($.2p?2.E.13():15))||{},{});3(!(o.j>0)){o.j=2.E.I(\'2b\');3(!(o.j>0)){o.j=(A(2.e.1u.F(/\\b(j|2x)\\-([0-9]+)\\b/m)||[\'\']).F(/[0-9]+/m)||[\'\'])[0];3(!(o.j>0))o.j=-1;2r o.j=A(o.j).F(/[0-9]+/m)[0]}};o.j=1i 2s(o.j);o.d=o.d||2.E.I(\'d\')||\'\';3(!o.d){o.d=(2.e.1u.F(/\\b(d\\-[\\w\\|]+)\\b/m))||\'\';o.d=1i A(o.d).t(/^(d|1m)\\-/i,\'\')};$.Q(2,o||{});2.D=$.Q({},$.8.2.l.D,2.D);$.Q(2,{n:0,J:[],2a:[],1j:2.e.N||\'2\'+A(19),1I:6(z){c 2.1j+(z>0?\'28\'+A(z):\'\')},L:6(1K,1g){h 1f=2[1K],k=$(1g).I(\'k\');3(1f){h 1o=1f(1g,k,2);3(1o!=15)c 1o}c 1d}});3(A(2.d).Z>1){2.d=2.d.t(/\\W+/g,\'|\').t(/^\\W|\\W$/g,\'\');2.1x=1i 24(\'\\\\.(\'+(2.d?2.d:\'\')+\')$\',\'m\')};2.T=2.1j+\'23\';2.E.1L(\'\');2.1M=$(\'#\'+2.T+\'\');2.e.H=2.e.H||\'p\'+19+\'[]\';3(!2.M){2.1M.1n(\'\');2.M=$(\'#\'+2.T+\'1N\')};2.M=$(2.M);2.17=6(7,u){2.n++;7.2=2;3(u>0)7.N=7.H=\'\';3(u>0)7.N=2.1I(u);7.H=A(2.1G.t(/\\$H/m,$(2.P).I(\'H\')).t(/\\$N/m,$(2.P).I(\'N\')).t(/\\$g/m,19).t(/\\$i/m,u));3((2.j>0)&&((2.n-1)>(2.j)))7.14=1d;2.16=2.J[u]=7;7=$(7);7.1l(\'\').I(\'k\',\'\')[0].k=\'\';7.Y(\'2-1k\');7.29(6(){$(5).22();3(!2.L(\'27\',5,2))c y;h 12=\'\',v=A(5.k||\'\');3(2.d&&v&&!v.F(2.1x))12=2.D.1E.t(\'$1m\',A(v.F(/\\.\\w{1,4}$/m)));1Y(h f 25 2.J)3(2.J[f]&&2.J[f]!=5)3(2.J[f].k==v)12=2.D.1D.t(\'$p\',v.F(/[^\\/\\\\]+$/m));h S=$(2.P).P();S.Y(\'2\');3(12!=\'\'){2.1J(12);2.n--;2.17(S[0],u);7.1t().1Z(S);7.K();c y};$(5).1s({1v:\'20\',1w:\'-21\'});7.26(S);2.1z(5,u);2.17(S[0],u+1);3(!2.L(\'2z\',5,2))c y});$(7).13(\'2\',2)};2.1z=6(7,u){3(!2.L(\'2u\',7,2))c y;h r=$(\'\'),v=A(7.k||\'\'),a=$(\'<1y 11="2-1A" 1A="\'+2.D.1C.t(\'$p\',v)+\'">\'+2.D.p.t(\'$p\',v.F(/[^\\/\\\\]+$/m)[0])+\'\'),b=$(\'\'+2.D.K+\'\');2.M.1n(r.1n(b,\' \',a));b.1U(6(){3(!2.L(\'2v\',7,2))c y;2.n--;2.16.14=y;2.J[u]=15;$(7).K();$(5).1t().K();$(2.16).1s({1v:\'\',1w:\'\'});$(2.16).1c().1l(\'\').I(\'k\',\'\')[0].k=\'\';3(!2.L(\'2w\',7,2))c y;c y});3(!2.L(\'2B\',7,2))c y};3(!2.2)2.17(2.e,0);2.n++;2.E.13(\'2\',2)})};$.Q($.8.2,{1c:6(){h 1h=$(5).13(\'2\');3(1h)1h.M.2A(\'a.2-K\').1U();c $(5)},1a:6(q){q=(10(q)==\'1e\'?q:\'\')||\'1T\';h o=[];$(\'1p:p.2\').R(6(){3($(5).1l()==\'\')o[o.Z]=5});c $(o).R(6(){5.14=1d}).Y(q)},1q:6(q){q=(10(q)==\'1e\'?q:\'\')||\'1T\';c $(\'1p:p.\'+q).2y(q).R(6(){5.14=y})},U:{},1W:6(G,1Q,C){h B,k;C=C||[];3(C.1B.1R().1V("1X")<0)C=[C];3(10(G)==\'6\'){$.8.2.1a();k=G.18(1Q||V,C);1O(6(){$.8.2.1q()},1P);c k};3(G.1B.1R().1V("1X")<0)G=[G];1Y(h i=0;i0){ + clickFormalReport() + }else{ + $.alert('璇蜂笂浼犳埧灞嬬収鐗囷紒'); + } + } + }) + +}); + +function clickFormalReport(){ + $.prompt('姝e紡鎶ュ憡灏嗗敖蹇偖瀵勭粰鎮紝璇锋敞鎰忔煡鏀讹紝璋㈣阿锛佸鏈夌枒闂彲涓庢垜浠仈绯伙細62392317', '璇峰~鍐欐寮忔姤鍛婇偖瀵勫湴鍧�', function (value) { + var address = $(".modal-text-input").val(); + if(address==""){ + $.alert('鍦板潃涓嶈兘涓虹┖'); + }else{ + $.ajax({ + url:"sendFormalReportApply", + data:{ + evaluationId:eId, + address:address + }, + dataType:"json", + success:function(data){ + $.cookie("fjt-formal-report",address, {path:"/",expires: 30}) + alert("鎮ㄧ殑鐢宠宸叉彁浜わ紝璇疯�愬績绛夊緟!"); + } + }) + } + }, + function (value) { + + }); + + var fjtReport = $.cookie("fjt-formal-report"); + if(fjtReport){ + $(".modal-text-input").val(fjtReport); + } +} + + function collectDistrict(eId, status){ $.ajax({ url:"collectDistrict", diff --git a/projects/fangjia-open/src/main/webapp/static/js/select.js b/projects/fangjia-open/src/main/webapp/static/js/select.js index 6152b33bc..b7c01d2f6 100644 --- a/projects/fangjia-open/src/main/webapp/static/js/select.js +++ b/projects/fangjia-open/src/main/webapp/static/js/select.js @@ -152,7 +152,8 @@ $(document).on('click', '.create-actions03', function () { $("#buildType").val("8") $("#houseFloor").show() $("#floorDesc").hide() - $("#basementAreaLi").hide() + $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -163,6 +164,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -173,6 +175,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -183,6 +186,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -193,6 +197,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -203,6 +208,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -213,6 +219,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").show() + $("#basementAreaLi_intr").show() } }, { @@ -223,6 +230,7 @@ $(document).on('click', '.create-actions03', function () { $("#floorDesc").show() // $("#houseFloor").hide() $("#basementAreaLi").hide() + $("#basementAreaLi_intr").hide() } }, { @@ -233,6 +241,7 @@ $(document).on('click', '.create-actions03', function () { $("#houseFloor").show() // $("#floorDesc").hide() $("#basementAreaLi").hide() + $("#basementAreaLi_intr").hide() } } ]; diff --git a/projects/fangjia-open/src/main/webapp/static/style/wx.css b/projects/fangjia-open/src/main/webapp/static/style/wx.css index 55e0d9d3e..269a1a00e 100644 --- a/projects/fangjia-open/src/main/webapp/static/style/wx.css +++ b/projects/fangjia-open/src/main/webapp/static/style/wx.css @@ -64,6 +64,10 @@ input::-webkit-input-placeholder{ .button.button-fill2{background:#ec881d;border-radius:0;width:100%;z-index:20;color: #fff; border: none;} .button.button-fill2:active{background:#bd6c16;} +.button.button-fill3{background:#ec881d;border-radius:0;bottom:0;z-index:20;position: fixed;color: #fff; border: none;} +.button.p1{left: 0;} +.button.p2{right: 0;} + .content-block{padding:0;margin:0;} .content-block p.di a{color:#a9a9a9;} .row{margin:0;} @@ -115,7 +119,7 @@ input::-webkit-input-placeholder{ .topic01{line-height:0.7rem;margin-bottom:-1px;} .topic01 .topicContent{padding:0 20px;} .topic01 .topicContent p{font-size:0.7rem;} -.topic01 .topicContent01{padding:12px 20px;padding-bottom:0;} +.topic01 .topicContent01{padding:12px 10px;padding-bottom:0;} .charts{height: 200px;margin-top: 20px;text-align: center;} .topicContent img{width:25%;background:#ccc;float:left;margin: 0 4% 5%;background-size:100%;} .cancelCollection:active{ @@ -202,6 +206,9 @@ input::-webkit-input-placeholder{ .waiting{padding:0 4px;height:30px;background:#808080;border:solid 1px #545454;border-radius:2px;font-size:0.7rem;color:white;text-align:center;line-height:30px;float:right;position:absolute;right:0;top:8px;cursor:pointer;} .waiting1{height:30px;background:#808080;border:solid 1px #545454;border-radius:2px;font-size:0.7rem;color:white;text-align:center;line-height:30px;float:right;right:0;top:8px;cursor:pointer;} .change_btn{width:102px;height:38px;background:#f0f0f0;border:solid 1px #e1e1e1;text-align:center;line-height:38px;float:right;cursor:pointer;color: #333;font-size: 14px;} + +.multi{width: 100px;} +.MultiFile-wrap{margin-top: -50px;margin-left: 100px;} /* 鑷�傚簲 */ @media(max-width:1200px){ .tabs{padding-top:67px;} @@ -212,9 +219,12 @@ input::-webkit-input-placeholder{ .inputTopic02 .topicTitle .input_lender{width:36%;} #bhFrom .input_mobileNumber{width:63%;padding-left: 30px;} .change_btn{width:72px;} + } @media(max-width:414px){ #bhFrom .input_mobileNumber{width:63%;padding-left: 30px;} + .multi{width: 108px;} + .MultiFile-wrap{margin-top: -50px;margin-left: 105px;} } @media(max-width:360px) { #bhFrom .input_mobileNumber{width:63%;padding-left: 30px;} @@ -222,5 +232,6 @@ input::-webkit-input-placeholder{ @media(max-width:375px){ #bhFrom .input_mobileNumber{width:63%;padding-left: 40px;} + .multi{width: 100px;} } diff --git a/projects/fangjia-open/src/main/webapp/user/reqCityChoicePage.ftl b/projects/fangjia-open/src/main/webapp/user/reqCityChoicePage.ftl index 5575699f0..4b274c15c 100644 --- a/projects/fangjia-open/src/main/webapp/user/reqCityChoicePage.ftl +++ b/projects/fangjia-open/src/main/webapp/user/reqCityChoicePage.ftl @@ -42,7 +42,7 @@
    - <#if type?? && type == 'b' && (citys??&&citys?size>0)> + <#if type?? && (type == 'b' || type == 'gb') && (citys??&&citys?size>0)>
    <#list citys as bo>

    ${bo}

    @@ -54,7 +54,7 @@
    - <#if type?? && type == 'c' || type == 'b' && (citys??&&citys?size=0)> + <#if type?? && type == 'c' || (type == 'b' || type == 'gb') && (citys??&&citys?size=0)>
    褰撳墠瀹氫綅鍩庡競
    diff --git a/projects/fangjia-open/src/main/webapp/user/reqLoginPage.ftl b/projects/fangjia-open/src/main/webapp/user/reqLoginPage.ftl index 621633126..f9d2c03e3 100644 --- a/projects/fangjia-open/src/main/webapp/user/reqLoginPage.ftl +++ b/projects/fangjia-open/src/main/webapp/user/reqLoginPage.ftl @@ -84,7 +84,7 @@ if(re.result == "fail"){ $.toast(re.msg); } else { - window.location.href = "reqCityChoicePage?type=b"; + window.location.href = "reqCityChoicePage?type=gb"; } },error:function (data, status) { $.toast("鍙戦�佸け璐ワ紝璇烽噸璇�"); diff --git a/projects/fangjia-open/src/main/webapp/user/setup.ftl b/projects/fangjia-open/src/main/webapp/user/setup.ftl index a173193de..797f87a6c 100644 --- a/projects/fangjia-open/src/main/webapp/user/setup.ftl +++ b/projects/fangjia-open/src/main/webapp/user/setup.ftl @@ -67,7 +67,7 @@
    锛堝繀濉」锛�
    @@ -76,8 +77,9 @@
    瀹ゅ彿鎴栭儴浣嶏細
    - +
    +
    瀹�
    锛堝繀濉」锛�
    @@ -170,6 +172,13 @@
    +
  • +
    +
    + *寤虹瓚闈㈢Н涓惈鏈夊湴涓嬮檮灞為潰绉� +
    +
    +
  • @@ -240,6 +249,7 @@ url: 'businessUserEvaluate', data: $("#evaluateForm").serialize(), dataType: "json", + async: false, method: "POST", success: function (data) { if (data.id == undefined) { @@ -253,9 +263,10 @@ } } }, - error: function () { + error: function(XMLHttpRequest){ $.toast("鏈嶅姟鍣ㄥ紓甯革紝璇烽噸鏂拌瘎浼�"); $("#evaluateBtn").prop("disabled", false) + console.log(XMLHttpRequest.readyState + XMLHttpRequest.status + XMLHttpRequest.responseText); } }) }) diff --git a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl index 62a40dd3c..165012ff6 100644 --- a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl +++ b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl @@ -16,6 +16,12 @@ @@ -28,7 +34,8 @@

    ${fjtEvaluation.districtName!}

    -

    ${fjtEvaluation.address!} <#if fjtEvaluation.houseNum?? && (fjtEvaluation.houseNum?contains("鏍�") || fjtEvaluation.houseNum?contains("骞�"))>${fjtEvaluation.houseNum!}<#else>${fjtEvaluation.houseNum!}鍙�${fjtEvaluation.roomNum!}瀹� 閲嶆柊璇勪及 >

    +

    ${fjtEvaluation.address!} <#if fjtEvaluation.houseNum?? && fjtEvaluation.houseNum?contains("鍙�")>${fjtEvaluation.houseNum!}<#else>${fjtEvaluation.houseNum!}鍙�${fjtEvaluation.roomNum!}瀹� 閲嶆柊璇勪及 >

    +

    *璇风‘璁や笌浜ц瘉鍦板潃涓�鑷�

    <#if bohaiEvaluationAudit?? && bohaiEvaluationAudit.auditStatus!=0>

    璇勪及鎬讳环锛�<#if fjtEvaluation??> @@ -37,7 +44,7 @@ <#if role?? && role==17 && loanInfoMap??>

    鎵�灞炲垎绫伙細${loanInfoMap.type!}绫�

    鍙捶鎴愭暟锛�${loanInfoMap.loan_ratio!}鎴�

    -

    鍙捶閲戦锛�${(fjtEvaluation.totalPrice*loanInfoMap.loan_ratio*0.1/10000)?string('0.##')}涓囧厓

    +

    鍙捶閲戦锛�${(bohaiEvaluationAudit.inquirePrice*loanInfoMap.loan_ratio*0.1/10000)?string('0.##')}涓囧厓

    璐锋鍒╃巼锛�4.5%

    <#else> @@ -81,7 +88,7 @@
    鏈熸湜浠凤細 -  涓囧厓 + disabled> 涓囧厓 鎻愪氦 鍒锋柊
    @@ -125,8 +132,39 @@
    - - +
    + + +
    + <#if reportFileMap??> +
    + 宸蹭笂浼犳枃浠讹細 + <#if reportFileMap["1"]??>璇环鍗�(${reportFileMap["1"]?size}) + <#if reportFileMap["2"]??> + <#if reportFileMap["3"]??> + <#if reportFileMap["4"]??> +
    + + + +
    + 鏂囦欢绫诲瀷锛� + +

    璇烽�夋嫨绫诲瀷

    +
    +
    + 涓婁紶鏂囦欢锛� + 涓婁紶 + +
    +
    + 娉細濡傞渶涓嬭浇璇勪及鎶ュ憡锛屼骇璇佷负蹇呭~椤� + 鎴垮眿鐓х墖涓婁紶瑕佹眰锛氬皬鍖哄叆鍙�1寮狅紝灏忓尯鐜1寮狅紝闂ㄧ墝鍙�1寮狅紝澶栫珛闈�1寮狅紝瀹ゅ唴鐓х墖2寮� +
    +
    +
    + +
    鎴夸骇鍩烘湰淇℃伅
    @@ -347,7 +385,7 @@

    <#if fjtEvaluation.basementArea??&&(fjtEvaluation.basementArea!>0)>${fjtEvaluation.basementArea!?string('0.##')}骞崇背<#else>-

    -

    <#if fjtEvaluation.basementArea??&&(fjtEvaluation.atticArea!>0)>${fjtEvaluation.atticArea!?string('0.##')}骞崇背<#else>-

    +

    <#if fjtEvaluation.atticArea??&&(fjtEvaluation.atticArea!>0)>${fjtEvaluation.atticArea!?string('0.##')}骞崇背<#else>-

    @@ -389,9 +427,15 @@

    - <#if bohaiEvaluationAudit?? && fjtEvaluation.lender?? && bohaiEvaluationAudit.auditStatus!=0> + <#if bohaiEvaluationAudit?? && fjtEvaluation.lender?? && bohaiEvaluationAudit.auditStatus!=0 && reportFileMap?? && reportFileMap["2"]??> @@ -408,6 +452,7 @@ + diff --git a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl index 13c360f37..fd5351b5d 100644 --- a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl +++ b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl @@ -387,6 +387,7 @@