Explorar o código

土地实物状况描述

wucl hai 7 meses
pai
achega
fc64aa5735

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 14 - 2
biz-base/src/test/java/com/dayou/DynamicGenTableWordTest.java


+ 4 - 0
common/src/main/java/com/dayou/constants/HouseGuarantyDoc.java

@@ -91,6 +91,10 @@ public class HouseGuarantyDoc {
      */
     public static final String LAND_USE_CER = "《国有土地使用证》";
 
+    /**
+     * 未知
+     */
+    public static final String UNKNOWN = "【未知】";
 
 
 }

+ 0 - 34
common/src/main/java/com/dayou/constants/HouseGuarantyParagraphTemp.java

@@ -1,34 +0,0 @@
-package com.dayou.constants;
-
-public class HouseGuarantyParagraphTemp {
-
-    public static  String YBJS_P1_1 = "委托人未提供估价对象房地产权属证书,根据委托人提供的《房地产评估委托书、确认书》等相关资料,经委托人确认:在价值时点,估价对象系合法建设、合法使用,估价对象房地产具备合法城市不动产权属证书,不受任何可能影响其价值的权利限制,能够合法、完整、独立的进入房地产市场转让,本次评估以此为假设前提进行估价。\n";
-
-    public static String YBJS_P1_2 = "在价值时点,估价委托人提供的估价对象房地产权属、估价所必需的反映估价对象状况的资料真实、合法、有效,估价对象符合国家相关法律法规设立抵押的有关规定。\n";
-
-    public static  String YBJS_P2 = "估价对象在价值时点的房地产市场为公开、平等、自愿的交易市场,即能满足以下条件:\n" +
-            "(1)交易双方自愿地进行交易;\n" +
-            "(2)交易双方处于利己动机进行交易;\n" +
-            "(3)交易双方精明、谨慎行事,并了解交易对象、知晓市场行情;\n" +
-            "(4)交易双方有较充裕的时间进行交易;\n" +
-            "(5)不存在买者因特殊兴趣而给予附加出价。\n";
-
-    public static  String YBJS_P3 = "房屋所有权人对估价对象合法拥有占有、使用、收益和处分的权利,至价值时点,本次评估以估价对象未发生任何形式的产权转移行为为估价假设前提。\n";
-
-    public static  String YBJS_P4 = "本次估价以估价对象无行政机关和司法机关限制其权利状况的情形,估价对象产权清晰、完整,权属无纠纷,可以在公开市场上合法转让、销售等处分为假设前提。\n";
-
-    public static String YBJS_P5 = "房屋所有权人因估价对象应缴纳的各项税费已按国家、省、市法律、法规及规章缴纳完毕,无欠缴税费情况。\n";
-
-    public static String YBJS_P6 = "我们已对委托人提供的估价对象《房屋所有权证》和《国有土地使用证》(《不动产权证书》)原件进行了审慎核对,在无理由怀疑其原件合法性、真实性、准确性和完整性的情况下,假设委托人提供的上述原件合法、真实、准确、完整。\n";
-
-    public static String YBJS_P7 = "我们已对房屋安全、环境污染等影响估价对象价值的重大因素给予了关注,在无理由怀疑估价对象存在安全隐患且无相应的专业机构进行鉴定、检测的情况下,假设估价对象能正常安全使用。\n";
-
-    public static String YBJS_P8 = "由于受专业限制,我们未对估价对象房屋建筑面积及其占用(分摊)的土地使用权面积进行专业测量,本次估价假设估价对象房屋建筑面积及其占用(分摊)的土地使用权面积与《房屋所有权证》和《国有土地使用证》《不动产权证书》记载面积一致。\n";
-
-    public static String YBJS_P9 = "由于我们无法通过第三方进一步查证估价对象是否存在法定优先受偿权,或者查证委托人提供的情况是否与实际相符,本次估价假设委托人提供的“估价对象权利状况说明及承诺书”所述内容真实、完整、有效。\n";
-
-    public static String YBJS_P10_1 = "估价对象为所在建筑物的部分,本次估价以估价对象建筑物区分所有权的共有部分的通行权及水、公共照明、消防等附属设施设备的使用权,能被房屋所有权人、实际占有人合法享有为前提进行估价。\n";
-
-    public static String YBJS_P10_2 = "估价对象为所在酒店的一部分,本次估价以估价对象所在酒店各功能区、共用及配套设施的使用权和公共部位的通行权,能被估价对象房屋所有权人、实际占有人享有,估价对象能持续正常经营为前提进行估价。\n";
-
-}

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

@@ -395,6 +395,7 @@ public class AsposeWordUtil {
                     builder.getCellFormat().setVerticalAlignment(CellVerticalAlignment.CENTER);
                     ParagraphFormat paragraphFormat = builder.getParagraphFormat();
                     paragraphFormat.setAlignment(ParagraphAlignment.CENTER);
+                    paragraphFormat.setFirstLineIndent(0);
                     paragraphFormat.setLineSpacing(0);
                     // 字体宋体
                     builder.getFont().setName("宋体");
@@ -423,6 +424,7 @@ public class AsposeWordUtil {
                         builder.insertCell();
                         builder.getCellFormat().setVerticalAlignment(CellVerticalAlignment.CENTER);
                         ParagraphFormat paragraphFormat = builder.getParagraphFormat();
+                        paragraphFormat.setFirstLineIndent(0);
                         paragraphFormat.setAlignment(ParagraphAlignment.CENTER);
                         paragraphFormat.setLineSpacing(0);
                         // 字体宋体

+ 113 - 3
common/src/main/java/com/dayou/utils/HouseDocumentUtil.java

@@ -8,17 +8,15 @@ import com.dayou.dto.HouseGuarantyTargetDTO;
 import com.dayou.dto.HousePledgeDTO;
 import com.dayou.entity.CertificateLandUse;
 import com.dayou.entity.HouseGuarantyTarget;
+import com.dayou.entity.HouseTargetEntity;
 import com.dayou.entity.TmplHouseParagraph;
 import com.dayou.enums.HouseTargetTableColumn;
 import com.dayou.exception.ErrorCode;
-import org.apache.commons.math3.analysis.function.Add;
 
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.function.Function;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 import static com.dayou.constants.HouseGuarantyDoc.*;
@@ -1378,5 +1376,117 @@ public class HouseDocumentUtil {
         return null;
     }
 
+    /**
+     * 估价对象实物状况描述
+     * @param location
+     * @param useTo
+     * @param entity
+     * @return
+     */
+    public static String targetEntityDesc(String location, String useTo,String acreage,HouseTargetEntity entity){
+        StringBuilder desc = new StringBuilder("估价对象坐落于");
+        desc.append(location).append(",所在项目为“").append(entity.getCommunityName()).append("”小区,")
+                .append("该项目系").append(entity.getHouseAge()).append("建成的总层数为").append(entity.getFloor())
+                .append("层的").append(entity.getBuildingStructure()).append("结构").append(useTo).append("楼,");
+                if (StrUtil.isNotBlank(entity.getBuildingNo())){
+                    desc.append("估价对象位于该项目").append(entity.getBuildingNo()).append(",");
+                }
+                desc.append("估价对象规划用途为").append(useTo).append(",").append("目前实际为")
+                        .append(entity.getUseInfo()).append(",估价对象建筑面积为").append(acreage).append("㎡,室内布局为")
+                        .append(entity.getRoomType()).append(",层高约").append(entity.getRoomHigh()).append("米,建筑外观为")
+                        .append(entity.getBuildingOut()).append(",室内装修状况如下:估价对象客厅地面贴").append(entity.getLivingroomGround())
+                        .append(",内墙为").append(entity.getLivingroomWall()).append(",天棚为").append(entity.getLivingroomTop())
+                        .append(";卧室地面为").append(entity.getBedroomGround()).append(",内墙为").append(entity.getBedroomWall())
+                        .append(",天棚为").append(entity.getBedroomTop()).append(";厨房及卫生间地面为").append(entity.getBathroomGround())
+                        .append(",内墙为").append(entity.getBathroomWall()).append(",天棚为").append(entity.getBathroomTop())
+                        .append(";").append(entity.getLivingroomOther()).append(",").append(entity.getBedroomOther()).append(",")
+                        .append(entity.getBathroomOther()).append("。").append("估价对象");
+
+                if (entity.getElevator()>0){
+                    desc.append("所在楼栋安装").append(entity.getElevator()).append("部载人电梯上下通行");
+                }else {
+                    desc.append("通过消防楼梯上下通行");
+                }
+        Boolean centerAirConditioning = entity.getCenterAirConditioning();
+        Boolean autoSpray = entity.getAutoSpray();
+        Boolean smogEmergency = entity.getSmogEmergency();
+        Boolean fireHydrant = entity.getFireHydrant();
+        Boolean netLine = entity.getNetLine();
+        Boolean visualSys = entity.getVisualSys();
+        Boolean officeSmartSys = entity.getOfficeSmartSys();
+        if (centerAirConditioning || autoSpray || smogEmergency || fireHydrant || netLine || visualSys || officeSmartSys){
+            desc.append(",所在楼栋安装有").append(centerAirConditioning?"中央空调、":"").append(autoSpray?"自动喷淋、":"")
+                    .append(smogEmergency?"烟感报警、":"").append(fireHydrant?"消防栓、":"").append(netLine?"网线光纤、":"")
+                    .append(visualSys?"可视对讲系统、":"").append(officeSmartSys?"办公智慧系统、":"");
+        }
+        String baseFacility = entity.getBaseFacility();
+
+        desc.append("通气".equals(baseFacility)?"估价对象所在项目水、电、气、视、讯等基本设施较齐全。":("不通气".equals(baseFacility)?
+                "估价对象所在项目水、电、视、讯等基本设施较齐全。":"估价对象所在项目水、电、气、视、讯、暖气等基本设施较齐全。"));
+
+        String newPercentage = entity.getNewPercentage();
+
+        desc.append(("全新".equals(newPercentage) || "九成新".equals(newPercentage))?"估价对象维护保养状况好":
+                ("八至九成新".equals(newPercentage) || "七至八成新".equals(newPercentage))?"估价对象维护保养状况较好":
+                        ("六至七成新".equals(newPercentage)?"估价对象维护保养状况一般":"估价对象维护保养状况差"))
+                .append(",成新率为").append(newPercentage).append("。");
+
+        return desc.toString();
+    }
+
+    /**
+     * 组合土地实物状况描述
+     * @param entities
+     * @return
+     */
+    public static String getLandInfoDesc(List<HouseTargetEntity> entities){
+        StringBuilder resultDesc = new StringBuilder();
+        if (CollectionUtil.isNotEmpty(entities)){
+            for (HouseTargetEntity entity : entities){
+                //第一段
+                StringBuilder p = new StringBuilder("估价对象"+entity.getTid()+"序号"+entity.getTno()+"\n");
+                if (entity.getCertCombination()==5 || entity.getCertCombination()==6){
+                    p.append("(1)根据估价对象权利人提供的相关资料,本次评估设定估价对象分摊(占用)的土地使用权系")
+                            .append(entity.getTargetLandUseType()).append(entity.getTargetLandUseTo())
+                            .append(";估价对象宗地四至:东临").append(entity.getEastWay()).append(",西临")
+                            .append(entity.getWestWay()).append(",南临").append(entity.getSouthWay())
+                            .append(",北临").append(entity.getNorthWay()).append("。");
+                }else if (entity.getCertCombination() == 4){
+                    p.append("土地开发程度:经注册房地产估价师实地查勘,至价值时点,估价对象所在宗地上已修建")
+                            .append(entity.getUseTo()).append("用房,土地开发程度为").append(entity.getLandDeep())
+                            .append(";根据委托人提供的资料,估价对象所在宗地接城市供水、排水系统,雨水、污水分流处理,供电接城市电网,固定电话、网络接城市通讯网,移动讯号全覆盖。");
+                }else if (entity.getCertCombination() == 2 || entity.getCertCombination() == 3){
+                    p.append("估价对象土地坐落、用途、面积、使用权类型、土地使用年期:根据估价对象权利人提供的")
+                            .append(entity.getLandCertificateNo()).append("《国有土地使用证》记载,估价对象所在宗地位于")
+                            .append(entity.getLandLocation()).append(",估价对象占用").append(entity.getLandUseType())
+                            .append(entity.getLandUseTo()).append("土地使用权面积:").append(entity.getLandAcreage())
+                            .append("㎡,土地使用权终止日期为").append(entity.getLandExpireDate()).append(",至价值时点,剩余使用年期为抵押价值评估年;估价对象宗地四至:东临")
+                            .append(entity.getEastWay()).append(",西临")
+                            .append(entity.getWestWay()).append(",南临").append(entity.getSouthWay())
+                            .append(",北临").append(entity.getNorthWay()).append("。");
+                }else{
+                    p.append("估价对象土地坐落、用途、面积、使用权类型、土地使用年期:根据估价对象权利人提供的")
+                            .append(entity.getAssetsCertificateNo()).append("《不动产权证书》记载,估价对象所在宗地位于")
+                            .append(entity.getAssetsLocation()).append(",估价对象占用").append(entity.getAssetsUseType())
+                            .append(entity.getAssetsUseTo()).append("土地使用权面积:").append(entity.getAssetsAcreage())
+                            .append("㎡,土地使用权终止日期为").append(entity.getAssetsExpireDate()).append(",至价值时点,剩余使用年期为抵押价值评估年;估价对象宗地四至:东临")
+                            .append(entity.getEastWay()).append(",西临")
+                            .append(entity.getWestWay()).append(",南临").append(entity.getSouthWay())
+                            .append(",北临").append(entity.getNorthWay()).append("。");
+                }
+                p.append("\n");
+                //第二段
+                p.append("(2)估价对象土地形状、地形、地势、工程地质状况:经注册房地产估价师实地查勘,估价对象所在宗地形状较规则,利于项目规划布局和土地利用;地形、地势平缓无明显坡度;地基承载力较强,无不良地质条件。至价值时点,宗地上已修建")
+                        .append(entity.getUseTo()).append("用房。\n");
+                //第三段
+                p.append("(3)土地开发程度:经注册房地产估价师实地查勘,至价值时点,估价对象所在宗地上已修建")
+                        .append(entity.getUseTo()).append("用房,土地开发程度为").append(entity.getLandDeep())
+                        .append(";根据委托人提供的资料,估价对象所在宗地接城市供水、排水系统,雨水、污水分流处理,供电接城市电网,固定电话、网络接城市通讯网,移动讯号全覆盖。\n");
+
+                resultDesc.append(p);
+            }
+        }
+        return resultDesc.toString();
+    }
 
 }

+ 5 - 0
dao/src/main/java/com/dayou/mapper/HouseTargetEntityMapper.java

@@ -2,6 +2,11 @@ package com.dayou.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.dayou.entity.HouseTargetEntity;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface HouseTargetEntityMapper extends BaseMapper<HouseTargetEntity> {
+
+    List<HouseTargetEntity> getListById(@Param("docId") Long docId);
 }

+ 32 - 0
dao/src/main/resources/mapper/HouseTargetEntityMapper.xml

@@ -2,5 +2,37 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.dayou.mapper.HouseTargetEntityMapper">
 
+    <select id="getListById" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseTargetEntity">
+        SELECT
+            hte.*,
+            clu.location as landLocation,
+            clu.acreage as landAcreage,
+            clu.use_to as landUseTo,
+            clu.use_type as landUseType,
+            clu.expire_date as landExpireDate,
+            clu.certificate_no as landCertificateNo,
+            cfa.location as assetsLocation,
+            cfa.acreage_desc as assetsAcreage,
+            cfa.use_to as assetsUseTo,
+            cfa.own_ship_nature as assetsUseType,
+            cfa.certificate_no as assetsCertificateNo,
+            cfa.expire_date_desc as assetsExpireDate,
+            hgt.land_use_to as targetLandUseTo,
+            hgt.land_use_type as targetLandUseType
+        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
+                    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
+                    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
+        order by hte.id asc
+    </select>
 
 </mapper>

+ 7 - 0
domain/src/main/java/com/dayou/doc/house/GuarantyResultDO.java

@@ -45,7 +45,14 @@ public class GuarantyResultDO {
      */
     private String targetScope;
 
+    /**
+     * 建筑物实物状况
+     */
     private String buildingInfo;
 
+    /**
+     * 土地实物状况
+     */
+    private String landInfo;
 
 }

+ 2 - 0
domain/src/main/java/com/dayou/entity/HouseGuarantyTarget.java

@@ -107,4 +107,6 @@ public class HouseGuarantyTarget extends BaseEntity implements Serializable {
     private Boolean isInChengDu;
 
     private Boolean houseGetLandInfo;
+
+    private String landUseType;
 }

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

@@ -1,5 +1,6 @@
 package com.dayou.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.dayou.common.BaseEntity;
 import lombok.Data;
 
@@ -9,13 +10,15 @@ public class HouseTargetEntity extends BaseEntity {
     private Long businessId;
     private String tid;
     private String tno;
+    private String communityName;
+    private String buildingNo;
     private String houseAge;
     private String useInfo;
     private String useTo;
     private String buildingOut;
     private String atFloor;
     private String floor;
-    private String elevator;
+    private Integer elevator;
     private Boolean centerAirConditioning;
     private Boolean autoSpray;
     private Boolean smogEmergency;
@@ -41,4 +44,47 @@ public class HouseTargetEntity extends BaseEntity {
     private String bathroomWall;
     private String bathroomOther;
     private String landDeep;
+    private Integer certCombination;
+    private String eastWay;
+    private String westWay;
+    private String southWay;
+    private String northWay;
+
+    /**
+     * 国土证
+     */
+    @TableField(exist = false)
+    private String landCertificateNo;
+    @TableField(exist = false)
+    private String landLocation;
+    @TableField(exist = false)
+    private String landUseTo;
+    @TableField(exist = false)
+    private String landAcreage;
+    @TableField(exist = false)
+    private String landUseType;
+    @TableField(exist = false)
+    private String landExpireDate;
+
+
+    /**
+     * 不动产权利证书
+     */
+    @TableField(exist = false)
+    private String AssetsCertificateNo;
+    @TableField(exist = false)
+    private String AssetsLocation;
+    @TableField(exist = false)
+    private String AssetsUseTo;
+    @TableField(exist = false)
+    private String AssetsAcreage;
+    @TableField(exist = false)
+    private String AssetsUseType;
+    @TableField(exist = false)
+    private String AssetsExpireDate;
+
+    @TableField(exist = false)
+    private String targetLandUseTo;
+    @TableField(exist = false)
+    private String targetLandUseType;
 }

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

@@ -6,7 +6,7 @@ import lombok.Builder;
 import lombok.Data;
 
 @Builder
-public class HouseEntityTable {
+public class HouseEntityTable{
 
 
     @WordTableColumn(name = "估价对象")
@@ -24,7 +24,7 @@ public class HouseEntityTable {
     @WordTableColumn(name = "用途")
     private String useTo;
 
-    @WordTableColumn(name = "建筑面积")
+    @WordTableColumn(name = "建筑面积(㎡)")
     private String acreage;
 
     @WordTableColumn(name = "实物状况")

+ 118 - 5
service/src/main/java/com/dayou/service/impl/HouseGuarantyServiceImpl.java

@@ -21,7 +21,9 @@ import com.dayou.entity.*;
 import com.dayou.enums.DocumentType;
 import com.dayou.enums.BusinessEnum;
 import com.dayou.exception.ErrorCode;
+import com.dayou.mapper.HouseTargetEntityMapper;
 import com.dayou.service.*;
+import com.dayou.table.HouseEntityTable;
 import com.dayou.utils.*;
 import com.dayou.utils.table.WordTableHelper;
 import com.dayou.vo.HouseTargetVO;
@@ -34,10 +36,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collections;
+import java.util.*;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
 import static com.dayou.constants.HouseGuarantyDoc.*;
@@ -78,6 +78,12 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     @Autowired
     private CertificateLandUseService certificateLandUseService;
 
+    @Autowired
+    private HouseTargetEntityService houseTargetEntityService;
+
+    @Autowired
+    private HouseTargetEntityMapper houseTargetEntityMapper;
+
     @Override
     public Long createTableWord(HouseGuarantyTableDTO houseGuarantyTableDTO) {
         try {
@@ -335,11 +341,13 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
             guarantyResultDO.setCreditCode((String) jsonObject.get("统一社会信用代码"));
 
             Map<Object, List<Object>> collect = array.stream().collect(Collectors.groupingBy(x -> ((JSONObject) x).get(ID.getZhName())));
-            String targetScope = HouseDocumentUtil.combinationTargetDescription(collect);
 
-            guarantyResultDO.setTargetScope(targetScope);
+            guarantyResultDO.setTargetScope(HouseDocumentUtil.combinationTargetDescription(collect));
 
+            List<HouseTargetEntity> entities = houseTargetEntityMapper.getListById(id);
 
+            //土地实物状况描述
+            guarantyResultDO.setLandInfo(HouseDocumentUtil.getLandInfoDesc(entities));
 
             byte[] tmplWordByte = Files.readAllBytes(Paths.get(baseDir
                     + fileNetConfig.getHouseGuarantyTemplatePath() + GUARANTY_RESULT_TEMPLATE));
@@ -351,6 +359,52 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
             FileOutputStream fos = new FileOutputStream(resultFile);
             fos.write(resultWordByte);
             fos.close();
+
+            Thread.sleep(1000);
+
+            //生成文档中的表格
+            //1. 实物状况表格
+
+            Document doc = new Document(baseDir + guarantyResultName);
+
+            List<HouseEntityTable> entityTables = entities.stream().map(x -> {
+                String location = UNKNOWN;
+                String acreage = UNKNOWN;
+                String useTo = UNKNOWN;
+                String structure = UNKNOWN;
+                CertificateFixedAssets fa = certificateFixedAssetsService.getOne(new LambdaQueryWrapper<CertificateFixedAssets>()
+                        .eq(CertificateFixedAssets::getBusinessId, x.getBusinessId())
+                        .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::getTid, x.getTid())
+                            .eq(CertificateHouseOwn::getTno, x.getTno())
+                            .select(CertificateHouseOwn::getLocation, CertificateHouseOwn::getAcreage, CertificateHouseOwn::getUseTo));
+                    if (certHouse != null) {
+                        location = certHouse.getLocation();
+                        acreage = certHouse.getAcreage();
+                        useTo = certHouse.getUseTo();
+                        structure = certHouse.getStructure();
+                    }
+                } else {
+                    location = fa.getLocation();
+                    acreage = fa.getAcreageDesc();
+                    useTo = fa.getUseTo();
+                    structure = "/";
+                }
+
+                HouseEntityTable entityTable = HouseEntityTable.builder().tid(x.getTid()).tno(x.getTno())
+                        .useTo(useTo).acreage(acreage).structure(structure)
+                        .location(location).desc(HouseDocumentUtil.targetEntityDesc(location, useTo, acreage, x)).build();
+                return entityTable;
+            }).collect(Collectors.toList());
+
+            AsposeWordUtil.createTable(doc, HouseEntityTable.class, entityTables, "buildingInfo");
+            doc.save(baseDir + guarantyResultName);
+
             //更新过程文档url
             HouseGuarantyProcess houseGuarantyProcess = new HouseGuarantyProcess();
             houseGuarantyProcess.setProcessName(GUARANTY_RESULT_REPORT.getMsg());
@@ -439,4 +493,63 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
         }
         return certificateTypes;
     }
+
+    /**
+     * 不动产证 0
+     * 房新&土新 1
+     * 房新&土老 2
+     * 房老&土新 3
+     * 房老&土老 4
+     * 房新&土无 5
+     * 房老&土无 6
+     * @param businessId
+     * @param tid
+     * @param tno
+     * @return
+     */
+    private Integer getCertificateCombination(Long businessId,String tid,String tno){
+        int imm = certificateFixedAssetsService.count(new LambdaQueryWrapper<CertificateFixedAssets>()
+                .eq(CertificateFixedAssets::getBusinessType, GUARANTY)
+                .eq(CertificateFixedAssets::getBusinessId, businessId)
+                .eq(CertificateFixedAssets::getTid,tid)
+                .eq(CertificateFixedAssets::getTno,tno));
+        if (imm == 0) {
+            CertificateHouseOwn certHouseOwn = certificateHouseOwnService.getOne(new LambdaQueryWrapper<CertificateHouseOwn>()
+                    .eq(CertificateHouseOwn::getBusinessType, GUARANTY)
+                    .eq(CertificateHouseOwn::getBusinessId, businessId)
+                    .eq(CertificateHouseOwn::getTid, tid)
+                    .eq(CertificateHouseOwn::getTno, tno)
+                    .select(CertificateHouseOwn::getIsNew));
+
+            CertificateLandUse certLandUse = certificateLandUseService.getOne(new LambdaQueryWrapper<CertificateLandUse>()
+                    .eq(CertificateLandUse::getBusinessType, GUARANTY)
+                    .eq(CertificateLandUse::getBusinessId, businessId)
+                    .eq(CertificateLandUse::getTid, tid)
+                    .eq(CertificateLandUse::getTno, tno)
+                    .select(CertificateLandUse::getIsNew));
+
+
+            if (certHouseOwn != null && certLandUse != null) {
+                if (certHouseOwn.getIsNew() && certLandUse.getIsNew()) {
+                    return 1;
+                } else if (certHouseOwn.getIsNew()) {
+                    return 2;
+                } else if (certLandUse.getIsNew()) {
+                    return 3;
+                } else {
+                    return 4;
+                }
+            } else if (certHouseOwn != null) {
+                if (certHouseOwn.getIsNew()) {
+                    return 5;
+                } else {
+                    return 6;
+                }
+            } else {
+                ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR, "缺失权属证件信息");
+            }
+        }
+        return 0;
+    }
 }
+

+ 16 - 0
sql/update_sql.sql

@@ -611,3 +611,19 @@ ALTER TABLE assets_report ADD COLUMN calculate_id BIGINT(20) NULL COMMENT '关
 ALTER TABLE assets_report ADD COLUMN production_no VARCHAR(255) NULL COMMENT '报告号(产品号)';
 ALTER TABLE assets_calculate_eqpt_data ADD COLUMN evaluate_original_value DECIMAL(11,2) NULL COMMENT '评估原值';
 ALTER TABLE assets_calculate_eqpt_data ADD COLUMN evaluate_net_value DECIMAL(11,2) NULL COMMENT '评估净值';
+
+
+/**
+  日期:2024-12-16
+  修改人:吴长林
+  未更新到test-env
+ */
+ALTER TABLE house_target_entity ADD COLUMN community_name VARCHAR(255)  NULL COMMENT '小区名称';
+ALTER TABLE house_target_entity ADD COLUMN building_no VARCHAR(32)  NULL COMMENT '栋号';
+ALTER TABLE house_target_entity ADD COLUMN cert_combination int(8)  NULL COMMENT '证件组合类型';
+ALTER TABLE house_target_entity ADD COLUMN east_way varchar(255) NULL COMMENT '东至';
+ALTER TABLE house_target_entity ADD COLUMN west_way varchar(255) NULL COMMENT '西至';
+ALTER TABLE house_target_entity ADD COLUMN south_way varchar(255) NULL COMMENT '南至';
+ALTER TABLE house_target_entity ADD COLUMN north_way varchar(255) NULL COMMENT '北至';
+ALTER TABLE house_guaranty_target ADD COLUMN land_use_type varchar(32) NULL COMMENT '土地使用权类型';
+