|
@@ -47,6 +47,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.dayou.constants.HouseGuarantyDoc.*;
|
|
|
import static com.dayou.enums.BusinessEnum.HouseGuarantyChapter.ORDINARY_ASSUMPTION;
|
|
|
+import static com.dayou.enums.BusinessEnum.HouseGuarantyProcess.STATEMENT_CONDITIONS_EXPLAIN;
|
|
|
import static com.dayou.enums.BusinessEnum.HouseSubBusiness.GUARANTY;
|
|
|
import static com.dayou.enums.HouseTargetTableColumn.ID;
|
|
|
import static java.lang.Thread.sleep;
|
|
@@ -93,7 +94,7 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean analysisCollect1(Long id) {
|
|
|
+ public Boolean analysisCollect1(Long id) throws Exception {
|
|
|
try {
|
|
|
sleep(1000);
|
|
|
} catch (InterruptedException e) {
|
|
@@ -101,23 +102,23 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
|
|
|
}
|
|
|
HouseGuarantyProcess process = houseGuarantyProcessService.getById(id);
|
|
|
String home = fileNetConfig.getBaseDir() + process.getHome();
|
|
|
- try {
|
|
|
Workbook workbook = new Workbook( home + COLLECT1_XLSX);
|
|
|
workbook.save(home+ COLLECT1_JSON, SaveFormat.JSON);
|
|
|
+ //解析估价对象json(估价对象一览表)
|
|
|
JSONArray array = JsonUtil.file2JsonArray(home + COLLECT1_JSON, TARGETS_TABLE_ZH);
|
|
|
- //解析估价对象json
|
|
|
JSONArray xArray = HouseDocumentUtil.houseTargetsFormat(array);
|
|
|
- //纯估价对象
|
|
|
JsonUtil.jsonArray2File(xArray,home + TARGETS_JSON);
|
|
|
- return Boolean.TRUE;
|
|
|
- } catch (Exception e) {
|
|
|
- ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"Json文件读取错误");
|
|
|
- return Boolean.FALSE;
|
|
|
- }
|
|
|
+
|
|
|
+ //解析估价对象json(基本信息)
|
|
|
+ JSONArray baseInfoArray = JsonUtil.file2JsonArray(home + COLLECT1_JSON, BASE_INFO_ZH);
|
|
|
+ JSONObject baseInfo = HouseDocumentUtil.baseInfoFormat(baseInfoArray);
|
|
|
+ JsonUtil.jsonObject2File(baseInfo,home + BASE_INFO_JSON);
|
|
|
+ return Boolean.TRUE;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String genConsignorLetter(Long id) {
|
|
|
+ public Long genConsignorLetter(Long id) {
|
|
|
try {
|
|
|
sleep(1000);
|
|
|
} catch (InterruptedException e) {
|
|
@@ -178,8 +179,9 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
|
|
|
//更新过程文档url
|
|
|
houseGuarantyProcessService.update(new LambdaUpdateWrapper<HouseGuarantyProcess>().set(HouseGuarantyProcess::getDocUrl, consignorLetterName)
|
|
|
.eq(BaseEntity::getId,id));
|
|
|
- documentProductionService.save(buildDocumentProduction(id,projectName,docNo,consignor));
|
|
|
- return consignorLetterName;
|
|
|
+ DocumentProduction dp = buildDocumentProduction(id, projectName, docNo, consignor);
|
|
|
+ documentProductionService.save(dp);
|
|
|
+ return dp.getId();
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
@@ -205,7 +207,7 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
|
|
|
}
|
|
|
return houseTargetVOList;
|
|
|
} catch (Exception e) {
|
|
|
- ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"Json文件读取错误");
|
|
|
+ ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"文件读取错误");
|
|
|
}
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
@@ -256,7 +258,8 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
|
|
|
String limitCondition = tmplHouseParagraphService.findLimitConditionResult(targets
|
|
|
,HouseDocumentUtil.checkBoolean(valueMap.get("isDeductSellAmount"))
|
|
|
,HouseDocumentUtil.checkBoolean(valueMap.get("hasTechReport"))
|
|
|
- ,HouseDocumentUtil.checkBoolean(valueMap.get("isNsBank")));
|
|
|
+ ,HouseDocumentUtil.checkBoolean(valueMap.get("isNsBank"))
|
|
|
+ ,hasImmovableCertificate);
|
|
|
|
|
|
conditionDO.setXZTJ(limitCondition);
|
|
|
|
|
@@ -281,7 +284,7 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
|
|
|
fos.close();
|
|
|
//更新过程文档url
|
|
|
HouseGuarantyProcess houseGuarantyProcess = new HouseGuarantyProcess();
|
|
|
- houseGuarantyProcess.setProcessName("《估价的假设和限制条件及使用报告说明》");
|
|
|
+ houseGuarantyProcess.setProcessName(STATEMENT_CONDITIONS_EXPLAIN.getMsg());
|
|
|
houseGuarantyProcess.setDocUrl(conditionLetterName);
|
|
|
houseGuarantyProcess.setHome(process.getHome());
|
|
|
houseGuarantyProcess.setParentId(process.getId());
|