Browse Source

Merge branch 'master' of http://47.108.172.52:3000/dayou/productivity-platform

GouGengquan 7 months ago
parent
commit
96318cdd87

+ 59 - 0
biz-base/src/main/java/com/dayou/controller/HouseGuarantyAreaController.java

@@ -0,0 +1,59 @@
+package com.dayou.controller;
+
+import com.dayou.entity.HouseGuarantyAim;
+import com.dayou.entity.HouseGuarantyArea;
+import com.dayou.result.Result;
+import com.dayou.service.HouseGuarantyAreaService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+
+/**
+ * 房地产估价对象标的物区位状况
+ */
+@RestController
+@RequestMapping("houseGuarantyArea")
+@Slf4j
+public class HouseGuarantyAreaController {
+
+    @Autowired
+    private HouseGuarantyAreaService houseGuarantyAreaService;
+
+    /**
+     * 更新和保存区位信息
+     * @param houseGuarantyArea
+     * @return
+     */
+    @PostMapping("")
+    public Result<Long> save(@RequestBody HouseGuarantyArea houseGuarantyArea) {
+        houseGuarantyAreaService.saveOrUpdate(houseGuarantyArea);
+        return Result.build(houseGuarantyArea.getId());
+    }
+
+    /**
+     * 根据经纬度查询附近
+     * @param lngLat
+     * @return
+     */
+    @GetMapping("/lngLat")
+    public Result<HouseGuarantyArea> getByLngLat(String lngLat) {
+        HouseGuarantyArea area = houseGuarantyAreaService.getByLngLat(lngLat);
+        return Result.build(area);
+    }
+
+    /**
+     * 根据文档id、估计对象id、标的物序号查询
+     * @param docId
+     * @param tid
+     * @param tno
+     * @return
+     */
+    @GetMapping("/ids")
+    public Result<HouseGuarantyArea> getByDocIdTidTno(Long docId,String tid,String tno){
+        HouseGuarantyArea ares = houseGuarantyAreaService.getByDocIdTidTno(docId,tid,tno);
+        return  Result.build(ares);
+    }
+
+}

+ 1 - 1
biz-base/src/test/java/com/dayou/DynamicGenTableWordTest.java

@@ -93,7 +93,7 @@ public class DynamicGenTableWordTest {
 
     @Test
     public void genEntityDesc() throws Exception {
-        List<HouseTargetEntity> list = houseTargetEntityService.list(new LambdaQueryWrapper<HouseTargetEntity>().eq(HouseTargetEntity::getBusinessId, 57));
+        List<HouseTargetEntity> list = houseTargetEntityService.list(new LambdaQueryWrapper<HouseTargetEntity>().eq(HouseTargetEntity::getDocId, 57));
         String desc = HouseDocumentUtil.targetEntityDesc("xdsdsd", "住宅", "233.23", list.get(0));
         System.out.println(desc);
     }

+ 1 - 1
biz-base/src/test/java/com/dayou/GuarantyResultTest.java

@@ -13,6 +13,6 @@ public class GuarantyResultTest {
 
     @Test
     public void test() {
-        houseGuarantyService.genResultLetter(57L);
+        houseGuarantyService.genResultLetter(65L);
     }
 }

+ 1 - 1
common/src/main/java/com/dayou/utils/AsposeWordUtil.java

@@ -472,7 +472,6 @@ public class AsposeWordUtil {
         Table table = builder.startTable();
         // 获取所有字段
         Field[] fields = clazz.getDeclaredFields();
-
         // 创建表头
         for (Field field : fields) {
             // 检查字段是否有自定义注解
@@ -537,4 +536,5 @@ public class AsposeWordUtil {
         table.setAlignment(CellVerticalAlignment.CENTER);
         builder.endTable();
     }
+
 }

+ 161 - 4
common/src/main/java/com/dayou/utils/HouseDocumentUtil.java

@@ -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;
+    }
 }

+ 15 - 0
dao/src/main/java/com/dayou/mapper/HouseGuarantyAreaMapper.java

@@ -0,0 +1,15 @@
+package com.dayou.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dayou.entity.HouseGuarantyArea;
+import org.apache.ibatis.annotations.Param;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public interface HouseGuarantyAreaMapper extends BaseMapper<HouseGuarantyArea> {
+
+    HouseGuarantyArea getByLngLat(@Param("lng") BigDecimal lng, @Param("lat") BigDecimal lat);
+
+    List<HouseGuarantyArea> getAreasList(@Param("id") Long id);
+}

dao/src/main/resources/mapper/HouseGuarantyAim.xml → dao/src/main/resources/mapper/HouseGuarantyAimMapper.xml


+ 33 - 0
dao/src/main/resources/mapper/HouseGuarantyAreaMapper.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dayou.mapper.HouseGuarantyAreaMapper">
+
+
+    <select id="getByLngLat" resultType="com.dayou.entity.HouseGuarantyArea">
+        SELECT * FROM house_guaranty_area
+                 WHERE ( lng &lt;=( #{lng}+0.01 ) and lng &gt;=( #{lng}-0.01 ))
+                   AND ( lat &gt;=( #{lat}-0.01 ) and lat &lt;=( #{lat}+0.01 ))
+                    and delete_status=0
+            order by id desc limit 1
+    </select>
+
+    <select id="getAreasList" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseGuarantyArea">
+        SELECT
+            hga.*,
+            hte.at_floor,
+            hte.floor ,
+            aim.act_address
+        FROM
+            house_guaranty_area hga
+                LEFT JOIN (select doc_id,tid,tno,at_floor,floor from house_target_entity  where delete_status = 0)hte ON (
+                hga.doc_id = hte.doc_id
+                    AND hga.tid = hte.tid
+                    AND hga.tno = hte.tno)
+                left join  (select doc_id,tid,tno,act_address from house_guaranty_aim where delete_status = 0) aim on (
+                hga.doc_id = aim.doc_id
+                    AND hga.tid = aim.tid
+                    AND hga.tno = aim.tno
+                )
+        where hga.delete_status = 0 and hga.doc_id = #{id} order by hga.id asc
+    </select>
+</mapper>

dao/src/main/resources/mapper/HouseGuarantyBase.xml → dao/src/main/resources/mapper/HouseGuarantyBaseMapper.xml


+ 9 - 9
dao/src/main/resources/mapper/HouseTargetEntityMapper.xml

@@ -22,22 +22,22 @@
         FROM
             house_target_entity hte
                 LEFT JOIN (select business_id,tid,tno,certificate_no,location,acreage,use_to,use_type,expire_date from certificate_land_use where delete_status = 0) clu ON (
-                hte.business_id = clu.business_id
+                hte.doc_id = clu.business_id
                     AND hte.tid = clu.tid
                     AND hte.tno = clu.tno)
                 left join  (select business_id,tid,tno,certificate_no,location,acreage_desc,use_to,own_ship_nature,expire_date_desc from certificate_fixed_assets where delete_status = 0) cfa on (
-                hte.business_id = cfa.business_id
+                hte.doc_id = cfa.business_id
                     AND hte.tid = cfa.tid
                     AND hte.tno = cfa.tno
                 )
-                left join (select t_id,doc_id,land_use_to ,land_use_type from house_guaranty_target where delete_status = 0) hgt on (hgt.doc_id = hte.business_id and hgt.t_id = hte.tid)
-        where hte.delete_status=0 and hte.business_id = #{docId}
+                left join (select tid,doc_id,land_use_to ,land_use_type from house_guaranty_target where delete_status = 0) hgt on (hgt.doc_id = hte.doc_id and hgt.tid = hte.tid)
+        where hte.delete_status=0 and hte.doc_id = #{docId}
         order by hte.tid asc ,hte.tno asc
     </select>
 
     <select id="getHouseRightsDTOList" parameterType="java.lang.Long" resultType="com.dayou.dto.HouseRightsDTO">
         SELECT
-            hte.business_id,
+            hte.doc_id,
             hte.tid,
             hte.tno,
             hte.use_info,
@@ -45,15 +45,15 @@
             hgt.*
         FROM
             house_target_entity hte
-                LEFT JOIN ( SELECT t_id, doc_id, is_rent_out, has_rent_out_contract,
+                LEFT JOIN ( SELECT tid, doc_id, is_rent_out, has_rent_out_contract,
                                    rent_end_date, rent_start_date, rent_money, rent_user,
                                    has_pledge, pledge_user, pledge_type, pledge_value ,
                                    has_land_use_right,has_living_right,land_use_right_from,
                                    land_use_right_to FROM house_guaranty_target
                                 WHERE delete_status = 0 ) hgt ON (
-                hgt.doc_id = hte.business_id
-                    AND hgt.t_id = hte.tid)
-        where hte.delete_status=0 and hte.business_id = #{docId}
+                hgt.doc_id = hte.doc_id
+                    AND hgt.tid = hte.tid)
+        where hte.delete_status=0 and hte.doc_id = #{docId}
         order by hte.tid asc ,hte.tno asc
 
     </select>

+ 52 - 0
domain/src/main/java/com/dayou/entity/HouseGuarantyArea.java

@@ -0,0 +1,52 @@
+package com.dayou.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.dayou.common.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class HouseGuarantyArea extends BaseEntity {
+
+    private Long docId;
+
+    private String tid;
+
+    private String tno;
+
+    private BigDecimal lng;
+
+    private BigDecimal lat;
+
+    private String location;
+
+    private String road;
+
+    private String publicTransport;
+
+    private String park;
+
+    private String business;
+
+    private String community;
+
+    private String education;
+
+    private String hospital;
+
+    private String bank;
+
+    private String hotel;
+
+    private String spot;
+
+    @TableField(exist = false)
+    private String atFloor;
+
+    @TableField(exist = false)
+    private String floor;
+
+    @TableField(exist = false)
+    private String actAddress;
+}

+ 1 - 1
domain/src/main/java/com/dayou/entity/HouseTargetEntity.java

@@ -7,7 +7,7 @@ import lombok.Data;
 @Data
 public class HouseTargetEntity extends BaseEntity {
 
-    private Long businessId;
+    private Long docId;
     private String tid;
     private String tno;
     private String communityName;

+ 17 - 0
domain/src/main/java/com/dayou/table/HouseAreaTable.java

@@ -0,0 +1,17 @@
+package com.dayou.table;
+
+import com.dayou.annotation.WordTableColumn;
+import lombok.Builder;
+
+@Builder
+public class HouseAreaTable {
+
+    @WordTableColumn(name = "类别")
+    private String type;
+
+    @WordTableColumn(name = "子类")
+    private String name;
+
+    @WordTableColumn(name = "状况描述")
+    private String value;
+}

+ 0 - 1
domain/src/main/java/com/dayou/table/HouseEntityTable.java

@@ -3,7 +3,6 @@ package com.dayou.table;
 
 import com.dayou.annotation.WordTableColumn;
 import lombok.Builder;
-import lombok.Data;
 
 @Builder
 public class HouseEntityTable{

+ 15 - 0
service/src/main/java/com/dayou/service/HouseGuarantyAreaService.java

@@ -0,0 +1,15 @@
+package com.dayou.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.dayou.entity.HouseGuarantyArea;
+
+import java.util.List;
+
+public interface HouseGuarantyAreaService extends IService<HouseGuarantyArea> {
+
+    HouseGuarantyArea getByLngLat(String lngLat);
+
+    HouseGuarantyArea getByDocIdTidTno(Long docId, String tid, String tno);
+
+    List<HouseGuarantyArea> getAreasList(Long id);
+}

+ 44 - 0
service/src/main/java/com/dayou/service/impl/HouseGuarantyAreaServiceImpl.java

@@ -0,0 +1,44 @@
+package com.dayou.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dayou.entity.HouseGuarantyArea;
+import com.dayou.mapper.HouseGuarantyAreaMapper;
+import com.dayou.service.HouseGuarantyAreaService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class HouseGuarantyAreaServiceImpl extends ServiceImpl<HouseGuarantyAreaMapper, HouseGuarantyArea> implements HouseGuarantyAreaService {
+
+    @Autowired
+    private HouseGuarantyAreaMapper houseGuarantyAreaMapper;
+
+    @Override
+    public HouseGuarantyArea getByLngLat(String lngLat) {
+        List<BigDecimal> lngLats = Arrays.stream(lngLat.split(","))
+                .map(BigDecimal::new).collect(Collectors.toList());
+        BigDecimal lng = lngLats.get(0);
+        BigDecimal lat = lngLats.get(1);
+        return houseGuarantyAreaMapper.getByLngLat(lng,lat);
+    }
+
+    @Override
+    public HouseGuarantyArea getByDocIdTidTno(Long docId, String tid, String tno) {
+        HouseGuarantyArea area = this.getOne(new LambdaQueryWrapper<HouseGuarantyArea>().eq(HouseGuarantyArea::getDocId, docId)
+                .eq(HouseGuarantyArea::getTid, tid).eq(HouseGuarantyArea::getTno, tno));
+        return area;
+    }
+
+    @Override
+    public List<HouseGuarantyArea> getAreasList(Long id) {
+        List<HouseGuarantyArea> list = houseGuarantyAreaMapper.getAreasList(id);
+        return list;
+    }
+}

+ 2 - 1
service/src/main/java/com/dayou/service/HouseGuarantyBaseServiceImpl.java

@@ -1,8 +1,9 @@
-package com.dayou.service;
+package com.dayou.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.entity.HouseGuarantyBase;
 import com.dayou.mapper.HouseGuarantyBaseMapper;
+import com.dayou.service.HouseGuarantyBaseService;
 import org.springframework.stereotype.Service;
 
 @Service

+ 9 - 3
service/src/main/java/com/dayou/service/impl/HouseGuarantyServiceImpl.java

@@ -87,9 +87,13 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
 
     @Autowired
     private HouseGuarantyBaseService houseGuarantyBaseService;
+
     @Autowired
     private HouseGuarantyTargetMapper houseGuarantyTargetMapper;
 
+    @Autowired
+    private HouseGuarantyAreaService houseGuarantyAreaService;
+
     @Override
     public Long createTableWord(HouseGuarantyTableDTO houseGuarantyTableDTO) {
         try {
@@ -362,7 +366,9 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
             HouseDocumentUtil.getRightsDesc(doc,houseRightsDTOList,
                     HouseDocumentUtil.checkBoolean(base.getIsCheckOriginCertificate()));
 
-
+            //获取区位状况数据源
+            List<HouseGuarantyArea> areas = houseGuarantyAreaService.getAreasList(id);
+            HouseDocumentUtil.getAreaDesc(doc,areas);
             //生成文档中的表格
             //建筑物实物状况表格
 
@@ -372,13 +378,13 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
                 String useTo = UNKNOWN;
                 String structure = UNKNOWN;
                 CertificateFixedAssets fa = certificateFixedAssetsService.getOne(new LambdaQueryWrapper<CertificateFixedAssets>()
-                        .eq(CertificateFixedAssets::getBusinessId, x.getBusinessId())
+                        .eq(CertificateFixedAssets::getBusinessId, x.getDocId())
                         .eq(CertificateFixedAssets::getTid, x.getTid())
                         .eq(CertificateFixedAssets::getTno, x.getTno())
                         .select(CertificateFixedAssets::getLocation, CertificateFixedAssets::getAcreageDesc, CertificateFixedAssets::getUseTo));
                 if (fa == null) {
                     CertificateHouseOwn certHouse = certificateHouseOwnService.getOne(new LambdaQueryWrapper<CertificateHouseOwn>()
-                            .eq(CertificateHouseOwn::getBusinessId, x.getBusinessId())
+                            .eq(CertificateHouseOwn::getBusinessId, x.getDocId())
                             .eq(CertificateHouseOwn::getTid, x.getTid())
                             .eq(CertificateHouseOwn::getTno, x.getTno())
                             .select(CertificateHouseOwn::getLocation, CertificateHouseOwn::getAcreage, CertificateHouseOwn::getUseTo));

+ 4 - 5
service/src/main/java/com/dayou/service/impl/HouseTargetEntityServiceImpl.java

@@ -1,6 +1,5 @@
 package com.dayou.service.impl;
 
-import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.entity.HouseGuarantyAim;
@@ -40,7 +39,7 @@ public class HouseTargetEntityServiceImpl extends ServiceImpl<HouseTargetEntityM
 
     @Override
     public Long addHouseTargetEntity(HouseTargetEntity houseTargetEntity) {
-        Integer certificateCombination = houseGuarantyService.getCertificateCombination(houseTargetEntity.getBusinessId(), houseTargetEntity.getTid(), houseTargetEntity.getTno());
+        Integer certificateCombination = houseGuarantyService.getCertificateCombination(houseTargetEntity.getDocId(), houseTargetEntity.getTid(), houseTargetEntity.getTno());
         houseTargetEntity.setCertCombination(certificateCombination);
         this.saveOrUpdate(houseTargetEntity);
         return houseTargetEntity.getId();
@@ -49,7 +48,7 @@ public class HouseTargetEntityServiceImpl extends ServiceImpl<HouseTargetEntityM
     @Override
     public HouseTargetEntity getHouseTargetEntityById(Long businessId, String tid, String tno) {
         return this.getOne(new LambdaQueryWrapper<HouseTargetEntity>()
-                .eq(HouseTargetEntity::getBusinessId, businessId)
+                .eq(HouseTargetEntity::getDocId, businessId)
                 .eq(HouseTargetEntity::getTid, tid).eq(HouseTargetEntity::getTno, tno));
     }
 
@@ -66,7 +65,7 @@ public class HouseTargetEntityServiceImpl extends ServiceImpl<HouseTargetEntityM
                         && aim.getTid().equals(originEntity.getTid())){
                 }else {
                     HouseTargetEntity targetEntity = this.getOne(new LambdaQueryWrapper<HouseTargetEntity>()
-                            .eq(HouseTargetEntity::getBusinessId, originEntity.getBusinessId())
+                            .eq(HouseTargetEntity::getDocId, originEntity.getDocId())
                             .eq(HouseTargetEntity::getTid, aim.getTid())
                             .eq(HouseTargetEntity::getTno, aim.getTno()));
                     if (targetEntity == null){
@@ -76,7 +75,7 @@ public class HouseTargetEntityServiceImpl extends ServiceImpl<HouseTargetEntityM
                     targetEntity.setId(null);
                     targetEntity.setTid(aim.getTid());
                     targetEntity.setTno(aim.getTno());
-                    targetEntity.setCertCombination(houseGuarantyService.getCertificateCombination(originEntity.getBusinessId(), aim.getTid(), aim.getTno()));
+                    targetEntity.setCertCombination(houseGuarantyService.getCertificateCombination(originEntity.getDocId(), aim.getTid(), aim.getTno()));
                     targetEntities.add(targetEntity);
                 }
             }

+ 28 - 0
sql/update_sql.sql

@@ -925,3 +925,31 @@ CREATE TABLE `house_target_entity` (
 
 SET FOREIGN_KEY_CHECKS = 1;
 
+/**
+    12-20
+    wucl
+ */
+CREATE TABLE `house_guaranty_area`  (
+                                                   `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
+                                                   `doc_id` bigint NOT NULL COMMENT '文档id',
+                                                   `tid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '估价对象id',
+                                                   `tno` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '估价对象序号',
+                                                   `lng` decimal(16, 6) NOT NULL COMMENT '经度',
+                                                   `lat` decimal(16, 6) NOT NULL COMMENT '纬度',
+                                                   `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '地址',
+                                                   `road` json NULL COMMENT '路网信息',
+                                                   `public_transport` json NULL COMMENT '公共交通',
+                                                   `park` json NULL COMMENT '停车场信息',
+                                                   `business` json NULL COMMENT '商场信息',
+                                                   `community` json NULL COMMENT '周边小区',
+                                                   `education` json NULL COMMENT '周边学校',
+                                                   `hospital` json NULL COMMENT '周边医院',
+                                                   `bank` json NULL COMMENT '周边银行',
+                                                   `hotel` json NULL COMMENT '周边酒店',
+                                                   `spot` json NULL COMMENT '周边景区',
+                                                   `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+                                                   `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+                                                   `delete_status` bit(1) NOT NULL DEFAULT b'0' COMMENT '删除状态',
+                                                   PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '房地产标的物周边区位信息' ROW_FORMAT = Dynamic;
+