出具正式报告
This commit is contained in:
+7
@@ -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<FormalReport> {
|
||||
}
|
||||
+7
@@ -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<FormalReport> implements FormalReportDao {
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
+59
@@ -105,6 +105,7 @@ public class WeiXinEvaluationController {
|
||||
private GoldLogsService goldLogsService;
|
||||
private PriceBorderService priceBorderService;
|
||||
private BohaiEvaluationAuditService bohaiEvaluationAuditService;
|
||||
private FormalReportService formalReportService;
|
||||
private FileService fileService;
|
||||
private ReportFileAttachService reportFileAttachService;
|
||||
|
||||
@@ -272,6 +273,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 +300,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", "-");
|
||||
}
|
||||
@@ -643,6 +653,8 @@ public class WeiXinEvaluationController {
|
||||
}
|
||||
}
|
||||
|
||||
UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(model.getEvaluationId());
|
||||
model.setUserTrades(userTrade);
|
||||
|
||||
if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){
|
||||
Map<String, Object> retMap = getLoanInfo(district, evaluation.getHouseArea());
|
||||
@@ -1022,6 +1034,49 @@ public class WeiXinEvaluationController {
|
||||
}
|
||||
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<String, Integer> data = new HashMap<String, Integer>();
|
||||
data.put("code", code);
|
||||
jsonModel.setJsonModel(data);
|
||||
}
|
||||
}
|
||||
return jsonModel;
|
||||
}
|
||||
|
||||
public Object checkImageAction(EvaluationModel model){
|
||||
JsonModel jsonModel = new JsonModel();
|
||||
if (StringUtils.isNotBlank(model.getEvaluationId())){
|
||||
List<ReportFileAttach> datas = reportFileAttachService.findHouseImage(Integer.valueOf(model.getEvaluationId()), 3);
|
||||
Map<String, Integer> data = new HashMap<String, Integer>();
|
||||
data.put("count", datas.size());
|
||||
jsonModel.setJsonModel(data);
|
||||
}
|
||||
return jsonModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void sendToEmail(String fjtUrl, String evaluationId, String email){
|
||||
try {
|
||||
@@ -1451,4 +1506,8 @@ public class WeiXinEvaluationController {
|
||||
public void setReportFileAttachService(ReportFileAttachService reportFileAttachService) {
|
||||
this.reportFileAttachService = reportFileAttachService;
|
||||
}
|
||||
|
||||
public void setFormalReportService(FormalReportService formalReportService) {
|
||||
this.formalReportService = formalReportService;
|
||||
}
|
||||
}
|
||||
|
||||
+19
-4
@@ -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<String, List<ReportFileAttach>> 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<String, List<ReportFileAttach>> 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ public class BHBankUtils {
|
||||
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");
|
||||
@@ -197,6 +198,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 +284,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 +409,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 +432,58 @@ public class BHBankUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Integer inquireToReport(String queryId, String reportMsg){
|
||||
String feedbackId = null;
|
||||
List<JSONObject> list = new ArrayList<JSONObject>();
|
||||
Map params = new HashMap();
|
||||
params.put("queryId",queryId);
|
||||
if(StringUtils.isNotBlank(reportMsg)){
|
||||
params.put("reportMsg",reportMsg);
|
||||
}
|
||||
|
||||
|
||||
List<String> 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 {
|
||||
content = request.post(uri+"/inquireToReport/bh/", params, headers, "utf-8");
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<class>com.fangjia.dal.sql.model.GoldLogs</class>
|
||||
<class>com.fangjia.dal.sql.model.BohaiEvaluationAudit</class>
|
||||
<class>com.fangjia.dal.sql.model.ReportFileAttach</class>
|
||||
<class>com.fangjia.dal.sql.model.FormalReport</class>
|
||||
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
@@ -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('正式报告将尽快邮寄给您,请注意查收,谢谢!如有疑问可与我们联系: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",
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -429,7 +429,13 @@
|
||||
|
||||
<#if bohaiEvaluationAudit?? && fjtEvaluation.lender?? && bohaiEvaluationAudit.auditStatus!=0 && reportFileMap?? && reportFileMap["2"]??>
|
||||
<div class="content-block">
|
||||
<p><a href="#" class="button button-big button-fill download_btn">下载评估报告</a></p>
|
||||
<#if userTrades??>
|
||||
<a href="#" class="button button-big button-fill3 download_btn p1" style="width: 49%;">下载评估报告</a>
|
||||
<a HREF="#" CLASS="button button-big button-fill3 formal_btn p2" style="width: 49%;">出具正式报告</a>
|
||||
<#else>
|
||||
<a href="#" class="button button-big button-fill download_btn">下载评估报告</a>
|
||||
</#if>
|
||||
|
||||
</div>
|
||||
</#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/*")
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.fangjia.service.sql;
|
||||
|
||||
import com.fangjia.dal.sql.model.FormalReport;
|
||||
|
||||
public interface FormalReportService {
|
||||
|
||||
FormalReport findFormalReportById(long evaluationId);
|
||||
|
||||
void save(FormalReport formalReport);
|
||||
|
||||
void update(FormalReport formalReport);
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.fangjia.service.sql;
|
||||
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.sql.fangjia.dao.FormalReportDao;
|
||||
import com.fangjia.dal.sql.model.FormalReport;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FormalReportServiceImpl implements FormalReportService {
|
||||
private FormalReportDao formalReportDao;
|
||||
|
||||
public FormalReportDao getFormalReportDao() {
|
||||
return formalReportDao;
|
||||
}
|
||||
|
||||
public void setFormalReportDao(FormalReportDao formalReportDao) {
|
||||
this.formalReportDao = formalReportDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FormalReport findFormalReportById(long evaluationId) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>(1);
|
||||
params.add(new QueryParam("evaluationId", evaluationId));
|
||||
return formalReportDao.findFirstByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(FormalReport formalReport) {
|
||||
formalReportDao.save(formalReport);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(FormalReport formalReport) {
|
||||
formalReportDao.update(formalReport);
|
||||
}
|
||||
}
|
||||
+2
@@ -10,4 +10,6 @@ public interface ReportFileAttachService {
|
||||
ReportFileAttach findFirstByParams(Integer evaluationId, String queryId, Integer userId, Integer fileClass, String fileName);
|
||||
|
||||
List<ReportFileAttach> findAllByParams(Integer evaluationId, String queryId, Integer userId);
|
||||
|
||||
List<ReportFileAttach> findHouseImage(Integer evaluationId, Integer fileClass);
|
||||
}
|
||||
|
||||
+8
@@ -42,4 +42,12 @@ public class ReportFileAttachServiceImpl implements ReportFileAttachService{
|
||||
params.add(new QueryParam("queryId", queryId));
|
||||
return reportFileAttachDao.findAllByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportFileAttach> findHouseImage(Integer evaluationId, Integer fileClass) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("evaluationId", evaluationId));
|
||||
params.add(new QueryParam("fileClass", fileClass));
|
||||
return reportFileAttachDao.findAllByParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user