diff --git a/projects/fangjia-bkoff/src/main/webapp/yugudan/editEval.ftl b/projects/fangjia-bkoff/src/main/webapp/yugudan/editEval.ftl
index eab869c86..53fd8f659 100644
--- a/projects/fangjia-bkoff/src/main/webapp/yugudan/editEval.ftl
+++ b/projects/fangjia-bkoff/src/main/webapp/yugudan/editEval.ftl
@@ -1339,7 +1339,7 @@
瀹ゅ彿 |
<#if evaluation.buildType!=3 && evaluation.buildType!=8 && evaluation.buildType!=0>
- <#if evaluation.floorDesc!="">
+ <#if evaluation.floorDesc?? && evaluation.floorDesc!="">
${evaluation.floorDesc!}
#if>
diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java
new file mode 100644
index 000000000..4f8c7d26b
--- /dev/null
+++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java
@@ -0,0 +1,7 @@
+package com.fangjia.dal.sql.fangjia.dao;
+
+import com.fangjia.dal.SqlDao;
+import com.fangjia.dal.sql.model.BohaiEvaluationAudit;
+
+public interface BohaiEvaluationAuditDao extends SqlDao {
+}
diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java
new file mode 100644
index 000000000..1035be137
--- /dev/null
+++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java
@@ -0,0 +1,7 @@
+package com.fangjia.dal.sql.fangjia.dao;
+
+import com.fangjia.dal.GoojiaFangjiaSqlDao;
+import com.fangjia.dal.sql.model.BohaiEvaluationAudit;
+
+public class BohaiEvaluationAuditDaoImpl extends GoojiaFangjiaSqlDao implements BohaiEvaluationAuditDao{
+}
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/BohaiEvaluationAudit.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java
new file mode 100644
index 000000000..adb5b7be6
--- /dev/null
+++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java
@@ -0,0 +1,184 @@
+package com.fangjia.dal.sql.model;
+import java.util.Date;
+import java.util.HashMap;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import com.fangjia.dal.SqlEntity;
+@Entity
+@Table(name = "bohai_evaluation_audit")
+public class BohaiEvaluationAudit implements SqlEntity{
+
+ long id;
+
+ long evaluationId;
+ String queryId;
+ Integer backStatus;
+ Integer inquirePrice;
+ Integer auditStatus;//
+ long userId;
+ Integer hopePrice;
+ Integer lastPrice;
+ String remark;
+
+ String inquireRemark;
+
+ String feedbackId;
+ Integer feedbackStatus;
+ String feedbackMsg;
+
+ Date dateCreated;
+ Date lastUpdated;
+
+ @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 = "back_status")
+ public Integer getBackStatus() {
+ return backStatus;
+ }
+
+ public void setBackStatus(Integer backStatus) {
+ this.backStatus = backStatus;
+ }
+
+ @Column(name = "inquire_price")
+ public Integer getInquirePrice() {
+ return inquirePrice;
+ }
+
+ public void setInquirePrice(Integer inquirePrice) {
+ this.inquirePrice = inquirePrice;
+ }
+
+ @Column(name = "audit_status")
+ public Integer getAuditStatus() {
+ return auditStatus;
+ }
+
+ public void setAuditStatus(Integer auditStatus) {
+ this.auditStatus = auditStatus;
+ }
+
+ @Column(name = "user_id")
+ public long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ @Column(name = "hope_price")
+ public Integer getHopePrice() {
+ return hopePrice;
+ }
+
+ public void setHopePrice(Integer hopePrice) {
+ this.hopePrice = hopePrice;
+ }
+
+ @Column(name = "last_price")
+ public Integer getLastPrice() {
+ return lastPrice;
+ }
+
+ public void setLastPrice(Integer lastPrice) {
+ this.lastPrice = lastPrice;
+ }
+
+ @Column(name = "remark")
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ @Column(name = "c_date")
+ public Date getDateCreated() {
+ return dateCreated;
+ }
+
+ public void setDateCreated(Date dateCreated) {
+ this.dateCreated = dateCreated;
+ }
+
+ @Column(name = "m_date")
+ public Date getLastUpdated() {
+ return lastUpdated;
+ }
+
+ public void setLastUpdated(Date lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ @Column(name = "feedback_id")
+ public String getFeedbackId() {
+ return feedbackId;
+ }
+
+ public void setFeedbackId(String feedbackId) {
+ this.feedbackId = feedbackId;
+ }
+
+ @Column(name = "feedback_status")
+ public Integer getFeedbackStatus() {
+ return feedbackStatus;
+ }
+
+ public void setFeedbackStatus(Integer feedbackStatus) {
+ this.feedbackStatus = feedbackStatus;
+ }
+
+ @Column(name = "feedback_msg")
+ public String getFeedbackMsg() {
+ return feedbackMsg;
+ }
+
+ public void setFeedbackMsg(String feedbackMsg) {
+ this.feedbackMsg = feedbackMsg;
+ }
+
+ @Column(name = "inquire_remark")
+ public String getInquireRemark() {
+ return inquireRemark;
+ }
+
+ public void setInquireRemark(String inquireRemark) {
+ this.inquireRemark = inquireRemark;
+ }
+}
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 4ca4a7f59..c5991df90 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
@@ -99,6 +99,9 @@ public class FjtEvaluation implements SqlEntity{
private Integer buyYear; //是否满五
private Integer onlyOne; //是否唯一
private Double registerPrice; //深圳 登记价
+
+ private String finishDateStr;//竣工时间
+ private String useType;//房屋用途
@GeneratedValue(strategy = GenerationType.AUTO)
@Id
@@ -729,6 +732,24 @@ public class FjtEvaluation implements SqlEntity{
this.registerPrice = registerPrice;
}
+ @Column(name = "finish_date_str")
+ public String getFinishDateStr() {
+ return finishDateStr;
+ }
+
+ public void setFinishDateStr(String finishDateStr) {
+ this.finishDateStr = finishDateStr;
+ }
+
+ @Column(name = "use_type")
+ public String getUseType() {
+ return useType;
+ }
+
+ public void setUseType(String useType) {
+ this.useType = useType;
+ }
+
@Override
public String toString() {
return "FjtEvaluation{" +
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/controllers/AddressController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java
index 708786087..39d5d7ffd 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
@@ -2760,55 +2760,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.getInt("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()) && 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/weixin/DistrictController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java
index a09518625..4cc728b6a 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
@@ -6,16 +6,12 @@ import com.fangjia.dal.QueryParam;
import com.fangjia.dal.SdQuery;
import com.fangjia.dal.SrQuery;
import com.fangjia.dal.common.DistrictKey;
-import com.fangjia.dal.mongo.model.DistrictStat;
import com.fangjia.dal.seaweed.model.District;
import com.fangjia.dal.sql.model.FjtUsers;
-import com.fangjia.dal.sql.model.UserCity;
import com.fangjia.open.compatible.model.JsonModel;
-import com.fangjia.open.model.BaseModel;
-import com.fangjia.open.model.FangjiaApiModel;
import com.fangjia.open.model.weixin.DistrictModel;
import com.fangjia.open.model.weixin.DistrictSearchModel;
-import com.fangjia.open.model.weixin.UserModel;
+import com.fangjia.open.util.BHBankUtils;
import com.fangjia.service.api.AutoCompleteBo;
import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.bo.DistrictStatRentBo;
@@ -27,8 +23,8 @@ import com.fangjia.service.sql.UserCityService;
import com.fangjia.service.user.UsersInfoService;
import com.fangjia.service.util.CookieUtils;
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
+import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
@@ -40,7 +36,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.net.URLEncoder;
import java.util.*;
public class DistrictController {
@@ -151,6 +146,7 @@ public class DistrictController {
districtModel.setMsg("参数错误");
return districtModel;
}
+
District district = null;
if(StringUtils.isNotBlank(districtModel.getId())) {
district = districtService.findById(districtModel.getId());
@@ -162,8 +158,14 @@ public class DistrictController {
} else {
district = districtService.findByKeyMiniModel(districtModel.getCityName(), districtModel.getRegion(), districtModel.getName(), "district");
}
+
//小区价格
DistrictStatBo districtStatBo = getDistrictStat(new DistrictKey(district));
+
+ String userId = CookieUtils.getCookieValue(request, "login_user_id");
+
+
+
//小区租金
List districtStatRentBos = districtStatRentService.findAllHouseTypeByDistrictStatRent(new DistrictKey(district));
//处理图片链接
@@ -183,7 +185,7 @@ public class DistrictController {
boolean is=true;
if (null != districtStatBo && null != districtStatBo.getDefaultDistrictStat()) {
double credit = districtStatBo.getDefaultDistrictStat().getCredit();
- String userId = CookieUtils.getCookieValue(request, "login_user_id");
+
Map map = userCityService.FindCreditByUserId(Long.parseLong(userId));
String creditStr = map.get(city);
if (StringUtils.isNotBlank(creditStr)) {
@@ -208,6 +210,8 @@ public class DistrictController {
return districtModel;
}
+
+
private DistrictStatBo getDistrictStat(DistrictKey districtKey) {
District district = districtService.findDistrict(districtKey, true);
DistrictStatBo statBo = null;
diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java
index 3fdb01671..2c75d331e 100644
--- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java
@@ -1,16 +1,10 @@
package com.fangjia.open.controllers.weixin;
import com.fangjia.core.util.StringUtil;
-import com.fangjia.dal.sql.model.EvaluationAudit;
-import com.fangjia.dal.sql.model.FjtEvaluation;
-import com.fangjia.dal.sql.model.FjtUsers;
-import com.fangjia.dal.sql.model.UserTrades;
+import com.fangjia.dal.sql.model.*;
import com.fangjia.open.model.RestfulModelAndView;
import com.fangjia.open.model.weixin.ReportModel;
-import com.fangjia.service.sql.EvaluationAuditService;
-import com.fangjia.service.sql.FjtEvaluationService;
-import com.fangjia.service.sql.FjtUsersService;
-import com.fangjia.service.sql.UserTradesService;
+import com.fangjia.service.sql.*;
import com.fangjia.service.util.CookieUtils;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -32,6 +26,7 @@ public class ReportController {
private FjtEvaluationService fjtEvaluationService;
private EvaluationAuditService evaluationAuditService;
private FjtUsersService fjtUsersService;
+ private BohaiEvaluationAuditService bohaiEvaluationAuditService;
public Object downloadListAction(HttpServletRequest req, ReportModel model, @Param(name = "page") String page) {
if(req.getMethod()==null || "GET".equalsIgnoreCase(req.getMethod())) {
@@ -68,7 +63,7 @@ public class ReportController {
jsonObject.put("bgsf", userTrades.getCharge()+"");
if(StringUtils.isNotBlank(evaluationId)) {
FjtEvaluation fjtEvaluation = fjtEvaluationService.findEvaluationById(NumberUtils.toLong(evaluationId));
- EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId);
+
if(fjtEvaluation != null) {
jsonObject.put("eid", fjtEvaluation.getId());
jsonObject.put("dz", fjtEvaluation.getAddress());
@@ -76,11 +71,40 @@ public class ReportController {
jsonObject.put("rn", fjtEvaluation.getRoomNum());
jsonObject.put("zdr", StringUtils.isBlank(fjtEvaluation.getLender()) ? "-" : fjtEvaluation.getLender());
jsonObject.put("mj", fjtEvaluation.getHouseArea());
- jsonObject.put("zj", df.format(fjtEvaluation.getTotalPrice() / 10000.0));
}
- if(evaluationAudit != null) {
- jsonObject.put("ckj", (evaluationAudit.getDealPrice()==null) ? "-" : df.format(evaluationAudit.getDealPrice())+"");//参考价
- jsonObject.put("zsj", (evaluationAudit.getAuditPrice()==null) ? "-" : df.format(evaluationAudit.getAuditPrice())+"");//终审价
+
+ if(fjtEvaluation != null && fjtUsers.getRole()==17){
+ BohaiEvaluationAudit bhEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(fjtEvaluation.getId());
+ String zj = "-";
+ String qwj = "-";
+ String zsj = "-";
+ if(bhEvaluationAudit != null){
+ if(bhEvaluationAudit.getInquirePrice()!=null && bhEvaluationAudit.getInquirePrice() > 0){
+ zj = String.valueOf((int)(bhEvaluationAudit.getInquirePrice() / 10000));
+ }
+ if(bhEvaluationAudit.getHopePrice()!=null && bhEvaluationAudit.getHopePrice()>0){
+ qwj = String.valueOf((int)(bhEvaluationAudit.getHopePrice() / 10000));
+ }
+
+ if(bhEvaluationAudit.getLastPrice()!=null && bhEvaluationAudit.getLastPrice()>0){
+ zsj = String.valueOf((int)(bhEvaluationAudit.getLastPrice() / 10000));
+ }
+
+ }
+ jsonObject.put("zj", zj);//总价
+ jsonObject.put("qwj", qwj);//期望价
+ jsonObject.put("zsj", zsj);//终审价
+
+ }else{
+ EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId);
+ if(fjtEvaluation != null) {
+ jsonObject.put("zj", df.format(fjtEvaluation.getTotalPrice() / 10000.0));
+ }
+
+ if(evaluationAudit != null) {
+ jsonObject.put("ckj", (evaluationAudit.getDealPrice()==null) ? "-" : df.format(evaluationAudit.getDealPrice())+"");//参考价
+ jsonObject.put("zsj", (evaluationAudit.getAuditPrice()==null) ? "-" : df.format(evaluationAudit.getAuditPrice())+"");//终审价
+ }
}
}
ja.add(jsonObject);
@@ -106,4 +130,13 @@ public class ReportController {
public void setFjtUsersService(FjtUsersService fjtUsersService) {
this.fjtUsersService = fjtUsersService;
}
+
+
+ public BohaiEvaluationAuditService getBohaiEvaluationAuditService() {
+ return bohaiEvaluationAuditService;
+ }
+
+ public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) {
+ this.bohaiEvaluationAuditService = bohaiEvaluationAuditService;
+ }
}
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 7507185f8..20817129d 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,5 +1,8 @@
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.*;
@@ -7,16 +10,27 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
-import com.fangjia.open.util.InsidePolygon2;
-import com.fangjia.service.mongo.fangjia.PriceBorderService;
+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;
@@ -28,17 +42,9 @@ 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.EvaluationAudit;
-import com.fangjia.dal.sql.model.FjtEvaluation;
-import com.fangjia.dal.sql.model.FjtUsers;
-import com.fangjia.dal.sql.model.GoldLogs;
-import com.fangjia.dal.sql.model.UserTrades;
-import com.fangjia.dal.sql.model.UsersDetail;
import com.fangjia.open.compatible.model.JsonModel;
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.service.bo.DistrictStatBo;
import com.fangjia.service.bo.HouseBo;
import com.fangjia.service.datastore.DistrictService;
@@ -51,21 +57,12 @@ 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.sms.SmsException;
import com.fangjia.service.sms.SmsService;
-import com.fangjia.service.sql.EvaluationAuditService;
-import com.fangjia.service.sql.EvaluationRateService;
-import com.fangjia.service.sql.FjtEvaluationService;
-import com.fangjia.service.sql.FjtUsersService;
-import com.fangjia.service.sql.GoldLogsService;
-import com.fangjia.service.sql.UserTradesService;
-import com.fangjia.service.sql.UsersDetailService;
import com.fangjia.service.user.UsersInfoService;
import com.fangjia.service.util.CookieUtils;
import com.google.common.collect.ImmutableMap;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
/**
* Created by wenyan on 2016/7/15.
@@ -107,11 +104,17 @@ public class WeiXinEvaluationController {
private EvaluationService evaluationService;
private GoldLogsService goldLogsService;
private PriceBorderService priceBorderService;
-
+ private BohaiEvaluationAuditService bohaiEvaluationAuditService;
+ 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");
@@ -122,7 +125,7 @@ public class WeiXinEvaluationController {
//MOBILES.add("13681915777");//13774361275
}
- public Object formAction(HttpServletRequest req, EvaluationModel model){
+ public Object formAction(HttpServletRequest req, EvaluationModel model, HttpServletResponse response){
District district = districtService.findById(model.getId());
model.setDistrict(district);
@@ -130,9 +133,33 @@ public class WeiXinEvaluationController {
long userId = Long.valueOf(cookieUserId);
FjtUsers fjtUsers = fjtUsersService.findById(userId);
model.setRole(fjtUsers.getRole());
+ if(fjtUsers.getRole()==17){
+ try {
+ response.sendRedirect("bhform?id="+model.getId());
+ } catch (IOException e) {
+ }
+ }
return model;
}
+ public Object bhformAction(EvaluationModel model) {
+ District district = districtService.findById(model.getId());
+ List addrAlias = new ArrayList();
+ if(StringUtils.isNotBlank(district.getAddress())){
+ addrAlias.add(district.getAddress());
+
+ if(district.getAddrAlias()!=null && !district.getAddrAlias().contains(district.getAddress())){
+ addrAlias.addAll(district.getAddrAlias());
+ }
+ district.setAddrAlias(addrAlias);
+ }
+
+ model.setDistrict(district);
+ return model;
+ }
+
+
+
/**
* 微信小程序:小区详情获取
* @return
@@ -177,6 +204,113 @@ public class WeiXinEvaluationController {
return jsonModel;
}
+
+
+ public Object bhhistoryAction(HttpServletRequest req, EvaluationModel model, @Param(name = "page") String page) {
+ if (req.getMethod() == null || "GET".equalsIgnoreCase(req.getMethod())) {
+ return model;
+ }
+ String cookieUserId = CookieUtils.getCookieValue(req, "login_user_id");
+ long userId = Long.valueOf(cookieUserId);
+ FjtUsers fjtUsers = fjtUsersService.findById(userId);
+ RestfulModelAndView data = new RestfulModelAndView();
+ JSONObject result = new JSONObject();
+ //最多10页
+ if (NumberUtils.toInt(page) > 10) {
+ result.put("result", new JSONArray().toString());
+ data.setModel(result);
+ return data;
+ }
+ 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) {
+ FjtEvaluation fjtEvaluation = fjtEvaluationList.get(i);
+ BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(fjtEvaluation.getId());
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("eid", fjtEvaluation.getId());
+ jsonObject.put("pgrq", sdf.format(fjtEvaluation.getDateCreated()));//评估日期
+ jsonObject.put("tjrq", (evaluationAudit == null || evaluationAudit.getAuditStatus() != 4) ? "-" : sdf.format(evaluationAudit.getLastUpdated()));//调价日期
+ jsonObject.put("dz", fjtEvaluation.getAddress());//地址
+ jsonObject.put("hn", fjtEvaluation.getHouseNum());
+ jsonObject.put("rn", fjtEvaluation.getRoomNum());
+ jsonObject.put("wylx", StringUtils.isBlank(BUILDTYPE_MAP.get(fjtEvaluation.getBuildType())) ? "-" : BUILDTYPE_MAP.get(fjtEvaluation.getBuildType()));//物业类型
+ jsonObject.put("mj", fjtEvaluation.getHouseArea());//面积
+ String zj = "-";
+ if(evaluationAudit != null && evaluationAudit.getInquirePrice() > 0){
+ zj = String.valueOf((int)(evaluationAudit.getInquirePrice() / 10000));
+ }
+ jsonObject.put("zj", zj);//总价
+ jsonObject.put("ckj", (evaluationAudit == null || evaluationAudit.getHopePrice() == null) ? "-" : (int)(evaluationAudit.getHopePrice()/ 10000));//期望价
+ jsonObject.put("zsj", (evaluationAudit == null || evaluationAudit.getLastPrice() == null) ? "-" : (int)(evaluationAudit.getLastPrice()/ 10000));//终审价
+ jsonObject.put("zdr", StringUtils.isBlank(fjtEvaluation.getLender()) ? "-" : fjtEvaluation.getLender());//主贷人
+ if(evaluationAudit==null || (evaluationAudit!=null && StringUtils.isBlank(evaluationAudit.getInquireRemark()))){
+ jsonObject.put("pgsm","");//评估说明
+ }else{
+ jsonObject.put("pgsm",evaluationAudit.getInquireRemark());//评估说明
+ }
+
+ if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==0) {
+ 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){
+ evaluationAudit.setAuditStatus(1);
+ evaluationAudit.setInquirePrice(totalPrice);
+ jsonObject.put("zj", (int)(totalPrice/10000));
+ bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
+ jsonObject.put("shzt", "价格已审核");
+ }
+ }
+ } else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==1) {
+ 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){
+ int inquirePrice = (Integer) object.get("inquirePrice");
+ evaluationAudit.setAuditStatus(3);
+ evaluationAudit.setLastPrice(inquirePrice);
+ evaluationAudit.setFeedbackStatus(feedbackStatus);
+ evaluationAudit.setFeedbackMsg((String)object.get("feedbackCallMsg"));
+ jsonObject.put("zsj",(int)(inquirePrice/ 10000));//终审价
+ bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
+ jsonObject.put("shzt", "审核完成");
+ }
+ }
+ }
+ }else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==3) {
+ jsonObject.put("shzt", "审核完成");
+ }else{
+ jsonObject.put("shzt", "-");
+ }
+
+ UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(String.valueOf(fjtEvaluation.getId()));
+ if(userTrade!=null){
+ jsonObject.put("down", 1);
+ }
+ ja.add(jsonObject);
+ }
+ result.put("result", ja.toString());
+ result.put("role", fjtUsers!=null? fjtUsers.getRole(): 0);
+ data.setModel(result);
+ return data;
+ }
+
/**
* 估价记录列表
* @param model
@@ -243,6 +377,7 @@ public class WeiXinEvaluationController {
return data;
}
+
public Object inputAction(EvaluationModel model){
District district = districtService.findById(model.getId());
if(model.getEvaluation() == null){
@@ -277,7 +412,9 @@ public class WeiXinEvaluationController {
evaluation.setCity(district.getCity());
evaluation.setRegion(district.getRegion());
evaluation.setDistrictName(district.getName());
- evaluation.setAddress(district.getAddress());
+ if(StringUtils.isBlank(evaluation.getAddress())){
+ evaluation.setAddress(district.getAddress());
+ }
evaluation.setUserId(userId);
evaluation.setDateCreated(new Date());
evaluation.setLastUpdated(new Date());
@@ -294,14 +431,97 @@ public class WeiXinEvaluationController {
}
int avgPrice = districtStatService.findLatestDistrictAvgPrice(new DistrictKey(district), null);
+
+ FjtUsers fjtUser = fjtUsersService.findById(Long.valueOf(userId));
+ if(fjtUser!=null && fjtUser.getRole()==17) {
+ evaluation.setDirection(3);//渤海朝向默认南
+ if(StringUtils.isBlank(evaluation.getUseType())){
+ evaluation.setUseType("居住");
+ }
+// BHBankUtils.getInquirePrice(model);
+ }
if(avgPrice > 0){
long totalPrice = evaluationRateService.evaluation(avgPrice, evaluation);
evaluation.setTotalPrice(Integer.valueOf(totalPrice+""));
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){
+ bhDists = BHBankUtils.getDistrictByBhbank(district.getName());
+ }
+ Map bhMatchMap = new HashMap();
+ if(bhDists.size()==1){
+ JSONObject o = bhDists.get(0);
+ String bhDistName = (String)o.get("name");
+ String regionCode = String.valueOf((Long)o.get("country"));
+ String bhRegion = BHBankUtils.regionCodeMap.get(regionCode);
+ bhMatchMap.put("preCode", (String)o.get("code"));
+ bhMatchMap.put("preName", bhDistName);
+ bhMatchMap.put("countryCode",regionCode);
+// bhMatchMap.put("buildName",(String)o.get("address"));
+ }else{
+ Map regionCodeMap = BHBankUtils.regionCodeMap;
+ String regionCode = null;
+ for(String key : regionCodeMap.keySet()){
+ String value = regionCodeMap.get(key);
+ if(value.equals(district.getRegion())){
+ regionCode = key;
+ break;
+ }
+ }
+ bhMatchMap.put("preName", district.getName());
+ bhMatchMap.put("countryCode",regionCode);
+ System.out.println("【渤海银行】地址查询返回结果"+bhDists.size()+"个");
+ }
+ UsersDetail usersDetail = usersDetailService.findById(Long.valueOf(userId));
+ 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");
+ Integer auditStatus = null;
+ String inquireRemark = (String) dataObj.get("remark");
+ if((Integer) bhApiResult.get("errCode") == 1){//待人工核验
+ auditStatus = 0;
+ }else if((Integer) bhApiResult.get("errCode") == 0){//正常返回
+ auditStatus = 1;
+ }
+
+ fjtEvaluationService.saveEvaluation(evaluation);
+ System.out.println("保存评估记录成功 "+evaluation.getDistrictName());
+
+ BohaiEvaluationAudit audit = new BohaiEvaluationAudit();
+ audit.setEvaluationId(evaluation.getId());
+ audit.setQueryId(queryId);
+ audit.setBackStatus((Integer) bhApiResult.get("errCode") );
+ audit.setUserId(userId);
+ audit.setInquirePrice(inquirePrice);
+ audit.setAuditStatus(auditStatus);//0:价格待审核 1:价格已审核 2:有期望价 3:价格确认
+ if(StringUtils.isNotBlank(inquireRemark) && !inquireRemark.equals("None")){
+ audit.setInquireRemark(inquireRemark);
+ }
+ audit.setDateCreated(new Date());
+ audit.setDateCreated(new Date());
+ bohaiEvaluationAuditService.saveBohaiEvaluationAudit(audit);
+ }
+ }else{
+ fjtEvaluationService.saveEvaluation(evaluation);
+ System.out.println("保存评估记录成功 "+evaluation.getDistrictName());
+ }
+
Map data = new HashMap();
data.put("id", String.valueOf(evaluation.getId()));
+ data.put("role", String.valueOf(fjtUser.getRole()));
JsonModel json = new JsonModel();
json.setJsonModel(data);
return json;
@@ -380,6 +600,8 @@ public class WeiXinEvaluationController {
model.setEvaluationAudit(evaluationAudit);
if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){
+
+
Map retMap = getLoanInfo(district, evaluation.getHouseArea());
if(retMap!=null && retMap.size()>0){
model.setLoanInfoMap(retMap);
@@ -387,6 +609,49 @@ public class WeiXinEvaluationController {
}
return model;
}
+
+ public Object bhreportAction(EvaluationModel model){
+ String evaluationId = model.getEvaluationId();
+ FjtEvaluation evaluation = fjtEvaluationService.findEvaluationById(Long.valueOf(evaluationId));
+ model.setFjtEvaluation(evaluation);
+ DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()));
+ model.setDistrictStatBo(districtStatBo);
+
+
+ FjtUsers fjtUser = fjtUsersService.findById(evaluation.getUserId());
+ model.setRole(fjtUser.getRole());
+
+ District district = districtService.findDistrict(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()), "district");
+ model.setId(district.getId());
+ //参考价
+ 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);
+ }
+ }
+
+
+ if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){
+ Map retMap = getLoanInfo(district, evaluation.getHouseArea());
+ if(retMap!=null && retMap.size()>0){
+ model.setLoanInfoMap(retMap);
+ }
+ }
+ return model;
+ }
//To C 报告结果页
public Object resultAction(EvaluationModel model){
@@ -580,8 +845,6 @@ public class WeiXinEvaluationController {
evaluationAudit.setVersion(1);
evaluationAuditService.save(evaluationAudit);
}
-
-
String smsContent = "【房价网】微信端调价地址:"+evaluationAudit.getCity()+" "+evaluationAudit.getInput()+",成交价:"+evaluationAudit.getDealPrice()+"万,请及时审核!用户邮箱: "+evaluationAudit.getUserName();
try {
for (String mobile : MOBILES) {
@@ -596,6 +859,40 @@ public class WeiXinEvaluationController {
return jsonMmodel;
}
+ public Object saveHopePriceAction(EvaluationModel model){
+ JsonModel jsonMmodel = new JsonModel();
+ if(StringUtils.isNotBlank(model.getEvaluationId()) && model.getHopePrice()!=null){
+ BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
+ if(evaluationAudit != null){
+ evaluationAudit.setHopePrice(model.getHopePrice()*10000);
+ evaluationAudit.setLastUpdated(new Date());
+ evaluationAudit.setAuditStatus(2);
+
+ //期望价反馈接口
+ UsersDetail usersDetail = usersDetailService.findById(evaluationAudit.getUserId());
+ String feedbackId = BHBankUtils.inquireFeedback(usersDetail.getName(), evaluationAudit.getQueryId(), model.getHopePrice());
+ if(StringUtils.isNotBlank(feedbackId)){
+ evaluationAudit.setFeedbackId(feedbackId);
+ }
+ bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
+ }
+ }
+ return jsonMmodel;
+ }
+
+ public Object saveBhRemarkAction(EvaluationModel model){
+ JsonModel jsonMmodel = new JsonModel();
+ if(StringUtils.isNotBlank(model.getEvaluationId()) && StringUtils.isNotBlank(model.getRemark())){
+ BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
+ if(evaluationAudit != null){
+ evaluationAudit.setRemark(model.getRemark());
+ evaluationAudit.setLastUpdated(new Date());
+ bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
+ }
+ }
+ return jsonMmodel;
+ }
+
//刷新审核价
public Object refreshAuditPriceAction(EvaluationModel model){
JsonModel jsonMmodel = new JsonModel();
@@ -611,6 +908,22 @@ public class WeiXinEvaluationController {
jsonMmodel.setJsonModel(dataMap);
return jsonMmodel;
}
+
+
+ public Object refreshBhAuditPriceAction(EvaluationModel model){
+ JsonModel jsonMmodel = new JsonModel();
+ Map dataMap = new HashMap();
+ if(StringUtils.isNotBlank(model.getEvaluationId()) ){
+
+ BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
+ if(bohaiEvaluationAudit != null){
+ dataMap.put("lastPrice", bohaiEvaluationAudit.getLastPrice());
+ dataMap.put("hopePrice", bohaiEvaluationAudit.getHopePrice());
+ }
+ }
+ jsonMmodel.setJsonModel(dataMap);
+ return jsonMmodel;
+ }
public Object collectsAction(EvaluationModel model, HttpServletRequest req, @Param(name = "page") String page){
@@ -856,6 +1169,195 @@ 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();
+ }
+ }
+
+ //将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;
@@ -937,4 +1439,16 @@ public class WeiXinEvaluationController {
public void setPriceBorderService(PriceBorderService priceBorderService) {
this.priceBorderService = priceBorderService;
}
+
+ public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) {
+ this.bohaiEvaluationAuditService = bohaiEvaluationAuditService;
+ }
+
+ public void setFileService(FileService fileService) {
+ this.fileService = fileService;
+ }
+
+ public void setReportFileAttachService(ReportFileAttachService reportFileAttachService) {
+ this.reportFileAttachService = reportFileAttachService;
+ }
}
diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java
index 3f0b81226..5f9c5a223 100644
--- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java
@@ -47,6 +47,11 @@ public class DistrictModel extends BaseModel {
// 判断是否需要查询均价,false则调用方自己去组装价格
private Boolean showPrice = true;
+
+// private String preCode;//渤海接口--楼盘编码
+// private String preName;//渤海接口--楼盘名称
+// private String countryCode;//渤海接口--区域编码
+// private String buildName;//渤海接口--地址
/**
* 判断是不是友达
@@ -205,4 +210,35 @@ public class DistrictModel extends BaseModel {
this.isYouDa = isYouDa;
}
+// public String getPreCode() {
+// return preCode;
+// }
+//
+// public void setPreCode(String preCode) {
+// this.preCode = preCode;
+// }
+//
+// public String getPreName() {
+// return preName;
+// }
+//
+// public void setPreName(String preName) {
+// this.preName = preName;
+// }
+//
+// public String getCountryCode() {
+// return countryCode;
+// }
+//
+// public void setCountryCode(String countryCode) {
+// this.countryCode = countryCode;
+// }
+//
+// public String getBuildName() {
+// return buildName;
+// }
+//
+// public void setBuildName(String buildName) {
+// this.buildName = buildName;
+// }
}
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 1282b227f..ce6cc6080 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,14 +1,19 @@
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.ReportFileAttach;
import com.fangjia.open.model.BaseModel;
import com.fangjia.service.bo.DistrictStatBo;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
/**
@@ -32,6 +37,7 @@ public class EvaluationModel extends BaseModel{
private long sellHouseCount;
private long rentHouseCount;
private EvaluationAudit evaluationAudit;
+ private BohaiEvaluationAudit bohaiEvaluationAudit;
private String lender;
private Double dealPrice;
private List evaluations;
@@ -40,6 +46,17 @@ public class EvaluationModel extends BaseModel{
private Integer role;
private String cardId;
private Map loanInfoMap;
+ private Integer hopePrice;
+ private String remark;
+// private String preCode;//渤海接口--楼盘编码
+// private String preName;//渤海接口--楼盘名称
+// private String countryCode;//渤海接口--区域编码
+// private String buildName;//渤海接口--地址
+
+ private List reportFiles;
+ private String queryId;
+ private Integer fileClass;
+ private Map> reportFileMap;
public void setId(String id) {
@@ -196,4 +213,93 @@ public class EvaluationModel extends BaseModel{
public void setLoanInfoMap(Map loanInfoMap) {
this.loanInfoMap = loanInfoMap;
}
+
+ public BohaiEvaluationAudit getBohaiEvaluationAudit() {
+ return bohaiEvaluationAudit;
+ }
+
+ public void setBohaiEvaluationAudit(BohaiEvaluationAudit bohaiEvaluationAudit) {
+ this.bohaiEvaluationAudit = bohaiEvaluationAudit;
+ }
+
+ public Integer getHopePrice() {
+ return hopePrice;
+ }
+
+ public void setHopePrice(Integer hopePrice) {
+ this.hopePrice = hopePrice;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ // public String getPreCode() {
+// return preCode;
+// }
+//
+// public void setPreCode(String preCode) {
+// this.preCode = preCode;
+// }
+//
+// public String getPreName() {
+// return preName;
+// }
+//
+// public void setPreName(String preName) {
+// this.preName = preName;
+// }
+//
+// public String getCountryCode() {
+// return countryCode;
+// }
+//
+// public void setCountryCode(String countryCode) {
+// this.countryCode = countryCode;
+// }
+//
+// public String getBuildName() {
+// return buildName;
+// }
+//
+// 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;
+ }
}
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
new file mode 100644
index 000000000..d638fe36d
--- /dev/null
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java
@@ -0,0 +1,437 @@
+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.*;
+
+public class BHBankUtils {
+
+// public static String token = "bohaifangjiatest";//测试token
+// 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","徐汇");
+ put("310105000000","长宁");
+ put("310106000000","静安");
+ put("310107000000","普陀");
+ put("310109000000","虹口");
+ put("310110000000","杨浦");
+ put("310112000000","闵行");
+ put("310113000000","宝山");
+ put("310114000000","嘉定");
+ put("310115000000","浦东");
+ put("310116000000","金山");
+ put("310117000000","松江");
+ put("310118000000","青浦");
+ put("310120000000","奉贤");
+ put("310230000000","崇明");
+ }};
+
+ public static List getDistrictByBhbank(String address){
+
+ List list = new ArrayList();
+ Map params = new HashMap();
+ params.put("keyword",address);
+
+ Integer date1 = (int)(new Date().getTime()/1000);
+ String str = token + date1.toString()+nonce;
+ 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.get(uri +"/searchAddr/bh/", params, headers, "utf-8");
+ if(StringUtils.isNotBlank(content)){
+ JSONObject jsonObj = JSONObject.fromObject(content);
+ JSONArray data = (JSONArray) jsonObj.get("data");
+ if(data.size()>0){
+ for(int i=0;i bhMatchMap, UsersDetail usersDetail, int fjwTotalPrice){
+ List list = new ArrayList();
+ Map params = new HashMap();
+ FjtEvaluation ev = model.getFjtEvaluation();
+ String queryFullAddr = ev.getAddress();
+ if(StringUtils.isNotBlank(ev.getHouseNum())){
+ queryFullAddr = queryFullAddr + ev.getHouseNum()+"号";
+ }
+ if(StringUtils.isNotBlank(ev.getRoomNum())){
+ queryFullAddr = queryFullAddr + ev.getRoomNum()+"室";
+ }
+ params.put("queryFullAddr",queryFullAddr);//加了楼栋号和室号403
+ if(bhMatchMap.containsKey("preCode")){
+ params.put("preCode", bhMatchMap.get("preCode"));
+ }
+ if(bhMatchMap.containsKey("preName")){
+ params.put("preName", bhMatchMap.get("preName"));
+ }
+ if(bhMatchMap.containsKey("countryCode")){
+ params.put("countryCode", bhMatchMap.get("countryCode"));
+ }
+
+ if(StringUtils.isNotBlank(ev.getAddress())){
+ params.put("buildName", ev.getAddress());
+ }
+ if(StringUtils.isNotBlank(ev.getUnitNum())){
+ params.put("unitCode", ev.getUnitNum());
+ }
+ if(ev.getHouseFloor()>0){
+ params.put("floor", String.valueOf(ev.getHouseFloor()));
+ }
+ if(ev.getHouseHight()>0){
+ params.put("totalFloor", String.valueOf(ev.getHouseHight()));
+ }
+ if(StringUtils.isNotBlank(ev.getRoomNum())){
+ params.put("houseNo",ev.getRoomNum());
+ }
+ if(ev.getHouseArea()>0){
+ params.put("groundArea", String.valueOf(ev.getHouseArea()));
+ }
+ params.put("orientName", "南");
+ params.put("buildYear", ev.getFinishDateStr());
+ fjwTotalPrice= (int)(fjwTotalPrice/10000) * 10000;
+ params.put("dealPriceTotal", String.valueOf(fjwTotalPrice));
+
+ params.put("userName", usersDetail.getName());
+ params.put("userPhone", usersDetail.getPhone());
+// params.put("userMail", "");
+ params.put("groupName", usersDetail.getOrgName());
+
+
+ List lists = Arrays.asList("queryFullAddr", "preCode", "preName", "countryCode", "buildName", "unitCode","floor","totalFloor","houseNo","groundArea","undergroundArea","orientName","buildYear","dealPriceTotal","specialNo","userName","userPhone","userMail","groupName");
+
+ 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 {
+ content = request.post(uri +"/inquirePrice/bh/", params, headers, "utf-8");
+ if(StringUtils.isNotBlank(content)){
+ JSONObject jsonObj = JSONObject.fromObject(content);
+ return jsonObj;
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static JSONObject getInquireRecord(String queryId){
+ List list = new ArrayList();
+ Map params = new HashMap();
+ params.put("queryId",queryId);
+
+ Integer date1 = (int)(new Date().getTime()/1000);
+ String str = token + date1.toString()+nonce;
+ 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.get(uri + "/inquireRecord/bh/", params, headers, "utf-8");
+ if(StringUtils.isNotBlank(content)){
+ JSONObject jsonObj = JSONObject.fromObject(content);
+ JSONObject data = (JSONObject) jsonObj.get("data");
+ if(data.size()>0){
+ return data;
+ }
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static String inquireFeedback(String name, String queryId, Integer hopePrice){
+ String feedbackId = null;
+ List list = new ArrayList();
+ Map params = new HashMap();
+ params.put("queryId",queryId);
+ params.put("userName",name);
+ params.put("feedbackMsg","期望价:"+hopePrice+"万");
+
+ List lists = Arrays.asList("queryId", "userName", "feedbackMsg");
+
+ 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 {
+ content = request.post(uri+"/inquireFeedback/bh/", params, headers, "utf-8");
+ if(StringUtils.isNotBlank(content)){
+ JSONObject jsonObj = JSONObject.fromObject(content);
+ Integer code = (Integer) jsonObj.get("errCode");
+ if (code == 0) {
+ JSONObject data = (JSONObject) jsonObj.get("data");
+ if(data.size()>0){
+ feedbackId = (String) data.get("feedbackId");
+ }
+ }
+
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return feedbackId;
+ }
+
+
+ public static JSONObject inquireFeedbackCall(String feedbackId){
+
+ List list = new ArrayList();
+ Map params = new HashMap();
+ params.put("feedbackId",feedbackId);
+
+ Integer date1 = (int)(new Date().getTime()/1000);
+ String str = token + date1.toString()+nonce;
+ 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.get(uri+"/inquireFeedbackCall/bh/", params, headers, "utf-8");
+ if(StringUtils.isNotBlank(content)){
+ JSONObject jsonObj = JSONObject.fromObject(content);
+ Integer code = (Integer) jsonObj.get("errCode");
+ if(code == 0){
+ JSONObject data = (JSONObject) jsonObj.get("data");
+ return data;
+ }
+
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ 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){
+ 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();
+ 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;
+ }
+
+}
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/persistence-goojia-fangjia.xml b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml
index fea498f8a..9004315d0 100644
--- a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml
+++ b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml
@@ -15,6 +15,8 @@
com.fangjia.dal.sql.model.UsersDetail
com.fangjia.dal.sql.model.EvaluationAudit
com.fangjia.dal.sql.model.GoldLogs
+ com.fangjia.dal.sql.model.BohaiEvaluationAudit
+ com.fangjia.dal.sql.model.ReportFileAttach
true
\ 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 62e8a4f8d..3e07b5ef4 100644
--- a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl
+++ b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl
@@ -50,7 +50,12 @@
<#if type?? && type == 'b'>
|