Merge branch 'open_gj' into 'master'

优化估值报告

See merge request !84
This commit is contained in:
2021-08-18 17:27:38 +08:00
5 changed files with 80 additions and 75 deletions
@@ -2447,7 +2447,8 @@ public class PropertyController {
evaluation.setRegion(model.getRegion());
evaluation.setDistrictName(model.getName());
evaluation.setDirection(DIRECTION.get(model.getDirection()));
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(model.getDecoration())));
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(StringUtils.isNotBlank(model.getDecoration()) ?
model.getDecoration() : model.getFitment())));
evaluation.setNoise(NOISE.get(model.getNoise()));
evaluation.setEstateType(PROPERTY_TYPES.get(model.getPropertyType()));
evaluation.setSight(SIGHT.get(model.getView()));
@@ -5047,7 +5048,7 @@ public class PropertyController {
districtPriceMap.put("name", district.getName());
districtPriceMap.put("address", district.getAddress());
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
districtPriceMap.put("totalPriceUpper", CNNMFilter.convert(String.valueOf(evaluation.getTotalPrice())));
districtPriceMap.put("totalPriceUpper", CurrencyConverter.toChinese(String.valueOf(evaluation.getTotalPrice())));
districtPriceMap.put("cal_date", DateUtil.formatByPattern(new Date(), "yyyy/MM/dd"));
districtPriceMap.put("direction", evaluation.getDirection());
districtPriceMap.put("size", evaluation.getArea());
@@ -5066,7 +5067,7 @@ public class PropertyController {
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
//按条件过滤相似小区
Integer buildYear = null;
List<District> districts = null;
List<District> districts = new ArrayList<District>();
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
if(buildYear!=null){
@@ -179,7 +179,7 @@ public class CcbRentController {
districtPriceMap.put("name", district.getName());
districtPriceMap.put("address", district.getAddress());
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
districtPriceMap.put("totalPriceUpper", CNNMFilter.convert(String.valueOf(evaluation.getTotalPrice())));
districtPriceMap.put("totalPriceUpper", CurrencyConverter.toChinese(String.valueOf(evaluation.getTotalPrice())));
districtPriceMap.put("cal_date", DateUtil.formatByPattern(new Date(), "yyyy/MM/dd"));
districtPriceMap.put("direction", evaluation.getDirection());
districtPriceMap.put("size", evaluation.getArea());
@@ -198,7 +198,7 @@ public class CcbRentController {
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
//按条件过滤相似小区
Integer buildYear = null;
List<District> districts = null;
List<District> districts = new ArrayList<District>();
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
if(buildYear!=null){
@@ -342,7 +342,8 @@ public class CcbRentController {
evaluation.setRegion(model.getRegion());
evaluation.setDistrictName(model.getName());
evaluation.setDirection(DIRECTION.get(model.getDirection()));
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(model.getDecoration())));
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(StringUtils.isNotBlank(model.getDecoration()) ?
model.getDecoration() : model.getFitment())));
evaluation.setAtticArea(model.getAtticSize());
evaluation.setTerraceArea(model.getOuterSize());
evaluation.setBasementArea(model.getBasementSize());
@@ -102,7 +102,7 @@
<b>室号</b>:<span name="room"></span><br/>
<b>朝向</b>:<span name="direction"></span><br/>
<b>建筑面积</b>:<span name="size"></span>平米<br/>
<b>所在楼层</b>:<span name="floor"></span> 层 <span name="height"></span>总层数<br/>
<b>所在楼层</b>:<span name="floor"></span> 层(共<span name="height"></span>层)<br/>
<b>电梯配套</b>:<span name="hasLift"></span><br/>
<b>装修情况</b>:<span name="fitment"></span><br/>
<b>建筑年代</b>:<span name="buildYear"></span><br/>
@@ -198,62 +198,13 @@
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
<script type="text/javascript" src="../static/js/trend-charts.js"></script>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script>
<#-- <script src="../static/js/purify.min.js"></script>-->
<#-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"></script>-->
<#-- <script src="../static/js/jspdf.umd.js"></script>-->
<#-- <script src="../static/js/SourceHanSans-normal.js"></script>-->
<#-- <script src="../static/js/simsun-normal.js"></script>-->
<#-- <script type="text/javascript">-->
<#-- $("#download").bind('click', function(){-->
<#-- window.location.href = "download"-->
<#-- // 打印所有可用的字体-->
<#-- // jspdf.html(document.body, {-->
<#-- // callback: function (doc) {-->
<#-- // doc.save("租金报告.pdf");-->
<#-- // },-->
<#-- // x: 10,-->
<#-- // y: 10-->
<#-- // });-->
<#-- // jspdf.html("test测试", {-->
<#-- // callback: function (doc) {-->
<#-- // doc.save("租金报告.pdf");-->
<#-- // },-->
<#-- // x: 10,-->
<#-- // y: 10-->
<#-- // });-->
<#-- });-->
<#-- $(function () {-->
<#-- $('span[name="name"]').text('场中小区');-->
<#-- });-->
<#-- </script>-->
<script type="text/javascript">
// window.jsPDF = window.jspdf.jsPDF
// var jspdf = new jsPDF();
// jspdf.addFileToVFS('SourceHanSans-Normal.ttf',normalChinese);
// jspdf.addFont('SourceHanSans-Normal.ttf', 'SourceHanSans-Normal', 'normal');
// jspdf.setFont('SourceHanSans-Light');
//console.log(jspdf.getFontList());
var chart;
let chart;
$("#download").bind('click', function(){
var chartImgUrl = $('#chartImgUrl').val();
$("#download").css('color', 'blue')
let chartImgUrl = $('#chartImgUrl').val();
window.location.href = "download?city="+params.city+"&district="+params.district+"&name="+params.name+"&address="+params.address+"&size="+params.size+"&floor="+params.floor
+"&height="+params.height+"&room="+params.room+"&hall="+params.hall+"&toilet="+params.toilet+"&direction="+params.direction+"&fitment="+params.fitment+"&chartImgUrl=" + chartImgUrl;
// jspdf.html(document.body, {
// callback: function (doc) {
// doc.save("租金报告.pdf");
// },
// x: 0,
// y: 0,
// fontFaces: [{
// family: 'SimSun',
// weight: 'bold',
// //style: style,
// src: [{
// format: "truetype",
// url: "../static/fonts/SimSun.ttf"
// }]
// }]
// });
});
// 后台传参过来用
@@ -269,11 +220,13 @@
'hall': sessionStorage.hall,
'toilet': sessionStorage.toilet,
'direction': sessionStorage.direction,
'fitment': sessionStorage.fitment
'fitment': sessionStorage.fitment,
'hasLift': sessionStorage.hasLift
};
function init() {
$('span[name="hasLift"]').text(params.hasLift == 'true' ? '有' : '无')
$.ajax({
// 注意需要加..
url: '../property/rentReport',
@@ -281,7 +234,7 @@
dataType:"json",
type:"post",
success:function(data){
if(data.code == 200){
let result = data.result;
// 评估时间
@@ -291,6 +244,15 @@
$('span[name="totalPrice"]').text(result.totalPrice)
$('span[name="totalPriceUpper"]').text(result.totalPriceUpper)
// 房产状况
$('span[name="room"]').text(result.room)
$('span[name="floor"]').text(result.floor)
$('span[name="buildYear"]').text(result.buildYear)
$('span[name="direction"]').text(result.direction)
$('span[name="size"]').text(result.size)
$('span[name="height"]').text(result.height)
$('span[name="fitment"]').text(result.fitment)
// 历史租金
var charts = {}
// charts.series = [{
@@ -317,16 +279,6 @@
charts.xData = result.trends.times; // 横坐标值
createChartNow('districtRentTrendsChart', charts, true);
}
// 房产状况
$('span[name="room"]').text(result.room)
$('span[name="direction"]').text(result.direction)
$('span[name="size"]').text(result.size)
$('span[name="floor"]').text(result.floor)
$('span[name="height"]').text(result.height)
$('span[name="hasLift"]').text(result.hasLift)
$('span[name="fitment"]').text(result.fitment)
$('span[name="buildYear"]').text(result.buildYear)
// 已租房源
var trades = result.trades;
@@ -59,7 +59,7 @@
<td class="textTd" style="width: 15%;">建筑面积</td>
<td class="textRight1" style="width: 35%;"><#if result.size??>${result.size}</#if>平米</td>
<td class="textTd" style="width: 15%;">所在楼层</td>
<td class="textRight2" colspan="3" style="width: 35%;"><#if result.floor??>${result.floor}</#if> 层 <#if result.height??>${result.height}</#if>总层数</td>
<td class="textRight2" colspan="3" style="width: 35%;"><#if result.floor??>${result.floor}</#if> 层(共<#if result.height??>${result.height}</#if>层)</td>
</tr>
<tr class="tdbg">
<td class="textTd">电梯配套</td>
@@ -122,8 +122,9 @@
<div class="item-inner">
<div class="content-block">
<div class="item-title label di">装修情况:</div>
<input type="hidden" id="decoration" name="decoration">
<input type="hidden" id="fitment" name="fitment">
<p class="di"><a href="#" class="create-actions05">请选择装修情况</a></p>
<p class="di"><a href="#" class="create-actions05-now">请选择装修情况</a></p>
</div>
</div>
</div>
@@ -172,6 +173,7 @@
sessionStorage.height = $('input[name="height"]').val()
sessionStorage.direction = $('input[name="direction"]').val()
sessionStorage.fitment = $('input[name="fitment"]').val()
sessionStorage.hasLift = $('input[name="hasLift"]').val()
}
function getSession() {
if (sessionStorage.city != undefined) {
@@ -305,6 +307,55 @@
$.actions(groups);
});
// 选择操作-装修情况
$(document).on('click', '.create-actions05-now', function () {
var buttons1 = [
{
text: '请选择装修情况',
label: true
},
{
text: '简装',
bold: true,
onClick: function () {
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
$("#fitment").val("2")
}
},
{
text: '毛坯',
onClick: function () {
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
$("#fitment").val("1")
}
},
{
text: '精装',
onClick: function () {
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
$("#fitment").val("3")
}
},
{
text: '豪装',
onClick: function () {
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
$("#fitment").val("4")
}
}
];
var buttons2 = [
{
text: '取消',
bg: 'gray'
}
];
var groups = [buttons1, buttons2];
$.actions(groups);
});
// 选择操作-房型-号
$(document).on('click', '.create-actions02-now', function () {
var buttons1 = [
@@ -378,7 +429,7 @@
text: '否',
onClick: function () {
$('#hasLift').val(false)
$("a.create-actions14").empty().text(this.text).addClass("selected")
$("a.create-actions14-now").empty().text(this.text).addClass("selected")
}
}
];