Parcourir la source

房地产抵押报告逻辑补充

wucl il y a 3 mois
Parent
commit
948fde08ec

+ 55 - 0
common/src/main/java/com/dayou/utils/AddressUtil.java

@@ -30,6 +30,11 @@ public class AddressUtil {
     private static final List<String> BIG_CHENGDU  = Arrays.asList("锦江区","武侯区","青羊区","郫都区","金牛区","高新区","温江区","成华区","新都区"
         ,"龙泉驿区","青白江区","双流区","都江堰市","崇州市","邛崃市","简阳市","彭州市","郫县","金堂县","大邑县","浦江县"
         ,"新津县","成都天府新区直管区","成都高新技术产业开发区","成都经济技术开发区");
+
+    private static final List<String> CENTER_CHENGDU  = Arrays.asList("锦江区","武侯区","青羊区","金牛区","成华区");
+
+    private static final List<String> TECH_CHENGDU  = Arrays.asList("高新区","成都高新技术产业开发区");
+
     /**
      *
      * @param address 地址字符串
@@ -136,4 +141,54 @@ public class AddressUtil {
         return false;
 
     }
+
+    /**
+     * 判断是否属于成都中心城区范围
+     * @param address
+     * @return
+     */
+    public static Boolean isCenterChengdu(String address){
+        Address addr = parseAddress(address);
+        if (addr!=null){
+            String city = addr.getCity();
+            if (StrUtil.isNotBlank(city) && city.contains("成都")){
+                return true;
+            }
+            String district = addr.getDistrict();
+
+            for (String str : CENTER_CHENGDU){
+                if (StrUtil.isNotBlank(district) && (str.contains(district) || district.contains(str))){
+                    return true;
+                }
+            }
+        }
+        return false;
+
+    }
+
+    /**
+     * 判断是否属于成都高新区
+     * @param address
+     * @return
+     */
+    public static Boolean isTechChengdu(String address){
+        Address addr = parseAddress(address);
+        if (addr!=null){
+            String city = addr.getCity();
+            if (StrUtil.isNotBlank(city) && city.contains("成都")){
+                return true;
+            }
+            String district = addr.getDistrict();
+
+            for (String str : TECH_CHENGDU){
+                if (StrUtil.isNotBlank(district) && (str.contains(district) || district.contains(str))){
+                    return true;
+                }
+            }
+        }
+        return false;
+
+    }
+
+
 }

Fichier diff supprimé car celui-ci est trop grand
+ 576 - 0
common/src/main/java/com/dayou/utils/HouseDocumentUtil.java


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

@@ -60,4 +60,41 @@ public class GuarantyResultDO {
      */
     private String valueTiming;
 
+    /**
+     * 已抵押担保的债权数额(万元)
+     */
+    private String pledgeValue;
+
+    /**
+     * 拖欠的建设工程价款(万元)
+     */
+    private String debtMoney;
+
+    /**
+     * 其他法定优先受偿款(万元)
+     */
+    private String firstMoney;
+
+    /**
+     * 合计(万元)
+     */
+    private String totalMoney;
+
+    /**
+     * 估价师1
+     */
+    private String appraiser1;
+    /**
+     * 估价师2
+     */
+    private String appraiser2;
+    /**
+     * 估价师1注册号
+     */
+    private String appraNo1;
+    /**
+     * 估价师2注册号
+     */
+    private String appraNo2;
+
 }

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

@@ -130,6 +130,8 @@ public class HouseGuarantyBase extends BaseEntity {
 
     private Boolean isTakeOutFirstMoney;
 
+    private String landUseType;
+
 
 
 

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

@@ -72,8 +72,6 @@ public class HouseGuarantyTarget extends BaseEntity implements Serializable {
 
     private String rentUser;
 
-
-
     private Boolean noBuildingHouseNos;
 
     private String exploreDate;
@@ -98,6 +96,14 @@ public class HouseGuarantyTarget extends BaseEntity implements Serializable {
 
     private Boolean isCostingShareMethod;
 
+    private String evaluateMethod;
+
+    private String useTo;
+
+    private String commonLevel;
+
+    private String independence;
+
     @TableField(exist = false)
     private List<HouseGuarantyAim> aims;
 

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

@@ -34,6 +34,7 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.math.BigDecimal;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.*;
@@ -86,6 +87,9 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     private HouseGuarantyTargetMapper houseGuarantyTargetMapper;
 
     @Autowired
+    private HouseGuarantyTargetService houseGuarantyTargetService;
+
+    @Autowired
     private HouseGuarantyAreaService houseGuarantyAreaService;
 
     @Override
@@ -309,7 +313,7 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
         HouseGuarantyProcess process = houseGuarantyProcessService.getById(dp.getBusinessId());
         String baseDir = fileNetConfig.getBaseDir();
 
-        //读取估价对象数组
+        //读取估价标的数组
         List<HouseGuarantyAim> aims = houseGuarantyAimService.list(new LambdaQueryWrapper<HouseGuarantyAim>().eq(HouseGuarantyAim::getDocId, id));
 
         //获取基本信息
@@ -324,6 +328,9 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
         //获取区位状况数据源
         List<HouseGuarantyArea> areas = houseGuarantyAreaService.getAreasList(id);
 
+        //估价对象数据源
+        List<HouseGuarantyTarget> targets = houseGuarantyTargetService.list(new LambdaQueryWrapper<HouseGuarantyTarget>().eq(HouseGuarantyTarget::getDocId,id));
+
         Map<String, List<HouseGuarantyAim>> collect = aims.stream().collect(Collectors.groupingBy(HouseGuarantyAim::getTid));
 
         //替换字段
@@ -338,6 +345,15 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
         guarantyResultDO.setCreditCode(base.getCreditCode());
         guarantyResultDO.setTargetScope(HouseDocumentUtil.combinationTargetDescription(collect));
         guarantyResultDO.setLandInfo(HouseDocumentUtil.getLandInfoDesc(entities));
+        guarantyResultDO.setDebtMoney(base.getDebtMoney());
+        guarantyResultDO.setFirstMoney(base.getFirstMoney());
+        guarantyResultDO.setPledgeValue(base.getPledgeValue());
+        guarantyResultDO.setAppraiser1(base.getAppraiser1());
+        guarantyResultDO.setAppraiser2(base.getAppraiser2());
+        guarantyResultDO.setAppraNo1(base.getAppraNo1());
+        guarantyResultDO.setAppraNo2(base.getAppraNo2());
+        BigDecimal total = new BigDecimal(base.getDebtMoney()).add(new BigDecimal(base.getFirstMoney())).add(new BigDecimal(base.getPledgeValue()==null?"0":base.getPledgeValue()));
+        guarantyResultDO.setTotalMoney(total.toString());
         try {
             byte[] tmplWordByte = Files.readAllBytes(Paths.get(baseDir
                     + fileNetConfig.getHouseGuarantyTemplatePath() + GUARANTY_RESULT_TEMPLATE));
@@ -354,10 +370,33 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
             //获取替换后的文档
             Document doc = new Document(baseDir + guarantyResultName);
             //创作权属信息段落
-            HouseDocumentUtil.getRightsDesc(doc,houseRightsDTOList,
-                    base);
+            HouseDocumentUtil.getRightsDesc(doc,houseRightsDTOList,base);
             //创作区位信息段落
             HouseDocumentUtil.getAreaDesc(doc,areas);
+            //创作价值内涵段落
+            HouseDocumentUtil.getValueConnotation(doc,targets,base.getLandUseType());
+            //创作提供的证件类型
+            HouseDocumentUtil.getCertificateTypes(doc,houseRightsDTOList);
+            //创作估价思路
+            HouseDocumentUtil.getEvaluateThinking(doc,targets);
+            //创作估价对象抵押价值
+            HouseDocumentUtil.getTargetPledgeInfo(doc,base,"88");
+            //创作估价对象通用性描述
+            HouseDocumentUtil.getTargetCommonInfo(doc,targets);
+            //创作估价对象独立使用性
+            HouseDocumentUtil.getTargetIndependence(doc,targets);
+            //创作估价对象分隔转让性
+            HouseDocumentUtil.getTargetTransfer(doc,targets);
+            //创作估价对象区位描述
+            HouseDocumentUtil.getTargetAreaInfo(doc,areas);
+            //创作估价对象土地开发程度
+            HouseDocumentUtil.getTargetLandDev(doc,entities);
+            //创作估价对象价值大小
+            HouseDocumentUtil.getTargetValueInfo(doc,targets);
+            //创作估价对象价值大小1
+            HouseDocumentUtil.getTargetValueInfo1(doc,targets);
+            //创作估价对象在在抵押期间产生的房地产信贷风险关注点
+            HouseDocumentUtil.getTargetRiskPoint(doc);
             //建筑物实物状况表格
             List<HouseEntityTable> entityTables = entities.stream().map(x -> {
                 String location = UNKNOWN;
@@ -546,5 +585,4 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
         }
         return 0;
     }
-}
-
+}