|
@@ -12,6 +12,7 @@ import com.dayou.entity.HouseGuarantyAim;
|
|
|
import com.dayou.entity.*;
|
|
|
import com.dayou.enums.HouseTargetTableColumn;
|
|
|
import com.dayou.exception.ErrorCode;
|
|
|
+import com.dayou.table.HouseAreaTable;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
@@ -1510,11 +1511,12 @@ public class HouseDocumentUtil {
|
|
|
|
|
|
Map<String, List<HouseRightsDTO>> rightsMap = rights.stream().collect(Collectors.groupingBy(HouseRightsDTO::getTid));
|
|
|
|
|
|
+ //设置字体样式
|
|
|
+ Font font = builder.getFont();
|
|
|
+ font.setName("宋体");
|
|
|
+ font.setSize(14);
|
|
|
+
|
|
|
for (Map.Entry<String, List<HouseRightsDTO>> entry : rightsMap.entrySet()){
|
|
|
- //设置字体样式
|
|
|
- Font font = builder.getFont();
|
|
|
- font.setName("宋体");
|
|
|
- font.setSize(14);
|
|
|
|
|
|
for (int i=0; i<entry.getValue().size() ; i++){
|
|
|
HouseRightsDTO right = entry.getValue().get(i);
|
|
@@ -1617,4 +1619,159 @@ public class HouseDocumentUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static void getAreaDesc(Document doc, List<HouseGuarantyArea> areas) throws Exception {
|
|
|
+ //构造 builder
|
|
|
+ DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
+ //将 光标移动到指定书签处,准备创作
|
|
|
+ builder.moveToBookmark("areaInfo", true, false);
|
|
|
+
|
|
|
+ Map<String, List<HouseGuarantyArea>> collect = areas.stream().collect(Collectors.groupingBy(HouseGuarantyArea::getTid));
|
|
|
+
|
|
|
+ //设置字体样式
|
|
|
+ Font font = builder.getFont();
|
|
|
+ font.setName("宋体");
|
|
|
+ font.setSize(14);
|
|
|
+
|
|
|
+ for (Map.Entry<String, List<HouseGuarantyArea>> entry : collect.entrySet()) {
|
|
|
+ for (HouseGuarantyArea area : entry.getValue()) {
|
|
|
+ builder.writeln("◆估价对象"+entry.getKey()+"序号"+area.getTno());
|
|
|
+ builder.writeln("经委托人介绍及注册房地产估价师实地查勘,估价对象"+entry.getKey()+"序号"+area.getTno()+"区位状况如下:");
|
|
|
+ List<HouseAreaTable> tables = convertHouseAreaTable(area);
|
|
|
+ AsposeWordUtil.createTable(builder, HouseAreaTable.class, tables);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private static List<HouseAreaTable> convertHouseAreaTable(HouseGuarantyArea area) {
|
|
|
+ String tid = area.getTid();
|
|
|
+ String tno = area.getTno();
|
|
|
+ String location = area.getLocation();
|
|
|
+ String actAddress = area.getActAddress();
|
|
|
+ List<HouseAreaTable> tables = new ArrayList<>();
|
|
|
+ StringBuffer value1 = new StringBuffer("估价对象");
|
|
|
+ value1.append("估价对象").append(tid).append("序号").append(tno)
|
|
|
+ .append("位于").append(location);
|
|
|
+ if (StrUtil.isNotBlank(actAddress)){
|
|
|
+ value1.append("(实际地址为").append(actAddress).append(")");
|
|
|
+ }
|
|
|
+ HouseAreaTable build1 = HouseAreaTable.builder().type("估价对象位置").name("坐落及方位")
|
|
|
+ .value(value1.toString()).build();
|
|
|
+ tables.add(build1);
|
|
|
+
|
|
|
+ StringBuffer value2 = new StringBuffer("距");
|
|
|
+ JSONArray array = JSONUtil.parseArray(area.getSpot());
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(array.get(0));
|
|
|
+ value2.append(jsonObject.get("name")).append("约").append(jsonObject.get("distance")).append("米。");
|
|
|
+ HouseAreaTable build2 = HouseAreaTable.builder().type("估价对象位置").name("与相关场所的距离")
|
|
|
+ .value(value2.toString()).build();
|
|
|
+ tables.add(build2);
|
|
|
+
|
|
|
+ StringBuffer value3 = new StringBuffer("估价对象");
|
|
|
+ value3.append(tid).append("序号").append(tno).append("所在大楼临街:")
|
|
|
+ .append(CollectionUtil.formatDotAndRemoveMiddle(JSONUtil.parseArray(area.getRoad())));
|
|
|
+ HouseAreaTable build3 = HouseAreaTable.builder().type("估价对象位置").name("临街状况")
|
|
|
+ .value(value3.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build3);
|
|
|
+ StringBuffer value4 = new StringBuffer();
|
|
|
+ value4.append(area.getAtFloor()).append("层").append("(总").append(area.getFloor()).append("层)");
|
|
|
+ HouseAreaTable build4 = HouseAreaTable.builder().type("估价对象位置").name("楼层")
|
|
|
+ .value(value4.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build4);
|
|
|
+ StringBuffer value5 = new StringBuffer("估价对象");
|
|
|
+ value5.append(tid).append("序号").append(tno).append("所在区域内分布着")
|
|
|
+ .append(CollectionUtil.formatDotAndRemoveMiddle(JSONUtil.parseArray(area.getRoad())))
|
|
|
+ .append("及区间道路,路网密集,交通便利。");
|
|
|
+ HouseAreaTable build5 = HouseAreaTable.builder().type("交通条件").name("道路等级及路网条件")
|
|
|
+ .value(value5.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build5);
|
|
|
+ StringBuffer value6 = new StringBuffer("估价对象");
|
|
|
+ value6.append(tid).append("序号").append(tno).append("周边有")
|
|
|
+ .append(CollectionUtil.formatDotAndRemoveMiddle(JSONUtil.parseArray(area.getPublicTransport()))).append("交通便捷度高");
|
|
|
+ HouseAreaTable build6 = HouseAreaTable.builder().type("交通条件").name("公共交通及对内交通状况")
|
|
|
+ .value(value6.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build6);
|
|
|
+ HouseAreaTable build = HouseAreaTable.builder().type("交通条件").name("交通管制情况")
|
|
|
+ .value("无").build();
|
|
|
+
|
|
|
+ tables.add(build);
|
|
|
+ JSONArray parks = JSONUtil.parseArray(area.getPark());
|
|
|
+ HouseAreaTable.builder().type("").name("停车方便程度")
|
|
|
+ .value(parks.size()>0?"设有地面停车场,停车方便程度一般。":"无停车场,停车方便程度较差").build();
|
|
|
+
|
|
|
+ JSONArray community = JSONUtil.parseArray(area.getCommunity());
|
|
|
+ StringBuffer value7 = new StringBuffer();
|
|
|
+ value7.append("周边区域内有").append(CollectionUtil.formatDotAndRemoveMiddle(community))
|
|
|
+ .append("等成熟居住小区,区域内商业分布较密集,人流量较大,繁华程度较高。");
|
|
|
+
|
|
|
+ HouseAreaTable build7 = HouseAreaTable.builder().type("商业繁华度").name("商业")
|
|
|
+ .value(value7.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build7);
|
|
|
+ HouseAreaTable.builder().type("城市基础设施状况").name("")
|
|
|
+ .value("所在区域内水、电、气、视、讯、路、宽带网等城市基础设施配套完善。").build();
|
|
|
+
|
|
|
+ JSONArray education = JSONUtil.parseArray(area.getEducation());
|
|
|
+ StringBuffer value8 = new StringBuffer();
|
|
|
+ value8.append(CollectionUtil.formatDotAndRemoveMiddle(education)).append("等分布在周围。");
|
|
|
+ HouseAreaTable build8 = HouseAreaTable.builder().type("公共服务设施").name("教育机构")
|
|
|
+ .value(value8.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build8);
|
|
|
+ JSONArray hospital = JSONUtil.parseArray(area.getHospital());
|
|
|
+ StringBuffer value9 = new StringBuffer();
|
|
|
+ value9.append(CollectionUtil.formatDotAndRemoveMiddle(hospital)).append("等。");
|
|
|
+ HouseAreaTable build9 = HouseAreaTable.builder().type("公共服务设施").name("医疗机构")
|
|
|
+ .value(value9.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build9);
|
|
|
+ JSONArray bank = JSONUtil.parseArray(area.getBank());
|
|
|
+ StringBuffer value10 = new StringBuffer();
|
|
|
+ value10.append(CollectionUtil.formatDotAndRemoveMiddle(bank)).append("在该区域及其周边均设有分支机构或营业网点。");
|
|
|
+ HouseAreaTable build10 = HouseAreaTable.builder().type("公共服务设施").name("金融机构")
|
|
|
+ .value(value10.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build10);
|
|
|
+ JSONArray business = JSONUtil.parseArray(area.getBusiness());
|
|
|
+ StringBuffer value11 = new StringBuffer();
|
|
|
+ value11.append(CollectionUtil.formatDotAndRemoveMiddle(business)).append("等。");
|
|
|
+ HouseAreaTable build11 = HouseAreaTable.builder().type("公共服务设施").name("商服设施")
|
|
|
+ .value(value11.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build11);
|
|
|
+ JSONArray hotel = JSONUtil.parseArray(area.getHotel());
|
|
|
+ StringBuffer value12 = new StringBuffer();
|
|
|
+ value12.append(CollectionUtil.formatDotAndRemoveMiddle(hotel)).append("等。");
|
|
|
+ HouseAreaTable build12 = HouseAreaTable.builder().type("公共服务设施").name("宾馆酒店")
|
|
|
+ .value(value12.toString()).build();
|
|
|
+
|
|
|
+ tables.add(build12);
|
|
|
+ HouseAreaTable build13 = HouseAreaTable.builder().type("周围环境和景观").name("自然环境")
|
|
|
+ .value("所在区域内无明显污染,绿化较好,紧邻河边,空气质量状况良好。").build();
|
|
|
+
|
|
|
+ tables.add(build13);
|
|
|
+ HouseAreaTable build14 = HouseAreaTable.builder().type("周围环境和景观").name("人文环境")
|
|
|
+ .value("区域内人口密度大,人流较大,商业繁华程度,区域治安状况良好。").build();
|
|
|
+
|
|
|
+ tables.add(build14);
|
|
|
+ JSONArray spot = JSONUtil.parseArray(area.getSpot());
|
|
|
+ List<String> spots = new ArrayList<>();
|
|
|
+ for (int i = 0; i < spot.size(); i++) {
|
|
|
+ JSONObject jsonObject1 = JSONUtil.parseObj(spot.get(i));
|
|
|
+ spots.add((String) jsonObject1.get("name"));
|
|
|
+ }
|
|
|
+ StringBuffer value15 = new StringBuffer();
|
|
|
+ value15.append(CollectionUtil.formatDotAndRemoveMiddle(spots)).append("等。");
|
|
|
+ HouseAreaTable build15 = HouseAreaTable.builder().type("周围环境和景观").name("景观")
|
|
|
+ .value(value15.toString()).build();
|
|
|
+ tables.add(build15);
|
|
|
+ return tables;
|
|
|
+ }
|
|
|
}
|