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-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/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-open/src/main/java/com/fangjia/open/controllers/AddressController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java
index 39d5d7ffd..907212d5f 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
@@ -2774,7 +2774,7 @@ public class AddressController {
if (json.getInt("code") == 200) {
JSONObject resultJson = json.getJSONObject("result");
JSONObject searchAddress = resultJson.getJSONObject("searchAddress");
- if (resultJson.getInt("credit") > 0) {
+ 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");
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 20817129d..6e72df050 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,38 +1,5 @@
package com.fangjia.open.controllers.weixin;
-import java.io.*;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-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.core.util.HttpRequest;
-import com.fangjia.dal.sql.model.*;
-import com.fangjia.open.OpenConfig;
-import com.fangjia.open.dto.UniversalDto;
-import com.fangjia.open.model.BasicModel;
-import com.fangjia.open.model.FilesModel;
-import com.fangjia.open.util.*;
-import com.fangjia.service.mongo.fangjia.*;
-import com.fangjia.service.sql.*;
-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 com.fangjia.core.util.DataUtil;
import com.fangjia.core.util.DateUtil;
import com.fangjia.dal.common.DistrictKey;
@@ -42,9 +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.*;
import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.bo.HouseBo;
import com.fangjia.service.datastore.DistrictService;
@@ -57,13 +27,35 @@ 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.*;
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.
*/
@@ -105,6 +97,7 @@ public class WeiXinEvaluationController {
private GoldLogsService goldLogsService;
private PriceBorderService priceBorderService;
private BohaiEvaluationAuditService bohaiEvaluationAuditService;
+ private FormalReportService formalReportService;
private FileService fileService;
private ReportFileAttachService reportFileAttachService;
@@ -272,6 +265,10 @@ 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){
@@ -295,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", "-");
}
@@ -451,12 +453,25 @@ public class WeiXinEvaluationController {
if(fjtUser!=null && fjtUser.getRole()==17) {
System.out.println("渤海地址搜索 "+evaluation.getAddress());
List bhDists = BHBankUtils.getDistrictByBhbank(evaluation.getAddress());
+ JSONObject o = null;
if(bhDists.size()<1){
bhDists = BHBankUtils.getDistrictByBhbank(district.getName());
+ o = bhDists.get(0);
+ }else if(bhDists.size()>1){
+ int mod = Integer.MAX_VALUE;
+ for(JSONObject jo : bhDists){
+ double price = Double.valueOf((String)jo.get("price"));
+ int bhprice = (int)price;
+ int bhmod = Math.abs(bhprice - avgPrice);
+ if(bhmod bhMatchMap = new HashMap();
- if(bhDists.size()==1){
- JSONObject o = bhDists.get(0);
+ if(o != null){
+
String bhDistName = (String)o.get("name");
String regionCode = String.valueOf((Long)o.get("country"));
String bhRegion = BHBankUtils.regionCodeMap.get(regionCode);
@@ -643,6 +658,8 @@ public class WeiXinEvaluationController {
}
}
+ UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(model.getEvaluationId());
+ model.setUserTrades(userTrade);
if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){
Map retMap = getLoanInfo(district, evaluation.getHouseArea());
@@ -979,13 +996,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());
@@ -1010,18 +1028,84 @@ public class WeiXinEvaluationController {
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 {
@@ -1261,8 +1345,45 @@ public class WeiXinEvaluationController {
}
}
+ 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) {
+ private static void inputStreamToFile(InputStream ins, File file) {
//将输出流转化为文件即可
FileOutputStream os = null;
try {
@@ -1451,4 +1572,8 @@ public class WeiXinEvaluationController {
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/model/weixin/EvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java
index ce6cc6080..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
@@ -7,10 +7,7 @@ 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.ReportFileAttach;
+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;
@@ -57,6 +54,8 @@ public class EvaluationModel extends BaseModel{
private String queryId;
private Integer fileClass;
private Map> reportFileMap;
+ private UserTrades userTrades;
+ private String address;
public void setId(String id) {
@@ -302,4 +301,20 @@ public class EvaluationModel extends BaseModel{
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 d638fe36d..02e10d76c 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
@@ -2,27 +2,15 @@ package com.fangjia.open.util;
import com.fangjia.core.util.HttpRequest;
import com.fangjia.core.util.MD5Util;
-import com.fangjia.core.util.MultipartUtility;
import com.fangjia.dal.sql.model.FjtEvaluation;
import com.fangjia.dal.sql.model.UsersDetail;
import com.fangjia.open.model.weixin.EvaluationModel;
-import com.mashape.unirest.http.HttpResponse;
-import com.mashape.unirest.http.Unirest;
-import com.mashape.unirest.request.HttpRequestWithBody;
-import com.yeepay.shade.org.apache.http.entity.mime.MultipartEntityBuilder;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import okhttp3.*;
-import org.apache.commons.collections.map.MultiValueMap;
import org.apache.commons.lang.StringUtils;
-import org.apache.http.HttpHeaders;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.springframework.http.ResponseEntity;
import java.io.File;
-import java.io.FileInputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
@@ -58,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);
@@ -73,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");
@@ -116,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()));
@@ -197,6 +188,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");
@@ -282,6 +274,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");
@@ -406,11 +399,6 @@ public class BHBankUtils {
.addFormDataPart("userName",name);
for(File file : uploadfiles){
- System.out.println(file.getAbsoluteFile());
- System.out.println(file.getName());
- System.out.println(file.getPath());
- System.out.println(file.getCanonicalPath());
- System.out.println(file.getParentFile());
builder.addFormDataPart("file",file.getPath(), RequestBody.create(MediaType.parse("application/octet-stream"), file));
}
RequestBody body = builder.build();
@@ -434,4 +422,60 @@ public class BHBankUtils {
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);
+ }
+
+
+ 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/resources/persistence-goojia-fangjia.xml b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml
index 9004315d0..69ec4700c 100644
--- a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml
+++ b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml
@@ -17,6 +17,7 @@
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/webapp/static/js/report.js b/projects/fangjia-open/src/main/webapp/static/js/report.js
index 2d8366e4a..92ef631b5 100644
--- a/projects/fangjia-open/src/main/webapp/static/js/report.js
+++ b/projects/fangjia-open/src/main/webapp/static/js/report.js
@@ -264,7 +264,7 @@ $('.little_btn').on('click', function () {
/* 涓嬭浇璇勪及鎶ュ憡 */
$('.download_btn').on('click', function () {
- $.prompt('璇勪及鎶ュ憡灏嗗敖蹇彂閫佸埌鎮ㄧ殑閭锛岃娉ㄦ剰鏌ユ敹锛岃阿璋紒濡傛湁鐤戦棶鍙笌鎴戜滑鑱旂郴锛�62392317/62397088', '璇峰~鍐欐姤鍛婂彂閫侀偖绠�', function (value) {
+ $.prompt('璇勪及鎶ュ憡灏嗗敖蹇彂閫佸埌鎮ㄧ殑閭锛岃娉ㄦ剰鏌ユ敹锛岃阿璋紒濡傛湁鐤戦棶鍙笌鎴戜滑鑱旂郴锛�62392317', '璇峰~鍐欐姤鍛婂彂閫侀偖绠�', function (value) {
var email = $(".modal-text-input").val();
if(email==""){
$.alert('閭涓嶈兘涓虹┖');
@@ -281,6 +281,7 @@ $('.download_btn').on('click', function () {
success:function(data){
$.cookie("fjt-lhemail",email, {path:"/",expires: 30})
alert("鎮ㄧ殑淇℃伅宸叉彁浜ゆ垚鍔�!");
+ window.location.reload();
}
})
}
@@ -297,6 +298,57 @@ $('.download_btn').on('click', function () {
});
+
+/* 涓嬭浇璇勪及鎶ュ憡 */
+$('.formal_btn').on('click', function () {
+ $.ajax({
+ url:"checkImage",
+ data:{
+ evaluationId:eId
+ },
+ dataType:"json",
+ success:function(data){
+ if(data && data.count>0){
+ 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/style/wx.css b/projects/fangjia-open/src/main/webapp/static/style/wx.css
index 780db8fe6..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{
diff --git a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl
index d5693153c..e70200bda 100644
--- a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl
+++ b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl
@@ -385,7 +385,7 @@
<#if fjtEvaluation.basementArea??&&(fjtEvaluation.basementArea!>0)>${fjtEvaluation.basementArea!?string('0.##')}骞崇背<#else>-#if>
- <#if fjtEvaluation.basementArea??&&(fjtEvaluation.atticArea!>0)>${fjtEvaluation.atticArea!?string('0.##')}骞崇背<#else>-#if>
+ <#if fjtEvaluation.atticArea??&&(fjtEvaluation.atticArea!>0)>${fjtEvaluation.atticArea!?string('0.##')}骞崇背<#else>-#if>
@@ -429,7 +429,13 @@
<#if bohaiEvaluationAudit?? && fjtEvaluation.lender?? && bohaiEvaluationAudit.auditStatus!=0 && reportFileMap?? && reportFileMap["2"]??>
-
涓嬭浇璇勪及鎶ュ憡
+ <#if userTrades??>
+
涓嬭浇璇勪及鎶ュ憡
+
鍑哄叿姝e紡鎶ュ憡
+ <#else>
+
涓嬭浇璇勪及鎶ュ憡
+ #if>
+
#if>
@@ -521,7 +527,7 @@
onClick: function () {
$("a.create-actions08").empty().text(this.text).addClass("selected")
$("#fileClass").val("1")
- $("input[name=reportFiles]").attr("accept","application/pdf")
+ $("input[name=reportFiles]").attr("accept","image/*")
}
},
{
@@ -563,11 +569,11 @@ function changeFile(d){
var val = $(d).attr("accept")
if(val==""){
var fileClass = $("#fileClass").val()
- if(fileClass == "1"){
- $(d).attr("accept","application/pdf")
- }else{
+ // if(fileClass == "1"){
+ // $(d).attr("accept","application/pdf")
+ // }else{
$(d).attr("accept","image/*")
- }
+ // }
}
}
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 @@