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