|
@@ -11,6 +11,7 @@ import com.dayou.dto.HouseRightsDTO;
|
|
|
import com.dayou.entity.HouseGuarantyAim;
|
|
|
import com.dayou.entity.*;
|
|
|
import com.dayou.enums.HouseTargetTableColumn;
|
|
|
+import com.dayou.exception.BusinessException;
|
|
|
import com.dayou.exception.ErrorCode;
|
|
|
import com.dayou.table.HouseAreaTable;
|
|
|
|
|
@@ -197,7 +198,7 @@ public class HouseDocumentUtil {
|
|
|
|
|
|
Set<String> landType = aims.stream().map(HouseGuarantyAim::getLandType).collect(Collectors.toSet());
|
|
|
|
|
|
- List<Object> outerAcreage = aims.stream().map(HouseGuarantyAim::getOuterAcreage).collect(Collectors.toList());
|
|
|
+ List<Object> outerAcreage = aims.stream().filter(x->!"/".equals(x.getOuterAcreage())).map(HouseGuarantyAim::getOuterAcreage).collect(Collectors.toList());
|
|
|
|
|
|
Set<String> useTo = aims.stream().map(HouseGuarantyAim::getUseTo).collect(Collectors.toSet());
|
|
|
|
|
@@ -271,7 +272,7 @@ public class HouseDocumentUtil {
|
|
|
* @param list
|
|
|
* @return
|
|
|
*/
|
|
|
- public static BigDecimal sumList(List<Object> list){
|
|
|
+ public static BigDecimal sumList(List<Object> list) {
|
|
|
BigDecimal sum = null;
|
|
|
try {
|
|
|
sum = (BigDecimal) list.stream().reduce(BigDecimal.ZERO, (a, b) -> {
|
|
@@ -492,8 +493,8 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplHouseParagraph 段落模版
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String getCheckOriginCertificate(String isCheckOriginCertificate,List<String> certificates, TmplHouseParagraph tmplHouseParagraph){
|
|
|
- if (checkBoolean(isCheckOriginCertificate)){
|
|
|
+ public static String getCheckOriginCertificate(Boolean isCheckOriginCertificate,List<String> certificates, TmplHouseParagraph tmplHouseParagraph){
|
|
|
+ if (isCheckOriginCertificate){
|
|
|
String paragraph = tmplHouseParagraph.getParagraph();
|
|
|
return paragraph.replace("{certificates}",CollectionUtil.formatDotAndRemoveMiddle(certificates));
|
|
|
}
|
|
@@ -828,8 +829,8 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isBigCertificateOnlyHouse(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,String isCheckOriginCertificate) {
|
|
|
- if (CollectionUtil.isNotEmpty(targets) && !checkBoolean(isCheckOriginCertificate)){
|
|
|
+ public static String isBigCertificateOnlyHouse(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,Boolean isCheckOriginCertificate) {
|
|
|
+ if (CollectionUtil.isNotEmpty(targets) && !isCheckOriginCertificate){
|
|
|
List<HouseGuarantyTarget> collect = targets.stream().filter(x -> StrUtil.isNotBlank(x.getLandCertificateType()) &&
|
|
|
x.getLandCertificateType().equals("大证") && !x.getHouseGetLandInfo()).collect(Collectors.toList());
|
|
|
if (CollectionUtil.isNotEmpty(collect)){
|
|
@@ -847,9 +848,9 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNotOriginCertificateOnlyHouse(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,String isCheckOriginCertificate,List<String> certificates) {
|
|
|
+ public static String isNotOriginCertificateOnlyHouse(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,Boolean isCheckOriginCertificate,List<String> certificates) {
|
|
|
if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- if (!checkBoolean(isCheckOriginCertificate)){
|
|
|
+ if (!isCheckOriginCertificate){
|
|
|
List<String> tIds = targets.stream().map(HouseGuarantyTarget::getTid).collect(Collectors.toList());
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
return paragraph.replace("{tIds}", CollectionUtil.formatDotAndRemoveMiddle(tIds)).replace("{certificates}", CollectionUtil.formatDotAndRemoveMiddle(certificates));
|
|
@@ -864,8 +865,8 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNotOriginFileInChengDu(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph ,String isCheckOriginCertificate,List<String> certificates) {
|
|
|
- if (CollectionUtil.isNotEmpty(targets) && !checkBoolean(isCheckOriginCertificate)){
|
|
|
+ public static String isNotOriginFileInChengDu(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph ,Boolean isCheckOriginCertificate,List<String> certificates) {
|
|
|
+ if (CollectionUtil.isNotEmpty(targets) && !isCheckOriginCertificate){
|
|
|
List<String> tIds = new ArrayList<>();
|
|
|
for (HouseGuarantyTarget target : targets) {
|
|
|
List<HouseGuarantyAim> targetDTOS = target.getAims();
|
|
@@ -892,8 +893,8 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNotOriginFileOutChengDu(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,String isCheckOriginCertificate,List<String> certificates) {
|
|
|
- if (CollectionUtil.isNotEmpty(targets) && !checkBoolean(isCheckOriginCertificate)){
|
|
|
+ public static String isNotOriginFileOutChengDu(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,Boolean isCheckOriginCertificate,List<String> certificates) {
|
|
|
+ if (CollectionUtil.isNotEmpty(targets) && !isCheckOriginCertificate){
|
|
|
List<String> tIds = new ArrayList<>();
|
|
|
for (HouseGuarantyTarget target : targets) {
|
|
|
List<HouseGuarantyAim> targetDTOS = target.getAims();
|
|
@@ -991,36 +992,28 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isOldPledgeToNewPledge(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
+ public static String isOldPledgeToNewPledge(TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> (x.getHasPledge()!=null &&
|
|
|
- x.getHasPledge() && StrUtil.isNotBlank(x.getPledgeType())
|
|
|
- && StrUtil.isNotBlank(x.getPledgeUser()) && StrUtil.isNotBlank(x.getPledgeValue())
|
|
|
- && StrUtil.isNotBlank(x.getNewPledgeUser()))).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- for (int i = 0; i < collect.size(); i++){
|
|
|
- String replace = getString(collect.get(i), paragraph);
|
|
|
- result.append(replace);
|
|
|
- if (i != collect.size()-1){
|
|
|
- result.append("\n");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (base.getHasPledge()){
|
|
|
+// List<HouseGuarantyTarget> collect = targets.stream().filter(x -> (x.getHasPledge()!=null &&
|
|
|
+// x.getHasPledge() && StrUtil.isNotBlank(x.getPledgeType())
|
|
|
+// && StrUtil.isNotBlank(x.getPledgeUser()) && StrUtil.isNotBlank(x.getPledgeValue())
|
|
|
+// && StrUtil.isNotBlank(x.getNewPledgeUser()))).collect(Collectors.toList());
|
|
|
+
|
|
|
+ String replace = getString(paragraph,base);
|
|
|
+ result.append(replace);
|
|
|
return result.toString();
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private static String getString(HouseGuarantyTarget target, String paragraph) {
|
|
|
- String pledgeType = target.getPledgeType();
|
|
|
- String pledgeUser = target.getPledgeUser();
|
|
|
- String pledgeValue = target.getPledgeValue();
|
|
|
- String newPledgeUser = target.getNewPledgeUser();
|
|
|
- String tId = target.getTid();
|
|
|
- return paragraph.replace("{tId}", tId)
|
|
|
- .replace("{tId}", tId).replace("{pledgeType}", pledgeType).replace("{pledgeType}", pledgeType)
|
|
|
+ private static String getString(String paragraph,HouseGuarantyBase base) {
|
|
|
+ String pledgeType = base.getPledgeType();
|
|
|
+ String pledgeUser = base.getPledgeUser();
|
|
|
+ String pledgeValue = base.getPledgeValue();
|
|
|
+ String newPledgeUser = base.getNewPledgeUser();
|
|
|
+ return paragraph.replace("{pledgeType}", pledgeType).replace("{pledgeType}", pledgeType)
|
|
|
.replace("{pledgeUser}", pledgeUser).replace("{pledgeValue}",
|
|
|
pledgeValue).replace("{newPledgeUser}", newPledgeUser);
|
|
|
}
|
|
@@ -1052,27 +1045,18 @@ public class HouseDocumentUtil {
|
|
|
|
|
|
/**
|
|
|
* 限制条件 适用于原抵押权未注销,现拟设立最高额抵押权,同一抵押权人
|
|
|
- * @param targets
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isOldPledgeToOldPledge(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
+ public static String isOldPledgeToOldPledge( TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> x.getHasPledge()!=null &&
|
|
|
- x.getHasPledge() && StrUtil.isNotBlank(x.getPledgeType())
|
|
|
- && x.getSamePledgeHigh()!=null &&x.getSamePledgeHigh()).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- for (int i = 0; i < collect.size(); i++){
|
|
|
- String tId = collect.get(i).getTid();
|
|
|
- String pledgeUser = collect.get(i).getPledgeUser();
|
|
|
- result.append(paragraph.replace("{tId}", tId).replace("{tId}",tId).replace("{pledgeUser}",pledgeUser));
|
|
|
- if (i != collect.size()-1){
|
|
|
- result.append("\n");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (base.getHasPledge()){
|
|
|
+// List<HouseGuarantyTarget> collect = targets.stream().filter(x -> x.getHasPledge()!=null &&
|
|
|
+// x.getHasPledge() && StrUtil.isNotBlank(x.getPledgeType())
|
|
|
+// && x.getSamePledgeHigh()!=null &&x.getSamePledgeHigh()).collect(Collectors.toList());
|
|
|
+ String pledgeUser = base.getPledgeUser();
|
|
|
+ result.append(paragraph.replace("{pledgeUser}",pledgeUser));
|
|
|
return result.toString();
|
|
|
}
|
|
|
return null;
|
|
@@ -1100,13 +1084,12 @@ public class HouseDocumentUtil {
|
|
|
|
|
|
/**
|
|
|
* 限制条件 是否提供技术报告
|
|
|
- * @param targets
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isProvideTechReport(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph,String hasTechReport) {
|
|
|
+ public static String isProvideTechReport(TmplHouseParagraph tmplParagraph,Boolean hasTechReport) {
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- if (checkBoolean(hasTechReport)){
|
|
|
+ if (hasTechReport){
|
|
|
return paragraph.replace("{hasTechReport}","、“估价技术报告”");
|
|
|
}
|
|
|
return paragraph.replace("{hasTechReport}","");
|
|
@@ -1117,8 +1100,8 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNSBank(TmplHouseParagraph tmplParagraph,String isNsBank) {
|
|
|
- return checkBoolean(isNsBank)?tmplParagraph.getParagraph():null;
|
|
|
+ public static String isNSBank(TmplHouseParagraph tmplParagraph,Boolean isNsBank) {
|
|
|
+ return isNsBank?tmplParagraph.getParagraph():null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1126,24 +1109,18 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNormalBank( TmplHouseParagraph tmplParagraph,String isNsBank) {
|
|
|
- return !checkBoolean(isNsBank)?tmplParagraph.getParagraph():null;
|
|
|
+ public static String isNormalBank( TmplHouseParagraph tmplParagraph,Boolean isNsBank) {
|
|
|
+ return !isNsBank?tmplParagraph.getParagraph():null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 估价中的特殊处理事项 无法定优先受偿款
|
|
|
- * @param targets
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNoFirstMoney(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> StrUtil.isBlank(x.getFirstMoney())).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- List<String> tIds = collect.stream().map(HouseGuarantyTarget::getTid).collect(Collectors.toList());
|
|
|
- String paragraph = tmplParagraph.getParagraph();
|
|
|
- return paragraph.replace("{tIds}", CollectionUtil.formatDotAndRemoveMiddle(tIds));
|
|
|
- }
|
|
|
+ public static String isNoFirstMoney(TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
+ if (StrUtil.isNotBlank(base.getFirstMoney())){
|
|
|
+ return tmplParagraph.getParagraph();
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
@@ -1154,17 +1131,10 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isSamePledgeUserContinue(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> x.getSamePledgeContinue()!=null &&
|
|
|
- x.getSamePledgeContinue() && StrUtil.isNotBlank(x.getPledgeType())).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- List<String> tIds = collect.stream().map(HouseGuarantyTarget::getTid).collect(Collectors.toList());
|
|
|
- Set<String> pledgeTypes = collect.stream().map(HouseGuarantyTarget::getPledgeType).collect(Collectors.toSet());
|
|
|
+ public static String isSamePledgeUserContinue(TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
+ if (base.getSamePledgeContinue()!=null && base.getSamePledgeContinue() && StrUtil.isNotBlank(base.getPledgeType())){
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- return paragraph.replace("{tIds}", CollectionUtil.formatDotAndRemoveMiddle(tIds))
|
|
|
- .replace("{pledgeTypes}",CollectionUtil.formatDotAndRemoveMiddle(pledgeTypes));
|
|
|
- }
|
|
|
+ return paragraph.replace("{pledgeTypes}",base.getPledgeType());
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
@@ -1175,24 +1145,13 @@ public class HouseDocumentUtil {
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isOldPledgeToNewPledgeSpecial(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
+ public static String isOldPledgeToNewPledgeSpecial(TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> StrUtil.isNotBlank(x.getPledgeType())
|
|
|
- && StrUtil.isNotBlank(x.getNewPledgeUser())).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- for (int i = 0; i < collect.size(); i++){
|
|
|
- String tId = collect.get(i).getTid();
|
|
|
- String pledgeType = collect.get(i).getPledgeType();
|
|
|
- String newPledgeUser = collect.get(i).getNewPledgeUser();
|
|
|
- result.append(paragraph.replace("{tId}", tId)
|
|
|
- .replace("{pledgeType}", pledgeType).replace("{newPledgeUser}",newPledgeUser));
|
|
|
- if (i != collect.size()-1){
|
|
|
- result.append("\n");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (StrUtil.isNotBlank(base.getPledgeType()) && StrUtil.isNotBlank(base.getNewPledgeUser())){
|
|
|
+ String pledgeType = base.getPledgeType();
|
|
|
+ String newPledgeUser = base.getNewPledgeUser();
|
|
|
+ result.append(paragraph.replace("{pledgeType}", pledgeType).replace("{newPledgeUser}",newPledgeUser));
|
|
|
return result.toString();
|
|
|
}
|
|
|
return null;
|
|
@@ -1200,27 +1159,17 @@ public class HouseDocumentUtil {
|
|
|
|
|
|
/**
|
|
|
* 估价中的特殊处理事项 适用于原已设立抵押权,现拟设立最高额抵押权,同一抵押权人
|
|
|
- * @param targets
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isNormalPledgeToHighPledge(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
+ public static String isNormalPledgeToHighPledge(TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> x.getHasPledge()!=null &&
|
|
|
- x.getHasPledge() && StrUtil.isNotBlank(x.getPledgeType()) && x.getSamePledgeHigh()!=null &&
|
|
|
- x.getSamePledgeHigh()).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- for (int i = 0; i < collect.size(); i++){
|
|
|
- String tId = collect.get(i).getTid();
|
|
|
- String pledgeUser = collect.get(i).getPledgeUser();
|
|
|
- result.append(paragraph.replace("{tId}", tId).replace("{tId}",tId).replace("{pledgeUser}",pledgeUser));
|
|
|
- if (i != collect.size()-1){
|
|
|
- result.append("\n");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (base.getHasPledge()!=null &&
|
|
|
+ base.getHasPledge() && StrUtil.isNotBlank(base.getPledgeType()) && base.getSamePledgeHigh()!=null &&
|
|
|
+ base.getSamePledgeHigh()){
|
|
|
+ String pledgeUser = base.getPledgeUser();
|
|
|
+ result.append(paragraph.replace("{pledgeUser}",pledgeUser));
|
|
|
return result.toString();
|
|
|
}
|
|
|
return null;
|
|
@@ -1228,26 +1177,16 @@ public class HouseDocumentUtil {
|
|
|
|
|
|
/**
|
|
|
* 估价中的特殊处理事项 适用于已设立最高额抵押权,抵押未到期
|
|
|
- * @param targets
|
|
|
* @param tmplParagraph
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String isHighPledgeNotExpire(List<HouseGuarantyTarget> targets, TmplHouseParagraph tmplParagraph) {
|
|
|
+ public static String isHighPledgeNotExpire( TmplHouseParagraph tmplParagraph,HouseGuarantyBase base) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
String paragraph = tmplParagraph.getParagraph();
|
|
|
- if (CollectionUtil.isNotEmpty(targets)){
|
|
|
- List<HouseGuarantyTarget> collect = targets.stream().filter(x -> x.getHasPledge()!=null && x.getHasPledge()
|
|
|
- && x.getHighPledgeNotExpire()!=null && x.getHighPledgeNotExpire()).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(collect)){
|
|
|
- for (int i = 0; i < collect.size(); i++){
|
|
|
- String tId = collect.get(i).getTid();
|
|
|
- String pledgeUser = collect.get(i).getPledgeUser();
|
|
|
- result.append(paragraph.replace("{tId}", tId).replace("{tId}",tId).replace("{pledgeUser}",pledgeUser));
|
|
|
- if (i != collect.size()-1){
|
|
|
- result.append("\n");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (base.getHasPledge()!=null && base.getHasPledge()
|
|
|
+ && base.getHighPledgeNotExpire()!=null && base.getHighPledgeNotExpire()){
|
|
|
+ String pledgeUser = base.getPledgeUser();
|
|
|
+ result.append(paragraph.replace("{pledgeUser}",pledgeUser));
|
|
|
return result.toString();
|
|
|
}
|
|
|
return null;
|