|
@@ -8,7 +8,6 @@ import com.dayou.dto.HouseGuarantyTargetDTO;
|
|
|
import com.dayou.entity.HouseGuarantyTarget;
|
|
|
import com.dayou.entity.TmplHouseParagraph;
|
|
|
import com.dayou.enums.HouseTargetTableColumn;
|
|
|
-import com.dayou.exception.BusinessException;
|
|
|
import com.dayou.exception.ErrorCode;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
@@ -131,7 +130,7 @@ public class HouseDocumentUtil {
|
|
|
addressList = addressList.subList(0, 8);
|
|
|
result = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(addressList)) + "等"+addressList.size();
|
|
|
}else {
|
|
|
- result = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(addressList)) + ",共计"+ addressList.size();
|
|
|
+ result = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(addressList)) + "共计"+ addressList.size();
|
|
|
}
|
|
|
return result +"处估价对象" + getUseTo(array) +"用房地产抵押价值评估";
|
|
|
}
|
|
@@ -239,6 +238,29 @@ public class HouseDocumentUtil {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 组合估价对象描述,添加序号
|
|
|
+ * @param collect
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String combinationTargetDescription(Map<Object, List<Object>> collect){
|
|
|
+ String actDesc = "";
|
|
|
+ int index = 1;
|
|
|
+ int mapSize = collect.size();
|
|
|
+ for (Map.Entry<Object, List<Object>> entry : collect.entrySet()) {
|
|
|
+ List<Object> value = entry.getValue();
|
|
|
+ JSONArray xArray = new JSONArray(value);
|
|
|
+ String actAddress = HouseDocumentUtil.getTargetDescription(xArray);
|
|
|
+ //添加换行符
|
|
|
+ if (index != mapSize){
|
|
|
+ actAddress += "\n";
|
|
|
+ }
|
|
|
+ actDesc += actAddress;
|
|
|
+ index ++;
|
|
|
+ }
|
|
|
+ return actDesc;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* List<Object>求和
|
|
|
* @param list
|
|
|
* @return
|
|
@@ -618,7 +640,7 @@ public class HouseDocumentUtil {
|
|
|
* @param hasImmovableCertificate
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isDivideMethod1(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplHouseParagraph, String hasImmovableCertificate,String acreage) {
|
|
|
+ public static String isDivideMethod1(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplHouseParagraph, String hasImmovableCertificate) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplHouseParagraph.getParagraph();
|
|
|
if (CollectionUtil.isNotEmpty(targets)){
|
|
@@ -627,6 +649,12 @@ public class HouseDocumentUtil {
|
|
|
if (CollectionUtil.isNotEmpty(collect)){
|
|
|
for (HouseGuarantyTarget target : collect) {
|
|
|
String tId = target.getTId();
|
|
|
+ List<HouseGuarantyTargetDTO> targetDTOS = JSON.parseArray(target.getBaseInfo(), HouseGuarantyTargetDTO.class);
|
|
|
+ List<String> acreageStr = targetDTOS.stream().filter(x -> StrUtil.isNotBlank(x.getAcreage())).map(HouseGuarantyTargetDTO::getAcreage).collect(Collectors.toList());
|
|
|
+ BigDecimal acreage = BigDecimal.ZERO;
|
|
|
+ for (String acreageStr1 : acreageStr) {
|
|
|
+ acreage = acreage.add(new BigDecimal(acreageStr1));
|
|
|
+ }
|
|
|
StringBuilder floorAcreageDesc = new StringBuilder();
|
|
|
String floor1Acreage = target.getFloor1Acreage();
|
|
|
String floor2Acreage = target.getFloor2Acreage();
|
|
@@ -646,7 +674,7 @@ public class HouseDocumentUtil {
|
|
|
}else {
|
|
|
floorAcreageDesc.append(";");
|
|
|
}
|
|
|
- paragraph = paragraph.replace("{immovable}", hasImmovableCertificate).replace("{tId}", tId).replace("{acreage}", acreage);
|
|
|
+ paragraph = paragraph.replace("{immovable}", hasImmovableCertificate).replace("{tId}", tId).replace("{acreage}", acreage.toPlainString());
|
|
|
paragraph = paragraph.replace("{floorAcreageDesc}", floorAcreageDesc.toString());
|
|
|
result.append(paragraph).append("\n");
|
|
|
}
|
|
@@ -662,7 +690,7 @@ public class HouseDocumentUtil {
|
|
|
* @param hasImmovableCertificate
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isDivideMethod2(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplHouseParagraph, String hasImmovableCertificate, String acreage) {
|
|
|
+ public static String isDivideMethod2(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplHouseParagraph, String hasImmovableCertificate) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplHouseParagraph.getParagraph();
|
|
|
if (CollectionUtil.isNotEmpty(targets)){
|
|
@@ -671,6 +699,12 @@ public class HouseDocumentUtil {
|
|
|
if (CollectionUtil.isNotEmpty(collect)){
|
|
|
for (HouseGuarantyTarget target : collect) {
|
|
|
String tId = target.getTId();
|
|
|
+ List<HouseGuarantyTargetDTO> targetDTOS = JSON.parseArray(target.getBaseInfo(), HouseGuarantyTargetDTO.class);
|
|
|
+ List<String> acreageStr = targetDTOS.stream().filter(x -> StrUtil.isNotBlank(x.getAcreage())).map(HouseGuarantyTargetDTO::getAcreage).collect(Collectors.toList());
|
|
|
+ BigDecimal acreage = BigDecimal.ZERO;
|
|
|
+ for (String acreageStr1 : acreageStr) {
|
|
|
+ acreage = acreage.add(new BigDecimal(acreageStr1));
|
|
|
+ }
|
|
|
StringBuilder floorAcreageDesc = new StringBuilder();
|
|
|
String floor1Acreage = target.getFloor1Acreage();
|
|
|
String floor2Acreage = target.getFloor2Acreage();
|
|
@@ -690,7 +724,7 @@ public class HouseDocumentUtil {
|
|
|
}else {
|
|
|
floorAcreageDesc.append(";");
|
|
|
}
|
|
|
- paragraph = paragraph.replace("{immovable}", hasImmovableCertificate).replace("{tId}", tId).replace("{acreage}", acreage);
|
|
|
+ paragraph = paragraph.replace("{immovable}", hasImmovableCertificate).replace("{tId}", tId).replace("{acreage}", acreage.toPlainString());
|
|
|
paragraph = paragraph.replace("{floorAcreageDesc}", floorAcreageDesc.toString());
|
|
|
result.append(paragraph).append("\n");
|
|
|
}
|