瀏覽代碼

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

GouGengquan 1 月之前
父節點
當前提交
a7f20daa61
共有 73 個文件被更改,包括 4642 次插入4633 次删除
  1. 15 1
      biz-base/src/main/java/com/dayou/controller/FileController.java
  2. 35 0
      biz-base/src/main/java/com/dayou/controller/HouseExcelDataController.java
  3. 11 13
      biz-base/src/main/java/com/dayou/controller/HouseGuarantyAreaController.java
  4. 0 40
      biz-base/src/main/java/com/dayou/controller/HouseGuarantyBaseController.java
  5. 36 24
      biz-base/src/main/java/com/dayou/controller/HouseGuarantyDocController.java
  6. 0 42
      biz-base/src/main/java/com/dayou/controller/HouseGuarantyTargetController.java
  7. 0 66
      biz-base/src/main/java/com/dayou/controller/HouseTargetEntityController.java
  8. 0 35
      biz-base/src/main/java/com/dayou/controller/TmplHouseParagraphController.java
  9. 7 5
      biz-base/src/main/resources/application-local.yaml
  10. 0 2
      biz-base/src/test/java/com/dayou/AddressParser.java
  11. 0 37
      biz-base/src/test/java/com/dayou/ConditionDocumentTest.java
  12. 0 90
      biz-base/src/test/java/com/dayou/DynamicGenTableWordTest.java
  13. 0 140
      biz-base/src/test/java/com/dayou/FreeMarkTest.java
  14. 6 0
      common/src/main/java/com/dayou/constants/HouseGuarantyDoc.java
  15. 17 1
      common/src/main/java/com/dayou/constants/TableHTML.java
  16. 170 1
      common/src/main/java/com/dayou/utils/EasyExcelUtil.java
  17. 2288 2289
      common/src/main/java/com/dayou/utils/HouseDocumentUtil.java
  18. 314 0
      common/src/main/java/com/dayou/utils/HttpKit.java
  19. 58 10
      common/src/main/java/com/dayou/utils/table/WordTableHelper.java
  20. 0 1
      dao/src/main/java/com/dayou/mapper/CertificateFixedAssetsMapper.java
  21. 2 0
      dao/src/main/java/com/dayou/mapper/DocumentProductionMapper.java
  22. 12 0
      dao/src/main/java/com/dayou/mapper/HouseExcelDataMapper.java
  23. 0 10
      dao/src/main/java/com/dayou/mapper/HouseGuarantyAimMapper.java
  24. 2 0
      dao/src/main/java/com/dayou/mapper/HouseGuarantyAreaMapper.java
  25. 0 10
      dao/src/main/java/com/dayou/mapper/HouseGuarantyBaseMapper.java
  26. 5 0
      dao/src/main/java/com/dayou/mapper/HouseGuarantyProcessMapper.java
  27. 0 12
      dao/src/main/java/com/dayou/mapper/HouseGuarantyTargetMapper.java
  28. 0 15
      dao/src/main/java/com/dayou/mapper/HouseTargetEntityMapper.java
  29. 113 0
      dao/src/main/resources/mapper/HouseExcelDataMapper.xml
  30. 0 6
      dao/src/main/resources/mapper/HouseGuarantyAimMapper.xml
  31. 22 0
      dao/src/main/resources/mapper/HouseGuarantyAreaMapper.xml
  32. 0 15
      dao/src/main/resources/mapper/HouseGuarantyBaseMapper.xml
  33. 16 0
      dao/src/main/resources/mapper/HouseGuarantyProcessMapper.xml
  34. 0 126
      dao/src/main/resources/mapper/HouseGuarantyTargetMapper.xml
  35. 0 66
      dao/src/main/resources/mapper/HouseTargetEntityMapper.xml
  36. 68 0
      domain/src/main/java/com/dayou/doc/house/BaseInfoDO.java
  37. 86 0
      domain/src/main/java/com/dayou/doc/house/GuarantyResultDO.java
  38. 4 2
      domain/src/main/java/com/dayou/dto/HouseGuarantyTableDTO.java
  39. 19 0
      domain/src/main/java/com/dayou/dto/LngLatDTO.java
  40. 11 0
      domain/src/main/java/com/dayou/dto/RoadDTO.java
  41. 2 0
      domain/src/main/java/com/dayou/entity/CertificateFixedAssets.java
  42. 464 0
      domain/src/main/java/com/dayou/entity/HouseExcelData.java
  43. 0 44
      domain/src/main/java/com/dayou/entity/HouseGuarantyAim.java
  44. 45 13
      domain/src/main/java/com/dayou/entity/HouseGuarantyArea.java
  45. 0 170
      domain/src/main/java/com/dayou/entity/HouseGuarantyBase.java
  46. 7 2
      domain/src/main/java/com/dayou/entity/HouseGuarantyProcess.java
  47. 0 110
      domain/src/main/java/com/dayou/entity/HouseGuarantyTarget.java
  48. 0 96
      domain/src/main/java/com/dayou/entity/HouseTargetEntity.java
  49. 1 2
      domain/src/main/java/com/dayou/enums/BusinessEnum.java
  50. 73 0
      domain/src/main/java/com/dayou/vo/HouseGuarantyBaseVO.java
  51. 0 14
      domain/src/main/java/com/dayou/vo/HouseTargetVO.java
  52. 2 0
      service/src/main/java/com/dayou/service/DocumentProductionService.java
  53. 42 0
      service/src/main/java/com/dayou/service/HouseExcelDataService.java
  54. 0 7
      service/src/main/java/com/dayou/service/HouseGuarantyAimService.java
  55. 7 2
      service/src/main/java/com/dayou/service/HouseGuarantyAreaService.java
  56. 0 11
      service/src/main/java/com/dayou/service/HouseGuarantyBaseService.java
  57. 2 0
      service/src/main/java/com/dayou/service/HouseGuarantyProcessService.java
  58. 11 18
      service/src/main/java/com/dayou/service/HouseGuarantyService.java
  59. 0 9
      service/src/main/java/com/dayou/service/HouseGuarantyTargetService.java
  60. 0 20
      service/src/main/java/com/dayou/service/HouseTargetEntityService.java
  61. 0 63
      service/src/main/java/com/dayou/service/TmplHouseParagraphService.java
  62. 0 4
      service/src/main/java/com/dayou/service/impl/CertificateHouseOwnServiceImpl.java
  63. 25 0
      service/src/main/java/com/dayou/service/impl/DocumentProductionServiceImpl.java
  64. 330 0
      service/src/main/java/com/dayou/service/impl/HouseExcelDataServiceImpl.java
  65. 0 11
      service/src/main/java/com/dayou/service/impl/HouseGuarantyAimServiceImpl.java
  66. 91 9
      service/src/main/java/com/dayou/service/impl/HouseGuarantyAreaServiceImpl.java
  67. 0 37
      service/src/main/java/com/dayou/service/impl/HouseGuarantyBaseServiceImpl.java
  68. 47 4
      service/src/main/java/com/dayou/service/impl/HouseGuarantyProcessServiceImpl.java
  69. 45 313
      service/src/main/java/com/dayou/service/impl/HouseGuarantyServiceImpl.java
  70. 0 18
      service/src/main/java/com/dayou/service/impl/HouseGuarantyTargetServiceImpl.java
  71. 0 141
      service/src/main/java/com/dayou/service/impl/HouseTargetEntityServiceImpl.java
  72. 0 455
      service/src/main/java/com/dayou/service/impl/TmplHouseParagraphServiceImpl.java
  73. 131 1
      sql/update_sql.sql

+ 15 - 1
biz-base/src/main/java/com/dayou/controller/FileController.java

@@ -7,6 +7,8 @@ import com.dayou.entity.TmplAssetCalculateSection;
 import com.dayou.exception.BusinessException;
 import com.dayou.result.Result;
 import com.dayou.result.Status;
+import com.dayou.service.DocumentProductionService;
+import com.dayou.service.HouseExcelDataService;
 import com.dayou.service.TmplAssetCalculateSectionService;
 import com.dayou.service.TmplAssetCalculateService;
 import com.dayou.utils.FileNetUtil;
@@ -40,6 +42,12 @@ public class FileController {
     @Autowired
     private FileNetConfig fileNetConfig;
 
+    @Autowired
+    private HouseExcelDataService houseExcelDataService;
+
+    @Autowired
+    private DocumentProductionService documentProductionService;
+
     /**
      * 上传资产测算表模板
      * @param multipartFile 文件
@@ -81,7 +89,13 @@ public class FileController {
     public Result<Map<String, String>> updateCollect(MultipartFile file){
         // 判断文件类型
         if (Objects.equals(file.getContentType(), "application/vnd.ms-excel") || Objects.equals(file.getContentType(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
-            return Result.build(FileNetUtil.upload(file, fileNetConfig.getBaseDir(), fileNetConfig.getHouseGuarantyPath(), COLLECT1_XLSX));
+            Map<String, String> upload = FileNetUtil.upload(file, fileNetConfig.getBaseDir(), fileNetConfig.getHouseGuarantyPath(), COLLECT1_XLSX);
+            //解析excel原始文件
+            Long excelId = houseExcelDataService.analysisOriginExcelData(file, upload.get("filePath"));
+            Long docId = documentProductionService.saveDocumentProductionByExcelId(excelId);
+            upload.put("excelId",String.valueOf(excelId));
+            upload.put("docId",String.valueOf(docId));
+            return Result.build(upload);
         }else {
             return Result.build(Status.PARAM_ERROR, "请上传xls或xlsx类型的excel文档!");
         }

+ 35 - 0
biz-base/src/main/java/com/dayou/controller/HouseExcelDataController.java

@@ -0,0 +1,35 @@
+package com.dayou.controller;
+
+import com.dayou.result.Result;
+import com.dayou.service.HouseExcelDataService;
+import com.dayou.vo.HouseGuarantyBaseVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 房地产估价对象标的物区位状况
+ */
+@RestController
+@RequestMapping("houseExcelData")
+@Slf4j
+public class HouseExcelDataController {
+
+    @Autowired
+    private HouseExcelDataService houseExcelDataService;
+
+    /**
+     * 获取报告基本信息
+     * @param excelId
+     * @return
+     */
+    @GetMapping("/baseInfo/{excelId}")
+    public Result<HouseGuarantyBaseVO> getBaseInfo(@PathVariable("excelId") Long excelId){
+        HouseGuarantyBaseVO base = houseExcelDataService.getBaseInfo(excelId);
+        return Result.build(base);
+    }
+
+}

+ 11 - 13
biz-base/src/main/java/com/dayou/controller/HouseGuarantyAreaController.java

@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 
 
 /**
@@ -21,14 +22,13 @@ public class HouseGuarantyAreaController {
     private HouseGuarantyAreaService houseGuarantyAreaService;
 
     /**
-     * 更新和保存区位信息
+     * 更新区位信息
      * @param houseGuarantyArea
      * @return
      */
-    @PostMapping("")
-    public Result<Long> save(@RequestBody HouseGuarantyArea houseGuarantyArea) {
-        houseGuarantyAreaService.saveOrUpdate(houseGuarantyArea);
-        return Result.build(houseGuarantyArea.getId());
+    @PutMapping("")
+    public Result<Boolean> updateArea(@RequestBody HouseGuarantyArea houseGuarantyArea) {
+        return Result.build(houseGuarantyAreaService.updateArea(houseGuarantyArea));
     }
 
     /**
@@ -43,16 +43,14 @@ public class HouseGuarantyAreaController {
     }
 
     /**
-     * 根据文档id、估计对象id、标的物序号查询
-     * @param docId
-     * @param tid
-     * @param tno
+     * 查询估价对象区位列表
+     * @param excelId
      * @return
      */
-    @GetMapping("/ids")
-    public Result<HouseGuarantyArea> getByDocIdTidTno(Long docId,String tid,String tno){
-        HouseGuarantyArea ares = houseGuarantyAreaService.getByDocIdTidTno(docId,tid,tno);
-        return  Result.build(ares);
+    @GetMapping("")
+    public Result<List<HouseGuarantyArea>> getAreaInfo(Long excelId){
+        List<HouseGuarantyArea> ret = houseGuarantyAreaService.getAreaInfo(excelId);
+        return Result.build(ret);
     }
 
 }

+ 0 - 40
biz-base/src/main/java/com/dayou/controller/HouseGuarantyBaseController.java

@@ -1,40 +0,0 @@
-package com.dayou.controller;
-
-import com.dayou.entity.HouseGuarantyBase;
-import com.dayou.result.Result;
-import com.dayou.service.HouseGuarantyBaseService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 房地产抵押基本信息
- */
-@RestController
-@RequestMapping("houseGuarantyBase")
-@Slf4j
-public class HouseGuarantyBaseController {
-
-    @Autowired
-    private HouseGuarantyBaseService houseGuarantyBaseService;
-
-    /**
-     * 基本信息保存
-     * @param base
-     * @return
-     */
-    @PostMapping("")
-    public Result<Long> add(@RequestBody  HouseGuarantyBase base){
-        return Result.build(houseGuarantyBaseService.add(base));
-    }
-
-    /**
-     * 根据id查询
-     * @param docId
-     * @return
-     */
-    @GetMapping("/{docId}")
-    public Result<HouseGuarantyBase> getByDocId(@PathVariable("docId") Long docId){
-        return Result.build(houseGuarantyBaseService.getByDocId(docId));
-    }
-}

+ 36 - 24
biz-base/src/main/java/com/dayou/controller/HouseGuarantyDocController.java

@@ -2,12 +2,12 @@ package com.dayou.controller;
 
 
 import com.dayou.dto.HouseGuarantyTableDTO;
-import com.dayou.entity.HouseGuarantyBase;
+import com.dayou.entity.DocumentProduction;
 import com.dayou.entity.HouseGuarantyProcess;
 import com.dayou.result.Result;
+import com.dayou.service.DocumentProductionService;
 import com.dayou.service.HouseGuarantyProcessService;
 import com.dayou.service.HouseGuarantyService;
-import com.dayou.vo.HouseTargetVO;
 import com.dayou.vo.ProcessVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +30,9 @@ public class HouseGuarantyDocController {
     @Autowired
     private HouseGuarantyProcessService houseGuarantyProcessService;
 
+    @Autowired
+    private DocumentProductionService documentProductionService;
+
     /**
      * 生成估价结果一览表的word文件
      * @return 过程表id
@@ -39,25 +42,16 @@ public class HouseGuarantyDocController {
         return Result.build(houseGuarantyService.createTableWord(houseGuarantyTableDTO));
     }
 
-    /**
-     * 解析表单中的估价对象
-     * @param processId
-     * @return
-     */
-    @GetMapping("/collect1/{processId}")
-    public Result<Long> analysisCollect1(@PathVariable("processId") Long processId) throws Exception {
-        return Result.build(houseGuarantyService.analysisCollect1(processId));
-    }
 
     /**
      * 生成致委托人函word
-     * @param pId
-     * @param docId
+     * @param excelId
+     * @param processId
      * @return
      */
     @GetMapping("/consignor")
-    public Result<Boolean> genConsignorLetter(Long pId,Long docId){
-        return Result.build(houseGuarantyService.genConsignorLetter(pId,docId));
+    public Result<Boolean> genConsignorLetter(Long excelId,Long processId) throws Exception {
+        return Result.build(houseGuarantyService.genConsignorLetter(excelId,processId));
     }
 
     /**
@@ -81,15 +75,6 @@ public class HouseGuarantyDocController {
         return Result.build(list);
     }
 
-    /**
-     * 获取估价对象
-     * @param id
-     * @return
-     */
-    @GetMapping("/targets/{id}")
-    public Result<List<HouseTargetVO>> getTargetsById(@PathVariable Long id){
-        return Result.build(houseGuarantyService.getTargetsById(id));
-    }
 
     /**
      * 生成《估价的假设和限制条件及使用报告说明》
@@ -111,4 +96,31 @@ public class HouseGuarantyDocController {
         return Result.build(houseGuarantyService.genResultLetter(id));
     }
 
+    @GetMapping("/cerf/html/{businessId}")
+    public Result<HouseGuarantyProcess> getCertificatesHtml(@PathVariable("businessId") Long businessId){
+        return Result.build(houseGuarantyService.getCertificatesHtml(businessId));
+    }
+
+
+    /**
+     * 合并文档成完整报告
+     * id = parentId
+     * @return
+     */
+    @GetMapping("/merge")
+    public Result<Boolean> houseGuarantyMerge(Long id) throws Exception {
+        Boolean ret = houseGuarantyProcessService.houseGuarantyMerge(id);
+        return Result.build(ret);
+    }
+
+    /**
+     * 完整报告信息
+     * @return
+     */
+    @GetMapping("/final/{id}")
+    public Result<DocumentProduction> finalDoc(@PathVariable("id") Long id) throws Exception {
+        DocumentProduction dp = documentProductionService.getById(id);
+        return Result.build(dp);
+    }
+
 }

+ 0 - 42
biz-base/src/main/java/com/dayou/controller/HouseGuarantyTargetController.java

@@ -1,42 +0,0 @@
-package com.dayou.controller;
-
-import com.dayou.entity.HouseGuarantyAim;
-import com.dayou.entity.HouseGuarantyTarget;
-import com.dayou.result.Result;
-import com.dayou.service.HouseGuarantyAimService;
-import com.dayou.service.HouseGuarantyTargetService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 房地产抵押类估价对象信息
- */
-@RestController
-@RequestMapping("house/guaranty/target")
-@Slf4j
-public class HouseGuarantyTargetController {
-
-    @Autowired
-    private HouseGuarantyTargetService houseGuarantyTargetService;
-
-    @Autowired
-    private HouseGuarantyAimService houseGuarantyAimService;
-
-    @PostMapping()
-    public Result<Long> save(@RequestBody HouseGuarantyTarget houseGuarantyTarget) {
-        List<HouseGuarantyAim> aims = houseGuarantyTarget.getAims();
-        houseGuarantyAimService.saveOrUpdateBatch(aims);
-        houseGuarantyTargetService.saveOrUpdate(houseGuarantyTarget);
-        return Result.build(houseGuarantyTarget.getId());
-    }
-
-    @GetMapping()
-    public Result<HouseGuarantyTarget> getTarget(Long docId, String tId) {
-        HouseGuarantyTarget target = houseGuarantyTargetService.getTarget(docId,tId);
-        return Result.build(target);
-    }
-
-}

+ 0 - 66
biz-base/src/main/java/com/dayou/controller/HouseTargetEntityController.java

@@ -1,66 +0,0 @@
-package com.dayou.controller;
-
-import com.dayou.entity.HouseTargetEntity;
-import com.dayou.result.Result;
-import com.dayou.service.HouseTargetEntityService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-
-/**
- * 房地产实物状况控制器
- */
-@RestController
-@RequestMapping("houseTargetEntity")
-@Slf4j
-public class HouseTargetEntityController {
-
-    @Autowired
-    private HouseTargetEntityService houseTargetEntityService;
-
-    /**
-     * 保存实物状况信息
-     * @param houseTargetEntity
-     * @return
-     */
-    @PostMapping("")
-    public Result<Long> addHouseTargetEntity(@RequestBody HouseTargetEntity houseTargetEntity) {
-        Long ret = houseTargetEntityService.addHouseTargetEntity(houseTargetEntity);
-        return Result.build(ret);
-    }
-
-    /**
-     * 查询单个标的物实物状况
-     * @param businessId
-     * @param tid
-     * @param tno
-     * @return
-     */
-    @GetMapping("")
-    public Result<HouseTargetEntity> getHouseTargetEntityById(Long businessId,String tid,String tno) {
-        HouseTargetEntity ret = houseTargetEntityService.getHouseTargetEntityById(businessId,tid,tno);
-        return Result.build(ret);
-    }
-
-    /**
-     * 删除实物状况信息
-     * @param id
-     * @return
-     */
-    @DeleteMapping("/{id}")
-    public Result<Boolean> removeHouseTargetEntityById(@PathVariable("id") Long id) {
-        return Result.build(houseTargetEntityService.removeById(id));
-    }
-
-    /**
-     * 复制到其他实物状况
-     * @param id
-     * @return
-     */
-    @GetMapping("/copy/{id}")
-    public Result<Boolean> copyHouseTargetEntity(@PathVariable("id") Long id){
-        Boolean ret = houseTargetEntityService.copyHouseTargetEntity(id);
-        return Result.build(ret);
-    }
-}

+ 0 - 35
biz-base/src/main/java/com/dayou/controller/TmplHouseParagraphController.java

@@ -1,35 +0,0 @@
-package com.dayou.controller;
-
-
-import com.dayou.entity.TmplHouseParagraph;
-import com.dayou.result.Result;
-import com.dayou.service.TmplHouseParagraphService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/tmplHouseParagraph")
-@Slf4j
-public class TmplHouseParagraphController {
-
-    @Autowired
-    private TmplHouseParagraphService tmplHouseParagraphService;
-
-    /**
-     * 查询章节内可用段落
-     * @param tmplHouseParagraph
-     * @return
-     */
-    @PostMapping("/get")
-    public Result<List<TmplHouseParagraph>> findByMoldAndChapter(@RequestBody TmplHouseParagraph tmplHouseParagraph) {
-        List<TmplHouseParagraph> list = tmplHouseParagraphService.findByMoldAndChapter(tmplHouseParagraph);
-        return Result.build(list);
-    }
-
-}

+ 7 - 5
biz-base/src/main/resources/application-local.yaml

@@ -66,11 +66,8 @@ oa-api-url: localhost:8088/api/
 
 file-net:
   # 基础配置
-  base-dir: E:\productivity-platform-files\
+  base-dir: /Users/wuwei/opt/temp/
   max-file-size: 102400
-  domain: http://127.0.0.1:8080/pp/dfs
-  # 图片
-  image: images\
   # 资产业务配置
   asset-template-report-path: assets\templates\report\
   asset-template-calculate-path: assets\templates\calculate\
@@ -79,4 +76,9 @@ file-net:
   house-guaranty-path: house/guaranty
   house-guaranty-template-path: house/guaranty/temp/
 
-posyspath: D:\pageoffice
+posyspath:  /Users/wuwei/pageoffice
+
+
+map:
+  url:  https://restapi.amap.com/v3/geocode/geo
+  key:  19c4734ab21efe7e377bf9065c47d9b2

+ 0 - 2
biz-base/src/test/java/com/dayou/AddressParser.java

@@ -7,14 +7,12 @@ import cn.hutool.json.JSONUtil;
 import com.dayou.dto.Address;
 import com.dayou.utils.AddressUtil;
 import com.dayou.utils.CollectionUtil;
-import com.dayou.utils.HouseDocumentUtil;
 
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
 import static com.dayou.enums.HouseTargetTableColumn.LOCATION;
-import static com.dayou.utils.HouseDocumentUtil.mergeAddress;
 
 public class AddressParser {
 

+ 0 - 37
biz-base/src/test/java/com/dayou/ConditionDocumentTest.java

@@ -1,48 +1,11 @@
 package com.dayou;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.dayou.entity.HouseGuarantyTarget;
-import com.dayou.service.CertificateLandUseService;
-import com.dayou.service.HouseGuarantyTargetService;
-import com.dayou.service.TmplHouseParagraphService;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
-import java.util.Arrays;
-import java.util.List;
-
-import static com.dayou.constants.HouseGuarantyDoc.NO;
 
 @SpringBootTest
 public class ConditionDocumentTest {
 
 
 
-    @Autowired
-    private TmplHouseParagraphService tmplHouseParagraphService;
-
-    @Autowired
-    private HouseGuarantyTargetService houseGuarantyTargetService;
-
-    @Autowired
-    private CertificateLandUseService certificateLandUseService;
-
-    /**
-     * 一般假设测试类
-     */
-    @Test
-    public void testYBJS() {
-        String cers [] = {"《不动产权证书》","《房屋所有权利证书》","《国有土地证书》"};
-        List<String> cersList = Arrays.asList(cers);
-        List<HouseGuarantyTarget> targets = houseGuarantyTargetService.list(new LambdaQueryWrapper<HouseGuarantyTarget>().eq(HouseGuarantyTarget::getDocId, 42));
-        //String ybjsResult = tmplHouseParagraphService.findYBJSResult(targets, NO, cersList);
-        //List<CertificateLandUse> landCerts = certificateLandUseService.list(new LambdaQueryWrapper<CertificateLandUse>().eq(CertificateLandUse::getBusinessId, 42));
-
-        //String wdsxjsResult = tmplHouseParagraphService.findWDSXJSResult(targets, landCerts);
-       //String bxyzjsResult = tmplHouseParagraphService.findBXYZJSResult(targets, cersList, "2024年2月23日");
-        String yjbujsResult = tmplHouseParagraphService.findYJBUJSResult(targets, cersList, false,"收益法");
-        System.out.println(yjbujsResult);
-
-    }
 }

File diff suppressed because it is too large
+ 0 - 90
biz-base/src/test/java/com/dayou/DynamicGenTableWordTest.java


File diff suppressed because it is too large
+ 0 - 140
biz-base/src/test/java/com/dayou/FreeMarkTest.java


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

@@ -46,6 +46,12 @@ public class HouseGuarantyDoc {
     public static final String TARGETS_DOCX = "targets_table.docx";
 
     /**
+     * 权属信息表table word
+     */
+    public static final String CERT_DOCX = "certificates_table.docx";
+
+
+    /**
      * 估价的假设和限制条件及使用报告说明
      */
     public static final String CONDITION_LETTER_TEMPLATE = "condition_letter.docx";

+ 17 - 1
common/src/main/java/com/dayou/constants/TableHTML.java

@@ -43,7 +43,7 @@ public class TableHTML {
                     "</span></p>" +
                     "</td>";
 
-    public static final String TABLE_STYLE = "width:100%;border-collapse:collapse; border-spacing:0; empty-cells:show;";
+    public static final String TABLE_STYLE = "width:100%;border-collapse:collapse; border-spacing:0; empty-cells:show;table-layout:fixed";
 
 
     public static final String TD_STYLE = "font-size:12px;font-family:宋体; " +
@@ -51,6 +51,22 @@ public class TableHTML {
             "background-color:transparent; padding-left:0.0035in; padding-right:0.0035in; padding-top:0in; padding-bottom:0in; " +
             "vertical-align:middle;";
 
+
+    public static final String TD_STYLE_1 = "font-size:6.5px;font-family:宋体;word-break: break-all; " +
+            "border:1px solid black; " +
+            "background-color:transparent; " +
+            "width:15px;";
+
+    public static final String TD_STYLE_2 = "font-size:6.5px;font-family:宋体;word-break: break-all; " +
+            "border:1px solid black; " +
+            "background-color:transparent; " +
+            "width:30px;";
+
+    public static final String TD_STYLE_3 = "font-size:6.5px;font-family:宋体;word-break: break-all; " +
+            "border:1px solid black; " +
+            "background-color:transparent; " +
+            "width:50px;";
+
     public static String P_SPAN = "<p style = \"text-align: center; text-indent: 0em; line-height: normal;\" ><span style=\"text-align: -webkit-center; text-wrap: wrap;\">content</span> </p> " ;
 
     public static final String SPAN_STYLE = "text-align: -webkit-center; text-wrap: wrap;";

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

@@ -16,14 +16,129 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.nio.file.Files;
 import java.nio.file.Paths;
+import java.text.DecimalFormat;
 import java.util.HashMap;
 import java.util.Map;
 
 import static com.dayou.result.Status.SYSTEM_ERROR;
+import static org.apache.poi.ss.usermodel.CellType.NUMERIC;
 
 
 public class EasyExcelUtil {
 
+    private static final Map<String,String> nameMap = new HashMap<>();
+
+    static {
+        nameMap.put("报告编号","docNo");
+        nameMap.put("估价项目名称","docName");
+        nameMap.put("估价委托人","consignor");
+        nameMap.put("不动产权利人","owner");
+        nameMap.put("注册房地产估价师1","appraiser1");
+        nameMap.put("注册房地产估价师2","appraiser2");
+        nameMap.put("注册号1","appraNo1");
+        nameMap.put("注册号2","appraNo2");
+        nameMap.put("估价报告出具日期","docDate");
+        nameMap.put("估价对象描述1","summary1");
+        nameMap.put("估价对象描述2","summary2");
+        nameMap.put("致函-估价目的","workPurpose");
+        nameMap.put("价值时点","valueTiming");
+        nameMap.put("价值类型","valueType");
+        nameMap.put("估价方法","workMethod");
+        nameMap.put("特别提示1","expeTip1");
+        nameMap.put("特别提示2","expeTip2");
+        nameMap.put("特别提示3","expeTip3");
+        nameMap.put("特别提示4","expeTip4");
+        nameMap.put("特别提示5","expeTip5");
+        nameMap.put("附件1","affix1");
+        nameMap.put("附件2","affix2");
+        nameMap.put("附件3","affix3");
+        nameMap.put("附件4","affix4");
+        nameMap.put("附件5","affix5");
+        nameMap.put("附件6","affix6");
+        nameMap.put("附件7","affix7");
+        nameMap.put("附件8","affix8");
+        nameMap.put("声明1","statement1");
+        nameMap.put("声明2","statement2");
+        nameMap.put("声明3","statement3");
+        nameMap.put("声明4","statement4");
+        nameMap.put("声明5","statement5");
+        nameMap.put("一般假设1","normalAssumption1");
+        nameMap.put("一般假设2","normalAssumption2");
+        nameMap.put("一般假设3","normalAssumption3");
+        nameMap.put("一般假设4","normalAssumption4");
+        nameMap.put("一般假设5","normalAssumption5");
+        nameMap.put("一般假设6","normalAssumption6");
+        nameMap.put("一般假设7","normalAssumption7");
+        nameMap.put("一般假设8","normalAssumption8");
+        nameMap.put("一般假设9","normalAssumption9");
+        nameMap.put("一般假设10","normalAssumption10");
+        nameMap.put("未定事项假设1","undefinedAssumption1");
+        nameMap.put("未定事项假设2","undefinedAssumption2");
+        nameMap.put("未定事项假设3","undefinedAssumption3");
+        nameMap.put("未定事项假设4","undefinedAssumption4");
+        nameMap.put("未定事项假设5","undefinedAssumption5");
+        nameMap.put("未定事项假设6","undefinedAssumption6");
+        nameMap.put("不相一致假设1","differentAssumption1");
+        nameMap.put("不相一致假设2","differentAssumption2");
+        nameMap.put("依据不足假设1","deficiencyAssumption1");
+        nameMap.put("依据不足假设2","deficiencyAssumption2");
+        nameMap.put("依据不足假设3","deficiencyAssumption3");
+        nameMap.put("依据不足假设4","deficiencyAssumption4");
+        nameMap.put("依据不足假设5","deficiencyAssumption5");
+        nameMap.put("限制条件1","limitCondition1");
+        nameMap.put("限制条件2","limitCondition2");
+        nameMap.put("限制条件3","limitCondition3");
+        nameMap.put("限制条件4","limitCondition4");
+        nameMap.put("限制条件5","limitCondition5");
+        nameMap.put("限制条件6","limitCondition6");
+        nameMap.put("限制条件7","limitCondition7");
+        nameMap.put("限制条件8","limitCondition8");
+        nameMap.put("使用本报告的一般说明1","normalExplain1");
+        nameMap.put("使用本报告的一般说明2","normalExplain2");
+        nameMap.put("使用本报告的一般说明3","normalExplain3");
+        nameMap.put("使用本报告的一般说明4","normalExplain4");
+        nameMap.put("使用本报告的一般说明5","normalExplain5");
+        nameMap.put("使用本报告的一般说明6","normalExplain6");
+        nameMap.put("使用本报告的一般说明7","normalExplain7");
+        nameMap.put("使用本报告的一般说明8","normalExplain8");
+        nameMap.put("使用本报告的一般说明9","normalExplain9");
+        nameMap.put("估价中的特殊处理事项1","expeHandle1");
+        nameMap.put("估价中的特殊处理事项2","expeHandle2");
+        nameMap.put("估价中的特殊处理事项3","expeHandle3");
+        nameMap.put("估价中的特殊处理事项4","expeHandle4");
+        nameMap.put("类型","consignorType");
+        nameMap.put("住所","consignorAddress");
+        nameMap.put("负责人","consignorPerson");
+        nameMap.put("注册资本","consignorMoney");
+        nameMap.put("统一社会信用代码","creditCode");
+        nameMap.put("四、估价对象及其范围","targetScope");
+        nameMap.put("四、建筑物实物状况","buildingInfo");
+        nameMap.put("四、土地实物状况","landInfo");
+        nameMap.put("四、担保物权状况","guarantyInfo");
+        nameMap.put("四、用益物权状况","remInfo");
+        nameMap.put("四、租赁或占用状况","rentInfo");
+        nameMap.put("五、价值时点2","valueTimingInfo");
+        nameMap.put("六、(二)价值内涵1","valueMeaning1");
+        nameMap.put("六、(二)价值内涵2","valueMeaning2");
+        nameMap.put("六、(二)价值内涵3","valueMeaning3");
+        nameMap.put("六、(二)价值内涵4","valueMeaning4");
+        nameMap.put("七、估价原则","principle");
+        nameMap.put("八、估价依据(一)","gist1");
+        nameMap.put("八、估价依据(二)","gist2");
+        nameMap.put("八、估价依据(三)","gist3");
+        nameMap.put("八、估价依据(四)","gist4");
+        nameMap.put("十、估价结果(一)","result1");
+        nameMap.put("已抵押担保的债权数额","pledgeValue");
+        nameMap.put("拖欠的建设工程价款","debtMoney");
+        nameMap.put("其他法定优先受偿款","firstMoney");
+        nameMap.put("合计","totalMoney");
+        nameMap.put("十、估价结果(三)","result3");
+        nameMap.put("十、估价结果(四)","result4");
+        nameMap.put("十二、实地查勘期","sceneDate");
+        nameMap.put("十三、估价作业期","workDate");
+
+    }
+
     /**
      * 填充动态数据到Excel
      *
@@ -267,7 +382,7 @@ public class EasyExcelUtil {
      */
     private static void copyCell(Cell srcCell, Cell desCell, Workbook targetWorkbook, Map<Short, Short> styleMap) {
         // 判断单元格值类型
-        if (srcCell.getCellType() == CellType.NUMERIC) {
+        if (srcCell.getCellType() == NUMERIC) {
             desCell.setCellValue(srcCell.getNumericCellValue());
         } else if (srcCell.getCellType() == CellType.STRING) {
             desCell.setCellValue(srcCell.getStringCellValue());
@@ -423,4 +538,58 @@ public class EasyExcelUtil {
         return cellValue;
     }
 
+    /**
+     * 读取EXCEL指定sheet、row 数据
+     *
+     * @param wb excel文件
+     * @param sheetName sheet名字
+     * @param row 目标行
+     * @return
+     */
+    public static Map<String, String> readExcelData(Workbook wb, String sheetName,int row) {
+        Map<String, String> valueMap = new HashMap<>();
+        Sheet sheet = wb.getSheet(sheetName);// 获取指定名称Sheet的内容
+        Row rowKey = null;
+        Row rowValue = null;
+        Cell cellKey = null;
+        Cell cellValue = null;
+        rowKey = sheet.getRow(0);
+        rowValue = sheet.getRow(row);
+        int lastColNum = rowKey.getLastCellNum();
+        FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
+        for (int colNum = 0; colNum <= lastColNum; colNum++) {
+            cellKey = rowKey.getCell(colNum);
+            cellValue = rowValue.getCell(colNum);
+            if (cellKey != null && StrUtil.isNotBlank(cellKey.toString())) {
+                String attr = nameMap.get(cellKey.getStringCellValue());
+                String value = "";
+                if (cellValue == null) {
+                    valueMap.put(attr, value);
+                }else {
+                    switch (cellValue.getCellType()) {
+                        case STRING:
+                            value = cellValue.getStringCellValue();
+                            break;
+                        case FORMULA: // 处理公式计算后的值,而非公式本身
+                            cellValue.setCellFormula(null);
+                            evaluator.evaluateFormulaCell(cellValue);
+                            if (cellValue.getCellType().equals(NUMERIC)){
+                                DecimalFormat df = new DecimalFormat("0");
+                                value = df.format(cellValue.getNumericCellValue());
+                            }else{
+                                value = cellValue.getStringCellValue();
+                            }
+
+                            break;
+                        default: // 对于其他类型,可以根据需要处理或忽略
+                            value = "Cell type not supported";
+                    }
+                    valueMap.put(attr, value);
+                }
+
+            }
+        }
+        return valueMap;
+    }
+
 }

File diff suppressed because it is too large
+ 2288 - 2289
common/src/main/java/com/dayou/utils/HouseDocumentUtil.java


+ 314 - 0
common/src/main/java/com/dayou/utils/HttpKit.java

@@ -0,0 +1,314 @@
+/**
+ * Copyright (c) 2015-2016, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.dayou.utils;
+
+
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.util.ContentCachingResponseWrapper;
+import org.springframework.web.util.WebUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class HttpKit {
+    private static final Pattern UUID_PATTERN = Pattern.compile("/\\w{8}(-\\w{4}){3}-\\w{12}");
+    private static final Pattern LONG_ID_PATTERN = Pattern.compile("/[0-9]\\d*");
+
+    private static final String UNKNOWN = "unknown";
+
+
+
+    /**
+     * 获取 HttpServletRequest
+     */
+    public static HttpServletResponse getResponse() {
+        HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+        return response;
+    }
+
+
+
+
+
+    /**
+     * 向指定URL发送GET方法的请求
+     *
+     * @param url   发送请求的URL
+     * @param param 请求参数
+     * @return URL 所代表远程资源的响应结果
+     */
+    public static String sendGet(String url, Map<String, String> param) {
+        String result = "";
+        BufferedReader in = null;
+        try {
+            StringBuffer query = new StringBuffer();
+
+            for (Map.Entry<String, String> kv : param.entrySet()) {
+                query.append(URLEncoder.encode(kv.getKey(), "UTF-8") + "=");
+                query.append(URLEncoder.encode(kv.getValue(), "UTF-8") + "&");
+            }
+            if (query.lastIndexOf("&") > 0) {
+                query.deleteCharAt(query.length() - 1);
+            }
+
+            String urlNameString = url + "?" + query.toString();
+            URL realUrl = new URL(urlNameString);
+            // 打开和URL之间的连接
+            URLConnection connection = realUrl.openConnection();
+            // 设置通用的请求属性
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 建立实际的连接
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 遍历所有的响应头字段
+            for (String key : map.keySet()) {
+                System.out.println(key + "--->" + map.get(key));
+            }
+            // 定义 BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(connection.getInputStream(),"UTF-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输入流
+        finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     *
+     * @param url   发送请求的 URL
+     * @param param 请求参数
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, Map<String, String> param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            String para = "";
+            for (String key : param.keySet()) {
+                para += (key + "=" + param.get(key) + "&");
+            }
+            if (para.lastIndexOf("&") > 0) {
+                para = para.substring(0, para.length() - 1);
+            }
+            String urlNameString = url + "?" + para;
+            URL realUrl = new URL(urlNameString);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(conn.getOutputStream());
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送 POST 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+
+    public static String sendPost(String url,Map<String, Object> param,String cookie){
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            String para = "";
+            for (String key : param.keySet()) {
+                para += (key + "=" + param.get(key) + "&");
+            }
+            if (para.lastIndexOf("&") > 0) {
+                para = para.substring(0, para.length() - 1);
+            }
+            String urlNameString = url + "?" + para;
+            URL realUrl = new URL(urlNameString);
+            // 打开和URL之间的连接
+            HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            conn.setRequestProperty("charset","UTF-8");
+            conn.setRequestProperty("Accept-Charset", "UTF-8");
+            conn.setRequestProperty("contentType","UTF-8");
+            conn.setRequestProperty("Cookie",cookie);
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+
+            // 获取URLConnection对象对应的输出流,设置utf-8编码
+            out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(),"UTF-8"));
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送 POST 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 打印返回参数
+     *
+     * @param response
+     */
+    public static String getResponseBody(ContentCachingResponseWrapper response) {
+        ContentCachingResponseWrapper wrapper = WebUtils.getNativeResponse(response,
+                ContentCachingResponseWrapper.class);
+        if (wrapper != null) {
+            byte[] buf = wrapper.getContentAsByteArray();
+            if (buf.length > 0) {
+                String payload;
+                try {
+                    payload = new String(buf, 0, buf.length, wrapper.getCharacterEncoding());
+                } catch (UnsupportedEncodingException e) {
+                    payload = "[unknown]";
+                }
+                return payload;
+            }
+        }
+        return "";
+    }
+
+    public static String getRequestApi(HttpServletRequest request) {
+        String path = request.getServletPath();
+        if (path == null) {
+            path = "";
+        }
+        path = UUID_PATTERN.matcher(path).replaceAll("/{id}");
+        path = LONG_ID_PATTERN.matcher(path).replaceAll("/{id}");
+
+        String method = request.getMethod();
+        if (method == null) {
+            method = "";
+        }
+
+        return method.toLowerCase() + ":" + path;
+    }
+
+    public static String getRequestApiWithNoId(HttpServletRequest request) {
+        String path = request.getServletPath();
+        if (path == null) {
+            path = "";
+        }
+        path = UUID_PATTERN.matcher(path).replaceAll("/{}");
+        path = LONG_ID_PATTERN.matcher(path).replaceAll("/{}");
+
+        String method = request.getMethod();
+        if (method == null) {
+            method = "";
+        }
+
+        return method.toLowerCase() + ":" + path;
+    }
+
+    /**
+     * 获取 IP地址
+     * 使用 Nginx等反向代理软件, 则不能通过 request.getRemoteAddr()获取 IP地址
+     * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,
+     * X-Forwarded-For中第一个非 unknown的有效IP字符串,则为真实IP地址
+     */
+    public static String getIpAddr(HttpServletRequest request) {
+        String ip = request.getHeader("x-forwarded-for");
+        if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+        }
+        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
+    }
+}

+ 58 - 10
common/src/main/java/com/dayou/utils/table/WordTableHelper.java

@@ -27,7 +27,7 @@ public class WordTableHelper {
      * @param html excel表格解析后的html代码
      * @return 生成的word表格的存储路径
      */
-    public String createTableWord(String html,String path){
+    public String createTableWord(String html,String path,String tableName){
         try {
             if (StrUtil.isNotBlank(html)){
                 RichObject richObject = new RichObject();
@@ -35,7 +35,7 @@ public class WordTableHelper {
                 RichHtmlHandler richHtmlHandler = WordGeneratorWithFreemarker.createRichHtmlHandler(richObject);
                 Map<String,String> data = new HashMap<>();
                 data.put("table", richHtmlHandler.getHandledDocBodyBlock());
-                String tablePath = path + TARGETS_DOCX;
+                String tablePath = path + tableName;
                 WordGeneratorWithFreemarker.createDoc("/",FTL_TEMPLATE,data,tablePath);
                 return tablePath;
             }
@@ -46,20 +46,13 @@ public class WordTableHelper {
         return null;
     }
 
-    public String htmlTableFormat(String srcHtml){
+    public String htmlTargetTableFormat(String srcHtml){
         Document document = Jsoup.parse(srcHtml);
-        removeActAddressCol(document);
-
         Elements table = document.getElementsByTag("table");
         table.attr("style",TABLE_STYLE);
         Elements td = document.select("table td");
         td.removeAttr("width");
         td.attr("style",TD_STYLE);
-        for (Element element : td){
-            String text = element.text();
-            element.text("");
-            element.append(P_SPAN.replace("content",text));
-        }
         return document.body().html();
     }
 
@@ -82,4 +75,59 @@ public class WordTableHelper {
         }
 
     }
+
+    public String htmlCertificateTableFormat(String certificateTableHtml) {
+        Document document = Jsoup.parse(certificateTableHtml);
+        Elements table = document.getElementsByTag("table");
+        table.attr("style",TABLE_STYLE);
+        Elements rows = table.select("tr");
+        for (int i = 0; i < rows.size(); i++){
+            Elements tds = rows.get(i).select("td");
+            for (int j = 0; j < tds.size(); j++){
+                if (j==0 || j==1 || j==3 || j==4){
+                    tds.get(j).attr("style",TD_STYLE_1);
+                }
+                else if (j==12){
+                    tds.get(j).attr("style",TD_STYLE_3);
+                }
+                else {
+                    tds.get(j).attr("style",TD_STYLE_2);
+                }
+            }
+            if (i!=0){
+                //合并权利性质列
+                Element td8 = tds.get(8);
+                Element td9 = tds.get(9);
+                Element td10 = tds.get(10);
+                td8.attr("colspan","3");
+                String colText1 = td8.text() + td9.text() + td10.text();
+                td8.text(colText1);
+                td9.remove();
+                td10.remove();
+                //合并用途列
+                Element td11 = tds.get(11);
+                Element td12 = tds.get(12);
+                Element td13 = tds.get(13);
+                td11.attr("colspan","3");
+                String colText2 = td11.text() + td12.text() + td13.text();
+                td11.text(colText2);
+                td12.remove();
+                td13.remove();
+                //合并面积列
+                Element td14 = tds.get(14);
+                Element td15 = tds.get(15);
+                Element td16 = tds.get(16);
+                Element td17 = tds.get(17);
+                Element td18 = tds.get(18);
+                td14.attr("colspan","5");
+                String colText3 = td14.text() + td15.text() + td16.text()+ td17.text() + td18.text();
+                td14.text(colText3);
+                td15.remove();
+                td16.remove();
+                td17.remove();
+                td18.remove();
+            }
+        }
+        return document.body().html();
+    }
 }

+ 0 - 1
dao/src/main/java/com/dayou/mapper/CertificateFixedAssetsMapper.java

@@ -2,7 +2,6 @@ package com.dayou.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.dayou.entity.CertificateFixedAssets;
-import com.dayou.entity.HouseGuarantyTarget;
 
 public interface CertificateFixedAssetsMapper extends BaseMapper<CertificateFixedAssets> {
 }

+ 2 - 0
dao/src/main/java/com/dayou/mapper/DocumentProductionMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.DocumentProductionQueryDTO;
 import com.dayou.entity.DocumentProduction;
+import com.dayou.entity.HouseGuarantyProcess;
 import org.apache.ibatis.annotations.Param;
 
 public interface DocumentProductionMapper extends BaseMapper<DocumentProduction> {
@@ -19,4 +20,5 @@ public interface DocumentProductionMapper extends BaseMapper<DocumentProduction>
     DocumentProduction getDocProdByBusinessId(@Param("businessId") Long businessId, @Param("businessSubId") Long businessSubId);
 
     Page<DocumentProduction> houseDocumentProduction(Page page, @Param("dto")DocumentProductionQueryDTO dto);
+
 }

+ 12 - 0
dao/src/main/java/com/dayou/mapper/HouseExcelDataMapper.java

@@ -0,0 +1,12 @@
+package com.dayou.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dayou.entity.HouseExcelData;
+import org.apache.ibatis.annotations.Param;
+
+public interface HouseExcelDataMapper extends BaseMapper<HouseExcelData> {
+
+    HouseExcelData getConditionDO(@Param("businessId") Long businessId);
+
+    HouseExcelData getResultReport(@Param("businessId") Long businessId);
+}

+ 0 - 10
dao/src/main/java/com/dayou/mapper/HouseGuarantyAimMapper.java

@@ -1,10 +0,0 @@
-package com.dayou.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.dayou.entity.HouseGuarantyAim;
-
-import java.util.List;
-
-public interface HouseGuarantyAimMapper extends BaseMapper<HouseGuarantyAim> {
-
-}

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

@@ -12,4 +12,6 @@ public interface HouseGuarantyAreaMapper extends BaseMapper<HouseGuarantyArea> {
     HouseGuarantyArea getByLngLat(@Param("lng") BigDecimal lng, @Param("lat") BigDecimal lat);
 
     List<HouseGuarantyArea> getAreasList(@Param("id") Long id);
+
+    List<HouseGuarantyArea> getAreaInfo(@Param("excelId") Long excelId);
 }

+ 0 - 10
dao/src/main/java/com/dayou/mapper/HouseGuarantyBaseMapper.java

@@ -1,10 +0,0 @@
-package com.dayou.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.dayou.entity.HouseGuarantyBase;
-import org.apache.ibatis.annotations.Param;
-
-public interface HouseGuarantyBaseMapper extends BaseMapper<HouseGuarantyBase> {
-
-    HouseGuarantyBase getByDocId(@Param("docId") Long docId);
-}

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

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.dayou.entity.HouseGuarantyProcess;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 房地产抵押过程表 Mapper 接口
@@ -14,4 +16,7 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface HouseGuarantyProcessMapper extends BaseMapper<HouseGuarantyProcess> {
 
+    HouseGuarantyProcess getProcessByDocId(@Param("docId") Long docId);
+
+    List<HouseGuarantyProcess> queryMaxCreateTimeDoc(@Param("home") String home);
 }

+ 0 - 12
dao/src/main/java/com/dayou/mapper/HouseGuarantyTargetMapper.java

@@ -1,12 +0,0 @@
-package com.dayou.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.dayou.entity.HouseGuarantyTarget;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-public interface HouseGuarantyTargetMapper extends BaseMapper<HouseGuarantyTarget> {
-
-    List<HouseGuarantyTarget> getList(@Param("docId") Long docId);
-}

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

@@ -1,15 +0,0 @@
-package com.dayou.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.dayou.dto.HouseRightsDTO;
-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);
-
-    List<HouseRightsDTO> getHouseRightsDTOList(@Param("docId")Long docId);
-}

+ 113 - 0
dao/src/main/resources/mapper/HouseExcelDataMapper.xml

@@ -0,0 +1,113 @@
+<?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.HouseExcelDataMapper">
+
+
+    <select id="getConditionDO" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseExcelData">
+        SELECT
+            appraiser1,
+            appraiser2,
+            appra_no1,
+            appra_no2,
+            doc_date,
+            normal_assumption1,
+            normal_assumption2,
+            normal_assumption3,
+            normal_assumption4,
+            normal_assumption5,
+            normal_assumption6,
+            normal_assumption7,
+            normal_assumption8,
+            normal_assumption9,
+            normal_assumption10,
+            undefined_assumption1,
+            undefined_assumption2,
+            undefined_assumption3,
+            undefined_assumption4,
+            undefined_assumption5,
+            undefined_assumption6,
+            different_assumption1,
+            different_assumption2,
+            deficiency_assumption1,
+            deficiency_assumption2,
+            deficiency_assumption3,
+            deficiency_assumption4,
+            deficiency_assumption5,
+            limit_condition1,
+            limit_condition2,
+            limit_condition3,
+            limit_condition4,
+            limit_condition5,
+            limit_condition6,
+            limit_condition7,
+            limit_condition8,
+            normal_explain1,
+            normal_explain2,
+            normal_explain3,
+            normal_explain4,
+            normal_explain5,
+            normal_explain6,
+            normal_explain7,
+            normal_explain8,
+            normal_explain9,
+            expe_handle1,
+            expe_handle2,
+            expe_handle3,
+            expe_handle4
+        FROM
+            house_excel_data
+        WHERE
+            id = #{businessId}
+          AND delete_status = 0
+    </select>
+
+    <select id="getResultReport" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseExcelData">
+        SELECT
+            doc_no,
+            consignor,
+            consignor_type,
+            consignor_address,
+            consignor_person,
+            consignor_money,
+            credit_code,
+            work_purpose,
+            target_scope,
+            building_info,
+            trim(land_info),
+            guaranty_info,
+            rem_info,
+            rent_info,
+            area_info,
+            value_timing,
+            value_timing_info,
+            value_type,
+            value_meaning1,
+            value_meaning2,
+            value_meaning3,
+            value_meaning4,
+            gist1,
+            gist2,
+            gist3,
+            gist4,
+            principle,
+            result1,
+            result3,
+            result4,
+            scene_date,
+            work_date,
+            appraiser1,
+            appraiser2,
+            appra_no1,
+            appra_no2,
+            excel_uri,
+            pledge_value,
+            debt_money,
+            first_money,
+            total_money
+        FROM
+            house_excel_data
+        WHERE
+            id = #{businessId}
+          AND delete_status = 0
+    </select>
+</mapper>

+ 0 - 6
dao/src/main/resources/mapper/HouseGuarantyAimMapper.xml

@@ -1,6 +0,0 @@
-<?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.HouseGuarantyAimMapper">
-
-
-</mapper>

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

@@ -30,4 +30,26 @@
                 )
         where hga.delete_status = 0 and hga.doc_id = #{id} order by hga.id asc
     </select>
+
+    <select id="getAreaInfo" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseGuarantyArea">
+        select
+            id,
+            excel_id,
+            tid,
+            lng,
+            lat,
+            location,
+            road as road1,
+            public_transport as publicTransport1,
+            park as park1,
+            business as business1,
+            community as community1,
+            education as education1,
+            hospital as hospital1,
+            bank as bank1,
+            hotel as hotel1,
+            spot as spot1,
+            doc_content
+        from house_guaranty_area where excel_id = #{excelId} and delete_status = 0
+    </select>
 </mapper>

+ 0 - 15
dao/src/main/resources/mapper/HouseGuarantyBaseMapper.xml

@@ -1,15 +0,0 @@
-<?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.HouseGuarantyBaseMapper">
-
-    <select id="getByDocId" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseGuarantyBase">
-        SELECT
-            *
-        FROM
-            house_guaranty_base
-        WHERE
-            id = ( SELECT base_id FROM house_guaranty_process WHERE id = ( SELECT business_id FROM document_production WHERE id = #{docId} AND delete_status = 0 ) AND delete_status = 0 )
-          AND delete_status = 0
-    </select>
-
-</mapper>

+ 16 - 0
dao/src/main/resources/mapper/HouseGuarantyProcessMapper.xml

@@ -2,5 +2,21 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.dayou.mapper.HouseGuarantyProcessMapper">
 
+    <select id="getProcessByDocId" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseGuarantyProcess">
+        select * from house_guaranty_process where excel_id = (select business_id from document_production where id = #{docId})
+    </select>
+
+    <select id="queryMaxCreateTimeDoc" parameterType="java.lang.String" resultType="com.dayou.entity.HouseGuarantyProcess">
+        SELECT
+            hgp.id,
+            hgp.doc_url,
+            hgp.process_name,
+            hgp.create_time
+        FROM
+            ( SELECT process_name, max( create_time ) AS ct FROM house_guaranty_process WHERE home = #{home} GROUP BY process_name ) mx
+                LEFT JOIN house_guaranty_process hgp ON (
+                mx.process_name = hgp.process_name
+                    AND mx.ct = hgp.create_time)
+    </select>
 
 </mapper>

+ 0 - 126
dao/src/main/resources/mapper/HouseGuarantyTargetMapper.xml

@@ -1,126 +0,0 @@
-<?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.HouseGuarantyTargetMapper">
-
-    <resultMap id="targetMap" type="com.dayou.entity.HouseGuarantyTarget">
-        <result column="id" property="id" />
-        <result column="dId" property="docId" />
-        <result column="tid" property="tid" />
-        <result column="is_part" property="isPart" />
-        <result column="has_building_year" property="hasBuildingYear" />
-        <result column="building_year" property="buildingYear" />
-        <result column="land_certificate_type" property="landCertificateType" />
-        <result column="land_use_to" property="landUseTo" />
-        <result column="land_expire_date" property="landExpireDate" />
-        <result column="share_acreage1" property="shareAcreage1" />
-        <result column="is_layer" property="isLayer" />
-        <result column="has_layer_image" property="hasLayerImage" />
-        <result column="floor1_acreage" property="floor1Acreage" />
-        <result column="floor2_acreage" property="floor2Acreage" />
-        <result column="floor3_acreage" property="floor3Acreage" />
-        <result column="is_address_same" property="isAddressSame" />
-        <result column="is_date_time_same" property="isDateTimeSame" />
-        <result column="is_address_certificate" property="isAddressCertificate" />
-        <result column="is_building_reduce_value" property="isBuildingReduceValue" />
-        <result column="has_origin_certificate" property="hasOriginCertificate" />
-        <result column="is_promise" property="isPromise" />
-        <result column="has_land_use_right_contract" property="hasLandUseRightContract" />
-        <result column="is_rent_out" property="isRentOut" />
-        <result column="has_rent_out_contract" property="hasRentOutContract" />
-        <result column="is_rent_limit" property="isRentLimit" />
-        <result column="not_rent_limit_reason" property="notRentLimitReason" />
-        <result column="rent_limit_reason" property="rentLimitReason" />
-        <result column="rent_end_date" property="rentEndDate" />
-        <result column="rent_start_date" property="rentStartDate" />
-        <result column="rent_money" property="rentMoney" />
-        <result column="rent_user" property="rentUser" />
-        <result column="has_pledge" property="hasPledge" />
-        <result column="pledge_type" property="pledgeType" />
-        <result column="pledge_user" property="pledgeUser" />
-        <result column="pledge_value" property="pledgeValue" />
-        <result column="same_pledge_continue" property="samePledgeContinue" />
-        <result column="new_pledge_user" property="newPledgeUser" />
-        <result column="high_pledge_not_expire" property="highPledgeNotExpire" />
-        <result column="same_pledge_high" property="samePledgeHigh" />
-        <result column="first_money" property="firstMoney" />
-        <result column="debt_money" property="debtMoney" />
-        <result column="is_take_out_first_money" property="isTakeOutFirstMoney" />
-        <result column="is_costing_share_method" property="isCostingShareMethod" />
-        <result column="no_building_house_nos" property="noBuildingHouseNos" />
-        <result column="explore_date" property="exploreDate" />
-        <result column="land_year_lower_house_year" property="landYearLowerHouseYear" />
-        <result column="is_promise_file" property="isPromiseFile" />
-        <result column="is_in_cheng_du" property="isInChengDu" />
-        <result column="house_get_land_info" property="houseGetLandInfo" />
-        <result column="land_use_type" property="landUseType" />
-        <result column="has_land_use_right" property="hasLandUseRight" />
-        <result column="has_living_right" property="hasLivingRight" />
-        <result column="land_use_right_from" property="landUseRightFrom" />
-        <result column="land_use_right_to" property="landUseRightTo" />
-        <collection property="aims" select="getAims" ofType="com.dayou.entity.HouseGuarantyAim"
-            column="{dId=dId,tid=tid}" />
-    </resultMap>
-
-    <select id="getList" parameterType="java.lang.Long" resultMap="targetMap">
-        select id,
-               #{docId} as dId,
-               tid,
-             is_part,
-               has_building_year,
-               building_year,
-               land_certificate_type,
-               land_use_to,
-                   land_expire_date,
-            share_acreage1,
-            is_layer,
-            has_layer_image,
-            floor1_acreage,
-            floor2_acreage,
-            floor3_acreage,
-            is_address_same,
-            is_date_time_same,
-            is_address_certificate,
-            is_building_reduce_value,
-            has_origin_certificate,
-            is_promise,
-            has_land_use_right_contract,
-            is_rent_out,
-            has_rent_out_contract,
-            is_rent_limit,
-            not_rent_limit_reason,
-            rent_limit_reason,
-            rent_end_date,
-            rent_start_date,
-            rent_money,
-            rent_user,
-            has_pledge,
-            pledge_user,
-            pledge_type,
-            pledge_value,
-            same_pledge_continue,
-            new_pledge_user,
-            high_pledge_not_expire,
-            same_pledge_high,
-            first_money,
-            debt_money,
-            is_take_out_first_money,
-            is_costing_share_method,
-            no_building_house_nos,
-            explore_date,
-            land_year_lower_house_year,
-            is_promise_file,
-            is_in_cheng_du,
-            house_get_land_info,
-            land_use_type,
-            has_land_use_right,
-                    has_living_right,
-                    land_use_right_from,
-                    land_use_right_to
-        from house_guaranty_target where doc_id = #{docId} and delete_status = 0
-    </select>
-
-    <select id="getAims" resultType="com.dayou.entity.HouseGuarantyAim">
-        select * from house_guaranty_aim where doc_id = #{dId} and tid = #{tid} and delete_status = 0
-    </select>
-
-</mapper>

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

@@ -1,66 +0,0 @@
-<?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.HouseTargetEntityMapper">
-
-    <select id="getListById" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseTargetEntity">
-        SELECT
-            hga.id as xId,
-            hga.doc_id as xDodId,
-            hga.tid as xTid,
-            hga.tno as xTno,
-            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_guaranty_aim hga left join
-                (select * 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 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.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.doc_id = cfa.business_id
-                    AND hte.tid = cfa.tid
-                    AND hte.tno = cfa.tno
-                )
-                                   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 hga.delete_status=0 and hga.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.doc_id,
-            hte.tid,
-            hte.tno,
-            hte.use_info,
-            hte.cert_combination as certType,
-            hgt.*
-        FROM
-            house_target_entity hte
-                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.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>
-
-</mapper>

+ 68 - 0
domain/src/main/java/com/dayou/doc/house/BaseInfoDO.java

@@ -0,0 +1,68 @@
+package com.dayou.doc.house;
+
+import lombok.Data;
+
+@Data
+public class BaseInfoDO {
+
+    /**
+     *报告编号
+     */
+    private String docNo;
+    /**
+     *报告项目名称
+     */
+    private String docName;
+    /**
+     *委托人
+     */
+    private String consignor;
+    /**
+     *不动产权利人
+     */
+    private String owner;
+    /**
+     *估价师1
+     */
+    private String appraiser1;
+    /**
+     *估价师2
+     */
+    private String appraiser2;
+    /**
+     *估价师1注册号
+     */
+    private String appraNo1;
+    /**
+     *估价师2注册号
+     */
+    private String appraNo2;
+    /**
+     *出具报告日期
+     */
+    private String docDate;
+    /**
+     *价值时点
+     */
+    private String valueTiming;
+    /**
+     *评估方法
+     */
+    private String workMethod;
+    /**
+     *估价对象描述1
+     */
+    private String summary1;
+    /**
+     *估价对象描述2
+     */
+    private String summary2;
+
+    /**
+     * 致函-估价目的
+     */
+    private String workPurpose;
+
+    private String excelUri;
+
+}

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

@@ -41,6 +41,11 @@ public class GuarantyResultDO {
     private String creditCode;
 
     /**
+     * 估价目的
+     */
+    private String workPurpose;
+
+    /**
      * 估价对象及范围
      */
     private String targetScope;
@@ -56,11 +61,90 @@ public class GuarantyResultDO {
     private String landInfo;
 
     /**
+     * 担保物权状况
+     */
+    private String guarantyInfo;
+
+    /**
+     * 用益物权状况
+     */
+    private String remInfo;
+
+    /**
+     * 租赁或占用情况
+     */
+    private String rentInfo;
+
+    /**
+     * 估价对象区位状况
+     */
+    private String areaInfo;
+
+    /**
      * 价值时点
      */
     private String valueTiming;
 
     /**
+     * 价值时点描述
+     */
+    private String valueTimingInfo;
+    /**
+     * 价值类型
+     */
+    private String valueType;
+    /**
+     * 价值内涵
+     */
+    private String valueMeaning;
+    /**
+     * 估价依据1
+     */
+    private String gist1;
+    /**
+     * 估价依据2
+     */
+    private String gist2;
+    /**
+     * 估价依据3
+     */
+    private String gist3;
+    /**
+     * 估价依据4
+     */
+    private String gist4;
+    /**
+     * 估价原则
+     */
+    private String principle;
+
+    /**
+     * 估价结果1
+     */
+    private String result1;
+    /**
+     * 估价结果2
+     */
+    private String result2;
+    /**
+     * 估价结果3
+     */
+    private String result3;
+    /**
+     * 估价结果4
+     */
+    private String result4;
+    /**
+     * 实地查勘期
+     */
+    private String sceneDate;
+    /**
+     * 估价作业期
+     */
+    private String workDate;
+
+
+    /**
      * 已抵押担保的债权数额(万元)
      */
     private String pledgeValue;
@@ -97,4 +181,6 @@ public class GuarantyResultDO {
      */
     private String appraNo2;
 
+    private String excelUri;
+
 }

+ 4 - 2
domain/src/main/java/com/dayou/dto/HouseGuarantyTableDTO.java

@@ -5,9 +5,11 @@ import lombok.Data;
 @Data
 public class HouseGuarantyTableDTO {
 
-    private String html;
+    private String targetTableHtml;
+
+    private String certificateTableHtml;
 
     private String homePath;
 
-    private Long baseId;
+    private Long excelId;
 }

+ 19 - 0
domain/src/main/java/com/dayou/dto/LngLatDTO.java

@@ -0,0 +1,19 @@
+package com.dayou.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class LngLatDTO {
+
+    /**
+     * 经度
+     */
+    private BigDecimal lng;
+
+    /**
+     * 纬度
+     */
+    private BigDecimal lat;
+}

+ 11 - 0
domain/src/main/java/com/dayou/dto/RoadDTO.java

@@ -0,0 +1,11 @@
+package com.dayou.dto;
+
+import lombok.Data;
+
+@Data
+public class RoadDTO {
+
+    private String name;
+
+    private String distance;
+}

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

@@ -47,6 +47,8 @@ public class CertificateFixedAssets extends BaseEntity {
     @WordTableColumn(name = "附记")
     private String attachInfo;
 
+    private String landAcreage;
+
     private Long createUserId;
 
 }

+ 464 - 0
domain/src/main/java/com/dayou/entity/HouseExcelData.java

@@ -0,0 +1,464 @@
+package com.dayou.entity;
+
+import com.dayou.common.BaseEntity;
+import lombok.Data;
+
+@Data
+public class HouseExcelData extends BaseEntity {
+
+    /**
+     * 报告业务类型
+     */
+    private String businessType;
+
+    /**
+     *报告编号
+     */
+    private String docNo;
+    /**
+     *报告项目名称
+     */
+    private String docName;
+    /**
+     *委托人
+     */
+    private String consignor;
+    /**
+     *不动产权利人
+     */
+    private String owner;
+    /**
+     *估价师1
+     */
+    private String appraiser1;
+    /**
+     *估价师2
+     */
+    private String appraiser2;
+    /**
+     *估价师1注册号
+     */
+    private String appraNo1;
+    /**
+     *估价师2注册号
+     */
+    private String appraNo2;
+    /**
+     *出具报告日期
+     */
+    private String docDate;
+    /**
+     *价值时点
+     */
+    private String valueTiming;
+    /**
+     *评估方法
+     */
+    private String workMethod;
+    /**
+     *估价对象描述1
+     */
+    private String summary1;
+    /**
+     *估价对象描述2
+     */
+    private String summary2;
+    /**
+     *致函-估价目的
+     */
+    private String workPurpose;
+    /**
+     *价值类型
+     */
+    private String valueType;
+    /**
+     *特别提示1
+     */
+    private String expeTip1;
+    /**
+     *特别提示2
+     */
+    private String expeTip2;
+    /**
+     *特别提示3
+     */
+    private String expeTip3;
+    /**
+     *特别提示4
+     */
+    private String expeTip4;
+    /**
+     *特别提示5
+     */
+    private String expeTip5;
+    /**
+     *附件1名称
+     */
+    private String affix1;
+    /**
+     *附件2名称
+     */
+    private String affix2;
+    /**
+     *附件3名称
+     */
+    private String affix3;
+    /**
+     *附件4名称
+     */
+    private String affix4;
+    /**
+     *附件5名称
+     */
+    private String affix5;
+    /**
+     *附件6名称
+     */
+    private String affix6;
+    /**
+     *附件7名称
+     */
+    private String affix7;
+    /**
+     *附件8名称
+     */
+    private String affix8;
+    /**
+     *声明1
+     */
+    private String statement1;
+    /**
+     *声明2
+     */
+    private String statement2;
+    /**
+     *声明3
+     */
+    private String statement3;
+    /**
+     *声明4
+     */
+    private String statement4;
+    /**
+     *声明5
+     */
+    private String statement5;
+    /**
+     *一般假设1
+     */
+    private String normalAssumption1;
+    /**
+     *一般假设2
+     */
+    private String normalAssumption2;
+    /**
+     *一般假设3
+     */
+    private String normalAssumption3;
+    /**
+     *一般假设4
+     */
+    private String normalAssumption4;
+    /**
+     *一般假设5
+     */
+    private String normalAssumption5;
+    /**
+     *一般假设6
+     */
+    private String normalAssumption6;
+    /**
+     *一般假设7
+     */
+    private String normalAssumption7;
+    /**
+     *一般假设8
+     */
+    private String normalAssumption8;
+    /**
+     *一般假设9
+     */
+    private String normalAssumption9;
+    /**
+     *一般假设10
+     */
+    private String normalAssumption10;
+    /**
+     *未定事项假设1
+     */
+    private String undefinedAssumption1;
+    /**
+     *未定事项假设2
+     */
+    private String undefinedAssumption2;
+    /**
+     *未定事项假设3
+     */
+    private String undefinedAssumption3;
+    /**
+     *未定事项假设4
+     */
+    private String undefinedAssumption4;
+    /**
+     *未定事项假设5
+     */
+    private String undefinedAssumption5;
+    /**
+     *未定事项假设6
+     */
+    private String undefinedAssumption6;
+    /**
+     *不相一致假设1
+     */
+    private String differentAssumption1;
+    /**
+     *不相一致假设2
+     */
+    private String differentAssumption2;
+    /**
+     *依据不足假设1
+     */
+    private String deficiencyAssumption1;
+    /**
+     *依据不足假设2
+     */
+    private String deficiencyAssumption2;
+    /**
+     *依据不足假设3
+     */
+    private String deficiencyAssumption3;
+    /**
+     *依据不足假设4
+     */
+    private String deficiencyAssumption4;
+    /**
+     *依据不足假设5
+     */
+    private String deficiencyAssumption5;
+    /**
+     *限制条件1
+     */
+    private String limitCondition1;
+    /**
+     *限制条件2
+     */
+    private String limitCondition2;
+    /**
+     *限制条件3
+     */
+    private String limitCondition3;
+    /**
+     *限制条件4
+     */
+    private String limitCondition4;
+    /**
+     *限制条件5
+     */
+    private String limitCondition5;
+    /**
+     *限制条件5
+     */
+    private String limitCondition6;
+    /**
+     *限制条件7
+     */
+    private String limitCondition7;
+    /**
+     *限制条件8
+     */
+    private String limitCondition8;
+    /**
+     *使用本报告的一般说明1
+     */
+    private String normalExplain1;
+    /**
+     *使用本报告的一般说明2
+     */
+    private String normalExplain2;
+    /**
+     *使用本报告的一般说明3
+     */
+    private String normalExplain3;
+    /**
+     *使用本报告的一般说明4
+     */
+    private String normalExplain4;
+    /**
+     *使用本报告的一般说明5
+     */
+    private String normalExplain5;
+    /**
+     *使用本报告的一般说明6
+     */
+    private String normalExplain6;
+    /**
+     *使用本报告的一般说明7
+     */
+    private String normalExplain7;
+    /**
+     *使用本报告的一般说明8
+     */
+    private String normalExplain8;
+    /**
+     *使用本报告的一般说明9
+     */
+    private String normalExplain9;
+    /**
+     *估价中的特殊处理事项1
+     */
+    private String expeHandle1;
+    /**
+     *估价中的特殊处理事项2
+     */
+    private String expeHandle2;
+    /**
+     *估价中的特殊处理事项3
+     */
+    private String expeHandle3;
+    /**
+     *估价中的特殊处理事项4
+     */
+    private String expeHandle4;
+
+    /**
+     *委托人类型
+     */
+    private String consignorType;
+    /**
+     *委托人住所
+     */
+    private String consignorAddress;
+    /**
+     *法定代表人
+     */
+    private String consignorPerson;
+    /**
+     *注册资本
+     */
+    private String consignorMoney;
+    /**
+     *统一社会信用代码
+     */
+    private String creditCode;
+    /**
+     *估价对象及范围
+     */
+    private String targetScope;
+    /**
+     *建筑物实物状况
+     */
+    private String buildingInfo;
+    /**
+     *土地实物状况
+     */
+    private String landInfo;
+    /**
+     *担保物权状况
+     */
+    private String guarantyInfo;
+    /**
+     *用益物权状况
+     */
+    private String remInfo;
+    /**
+     *租赁或占用情况
+     */
+    private String rentInfo;
+    /**
+     *估价对象区位状况
+     */
+    private String areaInfo;
+    /**
+     *价值时点描述
+     */
+    private String valueTimingInfo;
+    /**
+     *价值内涵1
+     */
+    private String valueMeaning1;
+
+    /**
+     *价值内涵2
+     */
+    private String valueMeaning2;
+
+    /**
+     *价值内涵3
+     */
+    private String valueMeaning3;
+
+    /**
+     *价值内涵4
+     */
+    private String valueMeaning4;
+    /**
+     *估价依据1
+     */
+    private String gist1;
+    /**
+     *估价依据2
+     */
+    private String gist2;
+    /**
+     *估价依据3
+     */
+    private String gist3;
+    /**
+     *估价依据4
+     */
+    private String gist4;
+    /**
+     *估价原则
+     */
+    private String principle;
+    /**
+     *估价结果1
+     */
+    private String result1;
+    /**
+     *估价结果3
+     */
+    private String result3;
+    /**
+     *估价结果4
+     */
+    private String result4;
+    /**
+     *实地查勘期
+     */
+    private String sceneDate;
+    /**
+     *估价作业期
+     */
+    private String workDate;
+    /**
+     *上传人USER_ID
+     */
+    private Long uploadUserId;
+    /**
+     *原始EXCEL资源路径
+     */
+    private String excelUri;
+
+    /**
+     * 已抵押担保的债权数额(万元)
+     */
+    private String pledgeValue;
+
+    /**
+     * 拖欠的建设工程价款(万元)
+     */
+    private String debtMoney;
+
+    /**
+     * 其他法定优先受偿款(万元)
+     */
+    private String firstMoney;
+
+    /**
+     * 合计(万元)
+     */
+    private String totalMoney;
+
+
+}

+ 0 - 44
domain/src/main/java/com/dayou/entity/HouseGuarantyAim.java

@@ -1,44 +0,0 @@
-package com.dayou.entity;
-
-import com.dayou.common.BaseEntity;
-import lombok.Data;
-
-
-@Data
-public class HouseGuarantyAim extends BaseEntity {
-
-    private Long docId;
-
-    private String tid;
-
-    private String tno;
-
-    private String certificateNo;
-
-    private String ownShipUser;
-
-    private String location;
-
-    private String atFloor;
-
-    private String structure;
-
-    private String useTo;
-
-    private String outerAcreage;
-
-    private String acreage;
-
-    private String price;
-
-    private String amount;
-
-    private String landCertificateNo;
-
-    private String landType;
-
-    private String actAddress;
-
-    private String lngLat;
-
-}

+ 45 - 13
domain/src/main/java/com/dayou/entity/HouseGuarantyArea.java

@@ -2,44 +2,46 @@ package com.dayou.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.dayou.common.BaseEntity;
+import com.dayou.dto.RoadDTO;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 @Data
 public class HouseGuarantyArea extends BaseEntity {
 
-    private Long docId;
+    private Long excelId;
 
     private String tid;
 
-    private String tno;
-
     private BigDecimal lng;
 
     private BigDecimal lat;
 
     private String location;
 
-    private String road;
+    private List<RoadDTO> road;
+
+    private List<String> publicTransport;
 
-    private String publicTransport;
+    private List<String> park;
 
-    private String park;
+    private List<String> business;
 
-    private String business;
+    private List<String> community;
 
-    private String community;
+    private List<String> education;
 
-    private String education;
+    private List<String> hospital;
 
-    private String hospital;
+    private List<String> bank;
 
-    private String bank;
+    private List<String> hotel;
 
-    private String hotel;
+    private List<String> spot;
 
-    private String spot;
+    private String docContent;
 
     @TableField(exist = false)
     private String atFloor;
@@ -49,4 +51,34 @@ public class HouseGuarantyArea extends BaseEntity {
 
     @TableField(exist = false)
     private String actAddress;
+
+    @TableField(exist = false)
+    private String road1;
+
+    @TableField(exist = false)
+    private String publicTransport1;
+
+    @TableField(exist = false)
+    private String park1;
+
+    @TableField(exist = false)
+    private String business1;
+
+    @TableField(exist = false)
+    private String community1;
+
+    @TableField(exist = false)
+    private String education1;
+
+    @TableField(exist = false)
+    private String hospital1;
+
+    @TableField(exist = false)
+    private String bank1;
+
+    @TableField(exist = false)
+    private String hotel1;
+
+    @TableField(exist = false)
+    private String spot1;
 }

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

@@ -1,170 +0,0 @@
-package com.dayou.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.dayou.common.BaseEntity;
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * 致委托人函 文档对象
- */
-@Data
-public class HouseGuarantyBase extends BaseEntity {
-
-    /**
-     * 估价项目名称
-     */
-    private String projectName;
-
-    /**
-     * 委托人
-     */
-    private String consignor;
-
-
-
-    /**
-     * 估价师1
-     */
-    private String appraiser1;
-
-    /**
-     * 估价师2
-     */
-    private String appraiser2;
-
-    /**
-     * 估价师1注册号
-     */
-    private String appraNo1;
-
-    /**
-     * 估价师2注册号
-     */
-    private String appraNo2;
-
-    /**
-     * 出具报告日期
-     */
-    private String docDate;
-
-    /**
-     * 报告号
-     */
-    private String docNo;
-
-    /**
-     * 价值时点
-     */
-    private String valueTiming;
-
-    /**
-     * 评估方法
-     */
-    private String methods;
-
-
-
-
-    /**
-     * 是否提供技术报告
-     */
-    private Boolean hasTechReport;
-
-    /**
-     * 是否是农商银行
-     */
-    private Boolean isNsBank;
-
-    /**
-     * 是否审核权属原件
-     */
-    private Boolean isCheckOriginCertificate;
-
-
-    /**
-     * 委托人类型
-     */
-    private String consignorType;
-
-    /**
-     * 委托人住所
-     */
-    private String consignorAddress;
-
-    /**
-     * 法定代表人
-     */
-    private String consignorPerson;
-
-    /**
-     * 委托人注册资本
-     */
-    private String consignorMoney;
-
-    /**
-     * 统一社会信用代码
-     */
-    private String creditCode;
-
-    private Boolean hasPledge;
-
-    private String pledgeUser;
-
-    private String pledgeType;
-
-    private String pledgeValue;
-
-    private Boolean samePledgeContinue;
-
-    private String newPledgeUser;
-
-    private Boolean highPledgeNotExpire;
-
-    private Boolean samePledgeHigh;
-
-    private String firstMoney;
-
-    private String debtMoney;
-
-    private Boolean isTakeOutFirstMoney;
-
-    private String landUseType;
-
-
-
-
-    /**
-     * 权利
-     */
-    @TableField(exist = false)
-    private String ownship;
-
-
-    /**
-     * 权利人是否为空
-     */
-    @TableField(exist = false)
-    private String ownshipBlank;
-
-    /**
-     * 地址描述
-     */
-    @TableField(exist = false)
-    private String actDesc;
-
-    /**
-     * 权利人
-     */
-    @TableField(exist = false)
-    private String ownshipUser;
-
-
-    @TableField(exist = false)
-    private List<String> methodList;
-
-    @TableField(exist = false)
-    private Long processId;
-
-}

+ 7 - 2
domain/src/main/java/com/dayou/entity/HouseGuarantyProcess.java

@@ -15,9 +15,9 @@ public class HouseGuarantyProcess extends BaseEntity implements Serializable {
     private Long parentId;
 
     /**
-     * 基本信息id
+     * excelId
      */
-    private Long baseId;
+    private Long excelId;
 
     /**
      * docHome
@@ -30,6 +30,11 @@ public class HouseGuarantyProcess extends BaseEntity implements Serializable {
     private String targetsHtml;
 
     /**
+     * 权属信息表代码
+     */
+    private String certificatesHtml;
+
+    /**
      * 过程节点
      */
     private String processName;

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

@@ -1,110 +0,0 @@
-package com.dayou.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.dayou.common.BaseEntity;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-@Data
-public class HouseGuarantyTarget extends BaseEntity implements Serializable {
-
-    private static final long serialVersionUID=1L;
-
-    private Long docId;
-
-    private String tid;
-
-    private String isPart;
-
-    private Boolean hasBuildingYear;
-
-    private String buildingYear;
-
-    private String landCertificateType;
-
-    private String landUseTo;
-
-    private String landExpireDate;
-
-    private String shareAcreage1;
-
-    private Boolean isLayer;
-
-    private Boolean hasLayerImage;
-
-    private String floor1Acreage;
-
-    private String floor2Acreage;
-
-    private String floor3Acreage;
-
-    private Boolean isAddressSame;
-
-    private Boolean isDateTimeSame;
-
-    private Boolean isAddressCertificate;
-
-    private Boolean isBuildingReduceValue;
-
-    private Boolean hasOriginCertificate;
-
-    private Boolean isPromise;
-
-    private Boolean hasLandUseRightContract;
-
-    private Boolean isRentOut;
-
-    private Boolean hasRentOutContract;
-
-    private Boolean isRentLimit;
-
-    private String notRentLimitReason;
-
-    private String rentLimitReason;
-
-    private String rentStartDate;
-
-    private String rentEndDate;
-
-    private String rentMoney;
-
-    private String rentUser;
-
-    private Boolean noBuildingHouseNos;
-
-    private String exploreDate;
-
-    private Boolean landYearLowerHouseYear;
-
-    private Boolean isPromiseFile;
-
-    private Boolean isInChengDu;
-
-    private Boolean houseGetLandInfo;
-
-    private String landUseType;
-
-    private Boolean hasLandUseRight;
-
-    private Boolean hasLivingRight;
-
-    private String landUseRightFrom;
-
-    private String landUseRightTo;
-
-    private Boolean isCostingShareMethod;
-
-    private String evaluateMethod;
-
-    private String useTo;
-
-    private String commonLevel;
-
-    private String independence;
-
-    @TableField(exist = false)
-    private List<HouseGuarantyAim> aims;
-
-}

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

@@ -1,96 +0,0 @@
-package com.dayou.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.dayou.common.BaseEntity;
-import lombok.Data;
-
-@Data
-public class HouseTargetEntity extends BaseEntity {
-
-    private Long docId;
-    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 Integer elevator;
-    private Boolean centerAirConditioning;
-    private Boolean autoSpray;
-    private Boolean smogEmergency;
-    private Boolean fireHydrant;
-    private Boolean netLine;
-    private Boolean visualSys;
-    private String buildingStructure;
-    private Boolean officeSmartSys;
-    private String baseFacility;
-    private String roomType;
-    private String roomHigh;
-    private String newPercentage;
-    private String livingroomGround;
-    private String livingroomTop;
-    private String livingroomWall;
-    private String livingroomOther;
-    private String bedroomGround;
-    private String bedroomTop;
-    private String bedroomWall;
-    private String bedroomOther;
-    private String bathroomGround;
-    private String bathroomTop;
-    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;
-    @TableField(exist = false)
-    private Long xId;
-    @TableField(exist = false)
-    private String xTid;
-    @TableField(exist = false)
-    private String xTno;
-}

+ 1 - 2
domain/src/main/java/com/dayou/enums/BusinessEnum.java

@@ -5,7 +5,7 @@ public enum BusinessEnum implements CodeMsgEnumInterface<String,String>{
 
     HOUSE_BUSINESS("HOUSE_BUSINESS","房地产", HouseSubBusiness.values()),
     HOUSE_GUARANTY_PROCESS("HOUSE_GUARANTY_PROCESS","房地产抵押节点",HouseGuarantyProcess.values()),
-    HOUSE_GUARANTY_RULES("HOUSE_GUARANTY_RULES","房地产抵押文档规则",HouseGuarantyRules.values())
+    HOUSE_GUARANTY_RULES("HOUSE_GUARANTY_RULES","房地产抵押文档规则",HouseGuarantyRules.values()),
     ;
     private String code;
 
@@ -67,7 +67,6 @@ public enum BusinessEnum implements CodeMsgEnumInterface<String,String>{
         STATEMENT_CONDITIONS_EXPLAIN("STATEMENT_CONDITIONS_EXPLAIN","《假设和限制条件及使用报告说明》","conditions"),
 
         GUARANTY_RESULT_REPORT("GUARANTY_RESULT_REPORT","《房地产抵押估价结果报告》","guarantyResult"),
-
         ;
 
         private String code;

+ 73 - 0
domain/src/main/java/com/dayou/vo/HouseGuarantyBaseVO.java

@@ -0,0 +1,73 @@
+package com.dayou.vo;
+
+import lombok.Data;
+
+
+@Data
+public class HouseGuarantyBaseVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 房地产业务
+     */
+    private String businessType;
+
+    /**
+     * 估价项目名称
+     */
+    private String docName;
+
+    /**
+     * 报告号
+     */
+    private String docNo;
+
+    /**
+     * 委托人
+     */
+    private String consignor;
+
+    /**
+     *不动产权利人
+     */
+    private String owner;
+    /**
+     *估价师1
+     */
+    private String appraiser1;
+    /**
+     *估价师2
+     */
+    private String appraiser2;
+    /**
+     *估价师1注册号
+     */
+    private String appraNo1;
+    /**
+     *估价师2注册号
+     */
+    private String appraNo2;
+
+    /**
+     *出具报告日期
+     */
+    private String docDate;
+    /**
+     *价值时点
+     */
+    private String valueTiming;
+    /**
+     *评估方法
+     */
+    private String workMethod;
+
+    /**
+     *原始EXCEL资源路径
+     */
+    private String excelUri;
+
+}

+ 0 - 14
domain/src/main/java/com/dayou/vo/HouseTargetVO.java

@@ -1,14 +0,0 @@
-package com.dayou.vo;
-
-import com.dayou.entity.HouseGuarantyAim;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class HouseTargetVO {
-
-    private String tId;
-
-    private List<HouseGuarantyAim> aims;
-}

+ 2 - 0
service/src/main/java/com/dayou/service/DocumentProductionService.java

@@ -26,4 +26,6 @@ public interface DocumentProductionService extends IService<DocumentProduction>
     DocumentProduction getDocProdByBusinessId(Long businessId, Long businessSubId);
 
     Page<DocumentProduction> houseDocumentProduction(DocumentProductionQueryDTO dto, Page page);
+
+    Long saveDocumentProductionByExcelId(Long excelId);
 }

+ 42 - 0
service/src/main/java/com/dayou/service/HouseExcelDataService.java

@@ -0,0 +1,42 @@
+package com.dayou.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.dayou.doc.house.BaseInfoDO;
+import com.dayou.doc.house.ConditionDO;
+import com.dayou.doc.house.GuarantyResultDO;
+import com.dayou.entity.HouseExcelData;
+import com.dayou.vo.HouseGuarantyBaseVO;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface HouseExcelDataService extends IService<HouseExcelData> {
+
+    /**
+     * 解析原始excel文件
+     * @param excel
+     * @return
+     */
+    Long analysisOriginExcelData(MultipartFile excel,String path);
+
+    /**
+     * 获取报告基本信息
+     * @param excelId
+     * @return
+     */
+    HouseGuarantyBaseVO getBaseInfo(Long excelId);
+
+    /**
+     * 文档baseInfo
+     * @param excelId
+     * @return
+     */
+    BaseInfoDO getBaseDO(Long excelId);
+
+    /**
+     * 从excelData中获取估价的假设和限制条件
+     * @param businessId
+     * @return
+     */
+    ConditionDO getConditionDO(Long businessId);
+
+    GuarantyResultDO getResultReport(Long businessId);
+}

+ 0 - 7
service/src/main/java/com/dayou/service/HouseGuarantyAimService.java

@@ -1,7 +0,0 @@
-package com.dayou.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.dayou.entity.HouseGuarantyAim;
-
-public interface HouseGuarantyAimService extends IService<HouseGuarantyAim> {
-}

+ 7 - 2
service/src/main/java/com/dayou/service/HouseGuarantyAreaService.java

@@ -1,6 +1,7 @@
 package com.dayou.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.dayou.dto.LngLatDTO;
 import com.dayou.entity.HouseGuarantyArea;
 
 import java.util.List;
@@ -9,7 +10,11 @@ public interface HouseGuarantyAreaService extends IService<HouseGuarantyArea> {
 
     HouseGuarantyArea getByLngLat(String lngLat);
 
-    HouseGuarantyArea getByDocIdTidTno(Long docId, String tid, String tno);
-
     List<HouseGuarantyArea> getAreasList(Long id);
+
+    List<HouseGuarantyArea> getAreaInfo(Long excelId);
+
+    LngLatDTO queryLngLat(String address);
+
+    Boolean updateArea(HouseGuarantyArea houseGuarantyArea);
 }

+ 0 - 11
service/src/main/java/com/dayou/service/HouseGuarantyBaseService.java

@@ -1,11 +0,0 @@
-package com.dayou.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.dayou.entity.HouseGuarantyBase;
-
-public interface HouseGuarantyBaseService extends IService<HouseGuarantyBase> {
-
-    Long add(HouseGuarantyBase base);
-
-    HouseGuarantyBase getByDocId(Long docId);
-}

+ 2 - 0
service/src/main/java/com/dayou/service/HouseGuarantyProcessService.java

@@ -1,6 +1,7 @@
 package com.dayou.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.dayou.entity.DocumentProduction;
 import com.dayou.entity.HouseGuarantyProcess;
 import com.dayou.vo.ProcessVO;
 
@@ -20,4 +21,5 @@ public interface HouseGuarantyProcessService extends IService<HouseGuarantyProce
 
     List<ProcessVO> getHouseGuarantyProcesses(Long id);
 
+    Boolean houseGuarantyMerge(Long id) throws Exception;
 }

+ 11 - 18
service/src/main/java/com/dayou/service/HouseGuarantyService.java

@@ -2,8 +2,7 @@ package com.dayou.service;
 
 
 import com.dayou.dto.HouseGuarantyTableDTO;
-import com.dayou.entity.HouseGuarantyBase;
-import com.dayou.vo.HouseTargetVO;
+import com.dayou.entity.HouseGuarantyProcess;
 
 import java.io.IOException;
 import java.util.List;
@@ -20,26 +19,13 @@ public interface HouseGuarantyService {
     Long createTableWord(HouseGuarantyTableDTO houseGuarantyTableDTO);
 
     /**
-     * 解析表单1
-     * @param processId
-     * @return
-     */
-    Long analysisCollect1(Long processId) throws Exception;
-
-    /**
      * 生成致委托人函
-     * @param pId
-     * @param docId
+     * @param excelId
      * @return
      */
-    Boolean genConsignorLetter(Long pId,Long docId);
+    Boolean genConsignorLetter(Long excelId,Long processId) throws Exception;
+
 
-    /**
-     * 获取估价对象
-     * @param id
-     * @return
-     */
-    List<HouseTargetVO> getTargetsById(Long id);
 
     /**
      * 生成《估价的假设和限制条件及使用报告说明》
@@ -69,4 +55,11 @@ public interface HouseGuarantyService {
      * @return
      */
     Integer getCertificateCombination(Long businessId,String tid,String tno);
+
+    /**
+     * 查询权属信息表代码
+     * @param businessId
+     * @return
+     */
+    HouseGuarantyProcess getCertificatesHtml(Long businessId);
 }

+ 0 - 9
service/src/main/java/com/dayou/service/HouseGuarantyTargetService.java

@@ -1,9 +0,0 @@
-package com.dayou.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.dayou.entity.HouseGuarantyTarget;
-
-public interface HouseGuarantyTargetService extends IService<HouseGuarantyTarget>  {
-
-    HouseGuarantyTarget getTarget(Long docId, String tId);
-}

+ 0 - 20
service/src/main/java/com/dayou/service/HouseTargetEntityService.java

@@ -1,20 +0,0 @@
-package com.dayou.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.dayou.dto.HouseRightsDTO;
-import com.dayou.entity.HouseTargetEntity;
-
-import java.util.List;
-
-public interface HouseTargetEntityService extends IService<HouseTargetEntity> {
-
-    Long addHouseTargetEntity(HouseTargetEntity houseTargetEntity);
-
-    HouseTargetEntity getHouseTargetEntityById(Long businessId, String tid, String tno);
-
-    Boolean copyHouseTargetEntity(Long id);
-
-    List<HouseRightsDTO> getHouseRightsDTOList(Long businessId);
-
-    List<HouseTargetEntity> getListById(Long id);
-}

+ 0 - 63
service/src/main/java/com/dayou/service/TmplHouseParagraphService.java

@@ -1,63 +0,0 @@
-package com.dayou.service;
-
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.dayou.entity.CertificateLandUse;
-import com.dayou.entity.HouseGuarantyBase;
-import com.dayou.entity.HouseGuarantyTarget;
-import com.dayou.entity.TmplHouseParagraph;
-
-import java.util.List;
-
-public interface TmplHouseParagraphService extends IService<TmplHouseParagraph> {
-
-    List<TmplHouseParagraph> findByMoldAndChapter(TmplHouseParagraph tmplHouseParagraph);
-
-    /**
-     * 生成一般假设最终结果
-     */
-    String findYBJSResult(List<HouseGuarantyTarget> targets,Boolean isCheckOriginCertificate, List<String> certificates);
-
-    /**
-     * 生成未定事项假设最终结果
-     * @param targets
-     */
-    String findWDSXJSResult(List<HouseGuarantyTarget> targets, List<CertificateLandUse> landCerts );
-
-    /**
-     * 生成不相一致假设结果
-     * @param targets
-     * @param certificates
-     * @param valueTiming
-     * @return
-     */
-    String findBXYZJSResult(List<HouseGuarantyTarget> targets, List<String> certificates, String valueTiming);
-
-    /**
-     * 生成依据不足假设结果
-     * @param targets
-     * @return
-     */
-    String findYJBUJSResult(List<HouseGuarantyTarget> targets,List<String> certificates,Boolean isCheckOriginCertificate,String methods);
-
-    /**
-     * 生成限制条件结果
-     * @param targets
-     * @return
-     */
-    String findLimitConditionResult(List<HouseGuarantyTarget> targets, HouseGuarantyBase base, List<String> certificates);
-
-    /**
-     * 生成使用报告说明
-     * @param targets
-     * @return
-     */
-    String findUseReportExplain(List<HouseGuarantyTarget> targets);
-
-    /**
-     * 生成 估价中的特殊处理事项
-     * @param targets
-     * @return
-     */
-    String findSpecialHandle(List<HouseGuarantyTarget> targets,HouseGuarantyBase base);
-}

+ 0 - 4
service/src/main/java/com/dayou/service/impl/CertificateHouseOwnServiceImpl.java

@@ -5,11 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.entity.CertificateHouseOwn;
 import com.dayou.mapper.CertificateHouseOwnMapper;
 import com.dayou.service.CertificateHouseOwnService;
-import com.dayou.service.HouseGuarantyService;
-import com.dayou.service.HouseTargetEntityService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Collections;
 import java.util.List;

+ 25 - 0
service/src/main/java/com/dayou/service/impl/DocumentProductionServiceImpl.java

@@ -1,15 +1,23 @@
 package com.dayou.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.dto.DocumentProductionQueryDTO;
 import com.dayou.entity.DocumentProduction;
+import com.dayou.enums.BusinessEnum;
+import com.dayou.enums.DocumentType;
 import com.dayou.mapper.DocumentProductionMapper;
 import com.dayou.service.DocumentProductionService;
+import com.dayou.service.HouseExcelDataService;
+import com.dayou.vo.HouseGuarantyBaseVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import static com.dayou.enums.BusinessEnum.HouseSubBusiness.GUARANTY;
+
 @Service
 public class DocumentProductionServiceImpl extends ServiceImpl<DocumentProductionMapper, DocumentProduction>
         implements DocumentProductionService {
@@ -17,6 +25,9 @@ public class DocumentProductionServiceImpl extends ServiceImpl<DocumentProductio
     @Autowired
     private DocumentProductionMapper documentProductionMapper;
 
+    @Autowired
+    private HouseExcelDataService houseExcelDataService;
+
     @Override
     public Page<DocumentProduction> getPage(DocumentProductionQueryDTO dto, Page page) {
         return  documentProductionMapper.getPage(page,dto);
@@ -51,4 +62,18 @@ public class DocumentProductionServiceImpl extends ServiceImpl<DocumentProductio
     public Page<DocumentProduction> houseDocumentProduction(DocumentProductionQueryDTO dto, Page page) {
         return documentProductionMapper.houseDocumentProduction(page,dto);
     }
+
+    @Override
+    public Long saveDocumentProductionByExcelId(Long excelId) {
+        HouseGuarantyBaseVO baseInfo = houseExcelDataService.getBaseInfo(excelId);
+        DocumentProduction documentProduction = new DocumentProduction();
+        BeanUtil.copyProperties(baseInfo,documentProduction);
+        documentProduction.setBusinessId(excelId);
+        documentProduction.setDocType(DocumentType.REPORT.getName());
+        documentProduction.setBusinessCate(GUARANTY.getMsg());
+        documentProduction.setCreateUserId(StpUtil.getLoginIdAsLong());
+        documentProduction.setBusinessType(BusinessEnum.HOUSE_BUSINESS.getMsg());
+        this.save(documentProduction);
+        return documentProduction.getId();
+    }
 }

+ 330 - 0
service/src/main/java/com/dayou/service/impl/HouseExcelDataServiceImpl.java

@@ -0,0 +1,330 @@
+package com.dayou.service.impl;
+
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dayou.common.BaseEntity;
+import com.dayou.doc.house.BaseInfoDO;
+import com.dayou.doc.house.ConditionDO;
+import com.dayou.doc.house.GuarantyResultDO;
+import com.dayou.dto.LngLatDTO;
+import com.dayou.entity.CertificateFixedAssets;
+import com.dayou.entity.HouseExcelData;
+import com.dayou.entity.HouseGuarantyArea;
+import com.dayou.enums.BusinessEnum;
+import com.dayou.mapper.HouseExcelDataMapper;
+import com.dayou.mapper.HouseGuarantyAreaMapper;
+import com.dayou.service.CertificateFixedAssetsService;
+import com.dayou.service.HouseExcelDataService;
+import com.dayou.service.HouseGuarantyAreaService;
+import com.dayou.utils.EasyExcelUtil;
+import com.dayou.vo.HouseGuarantyBaseVO;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import static org.apache.poi.ss.usermodel.CellType.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+@Service
+public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper, HouseExcelData> implements HouseExcelDataService {
+
+    @Autowired
+    private CertificateFixedAssetsService certificateFixedAssetsService;
+    @Autowired
+    private HouseExcelDataMapper houseExcelDataMapper;
+    @Autowired
+    private HouseGuarantyAreaService houseGuarantyAreaService;
+
+    @Override
+    public Long analysisOriginExcelData(MultipartFile excel,String path) {
+        XSSFWorkbook workbook = null;
+        try {
+            workbook = new XSSFWorkbook(excel.getInputStream());
+            Long excelId = doMainContent(workbook, path);
+            doTargetAreaInfo(workbook,excelId);
+            return excelId;
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public HouseGuarantyBaseVO getBaseInfo(Long excelId) {
+        HouseExcelData base = getBase(excelId);
+        return BeanUtil.copyProperties(base, HouseGuarantyBaseVO.class);
+    }
+
+    @Override
+    public BaseInfoDO getBaseDO(Long excelId) {
+        HouseExcelData base = getBase(excelId);
+        return BeanUtil.copyProperties(base, BaseInfoDO.class);
+    }
+
+    @Override
+    public ConditionDO getConditionDO(Long businessId) {
+        HouseExcelData hed = houseExcelDataMapper.getConditionDO(businessId);
+        ConditionDO condition = BeanUtil.copyProperties(hed, ConditionDO.class);
+        //一般假设
+        StringBuffer normalAssumptions = new StringBuffer();
+        normalAssumptions.append(hed.getNormalAssumption1()).append("\n")
+                .append(hed.getNormalAssumption2()).append("\n")
+                .append(hed.getNormalAssumption3()).append("\n")
+                .append(hed.getNormalAssumption4()).append("\n")
+                .append(hed.getNormalAssumption5()).append("\n")
+                .append(hed.getNormalAssumption6()).append("\n")
+                .append(hed.getNormalAssumption7()).append("\n")
+                .append(hed.getNormalAssumption8()).append("\n")
+                .append(hed.getNormalAssumption9()).append("\n")
+                .append(hed.getNormalAssumption10());
+        condition.setYBJS(normalAssumptions.toString());
+        //未定事项假设
+        StringBuffer undefinedAssumptions = new StringBuffer();
+        undefinedAssumptions.append(hed.getUndefinedAssumption1()).append("\n")
+                .append(hed.getUndefinedAssumption2()).append("\n")
+                .append(hed.getUndefinedAssumption3()).append("\n")
+                .append(hed.getUndefinedAssumption4()).append("\n")
+                .append(hed.getUndefinedAssumption5()).append("\n")
+                .append(hed.getUndefinedAssumption6());
+        condition.setWDSXJS(undefinedAssumptions.toString());
+        //不相一致假设
+        StringBuffer differentAssumptions = new StringBuffer();
+        differentAssumptions.append(hed.getDifferentAssumption1()).append("\n")
+                .append(hed.getDifferentAssumption2());
+        condition.setBXYZJS(differentAssumptions.toString());
+        //依据不足假设
+        StringBuffer deficiencyAssumptions = new StringBuffer();
+        deficiencyAssumptions.append(hed.getDeficiencyAssumption1()).append("\n")
+                .append(hed.getDeficiencyAssumption2()).append("\n")
+                .append(hed.getDeficiencyAssumption3()).append("\n")
+                .append(hed.getDeficiencyAssumption4()).append("\n")
+                .append(hed.getDeficiencyAssumption5());
+        condition.setYJBZJS(deficiencyAssumptions.toString());
+        //限制条件
+        StringBuffer limitConditions = new StringBuffer();
+        limitConditions.append(hed.getLimitCondition1()).append("\n")
+                .append(hed.getLimitCondition2()).append("\n")
+                .append(hed.getLimitCondition3()).append("\n")
+                .append(hed.getLimitCondition4()).append("\n")
+                .append(hed.getLimitCondition5()).append("\n")
+                .append(hed.getLimitCondition6()).append("\n")
+                .append(hed.getLimitCondition7()).append("\n")
+                .append(hed.getLimitCondition8());
+        condition.setXZTJ(limitConditions.toString());
+        //使用本报告的一般说明
+        StringBuffer normalExplain = new StringBuffer();
+        normalExplain.append(hed.getNormalExplain1()).append("\n")
+                .append(hed.getNormalExplain2()).append("\n")
+                .append(hed.getNormalExplain3()).append("\n")
+                .append(hed.getNormalExplain4()).append("\n")
+                .append(hed.getNormalExplain5()).append("\n")
+                .append(hed.getNormalExplain6()).append("\n")
+                .append(hed.getNormalExplain7()).append("\n")
+                .append(hed.getNormalExplain8()).append("\n")
+                .append(hed.getNormalExplain9());
+        condition.setSYBGSM(normalExplain.toString());
+        //估价中的特殊处理事项
+        StringBuffer expeHandle = new StringBuffer();
+        expeHandle.append(hed.getExpeHandle1()).append("\n")
+                .append(hed.getExpeHandle2()).append("\n")
+                .append(hed.getExpeHandle3()).append("\n")
+                .append(hed.getExpeHandle4());
+        condition.setTSSXCL(expeHandle.toString());
+        return condition;
+    }
+
+    @Override
+    public GuarantyResultDO getResultReport(Long businessId) {
+        HouseExcelData hed = houseExcelDataMapper.getResultReport(businessId);
+        GuarantyResultDO guarantyResultDO = BeanUtil.copyProperties(hed, GuarantyResultDO.class);
+        StringBuffer valueMeanings = new StringBuffer();
+        valueMeanings.append(hed.getValueMeaning1()).append("\n")
+                .append(hed.getValueMeaning2()).append("\n")
+                .append(hed.getValueMeaning3()).append("\n")
+                .append(hed.getValueMeaning4());
+        guarantyResultDO.setValueMeaning(valueMeanings.toString());
+
+        //获取估价对象区位状况描述
+        List<HouseGuarantyArea> areas = houseGuarantyAreaService.list(new LambdaQueryWrapper<HouseGuarantyArea>().eq(HouseGuarantyArea::getExcelId, businessId)
+                .select(HouseGuarantyArea::getDocContent).eq(BaseEntity::getDeleteStatus, false).orderByAsc(HouseGuarantyArea::getId));
+        StringBuffer docContent = new StringBuffer();
+        for (int i = 0; i < areas.size(); i++) {
+            if (i!= areas.size()-1){
+                docContent.append("\t").append(areas.get(i).getDocContent()).append("\n");
+            }else {
+                docContent.append("\t").append(areas.get(i).getDocContent());
+            }
+
+        }
+        guarantyResultDO.setAreaInfo(docContent.toString());
+        return guarantyResultDO;
+    }
+
+
+    private HouseExcelData getBase(Long excelId) {
+        LambdaQueryWrapper<HouseExcelData> queryWrapper = new LambdaQueryWrapper<HouseExcelData>().eq(HouseExcelData::getId, excelId)
+                .select(BaseEntity::getId,
+                        HouseExcelData::getDocName,
+                        HouseExcelData::getDocNo,
+                        HouseExcelData::getBusinessType,
+                        HouseExcelData::getConsignor,
+                        HouseExcelData::getOwner,
+                        HouseExcelData::getAppraiser1,
+                        HouseExcelData::getAppraiser2,
+                        HouseExcelData::getAppraNo1,
+                        HouseExcelData::getAppraNo2,
+                        HouseExcelData::getDocDate,
+                        HouseExcelData::getValueTiming,
+                        HouseExcelData::getWorkMethod,
+                        HouseExcelData::getWorkPurpose,
+                        HouseExcelData::getSummary1,
+                        HouseExcelData::getSummary2,
+                        HouseExcelData::getWorkPurpose,
+                        HouseExcelData::getExcelUri);
+        return this.getOne(queryWrapper);
+    }
+
+    /**
+     * 解析正文内容
+     * @param workbook
+     * @param path
+     * @return
+     */
+    private Long doMainContent(XSSFWorkbook workbook,String path ){
+        Map<String, String> excelData = EasyExcelUtil.readExcelData(workbook, "正文内容", 1);
+        HouseExcelData houseExcelData = BeanUtil.fillBeanWithMap(excelData, new HouseExcelData(), true);
+        houseExcelData.setBusinessType(BusinessEnum.HouseSubBusiness.GUARANTY.getCode());
+        houseExcelData.setUploadUserId(StpUtil.getLoginIdAsLong());
+        houseExcelData.setExcelUri(path);
+        this.save(houseExcelData);
+        return houseExcelData.getId();
+    }
+
+    /**
+     * 解析权属证件信息
+     * @param workbook
+     */
+    private void doCertificates(XSSFWorkbook workbook,Long businessId){
+        Sheet sheet = workbook.getSheet("权属信息");
+        int lastRowNum = sheet.getLastRowNum();
+        List<CertificateFixedAssets> certificates = new ArrayList<>();
+        for (int row = 3; row <= lastRowNum; row++) {
+            CertificateFixedAssets certificate = new CertificateFixedAssets();
+            Row rowValue = sheet.getRow(row);
+            //估价对象
+            Cell cell0 = rowValue.getCell(0);
+            certificate.setTid(cell0.getStringCellValue());
+            //序号
+            Cell cell1 = rowValue.getCell(1);
+            if (NUMERIC.equals(cell1.getCellType())){
+                certificate.setTno(String.valueOf(cell1.getNumericCellValue()));
+            }else {
+                certificate.setTno(cell1.getStringCellValue());
+            }
+            //不动产权证书号
+            Cell cell2 = rowValue.getCell(2);
+            certificate.setCertificateNo(cell2.getStringCellValue());
+            //权利人
+            Cell cell3 = rowValue.getCell(3);
+            certificate.setOwnShipUser(cell3.getStringCellValue());
+            //共有情况
+            Cell cell4 = rowValue.getCell(4);
+            certificate.setOwnShipInfo(cell4.getStringCellValue());
+            //坐落
+            Cell cell5 = rowValue.getCell(5);
+            certificate.setLocation(cell5.getStringCellValue());
+            //不动产单元号
+            Cell cell6 = rowValue.getCell(6);
+            certificate.setUnitNo(cell6.getStringCellValue());
+            //权利类型
+            Cell cell7 = rowValue.getCell(7);
+            certificate.setOwnShipType(cell7.getStringCellValue());
+            //权利性质
+            Cell cell8 = rowValue.getCell(8);
+            Cell cell9 = rowValue.getCell(9);
+            Cell cell10 = rowValue.getCell(10);
+            certificate.setOwnShipNature(cell8.getStringCellValue()+cell9.getStringCellValue()+cell10.getStringCellValue());
+            //用途
+            Cell cell11 = rowValue.getCell(11);
+            Cell cell12 = rowValue.getCell(12);
+            Cell cell13 = rowValue.getCell(13);
+            certificate.setUseTo(cell11.getStringCellValue()+cell12.getStringCellValue()+cell13.getStringCellValue());
+            //面积
+            Cell cell14 = rowValue.getCell(14);
+            Cell cell15 = rowValue.getCell(15);
+            String acreage = "";
+            if (NUMERIC.equals(cell15.getCellType())){
+                acreage = String.valueOf(cell15.getNumericCellValue());
+            }else {
+                acreage = cell15.getStringCellValue();
+            }
+            Cell cell16 = rowValue.getCell(16);
+            Cell cell17 = rowValue.getCell(17);
+            String acreage1 = "";
+            if (NUMERIC.equals(cell17.getCellType())){
+                acreage1 = String.valueOf(cell17.getNumericCellValue());
+            }else {
+                acreage1 = cell17.getStringCellValue();
+            }
+            Cell cell18 = rowValue.getCell(18);
+            certificate.setAcreageDesc(cell14.getStringCellValue()+acreage+cell16.getStringCellValue()
+                +acreage1+cell18.getStringCellValue());
+            //使用期限
+            Cell cell19 = rowValue.getCell(19);
+            certificate.setExpireDateDesc(cell19.getStringCellValue());
+            //权利其他状况
+            Cell cell20 = rowValue.getCell(20);
+            certificate.setOwnShipOtherInfo(cell20.getStringCellValue());
+            //附记
+            Cell cell21 = rowValue.getCell(21);
+            certificate.setAttachInfo(cell21.getStringCellValue());
+            //分摊土地面积
+            Cell cell22 = rowValue.getCell(22);
+            if (NUMERIC.equals(cell22.getCellType())){
+                certificate.setLandAcreage(String.valueOf(cell22.getNumericCellValue()));
+            }else {
+                certificate.setLandAcreage(cell22.getStringCellValue());
+            }
+            certificate.setBusinessType(BusinessEnum.HOUSE_BUSINESS.getMsg());
+            certificate.setBusinessId(businessId);
+            certificate.setCreateUserId(StpUtil.getLoginIdAsLong());
+            certificates.add(certificate);
+        }
+        certificateFixedAssetsService.saveBatch(certificates);
+    }
+
+    private void doTargetAreaInfo(XSSFWorkbook workbook,Long excelId) throws InterruptedException {
+        Sheet sheet = workbook.getSheet("估价对象描述");
+        int lastRowNum = sheet.getLastRowNum();
+        List<HouseGuarantyArea> houseGuarantyAreas = new ArrayList();
+        for (int row = 1; row <= lastRowNum; row++) {
+            HouseGuarantyArea houseGuarantyArea = new HouseGuarantyArea();
+            Row rowValue = sheet.getRow(row);
+            //估价对象
+            Cell cell0 = rowValue.getCell(0);
+            houseGuarantyArea.setTid(cell0.getStringCellValue());
+            //坐落
+            Cell cell1 = rowValue.getCell(1);
+            houseGuarantyArea.setLocation(cell1.getStringCellValue());
+            houseGuarantyArea.setExcelId(excelId);
+            //获取经纬度 高德接口QPS太高会限制请求。估此处休眠半秒。
+            Thread.sleep(500);
+            LngLatDTO lngLatDTO = houseGuarantyAreaService.queryLngLat(houseGuarantyArea.getLocation());
+            houseGuarantyArea.setLng(lngLatDTO.getLng());
+            houseGuarantyArea.setLat(lngLatDTO.getLat());
+            houseGuarantyAreas.add(houseGuarantyArea);
+        }
+        houseGuarantyAreaService.saveBatch(houseGuarantyAreas);
+    }
+}

+ 0 - 11
service/src/main/java/com/dayou/service/impl/HouseGuarantyAimServiceImpl.java

@@ -1,11 +0,0 @@
-package com.dayou.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.dayou.entity.HouseGuarantyAim;
-import com.dayou.mapper.HouseGuarantyAimMapper;
-import com.dayou.service.HouseGuarantyAimService;
-import org.springframework.stereotype.Service;
-
-@Service
-public class HouseGuarantyAimServiceImpl extends ServiceImpl<HouseGuarantyAimMapper, HouseGuarantyAim> implements HouseGuarantyAimService {
-}

+ 91 - 9
service/src/main/java/com/dayou/service/impl/HouseGuarantyAreaServiceImpl.java

@@ -1,22 +1,40 @@
 package com.dayou.service.impl;
 
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dayou.common.BaseEntity;
+import com.dayou.dto.LngLatDTO;
+import com.dayou.dto.RoadDTO;
 import com.dayou.entity.HouseGuarantyArea;
+import com.dayou.exception.ErrorCode;
 import com.dayou.mapper.HouseGuarantyAreaMapper;
 import com.dayou.service.HouseGuarantyAreaService;
+import com.dayou.utils.HttpKit;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
+@Slf4j
 @Service
 public class HouseGuarantyAreaServiceImpl extends ServiceImpl<HouseGuarantyAreaMapper, HouseGuarantyArea> implements HouseGuarantyAreaService {
 
+    @Value("${map.url}")
+    private String mapGeoApi;
+
+    @Value("${map.key}")
+    private String mapKey;
+
+
+
     @Autowired
     private HouseGuarantyAreaMapper houseGuarantyAreaMapper;
 
@@ -29,16 +47,80 @@ public class HouseGuarantyAreaServiceImpl extends ServiceImpl<HouseGuarantyAreaM
         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;
     }
+
+    @Override
+    public List<HouseGuarantyArea> getAreaInfo(Long excelId) {
+        List<HouseGuarantyArea> ares = houseGuarantyAreaMapper.getAreaInfo(excelId);
+        for (HouseGuarantyArea are :ares){
+            are.setRoad(JSON.parseArray(are.getRoad1(), RoadDTO.class));
+            are.setPublicTransport(JSON.parseArray(are.getPublicTransport1(),String.class));
+            are.setPark(JSON.parseArray(are.getPark1(),String.class));
+            are.setBusiness(JSON.parseArray(are.getBusiness1(),String.class));
+            are.setCommunity(JSON.parseArray(are.getPublicTransport1(),String.class));
+            are.setEducation(JSON.parseArray(are.getEducation1(),String.class));
+            are.setHospital(JSON.parseArray(are.getHospital1(),String.class));
+            are.setBank(JSON.parseArray(are.getBank1(),String.class));
+            are.setHotel(JSON.parseArray(are.getHotel1(),String.class));
+            are.setSpot(JSON.parseArray(are.getSpot1(),String.class));
+        }
+        return ares;
+    }
+
+    @Override
+    public LngLatDTO queryLngLat(String address) {
+        Map<String,String> params = new HashMap<>();
+        params.put("address",address);
+        params.put("key",mapKey);
+        String ret = HttpKit.sendGet(mapGeoApi, params);
+        JSONObject jsonObject = JSON.parseObject(ret);
+        log.info(ret);
+        if (jsonObject.get("status").equals("1")) {
+            JSONArray geocodes = jsonObject.getJSONArray("geocodes");
+            try {
+                JSONObject geo = JSON.parseObject(geocodes.get(0).toString());
+                String location = (String) geo.get("location");
+                List<String> point = Arrays.asList(location.split(","));
+                LngLatDTO lngLatDTO = new LngLatDTO();
+                lngLatDTO.setLng(new BigDecimal(point.get(0)));
+                lngLatDTO.setLat(new BigDecimal(point.get(1)));
+                return lngLatDTO;
+            } catch (Exception e) {
+                ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"高德接口:获取经纬度数据失败: 地址有误。");
+            }
+        }else {
+            if (jsonObject.get("info").equals("ENGINE_RESPONSE_DATA_ERROR")) {
+                ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"高德接口:"+address +"地址有误,无法解析出经纬度。");
+            }else {
+                ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"高德接口:获取经纬度数据失败:"+jsonObject.get("info"));
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public Boolean updateArea(HouseGuarantyArea houseGuarantyArea) {
+        String road = JSON.toJSONString(houseGuarantyArea.getRoad());
+        String publicTransport = JSON.toJSONString(houseGuarantyArea.getPublicTransport());
+        String park = JSON.toJSONString(houseGuarantyArea.getPark());
+        String business = JSON.toJSONString(houseGuarantyArea.getBusiness());
+        String community = JSON.toJSONString(houseGuarantyArea.getCommunity());
+        String education = JSON.toJSONString(houseGuarantyArea.getEducation());
+        String hospital = JSON.toJSONString(houseGuarantyArea.getHospital());
+        String bank = JSON.toJSONString(houseGuarantyArea.getBank());
+        String hotel = JSON.toJSONString(houseGuarantyArea.getHotel());
+        String spot = JSON.toJSONString(houseGuarantyArea.getSpot());
+        return this.update(new LambdaUpdateWrapper<HouseGuarantyArea>().eq(BaseEntity::getId,houseGuarantyArea.getId())
+                .set(HouseGuarantyArea::getRoad,road).set(HouseGuarantyArea::getPublicTransport,publicTransport)
+                .set(HouseGuarantyArea::getPark,park).set(HouseGuarantyArea::getBusiness,business).set(HouseGuarantyArea::getCommunity,community)
+                .set(HouseGuarantyArea::getEducation,education).set(HouseGuarantyArea::getHospital,hospital)
+                .set(HouseGuarantyArea::getBank,bank).set(HouseGuarantyArea::getHotel,hotel).set(HouseGuarantyArea::getSpot,spot)
+                .set(HouseGuarantyArea::getDocContent,houseGuarantyArea.getDocContent()));
+    }
 }

+ 0 - 37
service/src/main/java/com/dayou/service/impl/HouseGuarantyBaseServiceImpl.java

@@ -1,37 +0,0 @@
-package com.dayou.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.dayou.common.BaseEntity;
-import com.dayou.entity.HouseGuarantyBase;
-import com.dayou.entity.HouseGuarantyProcess;
-import com.dayou.mapper.HouseGuarantyBaseMapper;
-import com.dayou.service.HouseGuarantyBaseService;
-import com.dayou.service.HouseGuarantyProcessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class HouseGuarantyBaseServiceImpl extends ServiceImpl<HouseGuarantyBaseMapper, HouseGuarantyBase> implements HouseGuarantyBaseService {
-
-    @Autowired
-    private HouseGuarantyProcessService houseGuarantyProcessService;
-
-    @Autowired
-    private HouseGuarantyBaseMapper houseGuarantyBaseMapper;
-
-    @Override
-    public Long add(HouseGuarantyBase base) {
-        this.saveOrUpdate(base);
-        if (base.getProcessId() != null) {
-            houseGuarantyProcessService.update(new LambdaUpdateWrapper<HouseGuarantyProcess>()
-                    .eq(BaseEntity::getId,base.getProcessId()).set(HouseGuarantyProcess::getBaseId,base.getId()));
-        }
-        return base.getId();
-    }
-
-    @Override
-    public HouseGuarantyBase getByDocId(Long docId) {
-        return houseGuarantyBaseMapper.getByDocId(docId);
-    }
-}

+ 47 - 4
service/src/main/java/com/dayou/service/impl/HouseGuarantyProcessServiceImpl.java

@@ -1,9 +1,13 @@
 package com.dayou.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import com.aspose.words.Document;
+import com.aspose.words.ImportFormatMode;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.common.BaseEntity;
+import com.dayou.config.FileNetConfig;
 import com.dayou.entity.DocumentProduction;
 import com.dayou.entity.HouseGuarantyProcess;
 import com.dayou.enums.BusinessEnum;
@@ -15,21 +19,30 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import static com.dayou.enums.BusinessEnum.HouseGuarantyProcess.*;
+
 @Service
 public class HouseGuarantyProcessServiceImpl extends ServiceImpl<HouseGuarantyProcessMapper, HouseGuarantyProcess> implements HouseGuarantyProcessService {
 
     @Autowired
+    private HouseGuarantyProcessMapper houseGuarantyProcessMapper;
+
+    @Autowired
+    private FileNetConfig fileNetConfig;
+
+    @Autowired
     private DocumentProductionService documentProductionService;
 
+
     @Override
     public HouseGuarantyProcess getHouseGuarantyProcess(Long id) {
-        DocumentProduction dp = documentProductionService.getOne(new LambdaQueryWrapper<DocumentProduction>()
-                .select(DocumentProduction::getBusinessId).eq(BaseEntity::getId, id));
-        return this.getById(dp.getBusinessId());
+        HouseGuarantyProcess process = houseGuarantyProcessMapper.getProcessByDocId(id);
+        return process;
     }
 
     @Override
@@ -37,10 +50,11 @@ public class HouseGuarantyProcessServiceImpl extends ServiceImpl<HouseGuarantyPr
         List<BusinessEnum.HouseGuarantyProcess> aProcesses = Arrays.stream(BusinessEnum.HouseGuarantyProcess.values()).collect(Collectors.toList());
 
         if (id != null){
-            HouseGuarantyProcess parent = this.getOne(new LambdaQueryWrapper<HouseGuarantyProcess>().eq(BaseEntity::getId, id).select(HouseGuarantyProcess::getHome));
+            HouseGuarantyProcess parent = this.getOne(new LambdaQueryWrapper<HouseGuarantyProcess>().eq(BaseEntity::getId, id).select(HouseGuarantyProcess::getHome,HouseGuarantyProcess::getExcelId));
             Map<String, List<HouseGuarantyProcess>> collect = this.list(new LambdaQueryWrapper<HouseGuarantyProcess>().select(BaseEntity::getId, HouseGuarantyProcess::getHome,
                             BaseEntity::getUpdateTime, HouseGuarantyProcess::getProcessName,HouseGuarantyProcess::getDocUrl)
                     .eq(HouseGuarantyProcess::getHome, parent.getHome()).orderByDesc(BaseEntity::getCreateTime)).stream().collect(Collectors.groupingBy(HouseGuarantyProcess::getProcessName));
+
             List<ProcessVO> list = aProcesses.stream().map(x -> {
                 ProcessVO processVO = new ProcessVO();
                 processVO.setName(x.getMsg());
@@ -68,4 +82,33 @@ public class HouseGuarantyProcessServiceImpl extends ServiceImpl<HouseGuarantyPr
         return list;
     }
 
+    @Override
+    public Boolean houseGuarantyMerge(Long id) throws Exception {
+        HouseGuarantyProcess parent = this.getOne(new LambdaQueryWrapper<HouseGuarantyProcess>().eq(BaseEntity::getId, id).select(HouseGuarantyProcess::getHome,BaseEntity::getId,HouseGuarantyProcess::getExcelId));
+        String baseDir = fileNetConfig.getBaseDir();
+        String home = parent.getHome();
+        List<HouseGuarantyProcess> docs = houseGuarantyProcessMapper.queryMaxCreateTimeDoc(home);
+        HouseGuarantyProcess consignorLetter = docs.stream().filter(x -> CONSIGNOR_LETTER.getMsg().equals(x.getProcessName())).findFirst().get();
+        HouseGuarantyProcess explain = docs.stream().filter(x -> STATEMENT_CONDITIONS_EXPLAIN.getMsg().equals(x.getProcessName())).findFirst().get();
+        HouseGuarantyProcess resultReport = docs.stream().filter(x -> GUARANTY_RESULT_REPORT.getMsg().equals(x.getProcessName())).findFirst().get();
+        Document cosignorDocument = new Document(baseDir+consignorLetter.getDocUrl());
+        Document explainDocument = new Document(baseDir+explain.getDocUrl());
+        Document resultDocument = new Document(baseDir+resultReport.getDocUrl());
+        cosignorDocument.appendDocument(explainDocument, ImportFormatMode.KEEP_SOURCE_FORMATTING);
+        cosignorDocument.appendDocument(resultDocument,ImportFormatMode.KEEP_SOURCE_FORMATTING);
+        String subUrl = home +"FINAL_REPORT"+System.currentTimeMillis() + ".docx";
+        String guarantyResultName = baseDir + subUrl;
+        cosignorDocument.save(guarantyResultName);
+
+        DocumentProduction dp = documentProductionService.getOne(new LambdaQueryWrapper<DocumentProduction>().select(DocumentProduction::getDocVersion).eq(DocumentProduction::getBusinessId, parent.getExcelId()));
+
+        //更新document_production
+        return documentProductionService.update(new LambdaUpdateWrapper<DocumentProduction>()
+                .set(DocumentProduction::getDocUrl,subUrl)
+                .set(BaseEntity::getUpdateTime,new Date())
+                .set(DocumentProduction::getDocVersion,dp.getDocVersion()+1)
+                .eq(DocumentProduction::getBusinessId,parent.getExcelId()));
+
+    }
+
 }

+ 45 - 313
service/src/main/java/com/dayou/service/impl/HouseGuarantyServiceImpl.java

@@ -9,23 +9,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.dayou.common.BaseEntity;
 import com.dayou.config.FileNetConfig;
+import com.dayou.doc.house.BaseInfoDO;
 import com.dayou.doc.house.ConditionDO;
-import com.dayou.entity.HouseGuarantyBase;
 import com.dayou.doc.house.GuarantyResultDO;
 import com.dayou.dto.HouseGuarantyTableDTO;
-import com.dayou.entity.HouseGuarantyAim;
 import com.dayou.dto.HouseRightsDTO;
 import com.dayou.entity.*;
 import com.dayou.enums.DocumentType;
 import com.dayou.enums.BusinessEnum;
 import com.dayou.exception.ErrorCode;
-import com.dayou.mapper.HouseGuarantyTargetMapper;
-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;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -63,9 +59,6 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     private DocumentProductionService documentProductionService;
 
     @Autowired
-    private TmplHouseParagraphService tmplHouseParagraphService;
-
-    @Autowired
     private CertificateFixedAssetsService certificateFixedAssetsService;
 
     @Autowired
@@ -75,204 +68,65 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     private CertificateLandUseService certificateLandUseService;
 
     @Autowired
-    private HouseTargetEntityService houseTargetEntityService;
-
-    @Autowired
-    private HouseGuarantyAimService houseGuarantyAimService;
-
-    @Autowired
-    private HouseGuarantyBaseService houseGuarantyBaseService;
-
-    @Autowired
-    private HouseGuarantyTargetMapper houseGuarantyTargetMapper;
-
-    @Autowired
-    private HouseGuarantyTargetService houseGuarantyTargetService;
-
-    @Autowired
-    private HouseGuarantyAreaService houseGuarantyAreaService;
+    private HouseExcelDataService houseExcelDataService;
 
     @Override
     public Long createTableWord(HouseGuarantyTableDTO houseGuarantyTableDTO) {
-        String html = houseGuarantyTableDTO.getHtml();
+        String targetTableHtml = houseGuarantyTableDTO.getTargetTableHtml();
+        String certificateTableHtml = houseGuarantyTableDTO.getCertificateTableHtml();
         String homePath = houseGuarantyTableDTO.getHomePath();
-        Long baseId = houseGuarantyTableDTO.getBaseId();
-        String xHtml = wordTableHelper.htmlTableFormat(html);
+        Long excelId = houseGuarantyTableDTO.getExcelId();
+        String tHtml = wordTableHelper.htmlTargetTableFormat(targetTableHtml);
+        String cHtml = wordTableHelper.htmlCertificateTableFormat(certificateTableHtml);
         HouseGuarantyProcess hgp = new HouseGuarantyProcess();
-        hgp.setBaseId(baseId);
+        hgp.setExcelId(excelId);
         hgp.setHome(homePath);
-        hgp.setTargetsHtml(html);
+        hgp.setTargetsHtml(targetTableHtml);
+        hgp.setCertificatesHtml(cHtml);
         hgp.setProcessName(BusinessEnum.HouseGuarantyProcess.CONSIGNOR_LETTER.getMsg());
         houseGuarantyProcessService.save(hgp);
-        wordTableHelper.createTableWord(xHtml, fileNetConfig.getBaseDir() + homePath);
+        wordTableHelper.createTableWord(tHtml, fileNetConfig.getBaseDir() + homePath,TARGETS_DOCX);
+        wordTableHelper.createTableWord(cHtml, fileNetConfig.getBaseDir() + homePath,CERT_DOCX);
+
         return hgp.getId();
     }
 
-    @Override
-    public Long analysisCollect1(Long processId) throws Exception {
-        HouseGuarantyProcess process = houseGuarantyProcessService.getById(processId);
-        String home = fileNetConfig.getBaseDir() + process.getHome();
-        Workbook workbook = new Workbook( home + COLLECT1_XLSX);
-        workbook.save(home+ COLLECT1_JSON, SaveFormat.JSON);
-
-
-        //解析估价对象json(估价对象一览表)
-        JSONArray array = JsonUtil.file2JsonArray(home + COLLECT1_JSON);
-        JSONArray xArray = HouseDocumentUtil.houseTargetsFormat(array);
-        List<HouseGuarantyAim> houseGuarantyAims = HouseDocumentUtil.houseTargetsFormatDTO(xArray);
-        //获取项目名称
-        String projectName = HouseDocumentUtil.getProjectName(houseGuarantyAims);
-
-        HouseGuarantyBase base = houseGuarantyBaseService.getById(process.getBaseId());
-        if (base==null || StrUtil.isBlank(base.getConsignor())){
-            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"请先完善基本信息");
-        }
-        DocumentProduction dp = buildDocumentProduction(processId, projectName, base.getDocNo(), base.getConsignor());
-        documentProductionService.save(dp);
-
-        Long docId = dp.getId();
 
-        houseGuarantyAims.stream().forEach(x->{
-            x.setDocId(docId);
-        });
-        houseGuarantyAimService.saveBatch(houseGuarantyAims);
-
-        return docId;
-
-    }
 
     @Override
-    public Boolean genConsignorLetter(Long pId,Long docId) {
-        HouseGuarantyProcess process = houseGuarantyProcessService.getById(pId);
+    public Boolean genConsignorLetter(Long excelId,Long processId) throws Exception {
+        //从 HouseExcelData中获取正文内容
+        BaseInfoDO baseDO = houseExcelDataService.getBaseDO(excelId);
         String baseDir = fileNetConfig.getBaseDir();
-        String home = baseDir + process.getHome();
-
         try {
-            // 读取估价对象地址
-            List<HouseGuarantyAim> aims = houseGuarantyAimService.list(new LambdaQueryWrapper<HouseGuarantyAim>()
-                    .eq(HouseGuarantyAim::getDocId, docId));
-
-            //读取基本信息
-            HouseGuarantyBase base = houseGuarantyBaseService.getById(process.getBaseId());
-            base.setMethods(CollectionUtil.formatQuoteAndRemoveMiddle(base.getMethods()));
-            String projectName = HouseDocumentUtil.getProjectName(aims);
-            base.setProjectName(projectName);
-            Map<String, List<HouseGuarantyAim>> collect = aims.stream().collect(Collectors.groupingBy(HouseGuarantyAim::getTid));
-            String actDesc = HouseDocumentUtil.combinationTargetDescription(collect);
-            base.setActDesc(actDesc);
-            String ownShipUser = HouseDocumentUtil.getOwnShipUser(aims);
-
-            Boolean removeBlank = true;
-            if (!"".equals(ownShipUser) && !ownShipUser.contains(base.getConsignor())){
-                base.setOwnshipBlank("");
-                base.setOwnship("不动产权利人:");
-                base.setOwnshipUser(ownShipUser);
-                removeBlank = false;
-            }
             byte[] tmplWordByte = Files.readAllBytes(Paths.get(baseDir
                     + fileNetConfig.getHouseGuarantyTemplatePath() + CONSIGNOR_LETTER_TEMPLATE));
-            byte[] resultWordByte = AsposeWordUtil.fillWordDataByDomain(tmplWordByte, base);
-            String consignorLetterName = process.getHome() +"CONSIGNOR_LETTER_TEMPLATE"+ System.currentTimeMillis() + ".docx";
+            byte[] resultWordByte = AsposeWordUtil.fillWordDataByDomain(tmplWordByte, baseDO);
+            String docHome = baseDO.getExcelUri();
+            String consignorLetterName = docHome +"CONSIGNOR_LETTER_TEMPLATE"+ System.currentTimeMillis() + ".docx";
             File resultFile = new File(baseDir + consignorLetterName);
             FileOutputStream fos = new FileOutputStream(resultFile);
             fos.write(resultWordByte);
             fos.close();
-            insetTargetTableWord(baseDir + consignorLetterName,home + TARGETS_DOCX,removeBlank);
-            //更新过程文档url
+            insetTable2Word(baseDir + consignorLetterName,baseDir+docHome + TARGETS_DOCX,"targetTable");
             return houseGuarantyProcessService.update(new LambdaUpdateWrapper<HouseGuarantyProcess>().set(HouseGuarantyProcess::getDocUrl, consignorLetterName)
-                    .eq(BaseEntity::getId, pId));
-
-        }
-        catch (FileNotFoundException e) {
-            throw new RuntimeException(e);
+                .eq(BaseEntity::getId, processId));
         } catch (IOException e) {
             throw new RuntimeException(e);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
         }
-    }
 
-    @Override
-    public List<HouseTargetVO> getTargetsById(Long id) {
-        try {
-            //解析估价对象json
-            List<HouseTargetVO> houseTargetVOList = new ArrayList<>();
-            List<HouseGuarantyAim> aims = houseGuarantyAimService.list(new LambdaQueryWrapper<HouseGuarantyAim>().eq(HouseGuarantyAim::getDocId,id));
-            Map<String, List<HouseGuarantyAim>> collect = aims.stream().collect(Collectors.groupingBy(HouseGuarantyAim::getTid));
-            for (Map.Entry<String, List<HouseGuarantyAim>> entry : collect.entrySet()) {
-                HouseTargetVO houseTargetVO = new HouseTargetVO();
-                houseTargetVO.setTId(entry.getKey());
-                houseTargetVO.setAims(entry.getValue());
-                houseTargetVOList.add(houseTargetVO);
-            }
-            return houseTargetVOList;
-        } catch (Exception e) {
-            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"文件读取错误");
-        }
-        return Collections.emptyList();
     }
 
+
+
     @Override
     public String genConditionLetter(Long id) {
         DocumentProduction dp = documentProductionService.getById(id);
-        HouseGuarantyProcess process = houseGuarantyProcessService.getById(dp.getBusinessId());
+        HouseGuarantyProcess process = houseGuarantyProcessService.getOne(new LambdaQueryWrapper<HouseGuarantyProcess>().eq(HouseGuarantyProcess::getExcelId,dp.getBusinessId()).select(BaseEntity::getId,HouseGuarantyProcess::getHome));
         String baseDir = fileNetConfig.getBaseDir();
 
         try {
-            HouseGuarantyBase base = houseGuarantyBaseService.getById(process.getBaseId());
-            ConditionDO conditionDO = new ConditionDO();
-            conditionDO.setAppraiser1(base.getAppraiser1());
-            conditionDO.setAppraiser2(base.getAppraiser2());
-            conditionDO.setAppraNo1(base.getAppraNo1());
-            conditionDO.setAppraNo2(base.getAppraNo2());
-            conditionDO.setDocDate(base.getDocDate());
-
-            //获取估价对象所提供的权属证书类型
-            List<String> certificates = getCertificateTypes(id);
-
-            if (!CollectionUtil.isNotEmpty(certificates)){
-                ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"请先完善估价对象权证信息");
-            }
-
-            //获取估价对象补充信息
-            List<HouseGuarantyTarget> targets = houseGuarantyTargetMapper.getList(id);
-
-
-            //获取土地证信息
-            List<CertificateLandUse> landCerts = certificateLandUseService.list(new LambdaQueryWrapper<CertificateLandUse>().eq(CertificateLandUse::getBusinessId, id));
-            Boolean isCheckOriginCertificate = base.getIsCheckOriginCertificate();
-
-
-            //组合一般假设内容
-
-            String ybjsResult = tmplHouseParagraphService.findYBJSResult(targets,isCheckOriginCertificate, certificates);
-            conditionDO.setYBJS(ybjsResult);
-
-            //组合未定事项假设内容
-            String wdsxjsResult = tmplHouseParagraphService.findWDSXJSResult(targets,landCerts);
-            conditionDO.setWDSXJS(wdsxjsResult);
-
-            //组合不相一致假设内容
-            String bxyzjsResult = tmplHouseParagraphService.findBXYZJSResult(targets,certificates,base.getValueTiming());
-            conditionDO.setBXYZJS(bxyzjsResult);
-
-            //组合依据不足假设内容
-            String yjbujsResult = tmplHouseParagraphService.findYJBUJSResult(targets,certificates,isCheckOriginCertificate,base.getMethods());
-            conditionDO.setYJBZJS(yjbujsResult);
-
-            //组合限制条件内容
-            String limitCondition = tmplHouseParagraphService.findLimitConditionResult(targets,base,certificates);
-
-            conditionDO.setXZTJ(limitCondition);
-
-            //组合使用报告说明内容
-            String useReportExplain = tmplHouseParagraphService.findUseReportExplain(targets);
-
-            conditionDO.setSYBGSM(useReportExplain);
-
-            //组合估价中的特殊处理事项内容
-            String specialHandles = tmplHouseParagraphService.findSpecialHandle(targets,base);
-            conditionDO.setTSSXCL(specialHandles);
+            ConditionDO conditionDO = houseExcelDataService.getConditionDO(dp.getBusinessId());
 
             byte[] tmplWordByte = Files.readAllBytes(Paths.get(baseDir
                     + fileNetConfig.getHouseGuarantyTemplatePath() + CONDITION_LETTER_TEMPLATE));
@@ -310,50 +164,11 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     @Override
     public Boolean genResultLetter(Long id) {
         DocumentProduction dp = documentProductionService.getById(id);
-        HouseGuarantyProcess process = houseGuarantyProcessService.getById(dp.getBusinessId());
+        HouseGuarantyProcess process = houseGuarantyProcessService.getOne(new LambdaQueryWrapper<HouseGuarantyProcess>().eq(HouseGuarantyProcess::getExcelId,dp.getBusinessId()).select(BaseEntity::getId,HouseGuarantyProcess::getHome));
         String baseDir = fileNetConfig.getBaseDir();
 
-        //读取估价标的数组
-        List<HouseGuarantyAim> aims = houseGuarantyAimService.list(new LambdaQueryWrapper<HouseGuarantyAim>().eq(HouseGuarantyAim::getDocId, id));
-
-        //获取基本信息
-        HouseGuarantyBase base = houseGuarantyBaseService.getById(process.getBaseId());
-
-        //实物状况描述
-        List<HouseTargetEntity> entities = houseTargetEntityService.getListById(id);
-
-        //获取权属信息数据源
-        List<HouseRightsDTO> houseRightsDTOList = houseTargetEntityService.getHouseRightsDTOList(id);
-
-        //获取区位状况数据源
-        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));
-
-        //替换字段
-        GuarantyResultDO guarantyResultDO = new GuarantyResultDO();
-        guarantyResultDO.setValueTiming(base.getValueTiming());
-        guarantyResultDO.setDocNo(base.getDocNo());
-        guarantyResultDO.setConsignor(base.getConsignor());
-        guarantyResultDO.setConsignorType(base.getConsignorType());
-        guarantyResultDO.setConsignorAddress(base.getConsignorAddress());
-        guarantyResultDO.setConsignorPerson(base.getConsignorPerson());
-        guarantyResultDO.setConsignorMoney(base.getConsignorMoney());
-        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());
+        GuarantyResultDO guarantyResultDO = houseExcelDataService.getResultReport(dp.getBusinessId());
+
         try {
             byte[] tmplWordByte = Files.readAllBytes(Paths.get(baseDir
                     + fileNetConfig.getHouseGuarantyTemplatePath() + GUARANTY_RESULT_TEMPLATE));
@@ -366,76 +181,14 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
             fos.write(resultWordByte);
             fos.close();
 
-            //替换完成,此处开始动态创建内容
-            //获取替换后的文档
-            Document doc = new Document(baseDir + guarantyResultName);
-            //创作权属信息段落
-            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;
-                String acreage = UNKNOWN;
-                String useTo = UNKNOWN;
-                String structure = UNKNOWN;
-                CertificateFixedAssets fa = certificateFixedAssetsService.getOne(new LambdaQueryWrapper<CertificateFixedAssets>()
-                        .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.getDocId())
-                            .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.createTableWidthStyle(doc, HouseEntityTable.class, entityTables, "buildingInfo");
-            doc.save(baseDir + guarantyResultName);
-            //更新过程文档url
+//            AsposeWordUtil.createTableWidthStyle(doc, HouseEntityTable.class, entityTables, "buildingInfo");
+//            doc.save(baseDir + guarantyResultName);
+            //插入房屋权属状况
+            insetTable2Word(baseDir + guarantyResultName,baseDir+guarantyResultDO.getExcelUri() + CERT_DOCX,"targetCertificateTable");
+            //插入估价对象一览表
+            insetTable2Word(baseDir + guarantyResultName,baseDir+guarantyResultDO.getExcelUri() + TARGETS_DOCX,"targetTable");
+
             HouseGuarantyProcess houseGuarantyProcess = new HouseGuarantyProcess();
             houseGuarantyProcess.setProcessName(GUARANTY_RESULT_REPORT.getMsg());
             houseGuarantyProcess.setDocUrl(guarantyResultName);
@@ -453,50 +206,23 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     }
 
     /**
-     * 插入估价结果一览表word文件
+     * 在指定文档书签后插入表格
      * @param mainWordPath
      * @param tableWordPath
      * @throws Exception
      */
-    private void insetTargetTableWord(String mainWordPath,String tableWordPath,Boolean removeBlank)  throws Exception{
+    private void insetTable2Word(String mainWordPath,String tableWordPath,String bookmark)  throws Exception{
         // 主word文件
         Document mainDoc = new Document(mainWordPath);
-        if (removeBlank){
-            removeBlank(mainDoc);
-        }
+
         // 需要插入的word文件
         Document subDoc = new Document(tableWordPath);
 
-        mainDoc = AsposeWordUtil.insertDocumentAfterBookMark(mainDoc, subDoc, "targetTable", false);
+        mainDoc = AsposeWordUtil.insertDocumentAfterBookMark(mainDoc, subDoc, bookmark, false);
         // 保存文件
         mainDoc.save(mainWordPath);
     }
 
-    /**
-     * 删除空白域
-     * @param mainDoc
-     * @throws Exception
-     */
-    private void removeBlank(Document mainDoc ) throws Exception {
-        //删除空白行
-        DocumentBuilder builder = new DocumentBuilder(mainDoc);
-        builder.moveToMergeField("ownshipBlank");
-        Node currentParagraph2 = builder.getCurrentParagraph();
-        if (currentParagraph2.getParentNode() != null){
-            currentParagraph2.remove();
-        }
-        builder.moveToMergeField("ownship");
-        Paragraph currentParagraph = builder.getCurrentParagraph();
-        CompositeNode parentNode = currentParagraph.getParentNode();
-        if (parentNode != null){
-            currentParagraph.remove();
-        }
-        builder.moveToMergeField("ownshipUser");
-        Paragraph currentParagraph1 = builder.getCurrentParagraph();
-        if (currentParagraph1.getParentNode() != null){
-            currentParagraph1.remove();
-        }
-    }
 
     private DocumentProduction buildDocumentProduction(Long id,String docName,String docNo,String consignor){
         DocumentProduction dp = new DocumentProduction();
@@ -585,4 +311,10 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
         }
         return 0;
     }
+
+    @Override
+    public HouseGuarantyProcess getCertificatesHtml(Long businessId) {
+        return houseGuarantyProcessService.getOne(new LambdaQueryWrapper<HouseGuarantyProcess>()
+                .eq(HouseGuarantyProcess::getExcelId, businessId).select(HouseGuarantyProcess::getCertificatesHtml,BaseEntity::getId));
+    }
 }

+ 0 - 18
service/src/main/java/com/dayou/service/impl/HouseGuarantyTargetServiceImpl.java

@@ -1,18 +0,0 @@
-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.HouseGuarantyTarget;
-import com.dayou.mapper.HouseGuarantyTargetMapper;
-import com.dayou.service.HouseGuarantyTargetService;
-import org.springframework.stereotype.Service;
-
-@Service
-public class HouseGuarantyTargetServiceImpl extends ServiceImpl<HouseGuarantyTargetMapper, HouseGuarantyTarget> implements HouseGuarantyTargetService {
-
-    @Override
-    public HouseGuarantyTarget getTarget(Long docId, String tId) {
-        return this.getOne(new LambdaQueryWrapper<HouseGuarantyTarget>().eq(HouseGuarantyTarget::getDocId, docId)
-                .eq(HouseGuarantyTarget::getTid, tId));
-    }
-}

+ 0 - 141
service/src/main/java/com/dayou/service/impl/HouseTargetEntityServiceImpl.java

@@ -1,141 +0,0 @@
-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.HouseGuarantyAim;
-import com.dayou.dto.HouseRightsDTO;
-import com.dayou.entity.*;
-import com.dayou.exception.ErrorCode;
-import com.dayou.mapper.HouseTargetEntityMapper;
-import com.dayou.service.*;
-import com.dayou.utils.CollectionUtil;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static com.dayou.enums.BusinessEnum.HouseSubBusiness.GUARANTY;
-
-@Service
-public class HouseTargetEntityServiceImpl extends ServiceImpl<HouseTargetEntityMapper, HouseTargetEntity> implements HouseTargetEntityService {
-
-    @Autowired
-    private HouseGuarantyService houseGuarantyService;
-
-    @Autowired
-    private HouseTargetEntityMapper houseTargetEntityMapper;
-
-    @Autowired
-    private CertificateFixedAssetsService fixedAssetsService;
-
-    @Autowired
-    private CertificateHouseOwnService houseOwnService;
-
-    @Autowired
-    private CertificateLandUseService landUseService;
-    @Autowired
-
-    private HouseGuarantyAimService houseGuarantyAimService;
-
-    @Override
-    public Long addHouseTargetEntity(HouseTargetEntity houseTargetEntity) {
-        Integer certificateCombination = houseGuarantyService.getCertificateCombination(houseTargetEntity.getDocId(), houseTargetEntity.getTid(), houseTargetEntity.getTno());
-        houseTargetEntity.setCertCombination(certificateCombination);
-        this.saveOrUpdate(houseTargetEntity);
-        return houseTargetEntity.getId();
-    }
-
-    @Override
-    public HouseTargetEntity getHouseTargetEntityById(Long businessId, String tid, String tno) {
-        return this.getOne(new LambdaQueryWrapper<HouseTargetEntity>()
-                .eq(HouseTargetEntity::getDocId, businessId)
-                .eq(HouseTargetEntity::getTid, tid).eq(HouseTargetEntity::getTno, tno));
-    }
-
-    @Override
-    public Boolean copyHouseTargetEntity(Long id) {
-        HouseTargetEntity originEntity = this.getById(id);
-
-        List<HouseGuarantyAim> aims = houseGuarantyAimService.list(new LambdaQueryWrapper<HouseGuarantyAim>().eq(HouseGuarantyAim::getDocId, id));
-
-        List<HouseTargetEntity> targetEntities = new ArrayList<>();
-
-        for (HouseGuarantyAim aim : aims) {
-                if (aim.getTno().equals(originEntity.getTno())
-                        && aim.getTid().equals(originEntity.getTid())){
-                }else {
-                    HouseTargetEntity targetEntity = this.getOne(new LambdaQueryWrapper<HouseTargetEntity>()
-                            .eq(HouseTargetEntity::getDocId, originEntity.getDocId())
-                            .eq(HouseTargetEntity::getTid, aim.getTid())
-                            .eq(HouseTargetEntity::getTno, aim.getTno()));
-                    if (targetEntity == null){
-                        targetEntity = new HouseTargetEntity();
-                    }
-                    BeanUtils.copyProperties(originEntity,targetEntity);
-                    targetEntity.setId(null);
-                    targetEntity.setTid(aim.getTid());
-                    targetEntity.setTno(aim.getTno());
-                    targetEntity.setCertCombination(houseGuarantyService.getCertificateCombination(originEntity.getDocId(), aim.getTid(), aim.getTno()));
-                    targetEntities.add(targetEntity);
-                }
-            }
-
-        return this.saveOrUpdateBatch(targetEntities);
-    }
-
-    @Override
-    public List<HouseRightsDTO> getHouseRightsDTOList(Long businessId) {
-        List<HouseRightsDTO> rights = houseTargetEntityMapper.getHouseRightsDTOList(businessId);
-        //完善权属证件信息
-        for (HouseRightsDTO rightsDTO : rights) {
-            if (rightsDTO.getCertType()==0){
-                //只有不动产证
-                CertificateFixedAssets fixedAssets = fixedAssetsService.getOne(new LambdaQueryWrapper<CertificateFixedAssets>()
-                        .eq(CertificateFixedAssets::getBusinessId, businessId)
-                        .eq(CertificateFixedAssets::getTid, rightsDTO.getTid())
-                        .eq(CertificateFixedAssets::getTno, rightsDTO.getTno())
-                        .eq(CertificateFixedAssets::getBusinessType, GUARANTY.name()));
-                rightsDTO.setAssetsCert(fixedAssets);
-            } else if (rightsDTO.getCertType()==5 || rightsDTO.getCertType()==6){
-                //只有房地产证
-                CertificateHouseOwn houseOwn = houseOwnService.getOne(new LambdaQueryWrapper<CertificateHouseOwn>()
-                        .eq(CertificateHouseOwn::getBusinessId, businessId)
-                        .eq(CertificateHouseOwn::getTid, rightsDTO.getTid())
-                        .eq(CertificateHouseOwn::getTno, rightsDTO.getTno())
-                        .eq(CertificateHouseOwn::getBusinessType, GUARANTY.name()));
-                rightsDTO.setHouseOwnCert(houseOwn);
-            } else {
-                //房地产证
-                CertificateHouseOwn houseOwn = houseOwnService.getOne(new LambdaQueryWrapper<CertificateHouseOwn>()
-                        .eq(CertificateHouseOwn::getBusinessId, businessId)
-                        .eq(CertificateHouseOwn::getTid, rightsDTO.getTid())
-                        .eq(CertificateHouseOwn::getTno, rightsDTO.getTno())
-                        .eq(CertificateHouseOwn::getBusinessType, GUARANTY.name()));
-                rightsDTO.setHouseOwnCert(houseOwn);
-                //土地证
-                CertificateLandUse landUse = landUseService.getOne(new LambdaQueryWrapper<CertificateLandUse>()
-                        .eq(CertificateLandUse::getBusinessId, businessId)
-                        .eq(CertificateLandUse::getTid, rightsDTO.getTid())
-                        .eq(CertificateLandUse::getTno, rightsDTO.getTno())
-                        .eq(CertificateLandUse::getBusinessType, GUARANTY.name()));
-                rightsDTO.setLandUseCert(landUse);
-            }
-        }
-        return rights;
-    }
-
-    @Override
-    public List<HouseTargetEntity> getListById(Long id) {
-        List<HouseTargetEntity> entities = houseTargetEntityMapper.getListById(id);
-        List<HouseTargetEntity> collect = entities.stream().filter(x -> x.getId() == null).collect(Collectors.toList());
-        if (CollectionUtil.isNotEmpty(collect)){
-            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,
-                    "估价对象"+collect.get(0).getXTid()+"序号"+collect.get(0).getXTno()+"实物状况信息缺失。");
-        }
-        return entities;
-    }
-}

+ 0 - 455
service/src/main/java/com/dayou/service/impl/TmplHouseParagraphServiceImpl.java

@@ -1,455 +0,0 @@
-package com.dayou.service.impl;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.dayou.entity.CertificateLandUse;
-import com.dayou.entity.HouseGuarantyBase;
-import com.dayou.entity.HouseGuarantyTarget;
-import com.dayou.entity.TmplHouseParagraph;
-import com.dayou.mapper.TmplHouseParagraphMapper;
-import com.dayou.service.CertificateLandUseService;
-import com.dayou.service.TmplHouseParagraphService;
-import com.dayou.utils.HouseDocumentUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static com.dayou.enums.BusinessEnum.HouseGuarantyChapter.*;
-import static com.dayou.enums.BusinessEnum.HouseGuarantyRules.*;
-import static com.dayou.enums.BusinessEnum.HouseSubBusiness.GUARANTY;
-
-@Service
-public class TmplHouseParagraphServiceImpl extends ServiceImpl<TmplHouseParagraphMapper, TmplHouseParagraph> implements TmplHouseParagraphService {
-
-    @Autowired
-    private TmplHouseParagraphMapper tmplHouseParagraphMapper;
-
-    @Autowired
-    private CertificateLandUseService certificateLandUseService;
-
-    @Override
-    public List<TmplHouseParagraph> findByMoldAndChapter(TmplHouseParagraph tmplHouseParagraph) {
-        return tmplHouseParagraphMapper.findByMoldAndChapter(tmplHouseParagraph);
-    }
-
-    @Override
-    public String findYBJSResult(List<HouseGuarantyTarget> targets, Boolean isCheckOriginCertificate, List<String> certificates) {
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, ORDINARY_ASSUMPTION).orderByAsc(TmplHouseParagraph::getSort));
-        Map<Integer, List<TmplHouseParagraph>> collect = paragraphTemps.stream().collect(Collectors.groupingBy(TmplHouseParagraph::getSort));
-        StringBuilder normalCondition = new StringBuilder();
-        int i = 1;
-        for(Map.Entry<Integer, List<TmplHouseParagraph>> entry : collect.entrySet()) {
-            List<TmplHouseParagraph> paragraphs = entry.getValue();
-            for (TmplHouseParagraph  paragraph : paragraphs){
-                String rule = paragraph.getRule();
-                if (StrUtil.isNotBlank(rule)){
-                    if (IS_CHECK_ORIGIN_CERTIFICATE.getCode().equals(rule)){
-                        String checkOriginCertificate = HouseDocumentUtil.getCheckOriginCertificate(isCheckOriginCertificate,
-                                certificates, paragraph);
-
-                        if (StrUtil.isNotBlank(checkOriginCertificate)){
-                            normalCondition.append(i).append(". ");
-                            normalCondition.append(checkOriginCertificate);
-                            i++;
-                        }
-                    }
-                    if (IS_CHECK_ORIGIN_CERTIFICATE_XX.getCode().equals(rule)){
-                        String checkOriginCertificateXX = HouseDocumentUtil.getCheckOriginCertificateXX(certificates,paragraph);
-
-                        if (StrUtil.isNotBlank(checkOriginCertificateXX)){
-                            normalCondition.append(i).append(". ");
-                            normalCondition.append(checkOriginCertificateXX);
-                            i++;
-                        }
-                    }
-                    if (IS_BUILDING_PART.getCode().equals(rule)){
-                        String isBuildingPart = HouseDocumentUtil.getIsBuildingPart(targets,paragraph);
-                        if (StrUtil.isNotBlank(isBuildingPart)){
-                            normalCondition.append(i).append(". ");
-                            normalCondition.append(isBuildingPart);
-                            i++;
-                        }
-                    }
-                    if (IS_HOTEL_PART.getCode().equals(rule)){
-                        String isHotelPart = HouseDocumentUtil.getIsHotelPart(targets,paragraph);
-                        if (StrUtil.isNotBlank(isHotelPart)){
-                            normalCondition.append(i).append(". ");
-                            normalCondition.append(isHotelPart);
-                            i++;
-                        }
-                    }
-                }else{
-                    normalCondition.append(i).append(". ");
-                    normalCondition.append(paragraph.getParagraph());
-                    i++;
-                }
-            }
-
-
-        }
-        return normalCondition.toString();
-    }
-
-    @Override
-    public String findWDSXJSResult(List<HouseGuarantyTarget> targets, List<CertificateLandUse> landCerts ) {
-
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, UNDEFINED_ASSUMPTION).orderByAsc(TmplHouseParagraph::getSort));
-        StringBuilder result = new StringBuilder();
-        int i = 1;
-        for (TmplHouseParagraph paragraph : paragraphTemps){
-            String rule = paragraph.getRule();
-            if (StrUtil.isNotBlank(rule)){
-                if (IS_REGISTER_BUILDING_YEAR.getCode().equals(rule)){
-                    String buildingYear = HouseDocumentUtil.buildingYear(targets, paragraph);
-                    if (StrUtil.isNotBlank(buildingYear)){
-                        result.append(i).append(". ").append(buildingYear);
-                        i++;
-                    }
-                }
-                if (IS_USE_DIFFERENT.getCode().equals(rule)){
-                    String useDiff = HouseDocumentUtil.isUseDiff(targets,paragraph);
-                    if (StrUtil.isNotBlank(useDiff)){
-                        result.append(i).append(". ").append(useDiff);
-                        i++;
-                    }
-                }
-//                if (IS_PROVIDE_LAND_BIG_CERTIFICATE.getCode().equals(rule)){
-//                    String provideLandBigCertificate = HouseDocumentUtil.isProvideLandBigCertificate(targets,paragraph);
-//                    if (StrUtil.isNotBlank(provideLandBigCertificate)){
-//                        result.append(i).append(". ").append(provideLandBigCertificate);
-//                        i++;
-//                    }
-//                }
-                if (IS_PROVIDE_LAND_BIG_CERTIFICATE_SHARE.getCode().equals(rule)){
-                    String provideLandBigCertificateShare = HouseDocumentUtil.isProvideLandBigCertificateShare(targets,paragraph,landCerts);
-                    if (StrUtil.isNotBlank(provideLandBigCertificateShare)){
-                        result.append(i).append(". ").append(provideLandBigCertificateShare);
-                        i++;
-                    }
-                }
-                if (IS_DIVIDE_METHOD1.getCode().equals(rule)){
-                    String divideMethod1 = HouseDocumentUtil.isDivideMethod1(targets,paragraph);
-                    if (StrUtil.isNotBlank(divideMethod1)){
-                        result.append(i).append(". ").append(divideMethod1);
-                        i++;
-                    }
-                }
-                if (IS_DIVIDE_METHOD2.getCode().equals(rule)){
-                    String divideMethod2 = HouseDocumentUtil.isDivideMethod2(targets,paragraph);
-                    if (StrUtil.isNotBlank(divideMethod2)){
-                        result.append(i).append(". ").append(divideMethod2);
-                        i++;
-                    }
-                }
-            }
-            else{
-                result.append(i).append(". ");
-                result.append(paragraph.getParagraph());
-                i++;
-            }
-        }
-        return result.toString();
-    }
-
-    @Override
-    public String findBXYZJSResult(List<HouseGuarantyTarget> targets, List<String> certificates, String valueTiming) {
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, UNCONFORMITY_ASSUMPTION).orderByAsc(TmplHouseParagraph::getSort));
-        StringBuilder result = new StringBuilder();
-        int i = 1;
-        for (TmplHouseParagraph paragraph : paragraphTemps){
-            String rule = paragraph.getRule();
-            if (StrUtil.isNotBlank(rule)){
-                if (IS_ADDRESS_DIFF_CERTIFICATE.getCode().equals(rule)){
-                    String addressDiffCertificate = HouseDocumentUtil.isAddressDiffCertificate(targets, certificates, paragraph);
-                    if (StrUtil.isNotBlank(addressDiffCertificate)){
-                        result.append(i).append(". ").append(addressDiffCertificate);
-                        i++;
-                    }
-                }
-                if (IS_ADDRESS_DIFF_NO_CERTIFICATE.getCode().equals(rule)){
-                    String addressDiffNoCertificate = HouseDocumentUtil.isAddressDiffNoCertificate(targets, certificates, paragraph);
-                    if (StrUtil.isNotBlank(addressDiffNoCertificate)){
-                        result.append(i).append(". ").append(addressDiffNoCertificate);
-                        i++;
-                    }
-                }
-                if (IS_DATE_DIFF.getCode().equals(rule)){
-                    String dateDiff = HouseDocumentUtil.isDateDiff(targets, paragraph, valueTiming);
-                    if (StrUtil.isNotBlank(dateDiff)){
-                        result.append(i).append(". ").append(dateDiff);
-                        i++;
-                    }
-                }
-            }
-            else{
-                result.append(i).append(". ");
-                result.append(paragraph.getParagraph());
-                i++;
-            }
-        }
-        return result.toString();
-    }
-
-    @Override
-    public String findYJBUJSResult(List<HouseGuarantyTarget> targets,List<String> certificates,Boolean isCheckOriginCertificate,String methods) {
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, DEFICIENCY_ASSUMPTION).orderByAsc(TmplHouseParagraph::getSort));
-        StringBuilder result = new StringBuilder();
-        int i = 1;
-        for (TmplHouseParagraph paragraph : paragraphTemps){
-            String rule = paragraph.getRule();
-            if (StrUtil.isNotBlank(rule)){
-                if (IS_BIG_CERTIFICATE_ONLY_HOUSE.getCode().equals(rule)){
-                    String bigCertificateOnlyHouse = HouseDocumentUtil.isBigCertificateOnlyHouse(targets,paragraph,isCheckOriginCertificate);
-                    if (StrUtil.isNotBlank(bigCertificateOnlyHouse)){
-                        result.append(i).append(". ").append(bigCertificateOnlyHouse);
-                        i++;
-                    }
-                }
-                if (IS_NOT_ORIGIN_CERTIFICATE_AND_PROMISE_SAME.getCode().equals(rule)){
-                    String notOriginCertificateOnlyHouse = HouseDocumentUtil.isNotOriginCertificateOnlyHouse(targets,paragraph,isCheckOriginCertificate,certificates);
-                    if (StrUtil.isNotBlank(notOriginCertificateOnlyHouse)){
-                        result.append(i).append(". ").append(notOriginCertificateOnlyHouse);
-                        i++;
-                    }
-                }
-                if (IS_NOT_ORIGIN_FILES_IN_CHENGDU.getCode().equals(rule)){
-                    String bigCertificateOnlyHouse = HouseDocumentUtil.isNotOriginFileInChengDu(targets,paragraph,isCheckOriginCertificate,certificates);
-                    if (StrUtil.isNotBlank(bigCertificateOnlyHouse)){
-                        result.append(i).append(". ").append(bigCertificateOnlyHouse);
-                        i++;
-                    }
-                }
-                if (IS_NOT_ORIGIN_FILES_OUT_CHENGDU.getCode().equals(rule)){
-                    String notOriginFileOutChengDu = HouseDocumentUtil.isNotOriginFileOutChengDu(targets,paragraph,isCheckOriginCertificate,certificates);
-                    if (StrUtil.isNotBlank(notOriginFileOutChengDu)){
-                        result.append(i).append(". ").append(notOriginFileOutChengDu);
-                        i++;
-                    }
-                }
-                if (IS_RENT_OUT_NOT_CONTRACT_NO_AFFECT.getCode().equals(rule)){
-                    String rentOutNotContractNoAffect = HouseDocumentUtil.isRentOutNotContractNoAffect(targets,paragraph);
-                    if (StrUtil.isNotBlank(rentOutNotContractNoAffect)){
-                        result.append(i).append(". ").append(rentOutNotContractNoAffect);
-                        i++;
-                    }
-                }
-                if (IS_NOT_CONTRACT_LAND_LOWER_HOUSE_SY.getCode().equals(rule)){
-                    String notContractLandLowerHouseSY = HouseDocumentUtil.isNotContractLandLowerHouseSY(targets,paragraph,methods);
-                    if (StrUtil.isNotBlank(notContractLandLowerHouseSY)){
-                        result.append(i).append(". ").append(notContractLandLowerHouseSY);
-                        i++;
-                    }
-                }
-                if (IS_NOT_CONTRACT_LAND_LOWER_HOUSE_CB.getCode().equals(rule)){
-                    String notContractLandLowerHouseCB = HouseDocumentUtil.isNotContractLandLowerHouseCB(targets,paragraph,methods);
-                    if (StrUtil.isNotBlank(notContractLandLowerHouseCB)){
-                        result.append(i).append(". ").append(notContractLandLowerHouseCB);
-                        i++;
-                    }
-                }
-            }
-            else{
-                result.append(i).append(". ");
-                result.append(paragraph.getParagraph());
-                i++;
-            }
-        }
-        return result.toString();
-    }
-
-    @Override
-    public String findLimitConditionResult(List<HouseGuarantyTarget> targets, HouseGuarantyBase base, List<String> certificates) {
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, LIMIT_CONDITION).orderByAsc(TmplHouseParagraph::getSort));
-        StringBuilder result = new StringBuilder();
-        int i = 1;
-        for (TmplHouseParagraph paragraph : paragraphTemps){
-            String rule = paragraph.getRule();
-            if (StrUtil.isNotBlank(rule)){
-                if (IS_NOT_PLEDGE.getCode().equals(rule)){
-                    //todo
-                    String notPledge = HouseDocumentUtil.isNotPledge(paragraph,base.getHasPledge());
-                    if (StrUtil.isNotBlank(notPledge)){
-                        result.append(i).append(". ").append(notPledge);
-                        i++;
-                    }
-
-                }
-                if (IS_OLD_PLEDGE_TO_NEW_PLEDGE.getCode().equals(rule)){
-                    String oldPledgeToNewPledge = HouseDocumentUtil.isOldPledgeToNewPledge(paragraph,base);
-                    if (StrUtil.isNotBlank(oldPledgeToNewPledge)){
-                        result.append(i).append(". ").append(oldPledgeToNewPledge);
-                        i++;
-                    }
-                }
-                if (IS_OLD_PLEDGE_TO_OLD_PLEDGE.getCode().equals(rule)){
-                    String oldPledgeToOldPledge = HouseDocumentUtil.isOldPledgeToOldPledge(paragraph,base);
-                    if (StrUtil.isNotBlank(oldPledgeToOldPledge)){
-                        result.append(i).append(". ").append(oldPledgeToOldPledge);
-                        i++;
-                    }
-                }
-                if (IS_TRANSFER_NOT_DEDUCT_SELL_MONEY.getCode().equals(rule)){
-                    //todo
-                    String transferOutDeductSellMoney = HouseDocumentUtil.isTransferNotDeductSellMoney(targets,paragraph, "是");
-                    if (StrUtil.isNotBlank(transferOutDeductSellMoney)){
-                        result.append(i).append(". ").append(transferOutDeductSellMoney);
-                        i++;
-                    }
-                }
-                if (IS_TRANSFER_DEDUCT_SELL_MONEY.getCode().equals(rule)){
-                    //todo
-                    String transferDeductSellMoney = HouseDocumentUtil.isTransferDeductSellMoney(targets,paragraph,"是");
-                    if (StrUtil.isNotBlank(transferDeductSellMoney)){
-                        result.append(i).append(". ").append(transferDeductSellMoney);
-                        i++;
-                    }
-                }
-                if (IS_PROVIDE_TECH_REPORT.getCode().equals(rule)){
-                    String provideTechReport = HouseDocumentUtil.isProvideTechReport(paragraph,base.getHasTechReport());
-                    if (StrUtil.isNotBlank(provideTechReport)){
-                        result.append(i).append(". ").append(provideTechReport);
-                        i++;
-                    }
-                }
-                if (IS_NS_BANK.getCode().equals(rule)){
-                    String nsBank = HouseDocumentUtil.isNSBank(paragraph,base.getIsNsBank());
-                    if (StrUtil.isNotBlank(nsBank)){
-                        result.append(i).append(". ").append(nsBank);
-                        i++;
-                    }
-                }
-                if (IS_NORMAL_BANK.getCode().equals(rule)){
-                    String normalBank = HouseDocumentUtil.isNormalBank(paragraph,base.getIsNsBank());
-                    if (StrUtil.isNotBlank(normalBank)){
-                        result.append(i).append(". ").append(normalBank);
-                        i++;
-                    }
-                }
-                if (IS_HAS_IMMOVABLE_CERTIFICATE.getCode().equals(rule)){
-                    String hasImmovableCertificate1 = HouseDocumentUtil.isHasImmovableCertificate(targets,paragraph,certificates);
-                    if (StrUtil.isNotBlank(hasImmovableCertificate1)){
-                        result.append(i).append(". ").append(hasImmovableCertificate1);
-                        i++;
-                    }
-                }
-            }else{
-                result.append(i).append(". ");
-                result.append(paragraph.getParagraph());
-                i++;
-            }
-        }
-        return result.toString();
-    }
-
-    @Override
-    public String findUseReportExplain(List<HouseGuarantyTarget> targets) {
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, USE_REPORT_EXPLAIN).orderByAsc(TmplHouseParagraph::getSort));
-        StringBuilder result = new StringBuilder();
-        int i = 1;
-        for (TmplHouseParagraph paragraph : paragraphTemps){
-            String rule = paragraph.getRule();
-            if (StrUtil.isNotBlank(rule)){
-                //未定义
-            }else {
-                result.append(i).append(". ");
-                result.append(paragraph.getParagraph());
-                i++;
-            }
-        }
-        return result.toString();
-    }
-
-    @Override
-    public String findSpecialHandle(List<HouseGuarantyTarget> targets,HouseGuarantyBase base) {
-        List<TmplHouseParagraph> paragraphTemps = this.list(new LambdaQueryWrapper<TmplHouseParagraph>()
-                .eq(TmplHouseParagraph::getDocMold, GUARANTY).eq(TmplHouseParagraph::getChapter, SPECIAL_HANDLE).orderByAsc(TmplHouseParagraph::getSort));
-        StringBuilder result = new StringBuilder();
-        int i = 1;
-        for (TmplHouseParagraph paragraph : paragraphTemps){
-            String rule = paragraph.getRule();
-            if (StrUtil.isNotBlank(rule)){
-                if (IS_NO_FIRST_MONEY.getCode().equals(rule)){
-                    String noFirstMoney = HouseDocumentUtil.isNoFirstMoney(paragraph,base);
-                    if (StrUtil.isNotBlank(noFirstMoney)){
-                        result.append(i).append(". ").append(noFirstMoney);
-                        i++;
-                    }
-                }
-                if (IS_SAME_PLEDGE_USER_CONTINUE.getCode().equals(rule)){
-                    String samePledgeUserContinue = HouseDocumentUtil.isSamePledgeUserContinue(paragraph,base);
-                    if (StrUtil.isNotBlank(samePledgeUserContinue)){
-                        result.append(i).append(". ").append(samePledgeUserContinue);
-                        i++;
-                    }
-                }
-                if (IS_OLD_PLEDGE_TO_NEW_PLEDGE_SPECIAL.getCode().equals(rule)){
-                    String oldPledgeToNewPledgeSpecial = HouseDocumentUtil.isOldPledgeToNewPledgeSpecial(paragraph,base);
-                    if (StrUtil.isNotBlank(oldPledgeToNewPledgeSpecial)){
-                        result.append(i).append(". ").append(oldPledgeToNewPledgeSpecial);
-                        i++;
-                    }
-                }
-                if (IS_NORMAL_PLEDGE_TO_HIGH_PLEDGE.getCode().equals(rule)){
-                    String normalPledgeToHighPledge = HouseDocumentUtil.isNormalPledgeToHighPledge(paragraph,base);
-                    if (StrUtil.isNotBlank(normalPledgeToHighPledge)){
-                        result.append(i).append(". ").append(normalPledgeToHighPledge);
-                        i++;
-                    }
-                }
-                if (IS_HIGH_PLEDGE_NOT_EXPIRE.getCode().equals(rule)){
-                    String highPledgeNotExpire = HouseDocumentUtil.isHighPledgeNotExpire(paragraph,base);
-                    if (StrUtil.isNotBlank(highPledgeNotExpire)){
-                        result.append(i).append(". ").append(highPledgeNotExpire);
-                        i++;
-                    }
-                }
-                if (IS_NOT_RENT_OUT.getCode().equals(rule)){
-                    String notRentOut = HouseDocumentUtil.isNotRentOut(targets,paragraph);
-                    if (StrUtil.isNotBlank(notRentOut)){
-                        result.append(i).append(". ").append(notRentOut);
-                        i++;
-                    }
-                }
-                if (IS_RENT_OUT_NOT_AFFECT_HIGH.getCode().equals(rule)){
-                    String rentOutNotAffectHigh = HouseDocumentUtil.isRentOutNotAffectHigh(targets,paragraph);
-                    if (StrUtil.isNotBlank(rentOutNotAffectHigh)){
-                        result.append(i).append(". ").append(rentOutNotAffectHigh);
-                        i++;
-                    }
-                }
-                if (IS_RENT_OUT_NOT_AFFECT_NORMAL.getCode().equals(rule)){
-                    String rentOutNotAffectNormal = HouseDocumentUtil.isRentOutNotAffectNormal(targets,paragraph);
-                    if (StrUtil.isNotBlank(rentOutNotAffectNormal)){
-                        result.append(i).append(". ").append(rentOutNotAffectNormal);
-                        i++;
-                    }
-                }
-                if (IS_RENT_OUT_AFFECT_LOW.getCode().equals(rule)){
-                    String rentOutAffectLow = HouseDocumentUtil.isRentOutAffectLow(targets,paragraph);
-                    if (StrUtil.isNotBlank(rentOutAffectLow)){
-                        result.append(i).append(". ").append(rentOutAffectLow);
-                        i++;
-                    }
-                }
-            }else {
-                result.append(i).append(". ");
-                result.append(paragraph.getParagraph());
-                i++;
-            }
-        }
-        return result.toString();
-    }
-}
-
-

+ 131 - 1
sql/update_sql.sql

@@ -1033,4 +1033,134 @@ ALTER TABLE tmpl_asset_report_section MODIFY COLUMN tmpl_code VARCHAR(100) NULL
 ALTER TABLE assets_calculate_eqpt_data MODIFY COLUMN evaluate_original_value DECIMAL ( 20, 2 ) NULL COMMENT '评估原值';
 ALTER TABLE assets_calculate_eqpt_data MODIFY COLUMN evaluate_net_value DECIMAL(20,2) NULL COMMENT '评估净值';
 ALTER TABLE assets_calculate_eqpt_data MODIFY COLUMN book_original_value DECIMAL(20,2) NOT NULL COMMENT '账面原值';
-ALTER TABLE assets_calculate_eqpt_data MODIFY COLUMN book_net_value DECIMAL(20,2) NULL COMMENT '账面净值';
+ALTER TABLE assets_calculate_eqpt_data MODIFY COLUMN book_net_value DECIMAL(20,2) NULL COMMENT '账面净值';
+
+/**
+    日期:2025-06-16
+    修改人:吴长林
+    未更新到test-env
+ */
+ALTER TABLE house_guaranty_process CHANGE base_id excel_id bigint NULL COMMENT 'excelId';
+ALTER TABLE house_guaranty_process ADD COLUMN certificates_html longtext NULL COMMENT '权属信息表代码';
+DROP TABLE house_guaranty_aim;
+DROP TABLE house_guaranty_base;
+DROP TABLE house_guaranty_target;
+DROP TABLE house_target_entity;
+CREATE TABLE `productivity-platform`.`house_excel_data`  (
+                                                   `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
+                                                   `business_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '报告业务类型',
+                                                   `doc_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '报告编号',
+                                                   `doc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '报告项目名称',
+                                                   `consignor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托人',
+                                                   `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '不动产权利人',
+                                                   `appraiser1` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '估价师1',
+                                                   `appraiser2` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '估价师2',
+                                                   `appra_no1` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '估价师1注册号',
+                                                   `appra_no2` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '估价师2注册号',
+                                                   `doc_date` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '出具报告日期',
+                                                   `value_timing` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '价值时点',
+                                                   `work_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评估方法',
+                                                   `summary1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价对象描述1',
+                                                   `summary2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价对象描述2',
+                                                   `work_purpose` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '至函-估价目的',
+                                                   `value_type` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '价值类型',
+                                                   `expe_tip1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '特别提示1',
+                                                   `expe_tip2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '特别提示2',
+                                                   `expe_tip3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '特别提示3',
+                                                   `expe_tip4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '特别提示4',
+                                                   `expe_tip5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '特别提示5',
+                                                   `affix1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件1名称',
+                                                   `affix2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件2名称',
+                                                   `affix3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件3名称',
+                                                   `affix4` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件4名称',
+                                                   `affix5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件5名称',
+                                                   `affix6` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件6名称',
+                                                   `affix7` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件7名称',
+                                                   `affix8` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件8名称',
+                                                   `statement1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '声明1',
+                                                   `statement2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '声明2',
+                                                   `statement3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '声明3',
+                                                   `statement4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '声明4',
+                                                   `statement5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '声明5',
+                                                   `normal_assumption1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设1',
+                                                   `normal_assumption2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设2',
+                                                   `normal_assumption3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设3',
+                                                   `normal_assumption4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设4',
+                                                   `normal_assumption5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设5',
+                                                   `normal_assumption6` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设6',
+                                                   `normal_assumption7` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设7',
+                                                   `normal_assumption8` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设8',
+                                                   `normal_assumption9` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设9',
+                                                   `normal_assumption10` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '一般假设10',
+                                                   `undefined_assumption1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '未定事项假设1',
+                                                   `undefined_assumption2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '未定事项假设2',
+                                                   `undefined_assumption3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '未定事项假设3',
+                                                   `undefined_assumption4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '未定事项假设4',
+                                                   `undefined_assumption5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '未定事项假设5',
+                                                   `undefined_assumption6` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '未定事项假设6',
+                                                   `different_assumption1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '不相一致假设1',
+                                                   `different_assumption2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '不相一致假设2',
+                                                   `deficiency_assumption1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '依据不足假设1',
+                                                   `deficiency_assumption2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '依据不足假设2',
+                                                   `deficiency_assumption3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '依据不足假设3',
+                                                   `deficiency_assumption4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '依据不足假设4',
+                                                   `deficiency_assumption5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '依据不足假设5',
+                                                   `limit_condition1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件1',
+                                                   `limit_condition2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件2',
+                                                   `limit_condition3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件3',
+                                                   `limit_condition4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件4',
+                                                   `limit_condition5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件5',
+                                                   `limit_condition6` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件6',
+                                                   `limit_condition7` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件7',
+                                                   `limit_condition8` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '限制条件8',
+                                                   `normal_explain1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明1',
+                                                   `normal_explain2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明2',
+                                                   `normal_explain3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明3',
+                                                   `normal_explain4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明4',
+                                                   `normal_explain5` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明5',
+                                                   `normal_explain6` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明6',
+                                                   `normal_explain7` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明7',
+                                                   `normal_explain8` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明8',
+                                                   `normal_explain9` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '使用本报告的一般说明9',
+                                                   `expe_handle1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价中的特殊处理事项1',
+                                                   `expe_handle2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价中的特殊处理事项2',
+                                                   `expe_handle3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价中的特殊处理事项3',
+                                                   `expe_handle4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价中的特殊处理事项4',
+                                                   `consignor_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托人类型',
+                                                   `consignor_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托人住所',
+                                                   `consignor_person` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '法定代表人',
+                                                   `consignor_money` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '注册资本',
+                                                   `credit_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '统一社会信用代码',
+                                                   `target_scope` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价对象及范围',
+                                                   `building_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '建筑物实物状况',
+                                                   `land_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '土地实物状况',
+                                                   `guaranty_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '担保物权状况',
+                                                   `rem_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '用益物权状况',
+                                                   `rent_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '租赁或占用情况',
+                                                   `area_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价对象区位状况',
+                                                   `value_timing_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '价值时点描述',
+                                                   `value_meaning1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '价值内涵1',
+                                                   `value_meaning2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '价值内涵2',
+                                                   `value_meaning3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '价值内涵3',
+                                                   `value_meaning4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '价值内涵4',
+                                                   `gist1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价依据1',
+                                                   `gist2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价依据2',
+                                                   `gist3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价依据3',
+                                                   `gist4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价依据4',
+                                                   `principle` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价原则',
+                                                   `result1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价结果1',
+                                                   `result3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价结果3',
+                                                   `result4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '估价结果4',
+                                                   `scene_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '实地查勘期',
+                                                   `work_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '估价作业期',
+                                                   `pledge_value` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '已抵押担保的债权数额',
+                                                   `debt_money` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '拖欠的建设工程价款',
+                                                   `first_money` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '其他法定优先受偿款',
+                                                   `total_money` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '合计(万元)',
+                                                   `upload_user_id` bigint NOT NULL COMMENT '上传人id',
+                                                   `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 '删除状态',
+                                                   `excel_uri` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始excel保存路径',
+                                                   PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 110 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '房地产EXCEL原始数据' ROW_FORMAT = Dynamic;