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